I knew the Von Neumann trick from somewhere in the back of my head but couldn't remember the name, so I just re-derived it.
Use the von Neumann trick: flip the biased coin twice and map HT to heads and TH to tails, ignoring HH and TT. This yields exactly 50/50 because P(HT) = P(TH) = p(1-p).
Pro tip: Mention that the expected number of flips is 1/(2p(1-p)), which is minimized when p=0.5 and grows as p approaches 0 or 1; this shows awareness of efficiency and trade-offs.
Recognize that the biased coin has unknown probability p of heads, and we need a fair 50/50 outcome using only this coin.
Notice that sequences HT and TH have equal probability p(1-p), so they can be used to produce fair outcomes.
Flip the coin twice; if HT, return heads; if TH, return tails; if HH or TT, discard and repeat.
Show that conditional on not discarding, P(HT | HT or TH) = 1/2, ensuring exact fairness.
Compute expected number of flips as 1/(2p(1-p)), discuss best and worst cases, and mention potential optimizations.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.