Making a loaded coin fair – The Unfair Coin Problem

Today’s post is about Game Theory.

How do you make a loaded coin fair for a coin toss?

Let’s say that the coin is loaded such that heads comes up 75% of the time, and tails 25% of the time. How would one use this coin fairly for a coin toss?

Enter Jon Von Neumann, the father of Game Theory. His solution was elegant and simple;

Flip the coin twice. If the results are the same (HH or TT), ignore and proceed to flipping them two more times. If the two results are different (HT or TH), use the first of the two results. That is it.

The rationale is that p(H) * p(T) = p(T) * p(H), where p(H) is the probability for heads and p(T) is the probability for Tails. Thus, the probability of two consecutive different results is simply the product of the two.

Since p(H) * p(T) = p(T) * p(H), this now becomes a 50-50 chance. Voila, a fair coin toss rule.

This solution is as elegant as the Tit-for-tat solution for the iterated Prisoner’s dilemma question.

This also reminds me of a great quote from Taligent’s Guide to Designing Programs!

Remember that there is no code faster than no code.

Keep on learning…