Suppose you have 2 identical-looking coins: one that is fair and one that comes up heads 75% of the time.
You randomly chose one of them, flip it 3 times and it comes up as H-H-T.
What is the chance that the coin you picked is the fair one?
Source: Project Euler
The probability that you would pick the fair coin and it would come up HHT is 1/2 * 1/8 = 1/16.
The probability that you would pick the biased coin and it would come up HHT is 1/2 * (3/4)^2 * 1/4 = 9/128.
By Bayes' rule/theorem, the probability that you did pick the fair coin given this outcome, is (1/16) / (1/16 + 9/128) = 8/17.
or, in 128 trials with exact regard to probabilities, 8 out of 17 cases of HHT were from the fair coin:
fair HHH
fair HHH
fair THH
fair THH
fair HHH
fair HHH
fair TTH
fair TTH
fair HTH
fair HTH
fair TTH
fair TTH
fair HTH
fair HTH
fair THH
fair THH
fair HHH
fair HHH
fair THH
fair THH
fair HHH
fair HHH
fair TTH
fair TTH
fair HTT
fair HTT
fair TTT
fair TTT
fair HTT
fair HTT
fair THT
fair THT
fair HHT *
fair HHT *
fair THT
fair THT
fair HHT *
fair HHT *
fair TTT
fair TTT
fair HTT
fair HTT
fair TTT
fair TTT
fair HTT
fair HTT
fair THT
fair THT
fair HHT *
fair HHT *
fair THT
fair THT
fair HHT *
fair HHT *
fair TTT
fair TTT
fair HTH
fair HTH
fair TTH
fair TTH
fair HTH
fair HTH
fair THH
fair THH
unfair HHH
unfair HHH
unfair HHH
unfair THH
unfair HHH
unfair HHH
unfair HHH
unfair THH
unfair HHH
unfair HHH
unfair HTH
unfair TTH
unfair HTH
unfair HTH
unfair HHH
unfair THH
unfair HHH
unfair HHH
unfair HHH
unfair THH
unfair HHH
unfair HHH
unfair HHH
unfair THH
unfair HHH
unfair HHH
unfair HTH
unfair TTH
unfair HTH
unfair HTH
unfair HHH
unfair THH
unfair HHH
unfair HHH
unfair HHH
unfair THH
unfair HHH
unfair HHH
unfair HHH
unfair THH
unfair HHT *
unfair HHT *
unfair HTT
unfair TTT
unfair HTT
unfair HTT
unfair HHT *
unfair THT
unfair HHT *
unfair HHT *
unfair HHT *
unfair THT
unfair HHT *
unfair HHT *
unfair HHT *
unfair THT
unfair HHH
unfair HHH
unfair HTH
unfair TTH
unfair HTH
unfair HTH
unfair HHH
unfair THH
|
Posted by Charlie
on 2016-03-18 11:10:23 |