# Probability of a double-headed coin

Here are three related problems from Blitzstein and Hwang's Introduction to Probability. Curious if my approach is sound. I'm reasonably confident in the first result, but not so much in the other two, particularly the last one.

1:: A hat contains 100 coins, of which 99 are fair but one is double-headed. A coin is chosen uniformly at random. The chosen coin is flipped 7 times, and it lands heads on all 7. What is the probability that the chosen coin is double-headed?

With all of these, I'm using naive probability, in which the numerator is my desired outcome(s) and the denominator my possible outcomes given the result. In this case, my desired outcome is double-headed, and my possible outcomes are double-headed or not double-headed and seven straight heads. This gives me

$$\frac{\frac{1}{100}*1}{\frac{1}{100}*1 + \frac{99}{100}*\frac{1}{128}} \approx .5639$$

2:: A hat contains 100 coins, of which at least 99 are fair, but there may be one that is double-headed. (If there are no such coins, all 100 are fair.) There is a 1/2 chance that one of the coins is double-headed. A coin is chosen uniformly at random, is flipped 7 times, and lands heads each time.

(a) What is the probability that one of the coins is double-headed?

My desired outcomes are there is a double-headed coin and this coin is double-headed or there is a double-headed coin and this coin is not double-headed and this coin comes up heads seven times.

My possible outcomes are the two above, and also there is no double-headed coin and this coin has come up heads seven times. This gives me:

$$\frac{\frac{1}{2}*\frac{1}{100}*1 + \frac{1}{2}*\frac{99}{100}*\frac{1}{128}}{\frac{1}{2}*\frac{1}{100}*1 + \frac{1}{2}*\frac{99}{100}*\frac{1}{128} + \frac{1}{2}*\frac{1}{128}} \approx .6942$$

(b) What is the probability that the chosen coin is double-headed?

Similar to the above, but now

$$\frac{\frac{1}{2}*\frac{1}{100}*1}{\frac{1}{2}*\frac{1}{100}*1 + \frac{1}{2}*\frac{99}{100}*\frac{1}{128} + \frac{1}{2}*\frac{1}{128}} \approx .3914$$

Addendum: I'm a dolt - there was no reason for me to be less confident in the last answer than in the second one. (I should be equally (un)confident in both.) If the probability of selecting the double-headed coin, when present, is ≈.5639, Answer(2b) is just ≈.5639 * Answer(2a).

Here's a different explanation for part 1: Let $D$ be the event that the selected coin is double-headed, and let $S$ be the event that seven straight heads are rolled. Then \begin{align} P(D | S) &= \frac{P(S | D) P(D)}{P(S)} \\ &=\frac{P(S | D) P(D)}{P(S | D)P(D) + P(S | D^C) P(D^C)} \\ &= \frac{1 \cdot (1/100) }{1 \cdot (1/100) + (1/2^7) (99/100)} \\ &= 1/(1 + 99/128) \\ &\approx .5639. \end{align}

Another approach is to use Bayes theorem: For two independent events A and B, $$P(A|B)= \frac{P(B|A)P(A)}{P(B|A)P(A) + P(B|A^c)P(A^c)}$$

Question 1: Let event A be 'Chosen coin is double headed' and Event B be 'coin lands on head all 7 flips".

• P($A$)=P(Chosen coin is double headed)= $\frac{1}{100}$
• P($A^c$)=P(Chosen coin is not double headed)= $\frac{99}{100}$
• P($B|A$)=P(All 7 heads given coin is double headed)=1
• P($B$|$A^c$)=P(All 7 heads given coin is not double headed)= $\frac{1}{2^7}$

Therefore, $$P(A|B)= \frac{\frac{1}{100} * 1} { \frac{1}{100} * 1 + \frac{1}{2^7} *\frac{99}{100} } \approx 0.5639$$

Question 2(a): Let event A be 'One of the 100 coins is Double head' and Event B be 'coin lands on head all 7 flips".

• P($A$)=P(One of the 100 coins in Double head)= $\frac{1}{2}$
• P($A^c$)=P(None of the 100 coins is Double head)= $\frac{1}{2}$
• P($B|A$)=P(All 7 heads given one of the coin is double headed)= $\frac{1}{100} + \frac{1}{2^7} * \frac{99}{100}$
• P($B$|$A^c$)=P(All 7 heads given no coin is double headed)= $\frac{1}{2^7}$

Therefore, $$P(A|B)= \frac{(\frac{1}{100} + \frac{1}{2^7} * \frac{99}{100} ) * \frac{1}{2}} { (\frac{1}{100} + \frac{1}{2^7} * \frac{99}{100} ) * \frac{1}{2} + \frac{1}{2^7} *\frac{1}{2} } \approx 0.6942$$

Question 2(b): Let event A be 'Chosen coin is Double head' and Event B be 'coin lands on head all 7 flips".

• P($A$)=P(One of the 100 coins in Double head)= $\frac{1}{2} * \frac{1}{100} + 0$
• P($A^c$)=P(None of the 100 coins is Double head)= $\frac{1}{2} + \frac{1}{2} * \frac{99}{100}$
• P($B|A$)=P(All 7 heads given coin is double headed)=1
• P($B$|$A^c$)=P(ll 7 heads given coin is not double headed)= $\frac{1}{2^7}$

Therefore, $$P(A|B)= \frac{1*(\frac{1}{2} * \frac{1}{100} + 0)} { 1*(\frac{1}{2} * \frac{1}{100} + 0) + \frac{1}{2^7} * ( \frac{1}{2} + \frac{1}{2} * \frac{99}{100}) } \approx 0.3194$$