Drw · Behavioral
Expected Tosses Until HHT Given HHT Appears Before HTH
TrueInterview
September 26, 2026 · 1 min read
A fair coin is flipped repeatedly until three consecutive tosses form either HTH or HHT. Given that HHT shows up first, what is the expected number of flips, counting the flip that finishes the pattern?
Hint — Keep only the tosses that still matter: Model the situation with a small collection of states based on how much of either pattern the most recent flips could still start or extend. Conditioning on the winning pattern changes how much each journey through those states should weigh.
Constraints and Clarifications
- A pattern is spotted in any three consecutive flips, so it can reuse flips from an earlier partial match.
- The process halts at the first flip that completes either pattern.
- Let be the total flip count. The quantity requested is the conditional expectation , not the unconditional $E[N]$.
- Provide an exact value.
What a Strong Answer Covers
- A correct, minimal state space for the two-pattern race, including the transitions when a partial match breaks.
- The probability that HHT appears before HTH.
- A sound method to condition on the winning pattern, rather than reporting an unconditional expected flip count.
- A consistency check that combines the conditional expectations back into the unconditional expected flip count.
Follow-up Questions
- What is the unconditional expected number of flips, and what is the expected number given that HTH appears first?
- Do HHT and HTH have equal chances of appearing first, even though each has probability in any fixed window of three flips? Explain.
- How would you generalize the method to a race between two arbitrary head/tail patterns of length ?
Overview: Coin-pattern race question where a fair coin is flipped until HTH or HHT appears. Asks for the expected number of flips given that HHT appears first, testing Markov chain modeling of pattern matching, win probabilities, and the correct computation of conditional expectations.
Loading comments…