Apartments, applicants, parking spots, partners. Whenever options arrive one at a time and you can't go back, there's a single, surprisingly simple rule. It involves the number 37.
You almost certainly faced a version of it this morning: a stream of choices flying past, and the nagging feeling that the moment you commit to one, the next will be better. Should you settle? Should you hold out? Computer scientists have a name for the family — optimal stopping problems — and one of them has an answer so clean it's almost suspicious.
The whole chapter swings around one number: 37. Where it comes from, why it works, and where it shows up in apartment hunts, dating, parking, and online algorithms.
You're hiring a secretary. N candidates show up one at a time in random order. After each interview you must decide on the spot — hire them or reject them forever. No going back. No comparing side-by-side. When do you stop looking and commit?
That's it. That's the whole setup. It's called the secretary problem, formulated in the 1950s and famous ever since — partly because the answer is so weirdly specific, and partly because the same shape of problem keeps showing up everywhere else.
Here's the rule:
Look at the first 37 % of candidates without hiring anyone. Then take the next one who beats everyone you've seen so far.
Why 37 %? Because 1/e ≈ 0.368, and that's the threshold that balances the two ways the rule can fail: rejecting the actual best because they fell into your look phase, versus settling too early before the best has even shown up. Tilt the threshold up and you waste good candidates on calibration. Tilt it down and you commit before you know what good looks like. The sweet spot — provably — is the reciprocal of e.
The look phase isn't picking — it's calibrating. You're not throwing those candidates away, you're learning what good looks like. Then the moment someone beats your calibration set, you commit.
Two clean phases:
Now here's the part that makes the rule famous. Your chance of actually landing the best candidate is also about 37 % — and that's true no matter how big N gets. With 10 candidates or 10 million, the rule wins you the top of the pile around 37 % of the time.
That's a wild bargain. Without the rule, picking randomly nets you the best one with probability 1/N. With 100 candidates that's 1 %. The 37 % rule, with the same information, scores 37 × better.
"You don't need to see all the options. You need to see enough to know what good looks like."
The math is the math. The hard part is trusting the calibration — actually rejecting that very nice 11th apartment, the one you would have been happy to live in.
The classic 37 % rule assumes the rules at the top of the chapter. Relax any one of them and the answer shifts:
Take the secretary problem and squint. Anywhere data arrives as a stream and you have to decide irrevocably on each item, you're inside an optimal-stopping problem:
The algorithm is short enough that the type signature alone tells most of the story: stream in, maybe-pick out. Flip between the two languages — the shapes are nearly identical.
length once to split. Everything else is a single pass through the stream. That's why this rule scales to online settings where you decide on items as they arrive.The secretary problem is one corner of a larger map. The next chapter is its opposite mood: when you can come back, when failure is cheap, when the question stops being "should I commit?" and becomes "should I try something new, or stick with what I already love?"