1

Given a bag of $10$ coins, $9$ are ordinary coins and one is a double headed coin. How many tosses would you need to be $95\%$ sure that the coin is double headed?

This question is asked here but I would like to solve it in another way.

My attempt:

I think the question is asking for a natural number $n$ that satisfies $$P(Double|nH) \geq 0.95$$ where $P(Double)$ refers to the probability of selecting the double-headed coin and $P(nH)$ is the probability of landing $n$ heads.

By Bayes' theorem, we have \begin{align*} P(Double|nH) & = \frac{P(nH|Double)\times P(Double)}{P(nH)} \\ & = \frac{P(Double|nH)\times P(Double)}{P(nH|Double)\times P(Double)+ P(nH|fair)\times P(fair)} \\ & = \frac{1\times \frac{1}{10}}{\frac{1}{10}\times 1 + \frac{9}{10}\times \frac{1}{2^n}} \\ & = \frac{1}{1+ \frac{9}{2^n}}. \end{align*} Therefore, substituting the expression above in to the inequality, we have \begin{align*} \frac{1}{1+ \frac{9}{2^n}} & \geq 0.95 \\ 2^n & \geq \frac{0.95\times 9}{0.05} \\ n & \geq \log_2 171 > 7. \end{align*} So, I obtain that the minimum $n$ is $8$. However, from the answer given in the post, it seems that the answer is $6.$

May I know my mistake in my calculations above?

Idonknow
  • 16,493

1 Answers1

1

There are two small errors, but nevertheless, your calculation is by and large correct, whereas the answer to the other question is incorrect, as it doesn't take into account the given information about how the coin was chosen.

Your result is actually that the minimum $n$ is $8$, not $7$, since you need $n\ge\log_2171\gt7$.

And even though you performed the correct calculations, you've written the wrong probabilities for them. Your calculation should start:

\begin{eqnarray*} P(\text{double}\mid\text{$n$ heads}) &=& \frac{P(\text{double}\land\text{$n$ heads})}{P(\text{$n$ heads})} \\ &=& \frac{P(\text{$n$ heads}\mid\text{double})P(\text{double})}{P(\text{$n$ heads})}\;. \end{eqnarray*}

You might want to post your solution as an answer to the other question. It's a bit surprising that it's remained in this incorrect state without downvotes or comments all this time.

joriki
  • 242,601