This is the Von Neumann trick and I blanked on the name but remembered the logic: flip twice, if you get HT treat it as heads, TH as tails, and discard HH or TT.
Explain the von Neumann extractor: flip the coin twice, and if the results are different (HT or TH), output the first result; if the same (HH or TT), discard and repeat. This yields a fair 50/50 outcome regardless of the coin's bias, as long as the bias is not 0 or 1.
Pro tip: Mention the expected number of flips (1/(2p(1-p))) and note that while the method is unbiased, it may be inefficient for extreme biases; you can also discuss alternative approaches like using multiple flips to generate a random bit with fewer expected flips.
Recognize that the coin is biased with unknown probability p of heads, and we need a fair 50/50 outcome. The solution must not depend on knowing p.
Flip the coin twice. The sequences HT and TH are equally likely (both have probability p(1-p)), while HH and TT are not equally likely unless p=0.5.
If the pair is HT, output Heads; if TH, output Tails. If HH or TT, discard the pair and repeat the process.
Since HT and TH are equally likely, the conditional probability of outputting Heads given a non-discarded pair is 1/2. Thus the final output is fair.
The expected number of flips is 1/(2p(1-p)), which is minimized at p=0.5 (2 flips) and grows as p approaches 0 or 1. If p=0 or 1, the method never terminates; in practice, assume 0<p<1.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.