You paly a game with your friend Alice where you bet on the outcome of a coin toss. The coin has been provided by Alice. You think there is a 50% chance that she would have provided an unfair coin. If the coin is unfair then you believe that the probability that it will turn up heads is uniform in [0, 1].
The question is that,
1: You toss the coin and it comes up head. What is the probability that the coin is fair?
2: You toss the coin for the second time and it comes up head again. Now, what is the probability that the coin is fair?
For me, I solve this problem through this way,
P(fair|data) = $\frac{P(data|fair)P(fair)}{P(data|fair)P(fair)+P(data|unfair)P(unfair)}$
Where I know that P(fair)=0.5, P(data|fair)=$p^1(1-p)^0$=$p=0.5$ (as fair means P(head)=0.5=p), P(unfair)=0.5,
So, the previous equation can be substitued as,
P(fair|data) = $\frac{0.5*0.5}{0.5*0.5+P(data|unfair)*0.5}$
My question is how to express the term of P(data|unfair)?
Thanks.