Technique reference and sources
Self-overlap means a nonempty proper prefix of the pattern equals a suffix of the completed pattern. HT has no such border, HH has border H, HTH has border H, and HHH has borders H and HH. Waiting times come from the transition equations on longest-matched-prefix states (equivalently the border sum), not from a shorter or longer heuristic.
When this method fits
- You need expected flips until a coin pattern of length 2 or 3 appears.
- An interviewer asks why HH takes longer than HT.
- You must compare pattern waits (HHH vs THH, HTH vs HHT).
- Overlapping prefixes suggest the wait will exceed 2^length.
- Name prefix states. State 0 (no progress), state H (last flip starts the pattern), and so on up to the full pattern.
- Write one equation per state. Each equation adds 1 for the flip, then branches on H and T to the preserved-progress state.
- Track failure progress. From state H waiting for HT, flipping H keeps state H; waiting for HH, flipping T drops to state 0.
- Solve from the deepest state. Write the coupled equations, collect self-loop terms, and eliminate unknowns. Back-substitution works after the dependencies have been resolved.
- E[HT] = 4 with E_H = 2
- E[HH] = 6 with E_H = 4
- E[THH] = 8
- E[HTH] = 10
- E[HHH] = 14
- HT: 2^2 = 4
- HH: 2 + 4 = 6
- THH: 8 = 8
- HTH: 2 + 8 = 10
- HHH: 2 + 4 + 8 = 14
Common traps
Assuming every length-2 pattern takes 4 flips because each has probability 1/4 per window. Window probability ignores overlap. HT failures can preserve a useful H, while HH failures destroy all progress, so E[HH] = 6 exceeds E[HT] = 4. Only patterns with no self-overlap border match the naive 4.
Restarting from state 0 after every failed flip regardless of pattern. Match the flipped suffix against the pattern prefix. Waiting for THH, flipping T then H keeps state TH (two flips of progress), while flipping T then T keeps only state T. Preserved progress depends on the exact suffix.
Quoting E[HHH] = 8 by cubing the single-flip odds. 2^3 = 8 only prices patterns with no self-overlap border. Self-overlap describes borders of the completed pattern. For runs of heads, a tail destroys all partial progress; the state equations give 6 for HH and 14 for HHH.
- Deepest state: E_HH = 1 + 0.5 * 0 + 0.5 * E_0 = 1 + 0.5 * E_0 (T after HH keeps no prefix of HHH)
- Middle state: E_H = 1 + 0.5 * E_HH + 0.5 * E_0 = 1 + 0.5 * (1 + 0.5 * E_0) + 0.5 * E_0 = 1.5 + 0.75 * E_0
- Scratch: E_0 = 2 + E_H = 2 + 1.5 + 0.75 * E_0 = 3.5 + 0.75 * E_0, so 0.25 * E_0 = 3.5 and E_0 = 14
Source notes
These explanations and questions are written for QuantArc. Links show the underlying mathematics and learning design.
Harvard Stat 110: Probability (Joe Blitzstein)
Free course site with videos and the open companion book Introduction to Probability; the topic spine for counting, Bayes, and linearity. Lesson examples and questions are original.
Grinstead and Snell, Introduction to Probability (free PDF)
Free textbook PDF confirmed live: counting methods, poker-style dealing models, and the random-walk chapter behind gambler's ruin and first-step equations. Lesson examples and questions are original.
IES: Organizing Instruction and Study to Improve Student Learning
Supports worked examples, retrieval, explanations and spaced study. Does not establish QuantArc's exact lesson length, mastery threshold or review intervals.