Optimal Stopping for Die Rolls That Bust on Perfect Squares
Jane StreetQuantitative Trader · OnsiteLast updated
This question evaluates probabilistic reasoning and optimal stopping competency, testing understanding of Markov decision processes, expected-value calculations, and risk trade-offs in stochastic processes.
You repeatedly roll a fair six-sided die and keep a running cumulative sum $S$ of all the values rolled so far (starting from $S = 0$ before the first roll).
- After any roll, you may choose to stop and walk away with a payoff equal to the current sum $S$.
- However, if at any point the cumulative sum $S$ lands exactly on a positive perfect square ($1, 4, 9, 16, 25, \dots$), you immediately lose everything: the game ends with payoff $0$.
- If you keep rolling and have not busted, the game continues indefinitely — there is no limit on the number of rolls.
Determine the optimal strategy: for which values of the running sum should you keep rolling, and at which values should you stop and take the money? Justify why the strategy is optimal, and compute the expected payoff of the game under optimal play, starting from a sum of $0$.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.