Secretary Problem Calculator

Optimal stopping: when to stop looking and choose.

  • Any cutoff
  • Table for n up to 1000
  • Cardinal variant
A small rounded clay stool beside a short clay gate, with flat clay pebbles laid like stepping stones and three loose clay beads on sandy ground

The guide

Why the first applicants are only a sample, and why the best chance stops near 37 percent

Reject the early applicants, then take the first one who beats them all: the chance of landing the very best settles near 37 percent, however many arrive.

  • 36.79 percent limit chance of the best, 1/e
  • 37.10 percent best chance with 100 applicants
  • 39.87 percent best chance with 10 applicants
  • 0.9050 best cardinal payoff, 100 applicants
Read the full guide Fold the guide 6 min · 12 sources

Imagine that n people apply for one job. They arrive one at a time, in random order. After each interview you must say yes or no on the spot, and a person you turn away cannot be called back. You can tell how each applicant compares with the ones you have already met, but you know nothing about those still to come. How do you give yourself the best chance of hiring the single best of them all?

That is the secretary problem. It also goes by the names marriage problem, sultan’s dowry problem and best choice problem, and its answer is often repeated as the 37 percent rule. The answer is unusually tidy. The slogan is easy to bend out of shape.

Two different things are called 37 percent. They are worth keeping apart.

One is the share of applicants you let go by before you are willing to choose anyone. The other is your chance of ending up with the very best one. In the limit of many applicants both equal 1/e, which begins 0.3678794411714423. For any real number of applicants they are different numbers, and the calculator keeps them apart: you give it a cutoff r, the first position at which you may accept, so that exactly r - 1 applicants are rejected.

Why the early applicants are only a sample

The best rule has a simple shape. Reject the first r - 1 applicants outright and remember the best of them. Then accept the first later applicant who is better than that remembered one. If nobody is, you are left holding the last applicant, whoever that turns out to be.

The early applicants do double duty. You never take them, so none of them can be your choice, yet they set the bar. A bar set from too few applicants is easy to clear, and you grab a mediocre person before the best has arrived. A bar set from too many may have the best applicant hiding inside the rejected group, and then you drift to the end with nothing good.

The sample is a price paid for information.

Take the smallest case with a real choice, n = 3. Rejecting nobody (r = 1) means taking the first applicant, who is the best one time in three. Rejecting two and taking the last (r = 3) is again one in three. Rejecting exactly one (r = 2) wins half the time: the chance for a cutoff r is (r - 1) / n times the sum of 1 / (i - 1) for i from r to n, which here is one third times (1 + 1/2), or one half. For a number this small the calculator also plays the rule on every one of the six arrival orders and shows the same one half.

Small cases agree with the published table. The best cutoff for n = 1 to 10 is 1, 1, 2, 2, 3, 3, 3, 4, 4, 4. At n = 2 there is a tie, because r = 1 and r = 2 both give one half. The table lists the smaller cutoff, and so does the page.

Where 37 percent comes from

Let n grow, and write x for the share rejected, (r - 1) / n. The sum above is a stretch of the harmonic series, and harmonic numbers behave like the natural logarithm of n plus a constant, so the sum can be replaced by an integral. The chance then becomes -x ln x. Setting its slope to zero gives x = 1/e. The best cutoff therefore approaches n / e, and the chance of choosing the best approaches 1/e, about 36.79 percent.

That is the 37 percent rule, and it holds whether there are a hundred applicants or a hundred million.

The limit is a guide, not the exact answer. With ten applicants the chance for each cutoff from r = 1 to r = 10 is 0.1000, 0.2829, 0.3658, 0.3987, 0.3983, 0.3728, 0.3274, 0.2653, 0.1889 and 0.1000. The peak, 39.87 percent, sits at r = 4, which rejects three people. Here n / e is 3.68. Rounding that up to four rejections lands on r = 5 and 39.83 percent, a hair worse. The rule of thumb has to be turned into a whole number with care, and the page offers both versions side by side.

For 100 applicants the best cutoff is r = 38 and the chance is 37.10 percent, while n / e is 36.79. Rejecting half of them, r = 51, gives only 34.91 percent. For 1,000 applicants the best cutoff is r = 369 and the chance 36.82 percent. The curve is flat near its top: r = 37 and r = 39 give 37.10 percent and 37.08 percent. Missing by a position or two costs almost nothing, while missing by a quarter of n costs a great deal.

Published tables also disagree about what a cutoff is. One counts the applicants to skip, so its entry for five applicants is 2, while the table quoted above lists r = 3 for the same n. The two differ by exactly one, which is the off-by-one that the calculator guards against by always showing r and r - 1 together. At n = 2 that count lists one skipped applicant, which is r = 2, where the other table lists r = 1: the tie is broken the other way.

Beyond 2,000 applicants the calculator adds the terms in floating point with a running compensation, a method known as Kahan summation, so that rounding error does not pile up with the number of terms. Up to 2,000 it keeps exact fractions.

When a near miss still pays

Choosing the single best is a harsh goal. Often a very good applicant is nearly as good as the best. In the cardinal payoff version each applicant has a hidden value drawn evenly between 0 and 1. You still learn only whether an applicant beats everyone seen so far, and your payoff is the value of the person you take.

The best cutoff then moves far earlier. It is the floor or the ceiling of the square root of n, instead of n / e. For a cutoff c, the expected payoff is (2cn - c^2 + c - n) / (2cn). With four applicants it is 5/8 for c = 2, 7/12 for c = 3 and 1/2 for c = 4, so the best of those three is c = 2.

For 100 applicants, c = 10 gives an expected value of 0.9050. The classical cutoff, 38, gives only 0.8018 in this variant. The reason is simple: a good applicant now pays almost as well as the best, so waiting for the best costs more than it earns. At n = 20 the cutoffs c = 4 and c = 5 tie at 0.8000.

Which goal is the right one is a question about what you value, not about arithmetic.

What the rule leaves out

The classical answer rests on stated assumptions. The number of applicants n must be known in advance. They arrive in uniformly random order. You see only how each ranks among those already seen. Every decision is final. The solution is also only meaningful if the applicants do not know your strategy, since early applicants have no chance at all and might not show up otherwise.

If n is not known, the picture changes. When n is a random variable, the best achievable chance is typically lower than 1/e. A different result, the 1/e-law of best choice, covers an unknown number of applicants whose arrival times are random: wait until the share of expected arrivals reaches 1/e, then take the first applicant who beats all before, and the chance of success is at least 1/e whatever the number. The calculator names that law and does not go further.

It also leaves out choosing several applicants, choosing the second best, and the version in which you see actual values rather than ranks. The second-best goal, for example, has a limiting chance of only one quarter. None of this is advice about hiring, dating or buying a house. Real candidates do not arrive in random order with a known count and a final no.

A last word about the numbers on the page. The simulation shuffles arrival orders with the Fisher-Yates shuffle, which makes every order equally likely, and draws its random numbers from xorshift128, a generator that is fast but fails some statistical test suites. The win share comes with a Wilson 95 percent interval, which misses the true value about one time in twenty, so an exact value just outside the interval is not by itself an error. The heavy work runs in a Web Worker so the screen stays responsive, and numbers are formatted through Intl.NumberFormat.

Sources

Every source consulted for this guide. Links checked November 12, 2026.

  1. Secretary problem Wikipedia
  2. Optimal stopping Wikipedia
  3. Harmonic number Wikipedia
  4. e (mathematical constant) Wikipedia
  5. Binomial proportion confidence interval Wikipedia
  6. Kahan summation algorithm Wikipedia
  7. Fisher-Yates shuffle Wikipedia
  8. Xorshift Wikipedia
  9. Number of daughters to wait before picking in sultan's dowry problem with n daughters. The On-Line Encyclopedia of Integer Sequences (OEIS Foundation), A054404
  10. Decimal expansion of 1/e. The On-Line Encyclopedia of Integer Sequences (OEIS Foundation), A068985
  11. Web Workers API MDN Web Docs (Mozilla contributors)
  12. Intl.NumberFormat MDN Web Docs (Mozilla contributors)