Variance of taking balls from a bag question A bag contains $2$ white balls and $2$ black balls.
Each instance a ball is taken from the bag, if it's white it's returned to the bag and if it's black it's replaced by a white ball. The game ends when no black balls remain in the bag. Let $Y$ be the number of instances of the game; calculate $\operatorname{var}(Y).$ Answer in the book: $14.$
I am not sure how to write the probability function of $Y;$ please help and thanks in advance!

Let $Y$ be the number of black balls taken. The probability distribution table:
$$\begin{array}{c|l}
Y&P(Y)\\
\hline
2&\frac1{2^3}\\
3&\frac1{2^4}+\frac3{2^5}\\
4&\frac1{2^5}+\frac3{2^6}+\frac{3^2}{2^7}\\
5&\frac1{2^6}+\frac3{2^7}+\frac{3^2}{2^8}+\frac{3^3}{2^9}\\
\vdots
\end{array}$$
Note:
$$P(Y=n)=\sum_{i=1}^{n-1} \frac{3^{i-1}}{2^{n+i}}=\frac13\cdot \frac1{2^n}\sum_{i=1}^{n-1}\left(\frac32\right)^i=\frac{2\cdot 3^n-3\cdot 2^n}{3\cdot 4^n}.$$
Hence:
$$Var(Y)=\mathbb E(Y^2)-(\mathbb E(Y))^2=\\
\sum_{i=2}^\infty i^2\cdot \frac{2\cdot 3^i-3\cdot 2^i}{3\cdot 4^i}-\left(\sum_{i=2}^\infty i\cdot \frac{2\cdot 3^i-3\cdot 2^i}{3\cdot 4^i}\right)^2=\\
50-36=14.$$
WA answers: 1, 2, 3.
