Bayes' Rule and Coin Toss Probability

ohayme

New member
Joined
Dec 13, 2015
Messages
7
Hello,

A hat contains n coins, f of which are fair, and b of which are biased to land heads with probability of 2/3. A coin is drawn from the hat and tossed twice. The first time it lands heads, and the second time it lands tails. Given this information, what is the probability that it is a fair coin?

I already have the solution for this question is (9f/ 9f + 8b), but I don't quite get why the probability of
P(HT I fair) is 1/4 and why the probability of P(HT I biased ) is 2/3 x (1/3). I'm not sure where the 1/3 is coming from? If someone could explain how to do this question in detail it would be great since I really want to understand this question and Bayes' Rule. Thank you for your work!!
 
\(\displaystyle \text{If the coin is biased then the probability of flipping $HT$ is $P[HT]=P[H]P[T] = \dfrac 2 3 \left(1-\dfrac 2 3\right) = \dfrac 2 3 \dfrac 1 3= \dfrac 2 9$}\)


\(\displaystyle
P[fair|HT] = \dfrac{P[HT|fair]P[fair]}{P[HT]} = \dfrac{\frac 1 4 \frac f n}{\frac 1 4 \frac f n + \left(\frac 2 3 \frac 1 3\right) \frac b n}
\)

I leave you to work out the algebra to match your given answer.
 
Bayes's Law starts from here:

[MATH]\text {P(HT | fair) * P(fair)} \equiv \text {P(HT and fair)} \equiv \text {P(fair | HT) * P(HT)}.[/MATH]
You are interested in the probability of fair given HT. So by basic algebra you can conclude that

[MATH]\text {P(fair | HT)} = \dfrac{\text {P(HT and fair)}}{\text {P(HT)}}.[/MATH]
All clear to here?

It is fairly obvious how to calculate the numerator, but how do we calculate the denominator. The clue is that fair and biased are mutually exclusive and exhaustive.

[MATH]\text {P(HT)} = \text {P(HT and fair) + P(HT and biased)}.[/MATH]
If the coin is fair, the probability of heads is 1/2 as is the probability of tails. Tosses are independent so the probability of heads then tails is (1/2) * (1/2) = 1/4. So

[MATH]\text {P(HT and fair)} = \text {P(HT | fair) * P(fair)} = \dfrac{1}{4} * \dfrac{f}{f + b} = \dfrac{f}{4(f + b)}.[/MATH]
If the coin is biased , you are told that the probability of heads is 2/3, and thus the probability of tails must be 1 - 2/3 = 1/3. Tosses are independent so the probability of heads then tails is (2/3) * (1/3) = 2/9. So

[MATH]\text {P(HT and biased)} = \text {P(HT | biased) * P(biased)} = \dfrac{2}{9} * \dfrac{b}{f + b} = \dfrac{2b}{9(f + b)}.[/MATH]
[MATH]\therefore \text {P(HT)} = \dfrac{f}{4(f +b)} + \dfrac{2b}{9(f + b)} = \dfrac{9f + 8b}{36(f + b)}.[/MATH]
That gives us the denominator of the fraction we want, and, in getting here, we calculated the numerator.

[MATH]\therefore \text {P(fair | HT)} = \dfrac{\dfrac{f}{4(f + b)}}{\dfrac{9f + 8b}{36(f + b)}} = \dfrac{f}{4(f + b)} * \dfrac{36(f +b)}{9f + 8b} = \dfrac{9f}{9f + 8b}.[/MATH]
Is ANYTHING unclear now?

EDIT: This is basically the same answer as Romsek's. I just spelled it out detail by painful detail. Bayes's law problems frequently require a fair amount of manipulation and very clear understanding of the problem.
 
Last edited:
We have f+ b coins so the a-priori probability of selecting a fair coin is \(\displaystyle \frac{f}{f+ b}\) and the probability of selecting a biased coin is \(\displaystyle \frac{b}{f+ b}\). If we select a fair coin the probability of heads is 1/2. If we select a biased coin the probability of heads is 2/3.

Imagine doing this experiment 9000(f+ b) times. Then 9000f times we select the fair coin and 9000b times we select the biased coin. Of the 9000f times we select the fair coin, 4500f times we get heads on the first flip and 2250f times we get heads on the first two flips. Of the 9000b times we select the biased coin, 6000b times we get heads on the first flip and 4000b times we get heads on the first two flips . That is a total of 2250f+ 4000b times we get heads on the first two flips. Of those 2250f+ 4000b times, 2250f came when we had the fair coin so the probability we got the fair coin, given that we got heads, is 2250f/(2250f+ 4000b)= 9f/(9f+ 16b) and the probability we got the biased coin, given that we got heads, is 4000b/(2250f+ 4000b)= 16b/(9f+ 16b).
 
We have f+ b coins so the a-priori probability of selecting a fair coin is \(\displaystyle \frac{f}{f+ b}\) and the probability of selecting a biased coin is \(\displaystyle \frac{b}{f+ b}\). If we select a fair coin the probability of heads is 1/2. If we select a biased coin the probability of heads is 2/3.

Imagine doing this experiment 9000(f+ b) times. Then 9000f times we select the fair coin and 9000b times we select the biased coin. Of the 9000f times we select the fair coin, 4500f times we get heads on the first flip and 2250f times we get heads on the first two flips. Of the 9000b times we select the biased coin, 6000b times we get heads on the first flip and 4000b times we get heads on the first two flips . That is a total of 2250f+ 4000b times we get heads on the first two flips. Of those 2250f+ 4000b times, 2250f came when we had the fair coin so the probability we got the fair coin, given that we got heads, is 2250f/(2250f+ 4000b)= 9f/(9f+ 16b) and the probability we got the biased coin, given that we got heads, is 4000b/(2250f+ 4000b)= 16b/(9f+ 16b).
Halls I think you answered a question different from the one posed.
 
Top