Compute win probability in coin-toss game
Problem Description
Two players, A and B, engage in a coin-toss game with a fair coin, following these rules:
- Tossing Order: Player A tosses first, followed by B, then A again, and so on, alternating turns.
- Sequence Recording: The results of each toss (Heads 'H' or Tails 'T') are recorded sequentially.
- Game End Condition: The game concludes immediately upon the first occurrence of the subsequence "HT" (a Head followed directly by a Tail on the subsequent toss).
- Winner Determination: The player who tosses the Tail in this first "HT" subsequence is declared the winner.
Given that the coin is fair and the game continues indefinitely until the "HT" subsequence appears, calculate the probability that Player A wins the game.
AI interview prep
Core dilemma
Correctly modeling the game's state transitions and handling its potentially infinite nature to derive a closed-form probability for player A's win.
3 tradeoffs and 3 stress tests locked
Interview prep
Unlock the interviewer X-Ray rubric, tradeoff matrix, stress tests, clarifying questions, and key concepts.
Compute win probability in coin-toss game
Problem Description
Two players, A and B, engage in a coin-toss game with a fair coin, following these rules:
- Tossing Order: Player A tosses first, followed by B, then A again, and so on, alternating turns.
- Sequence Recording: The results of each toss (Heads 'H' or Tails 'T') are recorded sequentially.
- Game End Condition: The game concludes immediately upon the first occurrence of the subsequence "HT" (a Head followed directly by a Tail on the subsequent toss).
- Winner Determination: The player who tosses the Tail in this first "HT" subsequence is declared the winner.
Given that the coin is fair and the game continues indefinitely until the "HT" subsequence appears, calculate the probability that Player A wins the game.