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?