Coin-Flip Race to Four: Game Length and a Conditional Win Probability

Quick Overview

This question evaluates discrete probability skills including combinatorics, conditional probability, and reasoning about stopping rules for independent Bernoulli trials.

Coin-Flip Race to Four: Game Length and a Conditional Win Probability

Company: Jane Street

Role: Data Scientist

Category: Machine Learning

Difficulty: easy

Interview Round: Technical Screen

Two players play a coin-flipping game with a single fair coin. The coin is flipped once per round. Every heads counts for Player 1, and every tails counts for Player 2. Player 1 wins the moment the coin has landed heads 4 times in total; Player 2 wins the moment it has landed tails 4 times in total. The game stops immediately when either player wins. ### Constraints & Assumptions - The coin is fair: each flip is heads or tails with probability $1/2$, and flips are independent. - One shared coin is flipped once per round (the players do not flip separate coins). - The counts are cumulative totals over the whole game, not consecutive runs. - The game ends immediately at the flip on which one player's count reaches 4. ### Clarifying Questions to Ask - Is the coin fair, and are the flips independent? - Is there one shared flip per round (heads credits Player 1, tails credits Player 2), or does each player flip their own coin? - Do the four heads/tails need to be consecutive, or are they cumulative totals? - Does the game stop the instant one player reaches 4, or do we always flip a fixed number of rounds? ### Part 1 What is the maximum possible number of rounds the game can last? In other words, after how many rounds is a winner guaranteed? ```hint Pigeonhole After $n$ flips, the head count and the tail count sum to exactly $n$. How large does $n$ have to be before $\max(\text{heads}, \text{tails}) \ge 4$ is forced? Also check that the bound is achievable — exhibit a sequence that lasts that long. ``` #### What This Part Should Cover ```premium-lock What This Part Should Cover ``` ### Part 2 What is the probability that the game lasts the full 7 rounds — that is, a 7th flip is actually needed to decide the winner? ```hint Translate to the first six flips The game reaches round 7 exactly when neither player has won during rounds 1–6. Express that as a condition on the number of heads among the first 6 flips, then count sequences with a binomial coefficient. ``` #### What This Part Should Cover ```premium-lock What This Part Should Cover ``` ### Part 3 Now suppose you are told two facts: the game lasted the full 7 rounds, and among the first three rounds there were exactly two heads and one tail. Given this information, what is the probability that Player 1 won the game? ```hint Which flip decides the winner If the game reached round 7, what must the score have been after round 6? Then who wins is determined entirely by a single flip. ``` ```hint Red-herring check Given that the game lasted 7 rounds, does the extra detail about the first three rounds tell you anything about the deciding flip? Remember the flips are independent — you should not need a long Bayes computation. ``` #### What This Part Should Cover ```premium-lock What This Part Should Cover ``` ### What a Strong Answer Covers ```premium-lock What a Strong Answer Covers ``` ### Follow-up Questions - Generalize: if Player 1 needs $n$ heads and Player 2 needs $n$ tails, what is the maximum game length, and what is the probability the game lasts the full $2n-1$ rounds? - Suppose the coin is biased with $P(\text{heads}) = p$. Given that the game lasted 7 rounds, what is the probability Player 1 won? Does the first-three-rounds information matter now? - What is the expected number of rounds the game lasts with a fair coin? - This game is equivalent to a best-of-7 playoff series between evenly matched teams. What is the probability such a series goes to a game 7, and why does it match your Part 2 answer?

Quick Answer: This question evaluates discrete probability skills including combinatorics, conditional probability, and reasoning about stopping rules for independent Bernoulli trials.

|Home/Machine Learning/Jane Street
Jane Street logo
Jane Street
Jul 22, 2025, 12:00 AM
easyData ScientistTechnical ScreenMachine Learning
3
0

Two players play a coin-flipping game with a single fair coin. The coin is flipped once per round. Every heads counts for Player 1, and every tails counts for Player 2. Player 1 wins the moment the coin has landed heads 4 times in total; Player 2 wins the moment it has landed tails 4 times in total. The game stops immediately when either player wins.

Constraints & Assumptions

  • The coin is fair: each flip is heads or tails with probability 1/21/2 , and flips are independent.
  • One shared coin is flipped once per round (the players do not flip separate coins).
  • The counts are cumulative totals over the whole game, not consecutive runs.
  • The game ends immediately at the flip on which one player's count reaches 4.

Clarifying Questions to Ask Guidance

  • Is the coin fair, and are the flips independent?
  • Is there one shared flip per round (heads credits Player 1, tails credits Player 2), or does each player flip their own coin?
  • Do the four heads/tails need to be consecutive, or are they cumulative totals?
  • Does the game stop the instant one player reaches 4, or do we always flip a fixed number of rounds?

Part 1

What is the maximum possible number of rounds the game can last? In other words, after how many rounds is a winner guaranteed?

What This Part Should Cover Premium

Part 2

What is the probability that the game lasts the full 7 rounds — that is, a 7th flip is actually needed to decide the winner?

What This Part Should Cover Premium

Part 3

Now suppose you are told two facts: the game lasted the full 7 rounds, and among the first three rounds there were exactly two heads and one tail. Given this information, what is the probability that Player 1 won the game?

What This Part Should Cover Premium

What a Strong Answer Covers Premium

Follow-up Questions Guidance

  • Generalize: if Player 1 needs nn heads and Player 2 needs nn tails, what is the maximum game length, and what is the probability the game lasts the full 2n12n-1 rounds?
  • Suppose the coin is biased with P(heads)=pP(\text{heads}) = p . Given that the game lasted 7 rounds, what is the probability Player 1 won? Does the first-three-rounds information matter now?
  • What is the expected number of rounds the game lasts with a fair coin?
  • This game is equivalent to a best-of-7 playoff series between evenly matched teams. What is the probability such a series goes to a game 7, and why does it match your Part 2 answer?
Loading comments...