HHT Before HTT
A fair coin is flipped repeatedly until either the pattern or the pattern has appeared as a run of three consecutive flips. Find the probability that appears first.
Work it out, then compare with the answer.
SolutionShow the worked solution
Neither pattern can be completed until a head has appeared. So any initial tails can be ignored, and we may start in the state “last flip , no further progress”. Track the relevant suffix of the sequence:
- : the last flip is , and it is not preceded by a useful ;
- : the last two flips are ;
- : the last two flips are , following a reset or a start.
Let , , be the probabilities that appears first from , and respectively.
From , a head leaves us in and a tail completes . Two consecutive tails can never occur from here without first producing , so .
From , a head moves to and a tail moves to :
From , a tail completes , a loss. A head gives the suffix . Its last is a fresh start, because neither pattern can use the preceding , so we return to :
Substituting gives , so .
Key idea. Once appears, is certain to win. Thus wins exactly when occurs before .
Variations
The same idea with a twist. Each solution gives only the changed step.
Alice and Bob flip a fair coin repeatedly and record the sequence of outcomes. Alice wins if the pattern appears before the pattern ; otherwise Bob wins. Find the probability that Bob wins.
Work it out, then compare with the answer.
Solution
Use the same states after the first head. Now let and be the probabilities that Bob () wins from and from .
From Bob wins with probability , exactly as before.
From , a head completes , so Alice wins. A tail gives , which is useless to both players, so we must wait for the next head and return to . Hence .
From we have , so .