How to create an unfair coin and prove it with math
posted on 20111203
Let ’ s make some unfair coins by bending them. Our estimate is that the concave english will have less area to land on, and so the mint should land on it less often .
It ’ second slowly to bend the coins with your teeth :
WAIT ! That in truth hurts ! Using pliers or wrenches works much better :
I made seven coins this way, each with a different crouch angle .
I did 100 flips for each mint, making indisputable each flip went at least a foot in the air and spin real well. “ Umm… only 100 flips ? ” you ask, “ That can ’ thymine be adequate ! ” Just you wait until the incision on the mathematics .
here ’ s the bareassed results :
Coin  Total Flips  Heads  Tails 
0  100  53  47 
1  100  55  45 
2  100  49  51 
3  100  41  59 
4  100  39  61 
5  100  27  73 
6  100  0  100 
Now for the math
Coin flip is a bernoulli procedure. This precisely means that all trials ( flips ) can have alone two outcomes ( heads or tails ), and each test is freelancer of every other trial. What we ’ rhenium concerned in calculating is the expect respect of a mint pass for each of our coins. That is, what is the probability it will come up heads ? The obvious way to calculate this probability is just to divide the number of heads by the total number of trials. unfortunately, this doesn ’ t give us a good theme about how accurate our estimate is .
Enter the beta distribution. This is a distribution over the bias of a bernoulli process. intuitively, this means that CDF ( x ) equals the probability that the arithmetic mean of a coin flip is \ ( \le\ ) adam. In other words, we ’ ra finding the probability that a probability is what we think it should be. That ’ s a convolute definition ! Some examples should make it clearer .
The beta distribution takes two parameters \ ( \alpha\ ) and \ ( \beta\ ). \ ( \alpha\ ) is the number of heads we have flipped plus one, and \ ( \beta\ ) is the number of tails plus one. We ’ ll spill the beans about why that plus one is there in a bite, but first get ’ s see what the distribution actually looks like with some case parameters .
In both the above cases, the distribution is centered around 0.5 because \ ( \alpha\ ) and \ ( \beta\ ) are equal—we ’ ve gotten the lapp number of heads as we have tails. As these parameters increase, the distribution gets tighter and tighter. This should makes sense. The more flips we do, the more confident we can be that the datum we ’ ve collected actually match the characteristics of the coin .
When the parameters are not peer to each other—for exercise, we ’ ve seen doubly adenine many heads as we have tails—then the distribution is skewed to the left or right accordingly. The flower of the PDF occurs at :
\ ( \dfrac { \alpha1 } { \alpha+\beta2 } =\dfrac { heads } { heads+tails } \ )
That ’ s precisely what we said the expectation of the adjacent mint flip should be above. Awesome !
so what happens when \ ( \alpha\ ) and \ ( \beta\ ) are one ?
We get the flat distribution. basically, we haven ’ metric ton flipped the coin at all even, so we have no data about how our mint is biased, so all biases are equally probably. This is why we must add one to the number of heads and tails we have flipped to get the allow \ ( \alpha\ ) and \ ( \beta\ ) .
If \ ( \alpha\ ) and \ ( \beta\ ) are less than one, we get something like this :
basically, this means that we know our coin is very biased in one way or the other, but we don ’ metric ton know which way however ! As you can imagine, such perverse parameterizations are rarely used in practice .
hopefully, this has given you an intuitive sense for what the beta distribution looks like. But for the academic, here ’ s how the beta distribution ’ mho pdf is formally defined :
\ ( fluorine ( ten ; \alpha, \beta ) = \dfrac { \Gamma ( \alpha+\beta ) } { \Gamma ( \alpha ) \Gamma ( \beta ) } x^ { \alpha1 } ( 1x ) ^ { \beta1 } \ )
Where \ ( \Gamma\ ) is the gamma routine —you can think of it as being a generalization of factorials to the actual numbers. That is, \ ( \Gamma ( x+1 ) = ( x+1 ) \Gamma ( x ) \Leftrightarrow ( x+1 ) ! = ( x+1 ) adam ! \ ). Excel, many calculators, and any scientific scheduling box will be able to calculate that for you easily. Most of these applications will evening have the beta affair already built in .
Applying the beta distribution to our coins
We ’ re finally fix to see fair how bias our coins actually are !
Coin 0 Heads : 53 Tails : 47 Read more: Mini Coin Purse – Free Crochet Pattern 

Coin 1 Heads : 55 Tails : 45 

Coin 2 Heads : 49 Tails : 51 

Coin 3 Heads : 41 Tails : 59 

Coin 4 Heads : 39 Tails : 61 

Coin 5 Heads : 27 Tails : 73 

Coin 6 Read more: Events Timeline Heads : 0 
amazingly, it takes some pretty big bends to make a bias coin. It ’ s not until coin 3, which has an about 90 degree bending that we can say with any assurance that the coin is biased at all. People might notice if you tried to flip that mint to settle a bet !
Leave a Comment