← JPMorgan Chase Interview Insights
The setup is straightforward enough but I second-guessed myself on whether to condition on each round separately or just write out the full series from the start.
Model the game as a sequence of rounds where each round consists of both players flipping once, and A wins if A flips heads first in a round. Compute the probability of A winning in the first round, then use the geometric series for subsequent rounds, summing the infinite series to get the closed-form answer.
Pro tip: After deriving the answer, mention that the same result can be obtained by solving a recursive equation: P(A wins) = 1/2 + (1/4)P(A wins), which gives P = 2/3. This shows you can think both iteratively and recursively, a valuable skill in software engineering.
Let p be the probability that A wins. In a single round (A flips then B flips), A wins immediately if A flips heads (prob 1/2). If both flip tails (prob 1/4), the game resets to the starting state.
The probability that A wins on the first round is 1/2. The probability that A wins on the second round is (1/4)*(1/2), on the third round (1/4)^2*(1/2), etc. So p = sum_{k=0}^∞ (1/2)*(1/4)^k.
The series is geometric with first term a = 1/2 and common ratio r = 1/4. Sum = a/(1-r) = (1/2)/(3/4) = 2/3.
Alternatively, set up the equation p = 1/2 + (1/4)p, solve to get p = 2/3. This confirms the result and demonstrates an alternative approach.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.