This article is from the Puzzles FAQ, by Chris Cole chris@questrel.questrel.com and Matthew Daly mwdaly@pobox.com with numerous contributions by others.
Generate even odds from an unfair coin. For example, if you
thought a coin was biased toward heads, how could you get the
equivalent of a fair coin with several tosses of the unfair coin?
probability/flips/unfair.s
Toss twice. If both tosses give the same result, repeat this process
(throw out the two tosses and start again). Otherwise, take the first
of the two results.
 
Continue to: