We can analyze the problem by considering the game as a Markov process with several states. Recall that the game ends the moment we see a head followed immediately by a tail (HT), and the player who tossed the tail wins.
Let's define the following states, where the ordered pair (Last toss, Next player to toss) represents the situation:
- (H, A): The last toss was a Head and it is A's turn to toss.
- (H, B): The last toss was a Head and it is B's turn to toss.
- (T, A): The last toss was a Tail and it is A's turn.
- (T, B): The last toss was a Tail and it is B's turn.
- Start: No toss has occurred; A is about to toss.
Let:
- (P(H,A)) be the probability that A eventually wins when the current state is ((H,A)),
- (P(H,B)) be the probability that A wins from state ((H,B)),
- (P(T,A)) be the probability that A wins from state ((T,A)),
- (P(T,B)) be the probability that A wins from state ((T,B)),
- (P_{\text{Start}}) be the probability that A wins from the start of the game.
Step 1. Writing the Equations for Each State
-
State ((H, A)):
- If A tosses Tail (with probability (1/2)), we have observed the sequence HT. Since A tossed the tail, A wins immediately.
- If A tosses Head (with probability (1/2)), the sequence becomes H (from the previous toss) followed by H, and the game continues with state ((H, B)) (because the last toss is Head and it is now B’s turn).
Thus,
[
P(H,A) = \frac{1}{2}(1) + \frac{1}{2}P(H,B).
]
-
State ((H, B)):
- If B tosses Tail (with probability (1/2)), then we get HT and B wins; so A loses (0 probability for A).
- If B tosses Head (with probability (1/2)), the state changes to ((H, A)).
So,
[
P(H,B) = \frac{1}{2}(0) + \frac{1}{2}P(H,A) = \frac{1}{2}P(H,A).
]
-
State ((T, A)):
Here, the last toss was Tail, so an HT pattern cannot occur immediately.
- If A tosses Head (with probability (1/2)), the new state is ((H, B)) (because the last toss becomes Head and the turn passes to B).
- If A tosses Tail (with probability (1/2)), the new state is ((T, B)) (the last toss remains Tail and B tosses next).
Thus,
[
P(T,A) = \frac{1}{2}P(H,B) + \frac{1}{2}P(T,B).
]
-
State ((T, B)):
Similarly,
- If B tosses Head (with probability (1/2)), the state changes to ((H, A)).
- If B tosses Tail (with probability (1/2)), the state changes to ((T, A)).
So,
[
P(T,B) = \frac{1}{2}P(H,A) + \frac{1}{2}P(T,A).
]
-
Start State:
A starts the game:
- If A tosses Head (with probability (1/2)), the state becomes ((H, B)).
- If A tosses Tail (with probability (1/2)), the state becomes ((T, B)).
Thus,
[
P_{\text{Start}} = \frac{1}{2}P(H,B) + \frac{1}{2}P(T,B).
]
Step 2. Solving the Equations
For states ((H, A)) and ((H, B)):
From the equation for ((H, B)):
[
P(H,B) = \frac{1}{2}P(H,A).
]
Substitute into the equation for ((H,A)):
[
P(H,A) = \frac{1}{2} + \frac{1}{2}\left(\frac{1}{2}P(H,A)\right) = \frac{1}{2} + \frac{1}{4}P(H,A).
]
Subtract (\frac{1}{4}P(H,A)) from both sides:
[
\frac{3}{4}P(H,A) = \frac{1}{2} \quad \Longrightarrow \quad P(H,A) = \frac{1}{2} \cdot \frac{4}{3} = \frac{2}{3}.
]
Then,
[
P(H,B) = \frac{1}{2}P(H,A) = \frac{1}{2} \times \frac{2}{3} = \frac{1}{3}.
]
For states ((T, A)) and ((T, B)):
Let:
[
x = P(T,A) \quad \text{and} \quad y = P(T,B).
]
From the equations:
[
x = \frac{1}{2}P(H,B) + \frac{1}{2}y = \frac{1}{2}\left(\frac{1}{3}\right) + \frac{1}{2}y = \frac{1}{6} + \frac{1}{2}y,
]
[
y = \frac{1}{2}P(H,A) + \frac{1}{2}x = \frac{1}{2}\left(\frac{2}{3}\right) + \frac{1}{2}x = \frac{1}{3} + \frac{1}{2}x.
]
Now solve these equations:
From the first equation:
[
x = \frac{1}{6} + \frac{1}{2}y.
]
From the second:
[
y = \frac{1}{3} + \frac{1}{2}x.
]
Substitute the expression for (y) from the second equation into the first:
[
x = \frac{1}{6} + \frac{1}{2}\left(\frac{1}{3} + \frac{1}{2}x\right) = \frac{1}{6} + \frac{1}{6} + \frac{1}{4}x = \frac{1}{3} + \frac{1}{4}x.
]
Subtract (\frac{1}{4}x) from both sides:
[
x - \frac{1}{4}x = \frac{1}{3},
]
[
\frac{3}{4}x = \frac{1}{3} \quad \Longrightarrow \quad x = \frac{1}{3} \times \frac{4}{3} = \frac{4}{9}.
]
Then,
[
y = \frac{1}{3} + \frac{1}{2}x = \frac{1}{3} + \frac{1}{2}\left(\frac{4}{9}\right) = \frac{1}{3} + \frac{2}{9} = \frac{3}{9} + \frac{2}{9} = \frac{5}{9}.
]
So, we have:
[
P(T,A) = \frac{4}{9} \quad \text{and} \quad P(T,B) = \frac{5}{9}.
]
Finally, for the Start State:
Recall:
[
P_{\text{Start}} = \frac{1}{2}P(H,B) + \frac{1}{2}P(T,B) = \frac{1}{2}\left(\frac{1}{3}\right) + \frac{1}{2}\left(\frac{5}{9}\right).
]
Compute each term:
[
\frac{1}{2}\left(\frac{1}{3}\right) = \frac{1}{6}, \quad \frac{1}{2}\left(\frac{5}{9}\right) = \frac{5}{18}.
]
So,
[
P_{\text{Start}} = \frac{1}{6} + \frac{5}{18} = \frac{3}{18} + \frac{5}{18} = \frac{8}{18} = \frac{4}{9}.
]
Conclusion
The probability that A wins the game is:
[
\boxed{\frac{4}{9}}.
]