<s>[INST] Given a fair coin, what is the mean of the number of tails before we toss a head? 
Question: Given a fair coin, what is the mean of the number of tails before we toss a head?

Let $N$ be the number of tails before we toss a head. Then 
$$E(N) = \sum_{n=1}^\infty n P(N=n).$$
Since 
$$P(N=n) = \left(\frac{1}{2}\right)^{n-1}.$$
Then by using geometric series, we have 
\begin{align*}
E(N) & = \sum_{n=1}^\infty n P(N=n) \\
& = \sum_{n=1}^\infty n \left(\frac{1}{2}\right)^{n-1} \\
& = \frac{1}{(1-\frac{1}{2})^2} \\
& = 4.
\end{align*}
Are my calculations correct?
 [/INST] $P(N=n)=\frac{1}{2}^{n+1}$ not $P(N=n)=\frac{1}{2}^{n-1}$. 
 $P(N=n)$ is the probability that we get n tails and then one head so $P(N=n)=\frac{1}{2}^{n}\frac{1}{2}=\frac{1}{2}^{n+1}$
</s>