Picking the Winning Sequence Second in Penney's Game
Last updated: November 29, 2026
Quick Overview
In Penney's game, your opponent picks a sequence of three coin flips (for example HHT), then you pick a different one. A fair coin is flipped until one of the sequences appears. Compute the probability that HHT beats HTH, and describe how the second player can always gain an edge.
Meta
November 29, 20260
0
0 solved
In Penney's game, your opponent picks a sequence of three coin flips (for example HHT), then you pick a different one. A fair coin is flipped until one of the sequences appears. Compute the probability that HHT beats HTH, and describe how the second player can always gain an edge.
Nontransitive games show up in Meta's quantitative and data science interviews as a test of Markov chain reasoning under competition. The interviewer wants a clean state-based calculation and an understanding of why overlap structure, not the per-position probability, decides the race.
What the Interviewer Expects
- Set up a race Markov chain with states for the useful suffix
- Solve to get P(HHT before HTH) = 2/3
- State the second-player rule: flip the middle of the opponent's choice and prepend it
- Show the game is nontransitive
- Confirm with simulation
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
- What should you pick against HHH and what is your win probability?
- Why is the expected waiting time not the right way to compare sequences in a race?
- Can the first player ever have an advantage?
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, flips continue until HHT or HTH appears. We want and the general second-player strategy....
Approach
Track the longest suffix of the flips that is a prefix of either pattern. States: start, H, HH, HT. Compute = probability HHT wins from state ....