[Math] Expected number of coin tosses before $k$ heads

probability

If the probability of getting a head is $p$, how do you compute the expected number of coin tosses to get $k$ heads?

I thought this might be the mean of the negative binomial distribution but this gives me $pk/(1-p)$ which is $k$ for $p=1/2$ which can't be right.

Best Answer

Let $X_1$ be the number of coin tosses until the first head, $X_2$ be the number of coin tosses after that until the second head, and so on. We want $E[X]$ where $X = X_1 + X_2 + \dots + X_k$. By linearity of expectation, we have $E[X] = E[X_1] + E[X_2] + \dots + E[X_k]$.

For any $i$, the number $E[X_i]$, the expected number of coin tosses until a head appears, is $\dfrac{1}{p}$. You can see this by calculating the mean of the geometric distribution, or by noticing that $E[X_i] = 1 + (1-p)E[X_i]$, etc.

All this gives $E[X] = \dfrac1p + \dfrac1p + \dots + \dfrac1p = \dfrac{k}p$.

Related Question