HTH vs HH: Which Pattern Appears First?
A fair coin is tossed repeatedly. The game ends the moment either the pattern $HH$ or the pattern $HTH$ appears as consecutive flips -- whichever comes first.
What is the probability that $HTH$ appears before $HH$?
Model the process as a Markov chain over states that track the relevant suffix of the flip sequence. Set up and solve the system of linear equations exactly.
Open the full interactive solver, hints, and worked solution →