How to find out the conditional probability of an event followed by itself? I am a bit stuck with the following question if anyone can help me solve and understand this:
A man has a fair coin and a unfair coin (which shows up tail with 75% of the chance) in his bag. He selects one of the coins at a random, and when he flips it, it shows head.
Suppose that he flips the same coin a second time and again it shows head. Now what is the probability that it is a fair coin?

so far I have tried to find out probability that coin is head twice:
(0.5 x 0.5 x 0.5) + (0.5 x 0.25 x 0.25 ) = .125 + 0.015625 = 0.140625
probability that it is fair and head twice = .125
and my answer to this question was = .125 / .140625 = 0.89

With the information given, the prior probabilities are:
$$P(F)=P(U)=\frac{1}{2}$$
Let $H$ be the event that two successive heads are obtained. Then we have
$$P(H|F)=\frac{1}{4}$$
$$P(H|U)=\frac{1}{16}$$
By Bayes' Rule,
$$P(U|H)=\frac{p(H|U)P(U)}{p(H)}=\frac{\frac{1}{16}\frac{1}{2}}{P(H)}=\frac{1}{32}\frac{1}{P(H)}$$
and
$$P(F|H)=\frac{p(H|F)P(F)}{p(H)}=\frac{\frac{1}{4}\frac{1}{2}}{P(H)}=\frac{1}{8}\frac{1}{P(H)}$$
By the law of total probability,
$$P(U|H)+P(F|H)=1 \implies \frac{5}{32}\frac{1}{P(H)}=1 \implies P(H)=\frac{5}{32}$$
So $\boxed{P(F|H)=\frac{1}{8}\cdot\frac{32}{5}=\frac{4}{5}=0.8}$
