Coin probability example I have a bag of 10 coins and 1 of them has heads on both sides you choose 1 of the coins from the bag at random and then flip it 100 times observing heads every time and then tell me what the probability you chose a fair coin is.
 A: Let $X$ be a random coin from the bag and define event $A := \lbrace\text{ X is fair }\rbrace$, $B:= \lbrace \text{ X is head 100 times} \rbrace $. Then we have
$$P(A) = \frac{9}{10} \\ P(B) = \frac{9}{10}\frac{1}{2^{100}} + \frac{1}{10}\\
P(B|A) = \frac{1}{2^{100}}$$
Then using Bayes' rule we get $$ P(A |B) = \frac{ P(A)P(B|A)}{P(B)} =  \frac{9}{9+2^{100}}$$
A: TL;DR The answer is $\frac{9}{2^{100}+9}$
Explanation
The a priori probability that you got a fair coin is $\frac{9}{10}$. The probability of 100 heads in a row with a fair coin is $\frac{1}{2^{100}}$. So, the total probability that you got a fair coin and flipped 100 heads in a row is $\frac{9}{10\cdot2^{100}}$.
The a priori probability that you got the two-heads coin is $\frac{1}{10}$. The probability of 100 heads in a row with that coin is 1. So, the total probability that you got that coin and flipped 100 heads in a row is $\frac{1}{10}$.
The overall probability is
$\frac{P_{fair}}{P_{fair} + P_{DoubleHeads}}$ = $\frac{9\cdot\frac{1}{10\cdot2^{100}}}{\frac{1}{10}+9\cdot\frac{1}{10\cdot2^{100}}}$
Simplifying the fraction gives us $\frac{9}{2^{100}+9}$
