$P(\text{fair coin})=0.5$, if coin is unfair, then $P(\text{head|unfair})$ follows Uniform(0,1). Toss once, and get a head, find $P(\text{fair|head})$

58 Views Asked by At

There is a coin with a 50% chance that the coin is unfair. If the coin is unfair then the probability that it will turn up heads is uniform in [0, 1].You toss the coin once and it comes up head. What is the probability that the coin is fair?

What I tried as the following: $P(\text{fair|head})=\frac{P(\text{head|fair})P(\text{fair})}{P(\text{head})}=\frac{0.5*0.5}{P(\text{head})}$, but I do not know how to calculate $P(\text{head})$, is it $\frac{\text{how many heads we got}}{\text{how many time the coin flipped}}=1$?

If it is $1$, then if I condition on tail, then it becomes $P(\text{fair|tail})=\frac{P(\text{tail|fair})P(\text{fair})}{P(\text{tail})}=\frac{0.5*0.5}{P(\text{tail})}$, then denominator becomes $0$.

My second question is that for $P(\text{unfair|head})=\frac{P(\text{head|unfair})P(\text{unfair})}{P(\text{head})}=\frac{P(\text{head|unfair})*0.5}{P(\text{head})}$, here $P(\text{head|unfair})$ follows uniform distribution, which is a continuous distribution, how could I know $P(\text{head|unfair})$? Thank you very much!