How to use the secretary problem calculator
- Enter the number of candidates n, from 2 to 1,000,000.
- Optionally enter how many candidates you would skip, to see the chance for your own rule.
- Read the best number to skip, the chance of picking the very best, and the same as a share of n.
- Check the table of nearby choices to see how flat the curve is near the best point.
Formula
Rule: skip the first r - 1 candidates, then pick the first one who beats everyone seen so far
P(r) = ((r - 1) / n) x (1 / (r - 1) + 1 / r + ... + 1 / (n - 1)) for r >= 2, and P(1) = 1 / n
The best r is where P(r) is largest; for large n it is about n / e
The chance of choosing the best then tends to 1 / e = 36.788%
The sum is computed exactly for the n you enter, not from the large-n approximation.
Ten, one hundred and three candidates
With 10 candidates, skip the first 3 and take the first later candidate who is better than all of them. That picks the very best 39.869% of the time. With 100 candidates, skip the first 37 and the chance is 37.1043%. With 50 candidates the best number to skip is 18 for a chance of 37.4275%, whereas skipping only 10 gives 33.0047%.
For 3 candidates, skip 1 and the chance is exactly 50%, and for 1000 candidates, skip 368 for a chance of 36.8196%. The numbers settle toward 36.788% as n grows.
The classic puzzle
Candidates arrive one at a time in random order. After seeing each you must accept or reject at once, with no going back, and you want the single best one. Looking at the first few without choosing gives you a yardstick; picking too early wastes the chance to see better ones, and waiting too long leaves you with the last candidate, whoever it is. The best compromise is to look at about 37% and then leap.
The same idea is called the 37 percent rule, and it has been applied to choosing a house, a flat or a hire. To work out chances of other events, use the probability calculator.
When the rule does not fit
The result assumes you can rank candidates only against those you have already seen, that you can tell the best so far reliably, and that all orders are equally likely. If you can recall an earlier offer, if the candidates come with scores, or if finding second best is almost as good, the best strategy changes. Then a decision with payoffs, such as the decision tree expected value calculator, may be a better model.
Also note that the rule maximizes the chance of the very best, not the average quality. With 100 candidates it fails to find the best nearly two times in three, though it usually finds someone good. For averages of outcomes, use the expected value calculator.
Assumptions and limits
- Candidates are in uniformly random order and are all distinct in quality.
- You decide immediately and cannot return to a rejected candidate.
- Success means choosing the single best of all n candidates.
- If two skip counts give the same chance, the smaller is shown.
Frequently asked questions
What is the secretary problem?
A puzzle about stopping at the right moment: how to pick the best of a line of candidates when you must decide on each one when you see them.
What is the 37 percent rule?
Reject roughly the first 37% of candidates, then choose the first one better than all of those. It gives about a 37% chance of the best.
Why is the chance never above about 40% for large n?
Because you cannot avoid the risk that the best candidate is in the skipped group or that a good-looking one appears before the best.
Is the answer exact?
Yes, for the n you enter. The page adds the exact sum and does not use the 1 / e approximation.