💼 Secretary Problem — Optimal Stopping & the 37% Rule
The Secretary Problem and optimal stopping: reject the first ~37% of candidates, then hire the first one better than all seen. Watch a single run and a Monte-Carlo sweep showing the success-rate peak at N/e ≈ 1/e.
About this simulation
This is the classic optimal stopping puzzle: N candidates arrive in random order, you must accept or reject each immediately, and you win only by picking the single best one. The optimal strategy — reject the first r ≈ N/e candidates just to gauge quality (the "look" phase), then hire the next one better than all of them (the "leap") — succeeds roughly 1/e ≈ 36.8% of the time no matter how large N grows.
🔬 What it shows
A single animated hiring run through N candidates plus a Monte Carlo mode running thousands of trials to measure the empirical success rate of any chosen look-cutoff r against the theoretical 1/e limit.
🎮 How to use
Set Number of candidates N and Look cutoff r (or press "Set r to N/e" for the optimal cutoff), then ▶ Play a single run or 🎲 Run 5000 trials to see the Success rate stat converge.
💡 Did you know?
The "37% rule" isn't just a cute name — the exact optimal cutoff fraction r/N converges to 1/e ≈ 0.3679 as N grows, and the resulting success probability converges to that very same number, a rare case where a probability puzzle's answer and its strategy share one constant.
Frequently asked questions
Why reject the first r candidates at all instead of just picking the very first good one?
Without a "look" phase you have no baseline for what "good" means among these N candidates — the first phase exists purely to calibrate your standard before you're allowed to commit, which is the whole point of the strategy.
What happens to the Success rate if I set r much lower or higher than N/e?
Setting r too low means you'll often commit to an early candidate before better ones appear later; setting r too high means you'll reject too many good candidates in the look phase and risk running out of candidates, ending up forced to take the last one. Both directions lower the Success rate stat below the optimal ~36.8%.
Why does the Success rate stay near 1/e even as Number of candidates N grows very large?
This is the surprising core result of the secretary problem: even though there are more candidates to sift through, the optimal strategy's success probability doesn't shrink toward zero — it converges to a constant, 1/e, regardless of how large N gets.
What does "Best in look phase" actually track?
It's the highest-ranked candidate seen so far during the reject-only look phase — this becomes your benchmark; once the leap phase starts, the strategy hires the first candidate who beats this benchmark.
Does the 5000-trials mode prove the 1/e result, or just illustrate it?
It's an empirical Monte Carlo estimate — running many random candidate orderings and measuring how often the strategy actually finds the best one. It illustrates and numerically confirms the theoretical 1/e limit rather than proving it, which requires the underlying probability derivation.
Reject the first ~37% of candidates, then hire the first one better than all seen. Monte-Carlo sweep of every cutoff shows the success rate peaking at N/e, converging to 1/e ≈ 0.368.
3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install