Determine a probability of coin is fair in repeated trial The probability of getting head in a fair coin is 1/2 and the probability of getting tail in a fair coin is 1/2. While the probability of getting tail in a biased coin is 3/4 and probability of getting head in a biased coin is 1/4.
Suppose we don't know which one is a fair coin, which one is not.
What is the probability that the coin flipped was the fair coin, if 8 heads were observed in 10 trials?
Is it something like P(coin is fair | 8 heads appear in 10 trials)?
 A: $$P(\text{8 heads in 10 tosses}|\text{fair coin})={10\choose{8}}\frac{1}{2}^{10}$$
$$P(\text{8 heads in 10 tosses}|\text{unfair coin})={10\choose{8}}\frac{1}{4}^{8}\frac{3}{4}^2$$
Thus, the probability that the coin was fair would be 
$$\begin{align*}
P(\text{coin is fair})
&= \frac{P(\text{8 heads in 10 tosses}|\text{fair coin})}{P(\text{8 heads in 10 tosses}|\text{fair coin})+P(\text{8 heads in 10 tosses}|\text{unfair coin})}\\\\
&=\frac{{10\choose{8}}\frac{1}{2}^{10}}{{10\choose{8}}\frac{1}{2}^{10}+{10\choose{8}}\frac{1}{4}^{8}\frac{3}{4}^2}\\\\
&\approx 0.9913
\end{align*}$$
Alternatively, using Bayes' Theorem, assuming that the selected coin was random, we have
$$\begin{align*}
P(\text{coin is fair}|\text{8 heads in 10 tosses})
&= \frac{P(\text{coin is fair}\cap\text{8 heads in 10 tosses})}{P(\text{8 heads in 10 tosses})}\\\\
&= \frac{0.5\cdot{10\choose{8}}\frac{1}{2}^{10}}{0.5\cdot{10\choose{8}}\frac{1}{2}^{10}+0.5\cdot{10\choose{8}}\frac{1}{4}^{8}\frac{3}{4}^2}\\\\
&\approx 0.9913
\end{align*}$$
