Single run: candidates arrive left→right; look phase greyed, leap
phase active, chosen one highlighted
Monte-Carlo: success rate vs cutoff r over all r = 0 … N, peak marked
at N/e
📖 Theory — optimal stopping
You interview N candidates one at a time in random
order. After each interview you must decide on the spot to hire or
reject — rejections are final and you cannot go back. You only see
relative ranks (you can tell who is best so far), not absolute
scores. The optimal strategy is a threshold rule: reject the
first r candidates no matter what (the "look" phase),
remembering the best among them, then hire the first later candidate
who beats that benchmark (the "leap" phase). If none beats it, you
are stuck with the last candidate.
📐 Why the cutoff is N/e and success is 1/e
With cutoff r, you win exactly when the overall best
candidate sits at some position i > r and the best
of the first i − 1 candidates lies inside the look
window. Summing those probabilities gives the win probability
P(r) = (r/N)·Σ 1/(i−1) for i = r+1 … N.
Letting x = r/N and taking N → ∞, this
becomes P(x) = −x·ln x, which is maximised at
x = 1/e. So the best cutoff is r ≈ N/e
(about 37% of candidates), and the resulting success probability is
−(1/e)·ln(1/e) = 1/e ≈ 0.368 — independent of N.
💡 Applications
The same logic appears whenever you choose sequentially from options
you cannot revisit: hiring the best applicant from a stream of
interviews, picking an apartment in a hot rental market where flats
go fast, deciding when to stop dating and settle down (the "37% rule
for love"), or accepting the best offer when selling something to a
sequence of bidders. The takeaway is counter-intuitive: spend the
first ~37% of your search purely gathering information, commit to
nothing, then jump on the first option that beats everything you have
seen.
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.