Optimal Value of a Dice Game With Up to Two Rerolls

Last updated: November 29, 2026

Quick Overview

You roll a fair die and are paid its face value, but you may reroll, keeping only the final roll. What is the expected payoff under optimal play with one reroll allowed, and with two?

Google
Statistics & Math
Data Scientist
Google
November 29, 2026
Data Scientist
Phone Screen
Statistics & Math
Medium

0

0

0 solved


You roll a fair die and are paid its face value, but you may reroll, keeping only the final roll. What is the expected payoff under optimal play with one reroll allowed, and with two?

A short dynamic programming puzzle common in Google data science phone screens. The interviewer checks backward induction: compute the value of continuing, then keep any roll above it, and see whether you can generalize the recursion.

What the Interviewer Expects
  • Compute the no-reroll value 3.5
  • Keep rolls of 4 or more with one reroll, value 4.25
  • With two rerolls, threshold rises to 5, value 14/3
  • Express the recursion V_{k+1} = E[max(X, V_k)]
  • Note values converge to 6 as rerolls grow
Key Topics to Cover
dynamic programming
backward induction
optimal stopping
expected value
threshold strategies
How to Approach This
  1. Define your hypotheses (H0 and H1) clearly before performing any test.
  2. Calculate required sample size BEFORE running an experiment, using power analysis.
  3. Remember the Central Limit Theorem: sample means become approximately normal with large n.
  4. Watch for Simpson's paradox. Always segment data by key dimensions.
  5. Distinguish between statistical significance and practical significance.
Possible Follow-up Questions
  • What if each reroll costs $0.50?
  • How many rerolls do you need before the value exceeds 5.5?
  • What if you are paid the sum of all rolls instead of the last?
  • How does this generalize to a continuous Uniform(0,1) payoff?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Browse Statistics Questions
Sample Answer
Clarify

Fair six-sided die, payoff is the face of the final kept roll. 'One reroll' means up to two rolls total. No cost per roll unless stated. We want the expected value under optimal play....

Approach

Work backwards. With no rerolls left, the value is V0=3.5V_0 = 3.5. With k+1k + 1 rerolls left, after rolling xx you keep it if x>Vkx > V_k, else reroll and get VkV_k. So Vk+1=E[max⁡(X,Vk)]V_{k+1} = E[\max(X, V_k)]....


Submit Your Answer
Markdown supported