So, we have the 2 coins, coin X is HH, coin Y is normal.
Event A is the event you pick coin X. Event B is the event you throw three heads in a row.
P(A)=1/2, pretty clearly, but we want P(A|B)
P(A|B)=P(AnB)/P(B)
Now, we know that P(B)=(1/2)*P(B|A)+(1/2)*P(B|A'), yeah? (This is the law of total probability:
http://en.wikipedia.org/wiki/Law_of_total_probability )
so you get P(A|B)=2*P(AnB)/(P(B|A)+P(B|A')).
P(B|A)=P(BnA)/P(A)=2P(BnA) and P(B|A')=P(BnA')/P(A')=2P(BnA') -this just comes from the definitions
So we now have P(A|B)=P(AnB)/(P(AnB)+P(A'nB))
Now, P(AnB)=P(A)=1/2, and P(A'nB)=1/2*(1/2)^3=1/16
So we get P(A|B)=(1/2)/(1/2+1/16)
Does this make sense?