# Expected Number of Coin Tosses to Get Five Consecutive Heads

A fair coin is tossed repeatedly until 5 consecutive heads occurs.

What is the expected number of coin tosses?

Let $e$ be the expected number of tosses. It is clear that $e$ is finite.
Start tossing. If we get a tail immediately (probability $\frac{1}{2}$) then the expected number is $e+1$. If we get a head then a tail (probability $\frac{1}{4}$), then the expected number is $e+2$. Continue $\dots$. If we get $4$ heads then a tail, the expected number is $e+5$. Finally, if our first $5$ tosses are heads, then the expected number is $5$. Thus
$$e=\frac{1}{2}(e+1)+\frac{1}{4}(e+2)+\frac{1}{8}(e+3)+\frac{1}{16}(e+4)+\frac{1}{32}(e+5)+\frac{1}{32}(5).$$
Solve this linear equation for $e$. We get $e=62$.