Bayes probability with unfair coin - what went wrong

390 Views Asked by At

A box has 1000 pennies. One penny in the box has 2 heads. A coin is selected at random and flipped 5 times. If the coin comes up heads each time, what is the probability that the selected coin had two heads?

$$P(\text{ Two sided coin }|\text{ getting 5 heads })=\frac{P(\text{ getting 5 heads }|\text{ two sided coin }) \times P(\text{ picking two sided coin })}{P(\text{ getting 5 heads })}$$ $$ P(\text{ Two sided coin }|\text{ 5 heads })=\frac{(1\times1/1000)}{(1/2\times1/2\times1/2\times1/2\times1/2)}$$ $$ P(\text{ Two sided coin }|\text{ 5 heads })=1.024$$

Now clearly this is incorrect, but I am not understanding why, as I feel I have used Bayes the correct way

2

There are 2 best solutions below

2
On BEST ANSWER

First, check your calculation of $(1/2)^5$.

But even that does give the exact answer: when calculating $P(\text{getting 5 heads})$, you should consider also the fact that there is a biased coin, $$ P(\text{getting 5 heads}) = P(\text{getting 5 heads} \cap \text{two-sided coin}) + P(\text{getting 5 heads} \cap \text{fair coin}) = \cdots $$

0
On

The unconditional probability of getting five heads in a row is not $(1/2)^5 = 1/32$ as you have calculated in your work. This is because there is one two-headed coin in the box.

Instead, use the law of total probability to condition on the event of choosing the biased coin. If $H$ is the event that the chosen coin gives $5$ heads, and $B$ is the event that the chosen coin is 2-headed,

$$\Pr[H] = \Pr[H \mid B]\Pr[B] + \Pr[H \mid \bar B]\Pr[\bar B].$$

The first term is what you calculated in your numerator. The second term, naturally, is $$\Pr[H \mid \bar B] = (1/2)^5$$ and $$\Pr[\bar B] = 999/1000.$$