Probability · Waiting times · Hard
A monkey and three keys
A keyboard has three keys, A, B and C. A monkey presses one key at a time, each key equally likely and independent of the presses before. What is the expected number of presses until the three most recent presses read A, B, A in that order for the first time?
a fraction, an expression or a decimal to two significant figures · 5/8 · ln 2 · pi · inf
Answer and solution
Answer
30
Solution
Three positions (nothing matched, A, AB) and one equation for each.
Let x, y, z be the expected presses left with nothing, A and AB matched. x = 1 + (1/3)y + (2/3)x, so x = 3 + y. z = 1 + (2/3)x. y = 1 + (1/3)y + (1/3)z + (1/3)x, which with z gives y = 2 + (5/6)x. Then x = 5 + (5/6)x, so x = 30.
Waiting times comes up in 8 firms' roundsCitadel Securities · Goldman Sachs · Jump Trading · +5
These 9 rounds ask this kind of problem live, with follow-ups. Every round on every track is in Premium.