Home/Study Plan/Recursive Game Values
๐Ÿ”

Recursion & Recurrences

Recursive Game Values

Hard5โ€“6 hrsDynamic ProgrammingGame TheoryBellman EquationOptimal Play

Overview

Recursive game value problems are the hardest class of quant interview questions. They require you to find the VALUE of the game, not just describe a strategy. The Bellman equation is the key tool: the value of the game today equals the cost of playing today plus the expected value of playing optimally tomorrow. For threshold games (like The Picking Hat), the optimal threshold is found by differentiating the expected payoff with respect to the threshold and setting to zero. The self-consistency condition V = V(ฯ„) where ฯ„ = argmax V(ฯ„) lets you verify your answer.

How to Recognize

  • โ†’'You play optimally โ€” what is the expected value?'
  • โ†’Game where you choose between stop/continue at each step
  • โ†’Multi-stage games where future value depends on current state
  • โ†’'The Picking Hat', dice-rolling games with stopping decisions
  • โ†’Any problem asking for 'value of the game with optimal strategy'

Step-by-Step Approach

  1. 1.Define V(state) = expected value from this state under optimal play
  2. 2.Bellman equation: V(s) = max(stop payoff, E[V(next state)] - cost)
  3. 3.Work backwards from terminal states (boundary conditions)
  4. 4.For threshold problems: stop if current draw exceeds continuation value
  5. 5.The threshold = value of future opportunities (set equal, solve)

Key Formulas

01V=โˆ’c+E[maxโก(X,โ€‰V)]V = -c + E[\max(X,\, V)] \quad (stop if X>VX > V; cc = cost per draw)
02V=E[XโˆฃX>ฯ„]โ‹…P(X>ฯ„)1โˆ’P(Xโ‰คฯ„)โˆ’cโ‹…E[draws]V = \frac{E[X \mid X > \tau]\cdot P(X>\tau)}{1 - P(X \le \tau)} - c \cdot E[\text{draws}]
03ฯ„โˆ—=argโกmaxโกฯ„[ฯ„+xmaxโก2โˆ’cP(Xโ‰ฅฯ„)]\tau^* = \arg\max_\tau \left[\tfrac{\tau+x_{\max}}{2} - \frac{c}{P(X \ge \tau)}\right]
04V(\text{Picking Hat, 1--100}) = \tfrac{187}{2} - \tfrac{100}{14} = \tfrac{1209}{14} \approx \86.36$

Worked Examples

0Quick Example
Picking Hat: threshold ฯ„ satisfies โˆ‚V/โˆ‚ฯ„=0 โ†’ ฯ„ โ‰ˆ 101โˆ’10โˆš2 โ‰ˆ 87. Stop if draw โ‰ฅ 87. E[prize]=93.5, E[draws]=100/14โ‰ˆ7.1. Net value โ‰ˆ $86.36.

Problem

A hat contains numbers 1โ€“100 (with replacement). Each round you draw a number, write it down, and pay $1. You may stop at any time; you receive the last number written. What is the optimal strategy and the fair value of this game?

Solution

1

Let ฯ„ = threshold: stop if current draw X โ‰ฅ ฯ„.

2

P(stop each draw) = p = (101-ฯ„)/100. Expected draws = 1/p = 100/(101-ฯ„).

3

E[prize | stop] = mean of {ฯ„, ฯ„+1, ..., 100} = (ฯ„+100)/2.

4

V(ฯ„) = E[prize] โˆ’ E[cost] = (ฯ„+100)/2 โˆ’ 100/(101โˆ’ฯ„).

5

Optimize: dV/dฯ„ = 1/2 โˆ’ 100/(101โˆ’ฯ„)ยฒ = 0 โ†’ (101โˆ’ฯ„)ยฒ = 200 โ†’ ฯ„* = 101 โˆ’ 10โˆš2 โ‰ˆ 86.86 โ†’ use ฯ„=87.

6

V(87) = (87+100)/2 โˆ’ 100/(101โˆ’87) = 187/2 โˆ’ 100/14 = 93.5 โˆ’ 50/7 = 1209/14 โ‰ˆ $86.36.

Answer

V \approx \86.36$. Optimal strategy: keep drawing until you draw โ‰ฅ 87. Expected number of draws โ‰ˆ 7.1. Verify self-consistency: V โ‰ˆ 86.36 < 87 = ฯ„, confirming you should stop at exactly ฯ„=87.

Common Mistakes

  • !

    Using the WRONG continuation value as the threshold. The threshold should equal the continuation value (net of costs), not just E[next draw].

  • !

    Not accounting for the per-round cost. If draws cost c each, the threshold is E[future game value], which is LOWER than E[prize] by the expected cost.

  • !

    Assuming the threshold is the same as the expected value of the final prize. The threshold ฯ„ and the game value V are related by V(ฯ„) โ€” you need to optimize.

  • !

    For finite-horizon games, forgetting to work backwards. With N=3 rolls the threshold is different from Nโ†’โˆž.

Practice Problems

Click "Show Answer" to reveal
1

A hat has numbers 1โ€“10 (with replacement). Each draw costs $0.50. What is the optimal threshold and expected net value?

Hint: V(ฯ„) = (ฯ„+10)/2 โˆ’ 0.5 ร— 10/(11โˆ’ฯ„). Differentiate with respect to ฯ„ and set to zero.
2

You flip a fair coin repeatedly. You win 2nifthefirstheadappearsonflipn.Buteachflipcosts2โฟ if the first head appears on flip n. But each flip costs 1. What is the expected net value? (Modified St. Petersburg)

Hint: E[prize] = ฮฃ(1/2โฟ)ร—2โฟ = ฮฃ1 = โˆž (classic St. Petersburg). With cost $1/flip: should you play? E[net] = E[prize] โˆ’ E[flips]. E[flips] = 2 (geometric(1/2)). So E[net] = โˆž โˆ’ 2 = โˆž. But in practice, prizes are capped.
3

You have a single fair die. You can roll it at most 3 times, and you keep the result of your LAST roll (you must declare 'last' before rolling). What is the optimal strategy?

Hint: On roll 3 (must take it): E=3.5. On roll 2: stop if X > E[roll 3]=3.5, else declare roll 2 as last. On roll 1: compare to the value of having 2 rolls left.

Only works in the Electron app

<webview> is an Electron-only tag. Run npm run electron:dev to use this.

25:00Focus
0

25 min focus ยท 5 min break ยท long break every 4 sessions

The Ultimate Grind