Expected number of throws in the Penney’s game

combinatoricsexpected valueprobabilitystatistics

Two players toss a coin until HTT and the first player wins or TTH and the second player wins. What is the expected number of throws in the game?

My ideas: I tried to make a table with probabilities that game finishes after 3, 4 and so on tosses. Unfortunately, the Expected sum diverges in my case.

Best Answer

Let $x_{TH}$ be the expected number of remaining throws, given that $TH$ are the last two coins (and that no one has yet won). And same for the other alternatives.

Then we can write the system of recursions

$$\begin{align} x_{TH}&=1 + \frac{1}{2}x_{HT} + \frac{1}{2}x_{HH}\\ x_{TT}&=1 + \frac{1}{2}x_{TT}\\ x_{HH}&=1+\frac{1}{2}x_{HT} + \frac{1}{2}x_{HH}\\ x_{HT}&=1+ \frac{1}{2}x_{TH}\\ \end{align} $$

The second equation implies $x_{TT}=2$. The rest are solved by $x_{TH}=x_{HH}=6$ , $x_{HT}=4$.

Then the expected number of throws after the first two throws is $\frac{1}{4}(2+ 6 +6 +4)=9/2$

and the total expected number of throws is $$2+\frac92=\frac{13}{2}=6.5$$

Related Question