You have a coin biased toward heads or tails by some unknown amount. Can you use it to generate an even-odds outcome, a genuinely fair flip?
Reveal solutionHide solution
#Pair the flips
Yes. Flip the coin twice and read the ordered pair. Treat as one outcome and as the other, and throw away and , flipping a fresh pair until a mismatch appears.
Whatever the bias toward heads, the two mismatched pairs are equally likely,
because each is one head and one tail in some order. Conditioning on a kept pair, each output has probability exactly one half, and the bias cancels.
#The cost
The discarded and are the price. A kept pair appears with probability , largest at a fair coin and shrinking toward zero as the bias grows, so a very lopsided coin needs many flips per fair bit.
#A note on efficiency
Discarding both equal pairs is simple but not the most efficient extractor, since those pairs still carry usable randomness. Tree-based schemes recover much of it. See Stout and Warren, Tree Algorithms for Unbiased Coin Tossing with a Biased Coin, Annals of Probability 12 (1984), pp. 212-222.