← Jane Street Interview Insights
This one wrecked me for the first few minutes.
Model the problem as a Markov decision process where the state is the current sum, and the value function satisfies a Bellman equation. Recognize that the process is a random walk with absorbing square states, and solve for the optimal stopping boundary by comparing the immediate reward of stopping versus the expected value of continuing. Then compute the expected payoff from zero using the derived optimal strategy.
Pro tip: Emphasize that the optimal strategy is a threshold policy: stop when the current sum is sufficiently far from the next square, and the threshold depends on the distance to the next square. Also, note that the expected payoff is finite and can be computed via dynamic programming or by solving a system of linear equations.
Let V(s) be the maximum expected payoff starting from sum s. If s is a perfect square, V(s)=0. Otherwise, V(s)=max(s, (1/6)∑_{i=1}^6 V(s+i)).
Show that V(s) ≥ s, and the optimal strategy is to stop when s ≥ V_continue(s). Argue that the stopping region is characterized by a threshold: stop if s is large enough relative to the next square.
Use dynamic programming or solve the Bellman equation numerically. Because the state space is infinite but the process resets at squares, consider the value function modulo the distance to the next square.
Starting from 0, the first roll cannot hit a square (since 1 is a square, but 0 is not a square? Actually 0 is a square? Typically squares are 1,4,9,... so 0 is not considered). So V(0) = (1/6)∑_{i=1}^6 V(i). Use the computed V(s) to find V(0).
Check that the strategy is indeed optimal by confirming the Bellman equation holds. Discuss the intuition: the expected payoff is finite and the optimal strategy balances risk and reward.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.