Back to Interview Games

Biased Coin Fairness

ProbabilityMedium
10 min
20 pts

Description

Flip an unfair coin (p=0.6 heads) to simulate a fair coin. Compute success probability or expected trials.

Game Rules

You have a biased coin that lands heads with probability 0.6. Design a procedure to simulate a fair coin flip using this biased coin. What is the probability of success per trial? What is the expected number of flips needed?

Examples

Use pairs of flips: HH -> ignore, TT -> ignore, HT -> heads, TH -> tails

Each valid pair has probability 0.6 x 0.4 = 0.24

Expected trials = 1 / 0.24, or about 4.17 flips per fair coin simulation

Hints

  • Think about using pairs of flips

  • Consider which outcomes give equal probabilities

Solution (Click to reveal)

Flip twice. If HT, call it heads; if TH, call it tails; otherwise, flip again. Success probability = 0.24 per pair, expected flips = 4.17.

Back