You and I play the following game: I toss a coin repeatedly. The coin is unfair and $P(H) = p$. The game ends the first time that two consecutive heads $(HH)$ or two consecutive tails $(TT)$ are observed. I win if $(HH)$ is observed and you win if $(TT)$ is observed. Given that I won the game, find the probability that the first coin toss resulted in head.
So far my attempt is:
Let A be the event that I win the game. Using the law of total probability:
Where the probability is conditionally split between the first toss being Heads and Tails.
$P(T)$ = $1-p$
I am unsure of how to continue from here. Can someone help?