# Expected number of flips of 3 coins to get all of the same side.

So I need to find the expected value of the random variable X that denotes the number of coin flips needed to get all of the same side (all heads or all tails) when throwing three fair coins at once, but I'm not sure if the way of solving this is different than say for example, expected number of (single) coin flips until you get n heads in a row.

Can someone provide any guidance?

• This is indeed different than the problem of expected number of single coinflips to get $3$ heads in a row since the result of $(hht)(thh)(hth)$ would have caused the question of three heads in a row to end but three heads simultaneously to not have ended yet. Consider each time you flip three coins as a single flip of a different unfair coin with one side corresponding to all sides of your original coin being same and the other side corresponding to getting a mix of results for your original coin. What are the probabilities of each side? How many flips expected to get a head of this coin? – JMoravitz Jan 30 '17 at 6:34

On any one flip, the probability that all three coins come up the same is $\frac{2}{8}=\frac14$ and the probability that they don't is $\frac34$. Hence, the probability that the three coins come up the same for the first time at exactly the $n$-th flip is ${\left(\frac34\right)}^{n-1}\frac14$.

The expectation is therefore given by

$$\sum_{n\geq 1}n{\left(\frac34\right)}^{n-1}\frac14=\frac14\cdot\sum_{n\geq 1}n{\left(\frac34\right)}^{n-1}.$$

Now, consider $f(x)=\sum_{n\geq0}x^n=\frac{1}{1-x}$, $|x|<1$. We have that

$$f'(x)=\sum_{n\geq1}nx^{n-1}=\frac{1}{{(1-x)}^2}.$$

It follows that the expectation equals

$$\frac14\cdot f'\left(\frac34\right)=\frac14\cdot\frac{1}{{\left(\frac14\right)}^2}=\frac14\cdot16=4$$

This was checking the whole thing via definitions. But you could have skipped it all noting that the chance of 'success' at each step is $1/4$, so the expected value, naturally, would be $4$.

• For more on the matter, see geometric distributions. – Fimpellizieri Jan 30 '17 at 6:47
• How is probability of three heads $\frac{1}{4}$? But replacing everything in your answer by $\frac{1}{8}$ and $1-\frac{1}{8}$ gives correct answer. – Jan Jan 30 '17 at 6:56
• All heads is indeed $1/8$, but all on the same side means all heads or all tails, which is $2/8=1/4$. – Fimpellizieri Jan 30 '17 at 6:58
• Of course, my mistake. Apologies. – Jan Jan 30 '17 at 6:59