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:
$P(A)$=$P(A|H)*P(H)+P(A|T)*P(T)$
Where the probability is conditionally split between the first toss being Heads and Tails.
Now:
$P(H)$= $p$
$P(T)$ = $1-p$
$P(A|H)=P({HH})+P({HTHH})....$=$p+p^2(1-p)$+...= ???
$P(A|T)=P({THH})+P({THTHH})....$=$p^2+p^3(1-p)$+...= ???
I am unsure of how to continue from here. Can someone help?
I think you're on the right track!
Just one thing, notice that by Bayes:
$$P(H|A) = \frac{P(A|H)P(H)}{P(A)} = \frac{P(A|H)P(H)}{P(A|H)P(H) + P(A|T)P(T)}$$ Then from your calculations, you can notice that $P(A|T) = p \cdot P(A|H)$.
Now plugging things in $$P(H|A) = \frac{P(A|H)P(H)}{P(A|H)P(H) + p \cdot P(A|H)P(T)}$$ Notice you can cancel a lot of things and you should end up at a nice simple answer in terms of $p$