# Probability of unfair coin given 3 heads

A coin is either fair (0.5 probability of heads) or unfair (0.6 probability of heads).

Fair and unfair coins are identical at sight.

If I throw it and get 3 heads out of 3 throws, which is the probabilty that it is unfair?

I though:

The total probability (1) of my event that I observed (3 heads) is

(probability of it being fair)*(probability of my outcome if it is fair) +
(probability of it being UNfair)*(probability of my outcome if it is UNfair) = 1
probability of my outcome if it is fair = (1/2)^3 = 1/8
probability of my outcome if it is UNfair (6/10)^3 = (27/125)
probability it is fair = F
probability it is UNfair = 1 - F


$F(1/8) + (1-F)*(27/125) = 1$

But F is bigger than one and negative (F = -112/13) !

• That calculation doesn't make sense. Suppose you only had one coin, a fair one. Then the probability that it is fair is $P=1$, clearly. Would you argue that $P\times \frac 18=1$?
– lulu
May 26, 2018 at 12:23
• Try Bayes' Theorem. You can observe $3$ Heads in two ways. First, you could have picked the fair coin and thrown three heads with it, or you could have picked the unfair coin and thrown three heads. A priori, presumably, your estimate was probability $\frac 12$ for each choice. Work out the probability of each scenario. Then ask what portion of the sum of those two is explained by having chosen the unfair coin.
– lulu
May 26, 2018 at 12:25
• @lulu thanks I solved the problem (could you look at my self-answer please?) May 26, 2018 at 12:38
• Looks good (+1).
– lulu
May 26, 2018 at 12:52

Using Bayes Theorem

P(F) = probability the coin is fair
P(UF) = probability the coin is UNfair
O = the 3 heads that I observed
P(O|F) = probability that I observed 3 heads given that it is fair
P(O|F) = probability that I observed 3 heads given that it is UNfair
P(F|0) = probability that it is fair given that I observed 3 heads
P(UF|0) = probability that it is UNfair given that I observed 3 heads


$P(F|O) = P(O|F)*P(F) = (1/8)*(1/2)$

$P(UF|O) = P(O|UF)*P(UF) = (27/125)*(1/2)$

$P(UF|O) / ( P(UF|O) + P(F|O) ) = ((27/125)*(1/2)) / ((1/8)*(1/2) + (27/125)*(1/2)) = 0.633$

Another way to look at this is that the probability of it being unfair is (the relative probability that the coin is unfair given what I see) = (probability the coins is unfair PRIOR) * (probability of the event if the coin were unfair) divided by the weighed sum of (the probability that an UNfair coin causes what I see) + (the probability that a fair coin causes what I see), weighted by the prior probability that the coin is fair or unfair (both 1/2 because they look identical)