Problem 5.13 Easy Free 2 variations

Which Coin Was Drawn?

A box contains 10001000 coins: 999999 fair coins and 11 coin with heads on both sides. You pick a coin uniformly at random and flip it 1010 times, observing heads every time. Find the probability that the coin you picked is the double-headed one.

Work it out, then compare with the answer.

SolutionShow the worked solution

Let DD be the event that the double-headed coin was picked, and H10H_{10} the event of ten heads. The prior odds of DD are

P(D)P(Dc)=1/1000999/1000=1999.\frac{\mathbb{P}(D)}{\mathbb{P}(D^c)}=\frac{1/1000}{999/1000}=\frac{1}{999}.

The likelihoods are P(H10∣D)=1\mathbb{P}(H_{10}\mid D)=1 and P(H10∣Dc)=2−10\mathbb{P}(H_{10}\mid D^c)=2^{-10}, because the flips of a fair coin are independent. Their ratio is therefore 210=10242^{10}=1024.

By Bayes’ theorem, posterior odds equal prior odds times the likelihood ratio:

P(D∣H10)P(Dc∣H10)=1999⋅1024=1024999.\frac{\mathbb{P}(D\mid H_{10})}{\mathbb{P}(D^c\mid H_{10})}=\frac{1}{999}\cdot 1024=\frac{1024}{999}.

Converting odds rr into a probability r/(1+r)r/(1+r) gives

P(D∣H10)=10241024+999=10242023≈0.506.\mathbb{P}(D\mid H_{10})=\frac{1024}{1024+999}=\frac{1024}{2023}\approx 0.506.
10242023\boxed{\dfrac{1024}{2023}}

Key idea. Each head doubles the odds in favour of the double-headed coin. Ten heads multiply the odds by about 10001000, which roughly cancels the prior odds of 1:9991:999, so the posterior is close to 12\tfrac12.

Variations

The same idea with a twist. Each solution gives only the changed step.

Variation 5.13a

A bag contains 1919 fair coins and one double-headed coin. You draw a coin uniformly at random and flip it repeatedly, observing heads every time. Find the smallest number of consecutive heads needed for your posterior probability that the coin is double-headed to exceed 95%95\%.

Work it out, then compare with the answer.

Solution

The prior odds of the double-headed coin are 1/191/19. Each head multiplies the odds by 22, so after nn heads the posterior odds are 2n/192^n/19.

A posterior probability above 0.950.95 means odds above 0.95/0.05=190.95/0.05=19. The condition is therefore 2n/19>192^n/19>19, that is, 2n>3612^n>361.

Check the boundary values:

  • n=8n=8: 28=256<3612^8=256<361, and the posterior is 256/275≈0.931256/275\approx 0.931.
  • n=9n=9: 29=512>3612^9=512>361, and the posterior is 512/531≈0.964512/531\approx 0.964.
9\boxed{9}
Variation 5.13b

Two coins have heads probabilities p1p_1 and p2p_2 with 0<p1<10<p_1<1, 0<p2<10<p_2<1, p1+p2=1p_1+p_2=1, and p2>p1p_2>p_1. One coin is chosen uniformly at random and flipped twice, giving two heads. Given that this makes it 44 times as likely that Coin 22 was chosen rather than Coin 11, find p2p_2.

Work it out, then compare with the answer.

Solution

The two coins are equally likely a priori. The posterior odds of Coin 22 against Coin 11 therefore equal the likelihood ratio

p22p12.\frac{p_2^2}{p_1^2}.

Setting this equal to 44 and using p1,p2>0p_1,p_2>0 gives p2=2p1p_2=2p_1. Combining with p1+p2=1p_1+p_2=1 gives 3p1=13p_1=1, so p1=13p_1=\tfrac13 and p2=23p_2=\tfrac23. This satisfies p2>p1p_2>p_1.

p2=23\boxed{p_2=\tfrac{2}{3}}