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.