Expected Coin Flips Until HTH Versus HHT
Last updated: November 29, 2026
Quick Overview
Flip a fair coin repeatedly. What is the expected number of flips until the pattern HTH first appears, and until HHT first appears? If both patterns race in the same sequence, which appears first more often?
DRW
November 29, 20260
0
0 solved
Flip a fair coin repeatedly. What is the expected number of flips until the pattern HTH first appears, and until HHT first appears? If both patterns race in the same sequence, which appears first more often?
Pattern waiting time questions are a favorite at DRW because they reward setting up a small Markov chain and they have a counterintuitive twist. The interviewer checks state design, solving linear equations quickly, and explaining why overlap changes waiting times.
What the Interviewer Expects
- Defines states as longest suffix matching a prefix of the pattern
- Writes and solves the expectation equations
- Gets 10 for HTH and 8 for HHT
- Solves the race and gets 2/3 for HHT
- Explains self overlap as the reason
Key Topics to Cover
How to Approach This
- Define your hypotheses (H0 and H1) clearly before performing any test.
- Calculate required sample size BEFORE running an experiment, using power analysis.
- Remember the Central Limit Theorem: sample means become approximately normal with large n.
- Watch for Simpson's paradox. Always segment data by key dimensions.
- Distinguish between statistical significance and practical significance.
Possible Follow-up Questions
- Expected flips until HH? Until HT?
- Give the general formula using pattern autocorrelation.
- With a biased coin p of heads, recompute HHT.
- Which pattern of length 3 beats HHT in a race?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Browse Statistics QuestionsSample Answer
Clarify
Fair coin, independent flips. Waiting time counts flips up to and including the completing flip....
Approach
States track progress toward the pattern: the longest suffix of what we have seen that is also a prefix of the pattern. Let be the expected remaining flips from state ....