The Secretary Problem

Expectation · Hard · Free problem

You observe $n$ candidates (i.i.d. continuous draws) one at a time in random order. After seeing each candidate, you only know their relative rank among those seen so far. You must irrevocably accept or reject each candidate on the spot, and you win only if you select the overall best candidate.

Consider the threshold strategy: skip the first $r-1$ candidates (the "exploration phase"), then accept the next candidate who is the best seen so far (a "record").

  1. Prove that this class of threshold strategies contains the optimal strategy -- i.e., the strategy maximizing the probability of selecting the global best is of this form.
  1. Write the exact success probability $P(r, n)$ as a function of $r$ and $n$. Find the asymptotically optimal $r^{*}$ and the limiting success probability as $n \to \infty$.

Hints

  1. Think about why you should always accept a record (new best-so-far) once you are past the exploration phase -- what happens to the probability $1/k$ of being the global best as $k$ increases?
  2. Condition on the position $k$ of the global best. She gets selected if and only if the best of the first $k-1$ candidates falls in the exploration window of size $r-1$.
  3. Write the success probability as $P(r,n) = \frac{r-1}{n}\sum_{j=r-1}^{n-1}\frac{1}{j}$, then approximate the sum by $\int_{r/n}^{1} \frac{1}{t}\,dt$ and optimize over $r/n$.

Worked Solution

How to Think About It: This is the classical secretary problem. The intuition is simple: you need to see some candidates first to calibrate your standard, then hire the first one who beats everyone you have seen. If you set your threshold too low, you waste your "hire" on a mediocre early candidate. Too high, and you have already passed the best one. The optimal threshold balances exploration vs. exploitation.

Quick Estimate: For large $n$, the optimal threshold turns out to be around $n/e \approx 0.368n$, giving a success probability of about $1/e \approx 0.368$. So even with an infinite pool, you can pick the best candidate about 37% of the time -- remarkably good given you are choosing blind.

Approach: First derive $P(r, n)$, then optimize over $r$.

Formal Solution:

Part (i): Optimality of threshold strategies.

Consider any optimal strategy. At each step $k$, the decision to accept or reject depends only on the relative ranks of candidates seen so far (since values are continuous i.i.d., absolute values carry no extra information beyond relative ranks).

Suppose the optimal strategy says "reject" at position $k$ when the current candidate is a record (best so far). A record at position $k$ is the global best with conditional probability $k/n$ (it beats the first $k-1$ candidates by assumption, and it is the overall best iff it also beats the remaining $n-k$, which happens with probability $k/n$). So the *value of stopping* on a record, $k/n$, is increasing in $k$, while the *value of continuing* (the chance of catching the global best later) decreases as $k$ grows. Hence once it becomes optimal to accept a record at some position, it stays optimal at every later position: the set of positions where you accept records must be an up-set of the form $\{r, r+1, \ldots, n\}$ for some threshold $r$. That is exactly the threshold strategy.

Part (ii): Exact success probability.

With the threshold strategy (skip first $r-1$, then take the next record):

The best candidate is at position $k$ (each position equally likely with probability $1/n$). The strategy selects her if and only if: - $k \geq r$ (she is not in the exploration phase), AND - No candidate in positions $r, r+1, \ldots, k-1$ is a record at the time she appears -- equivalently, the best of the first $k-1$ candidates is among the first $r-1$.

The probability that the best of the first $k-1$ is among the first $r-1$ is $(r-1)/(k-1)$ (by symmetry of random orderings).

Summing over all possible positions of the best candidate:

$$P(r, n) = \sum_{k=r}^{n} \frac{1}{n} \cdot \frac{r-1}{k-1} = \frac{r-1}{n} \sum_{k=r}^{n} \frac{1}{k-1} = \frac{r-1}{n} \sum_{j=r-1}^{n-1} \frac{1}{j}$$

Asymptotic optimization. Let $x = r/n$ with $n \to \infty$. The sum becomes a Riemann integral:

$$P(r, n) \approx x \int_{x}^{1} \frac{1}{t}\, dt = -x \ln x$$

Maximize $f(x) = -x \ln x$: setting $f'(x) = -\ln x - 1 = 0$ gives $x^{*} = 1/e$.

The optimal threshold is $r^{*} \approx n/e$, and the limiting success probability is:

$$P^{*} = -\frac{1}{e} \ln \frac{1}{e} = \frac{1}{e} \approx 0.3679$$

Answer: The exact success probability is $P(r, n) = \frac{r-1}{n}\sum_{j=r-1}^{n-1}\frac{1}{j}$. The asymptotically optimal threshold is $r^{*} = \lfloor n/e \rfloor$, giving a limiting success probability of $1/e \approx 0.3679$.

Intuition

The secretary problem is the purest form of the explore-then-exploit tradeoff. You sacrifice a known fraction of your opportunities (about 37%) purely to learn what "good" looks like, then commit to the first candidate who clears that bar. The remarkable result is that this strategy works equally well whether $n$ is 10 or 10 million -- you always win about 37% of the time.

This $1/e$ threshold shows up throughout quant work: optimal timing of trades when you observe prices sequentially, choosing when to stop interviewing market-making candidates, or deciding when to commit to a model specification after testing alternatives. The deeper lesson is that in sequential decision-making under uncertainty, exploration has a quantifiable cost, and the optimal balance is often surprisingly simple.

Open the full interactive solver →