Q:

Probability of tossing coins

Suppose there are 10 coins laid out in front of you. All of the coins are fair (i.e. have an equal chance of heads or tails) except one, which flips to heads every time. You draw one coin at random and flip it 5 times. If each of the 5 flips results in heads, then the probability that this coin is fair can be written as $\frac{a}{b}$, where a and b are coprime positive integers. What is the value of a+b?

I tried it like this:
chance of getting all head in fair coin = $\frac{1}{2^5}$ = $\frac{1}{32}$
chance of selecting fair coin = $\frac{9}{10}$
chance of getting all head in unfair coin = 1
chance of selecting unfair coin = $\frac{1}{10}$
I calculated the answer as 
$$
\left(\frac{1}{32} \cdot \frac{9}{10}\right)+\left(1 \cdot\frac {1}{10}\right) =\frac{41}{320} \implies a+b=361$$
Is this answer correct?

A:

I'm afraid not.  The problem is an exercise in Bayes' theorem.
Let $F$ be the event that he coin is fair, and $5H$ be the event of getting $5$ heads.
$$P(F) = 9/10$$
$$P(5H|F) = 1/32$$
$$P(5H|\bar{F}) = 1$$
The problem asks for the probability that, given that you got $5$ heads, that the coin is fair, which is $P(F|5H)$.  Bayes' Theorem then states that
$$P(F|5H) = \frac{P(5H|F) P(F)}{P(5H|F) P(F)+P(5H|\bar{F})P(\bar{F})}$$
Plugging in the numbers, I get $P(F|5H)=9/41$.

