Head then tail — who wins?
Two players, A and B, take turns tossing a fair coin. A goes first, then B, then A, and so on. They watch for the first time a Head is immediately followed by a Tail (an HT subsequence). The person who tosses that Tail wins. Play through one game step by step — notice how a "live H" creates tension, because the very next T wins the game:
Play the game repeatedly and watch the win rates converge. After enough games, A's win rate settles near 44.4% — but why exactly 4/9?
The conditioning approach
Let be the probability A wins. Condition on A's first toss:
Case 1: A's first toss is T
If A tosses T first, no HT pattern can start with this T (we need an H before a T). The game essentially resets, but now B is in A's original position — B is the next to toss, and a fresh H is needed. So:
When A tosses T first, the roles effectively swap. B becomes the "first player" for the purpose of generating the H that must precede the winning T.
Case 2: A's first toss is H
Now we have a live H in play. Condition further on B's next toss:
- B tosses T (probability 1/2): The sequence HT is complete — B wins. P(A wins) = 0.
- B tosses H (probability 1/2): B now "owns" the live H. B is in the same position A was when A opened with H. So A wins with probability .
Solving: .
Putting it together
Verifying by conditioning
Run the simulation and watch the conditional probabilities separately — does and ?
As you accumulate more games, P(A) converges to the theoretical 4/9. The convergence chart tracks this running average:
The recursive structure
The game reduces to a self-referential equation:
- Name the unknown: let be what you want to find
- Condition on the first move: break into cases based on the first random event
- Express each case in terms of : use symmetry and role-swapping to relate conditional probabilities back to
This is the same technique used in the Gambler's Ruin, the Drunk Passenger, and the Amoeba Problem.
Competition appearances
This problem appears frequently in quant finance interviews (Goldman Sachs, Jane Street, Two Sigma), in mathematical olympiad training (ISI and CMI entrance exams use the conditioning technique as a staple), and in programming contests where it can be coded as a Markov chain for verification.
When a game involves two players alternating, condition on the first player's move, express the opponent's subsequent position as a version of the original game (possibly with roles swapped), and solve the resulting algebraic equation.
The takeaway
In alternating games, going first isn't always an advantage. The conditioning technique — naming the unknown, conditioning on the first move, and solving the resulting equation — works for any sequential probability problem. When you see players taking turns in a random process, think recursive equations.