O'Reilly logo

Digital Dice by Paul J. Nahin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Image

APPENDIX 7

How to Simulate Kelvin’s Fair Coin with a Biased Coin

Look again at note 7 in the introduction for the motivation behind this appendix. Suppose the biased coin has probability p of showing heads, and so probability 1 – p of showing tails. Suppose further that we assume individual tosses of the coin are independent. Toss the coin twice. It shows HH with probability p2, TT with probability (1 – p)2, and either TH or HT with equal probability p(l – p). So, if TH appears, call it heads, and if HT appears, call it tails. If either HH or TT appears, ignore the result and toss twice again. The price we pay for making any coin into a fair coin ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required