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
Statistics & Math
Quantitative Researcher
Meta
November 29, 2026
Quantitative Researcher
Onsite
Statistics & Math
Hard

0

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
Markov chains
Nontransitivity
Pattern races
First-step analysis
How to Approach This
  1. Define your hypotheses (H0 and H1) clearly before performing any test.
  2. Calculate required sample size BEFORE running an experiment, using power analysis.
  3. Remember the Central Limit Theorem: sample means become approximately normal with large n.
  4. Watch for Simpson's paradox. Always segment data by key dimensions.
  5. 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 Questions
Sample Answer
Clarify

Fair coin, flips continue until HHT or HTH appears. We want P(HHT first)P(\text{HHT first}) 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 xsx_s = probability HHT wins from state ss....


Submit Your Answer
Markdown supported