# Probability - Generating fair outcome using unfair coin

I have been thinking a lot about the following puzzle. But, could not arrive at a solution.

Can someone explain me how can you get a fair (equal probability) outcome using only an unfair coin (where unfair means that it will land head with probability p and tails 1-p where p != .5)?

-
This question belongs on CrossValidated: stats.stackexchange.com. – Shane Feb 10 '11 at 16:57
Right, but this could be (and probably is) an interview question for a quant job, so ? – egoroff Feb 10 '11 at 17:26
@egoroff So the next question we can expect is "how many manhole covers are in NYC?" – Shane Feb 10 '11 at 17:40

As long as you are allowed to discard initial unbalanced results (HH or TT) in favor of balanced results (HT or TH), you can get a fair outcome.

See http://en.wikipedia.org/wiki/Fair_coin for a detailed explanation.

-

What you are looking for is a Von Neumann Corrector - http://everything2.com/title/von+Neumann+corrector

-

You throw the coin twice. When you get heads-tails you count the toss as heads. If the tosses come up tails-heads you count it as tails. You ignore the throws that come up twice the same side. With this method you remove the bias.

This method is also called a von neumann corrector.

-