KatInterview

Optimal Stopping on a Die Game with Square Traps

Statistics & ExperimentsModel answer
HardModel answerStatistics & Experimentsprobabilitydynamic-programmingoptimal-stopping

Last updated

Evaluate optimal stopping strategies and dynamic programming formulations for a die-rolling game where landing on perfect squares results in total loss.

Imagine playing a continuous dice game starting at a cumulative score of $S = 0$ using a balanced six-sided die numbered $1$ through $6$.

During every round:

  1. You roll the die and add the rolled number to your total $S$.
  2. Bust Rule: If your updated sum $S$ is a strictly positive perfect square (i.e., $S \in {1, 4, 9, 16, 25, \dots}$), your score collapses to $0$, and the game terminates with zero payout.
  3. Cash-Out Option: If $S$ is not a perfect square, you face a choice: either stop playing to lock in $S$ as your final cash reward, or roll again.

Key Requirements

1. Bellman Equation & Expected Value Bounds

  • Formulate the state value function $V(s)$, defined as the maximum expected payout starting from any valid, non-busting state $s$.
  • Write out the explicit Bellman optimality equation for $V(s)$.
  • Determine whether the absolute maximum expected score achievable from $S=0$ is finite or infinite. Prove your intuition by analyzing the survival probability when attempting to navigate past high-valued consecutive squares $k^2$ and $(k+1)^2$ as $k \to \infty$.

2. Small State Strategy Analysis

  • After taking the initial roll from $S = 0$, you land on $S \in {2, 3, 5, 6}$ with probability $4/6$ (since $1$ and $4$ cause an instant bust).
  • Perform a one-step lookahead calculation for these small non-busting scores ($s = 2, 3, 5, 6$). Is it ever optimal to roll again from any of these positions, or should a rational player cash out immediately?

3. Asymptotics & Variant Scenarios

  • Analyze the asymptotic policy behavior when $S$ lies in the middle of a massive non-square region between $k^2$ and $(k+1)^2$ for very large $k$. How does the choice to roll change near the midpoint versus when drawing close to $(k+1)^2$?
  • Evaluate how the optimal strategy shifts under two structural modifications:
    • Partial Penalty: Busting does not end the game with zero payout, but instead imposes a fixed numerical deduction $C$ before letting the player decide whether to continue or stop.
    • Zero-Indexed Die: The die faces are modified to ${0, 1, 2, 3, 4, 5}$.

Hints

Hint 1

Think about the gap between consecutive squares k^2 and (k+1)^2, which equals 2k + 1. For large k, how many safe steps can you take without any risk of hitting (k+1)^2?

Hint 2

Calculate the expected outcome of taking one additional roll at state s. What is the probability of hitting a square from s?

Hint 3

Consider whether V(s) can grow indefinitely. Does the ability to cash out early place a lower bound on your decision?