You flip a fair coin until the pattern HTH appears as three consecutive tosses. What is the expected number of flips?
Reveal solutionHide solution
#States of progress
Track the longest tail of the tosses so far that starts HTH. The states are start, , , and the finished . Let , , be the expected flips still needed from start, from , and from .
#Mismatches and the reset
From start, a head advances to and a tail holds. From , another head keeps you at , since the fresh head is itself a new start of the pattern, while a tail advances to . From , a head finishes, but a tail resets all the way to start, since HTT shares nothing with the start of HTH.
#Solve
The three equations give , , and . Substituting, , so
#Compare
HTH lands between THH at and HHH at . The tail from wipes out all progress, which makes HTH slower than THH, yet its self-overlap is shallower than HHH's, so it still finishes well short of .