We both play a game where we flip a coin. You win if 3 heads appear, I win if 3 tails appear. What is the expected number of flips for the game to end.
The heads/tails doesn't need to be consecutive. Here's my approach:
First find the expected number of flips to get three heads before game ends. This can happen in either three or four of five tosses. So the expected value is $$\frac{1}{2^3}*3 + \frac{1}{2^4}*4C_3*4 + \frac{1}{2^5}*5C_3*5 $$
Divide this value by 2 to get the answer. Is this correct?
Many thanks.
$\endgroup$121 Answer
$\begingroup$Let $P(S)$ be the probability of a given sequence and let $N(S)$ be the number of flips in that sequence. You want to find $E(N(S)) = \sum_{S} P(S)N(S)$.
There are only finitely many possible games, namely, in alphabetical order:
- $HHH: P = 1/8, N = 3$
- $HHTH: P = 1/16, N = 4$
- $HHTTH: P = 1/32, N = 5$
- $HHTTT: P = 1/32, N = 5$
- $HTHH: P = 1/16, N = 4$
- $HTHTH: P = 1/32, N = 5$
- $HTHTT: P = 1/32, N = 5$
- $HTTHH: P = 1/32, N = 5$
- $HTTHT: P = 1/32, N = 5$
- $HTTT: P = 1/16, N = 4$
- $THHH: P = 1/16, N = 4$
- $THHTH: P = 1/32, N = 5$
- $THHTT: P = 1/32, N = 5$
- $THTHH: P = 1/32, N = 5$
- $THTHT: P = 1/32, N = 5$
- $THTT: P = 1/16, N = 4$
- $TTHHH: P = 1/32, N = 5$
- $TTHHT: P = 1/32, N = 5$
- $TTHT: P = 1/16, N = 4$
- $TTT: P = 1/8, N = 3$
Grouping these by $N$ we see that:
- For $N = 3$ the total $P = 1/4$
- For $N = 4$ the total $P = 3/8$
- For $N = 5$ the total $P = 3/8$
So $E(N) = 3 \cdot 1/4 + 4 \cdot 3/8 + 5 \cdot 3/8 = 33/8 = 4.125$
$\endgroup$