Do the closed-form expression for the variance and expected number of Bernoulli trials needed before both success and failure occur given $p$ (probability of success) exist?
What I have tried is a simple simulation in R which suggest for $p$ $=0.5$ the answer is $3$ and $\frac{13}{3}$ for $p=0.75$.
n <- 1e5
nr <- 150
p <- 0.75
test <- matrix(0, nrow = nr, ncol = n)
for (i in 1:n){
test[, i] <- sample(c(1,0), size = nr, replace = TRUE, prob = c(p, 1-p))
}
data.f <- data.frame(fsuc = apply(test == 1, 2, which.min),
ffail = apply(test == 0, 2, which.min))
mean(apply(data.f, 1, max))
I would love to but don't have time at the moment to dive into probability books.
Let $X$ be the number of trials needed until a success and a failure have occurred. If $X=k$, then $k\geq 2$, and either there have been $k-1$ successes followed by a failure or $k-1$ failures followed by a success. Therefore $$ \mathbb{P}(X=k)=p^{k-1}q+q^{k-1}p $$ for $k=2,3,4,\dots$.
Using the power series $$ \frac{1}{(1-x)^2}=\sum_{k=1}^{\infty}kx^{k-1}$$ we can compute $$\mathbb{E}[X]=\sum_{k=2}^{\infty}k\mathbb{P}(X=k)=q\sum_{k=2}^{\infty}kp^{k-1}+p\sum_{k=2}^{\infty}kq^{k-1}$$ $$ =q\Big(\frac{1}{(1-p)^2}-1\Big)+p\Big(\frac{1}{(1-q)^2}-1\Big)=\frac{1}{p}+\frac{1}{q}-1$$ using the fact that $p+q=1$. This matches your simulation for $p=\frac{1}{2}$. The variance can be computed similarly.