Home/Study Plan/Threshold Strategies
๐ŸŽฏ

Optimal Stopping & Thresholds

Threshold Strategies

Hard5โ€“6 hrsOptimal StoppingThresholdExpected ValueBellman EquationJane Street

Overview

Threshold strategies are optimal for any i.i.d. sequential sampling problem with replacement: at every draw, you compare the current value to a fixed threshold ฯ„ and stop if and only if the current draw exceeds ฯ„. The threshold equals the NET continuation value โ€” the expected prize you'd get if you kept playing forever, minus the expected cost. The derivation: write total value V(ฯ„) as a function of ฯ„, differentiate, set to zero. The elegant self-consistency: the optimal threshold is exactly the value of the game rounded up to the nearest integer. This makes sense: stop when the current draw beats your outside option (keeping playing).

How to Recognize

  • โ†’Draw from a distribution (with or without replacement) and decide to stop
  • โ†’'What is the optimal strategy?' or 'what is the fair value of this game?'
  • โ†’Game involves a cost per round and a prize equal to the last accepted value
  • โ†’Sampling continues until you 'accept' โ€” with replacement problems
  • โ†’Keywords: 'play as many rounds as you want', 'each round costs X'

Step-by-Step Approach

  1. 1.With replacement: threshold ฯ„ is the SAME every round (stationary problem)
  2. 2.V(ฯ„) = E[prize | X โ‰ฅ ฯ„] โˆ’ (cost per draw) ร— E[# draws to get X โ‰ฅ ฯ„]
  3. 3.E[prize | X โ‰ฅ ฯ„] = (ฯ„ + max) / 2 for discrete uniform
  4. 4.E[# draws] = 1/P(X โ‰ฅ ฯ„) since each draw is geometric
  5. 5.Optimize V(ฯ„) analytically: dV/dฯ„ = 0, then verify it's a maximum

Key Formulas

01V(ฯ„)=ฯ„+xmaxโก2โˆ’cP(Xโ‰ฅฯ„)V(\tau) = \frac{\tau + x_{\max}}{2} - \frac{c}{P(X \ge \tau)}
02ฯ„โˆ—=xmaxโก+1โˆ’2cโ‹…(xmaxโก+1โˆ’xminโก)1โ‰ˆxmaxโกโˆ’2cโ€‰n\tau^* = x_{\max} + 1 - \sqrt{\frac{2c \cdot (x_{\max}+1-x_{\min})}{1}} \approx x_{\max} - \sqrt{2c\,n}
03\text{Picking Hat: } \tau^* = 87,\quad V^* = \tfrac{1209}{14} \approx \86.36$
04Self-consistency:ย stopย ifย X>Vโˆ—\text{Self-consistency: stop if } X > V^* (threshold =โŒˆVโˆ—โŒ‰= \lceil V^* \rceil)

Worked Examples

0Quick Example
Hat 1โ€“100, cost 1/draw:V(ฯ„)=(ฯ„+100)/2โˆ’100/(101โˆ’ฯ„).SetdV/dฯ„=0:(101โˆ’ฯ„)2=200โ†’ฯ„โˆ—=87.V(87)=93.5โˆ’50/7โ‰ˆ1/draw: V(ฯ„) = (ฯ„+100)/2 โˆ’ 100/(101โˆ’ฯ„). Set dV/dฯ„=0: (101โˆ’ฯ„)ยฒ=200 โ†’ ฯ„*=87. V(87) = 93.5 โˆ’ 50/7 โ‰ˆ 86.36.

Problem

A hat contains the numbers 1โ€“100. Each round, AJ draws a number (with replacement), writes it down, and pays $1. The prize is the last number written. With optimal play, what is the fair value of this game?

Solution

1

STRATEGY STRUCTURE: Since draws are i.i.d. (with replacement), the optimal strategy is a threshold ฯ„: stop if and only if current draw โ‰ฅ ฯ„.

2

VALUE FUNCTION: P(stop each round) = (101โˆ’ฯ„)/100. Expected # draws = 100/(101โˆ’ฯ„). E[prize | stop] = mean of {ฯ„, ฯ„+1, ..., 100} = (ฯ„+100)/2.

3

V(ฯ„) = (ฯ„+100)/2 โˆ’ 1 ร— 100/(101โˆ’ฯ„) = (ฯ„+100)/2 โˆ’ 100/(101โˆ’ฯ„).

4

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

5

ROUND to integer: compare V(86) and V(87).

6

V(86) = 186/2 โˆ’ 100/15 = 93 โˆ’ 20/3 โ‰ˆ 86.33.

7

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

8

V(88) = 188/2 โˆ’ 100/13 = 94 โˆ’ 100/13 โ‰ˆ 86.31.

9

Optimal ฯ„* = 87. SELF-CONSISTENCY CHECK: V โ‰ˆ 86.36 < 87 = ฯ„* โœ“ (stop when draw exceeds current value).

Answer

V^* = \frac{1209}{14} \approx \86.36.Strategy:drawuntilXโ‰ฅ87.Onaverage,draw. Strategy: draw until X โ‰ฅ 87. On average, draw \approx 7.1times.Expectedprizeโ‰ˆ times. Expected prize โ‰ˆ 93.50. Expected cost โ‰ˆ $7.14.

Common Mistakes

  • !

    Using the WRONG threshold: the threshold is โŒˆV*โŒ‰, not E[X] or max/2 or any other naive guess.

  • !

    Forgetting the per-draw COST when computing continuation value. More costs โ†’ lower V โ†’ lower threshold โ†’ stop sooner.

  • !

    For WITHOUT-replacement problems: the distribution changes each draw (state is what's been seen), so a single static threshold is NOT optimal โ€” you need to update.

  • !

    Checking only integer thresholds without deriving the continuous optimum first. Always differentiate, find ฯ„_continuous, then check ฯ„_floor and ฯ„_ceil.

  • !

    Misidentifying the problem type: if it says 'with replacement', use static threshold. If 'without replacement', use backwards induction.

Practice Problems

Click "Show Answer" to reveal
1

A hat has numbers 1โ€“6 (uniform, with replacement). Each draw costs $0.25. What is the optimal threshold and expected value?

Hint: V(ฯ„) = (ฯ„+6)/2 โˆ’ 0.25 ร— 6/(7โˆ’ฯ„). Differentiate: dV/dฯ„ = 1/2 โˆ’ 0.25ร—6/(7โˆ’ฯ„)ยฒ = 0 โ†’ (7โˆ’ฯ„)ยฒ = 3 โ†’ ฯ„* = 7โˆ’โˆš3 โ‰ˆ 5.27.
2

Same hat (1โ€“6) but NOW each draw costs $1 (expensive!). What changes?

Hint: V(ฯ„) = (ฯ„+6)/2 โˆ’ 1 ร— 6/(7โˆ’ฯ„). Optimize. The high cost means you want to stop quickly โ€” threshold will be lower.
3

You're playing a game: draw uniformly from [0,1] (continuous), costs $c per draw, with replacement. What is the optimal threshold ฯ„* and expected value V*?

Hint: V(ฯ„) = E[X | X>ฯ„] โˆ’ c/P(X>ฯ„) = (1+ฯ„)/2 โˆ’ c/(1โˆ’ฯ„). Differentiate with respect to ฯ„.

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