← Tables
Study hall · 3/6Stop or Continue
Desk · re-roll game solver
1
Briefing · Study hall

Stop or Continue

Used in: interview EV puzzles, Higher or Lower

When you get to choose during a game, solve from the last decision backwards. At each step, keep what you have if it beats the EV of continuing.

V₀ = (s+1)/2 Vₖ = E[ max(X, Vₖ₋₁) ]

Vₖ is the game's value when you have k re-rolls left on an s-sided die. The threshold rule is: keep any roll strictly above Vₖ₋₁.

Under the hood: reading Vₖ = E[ max(X, Vₖ₋₁) ]
sNumber of sides on the die.
VₖWhat the game is worth when you still have k re-rolls left and you play perfectly.
V₀ = (s+1)/2With no re-rolls left you must keep the next roll, so the game is worth the plain EV of one roll.
XThe roll you are about to see.
Vₖ₋₁What you'd be worth if you threw this roll away: the same game with one fewer re-roll.
max(X, Vₖ₋₁)Your payoff after seeing X: keep X, or swap it for the rest of the game. You take whichever is bigger.
E[ … ]Average that payoff over every roll you might see.

Worked: six-sided die, one re-roll

V₀ = 3.5. On a 1, 2 or 3, re-rolling (worth 3.5) beats keeping, so max = 3.5. On a 4, 5 or 6, keep it. So V₁ = (3.5 + 3.5 + 3.5 + 4 + 5 + 6) ÷ 6 = 25.5 ÷ 6 = 4.25.

With two re-rolls the bar rises to 4.25, so only 5 and 6 are kept: V₂ = (4 × 4.25 + 5 + 6) ÷ 6 = 28 ÷ 6 = 4.67.

Why work backwards? You can't value the first decision without knowing what continuing is worth. Only the last decision has a known continuation (the plain EV), so you start there and move back one step at a time. This method is called backward induction, and it is exactly how American options are priced on a binomial tree: at each node, take the max of exercising now or holding.

Shorthand
  • Six-sided die, one re-roll = 4.25. Two re-rolls = 4.67. Memorise these two.
  • Keep if roll > value of continuing. Never compare to the overall average.
Reopen any time with How to play.