Secretary Problem Simulations
Explore. Simulate. Understand.
Experiment with sequential decisions, test different rejection thresholds, and discover why the classical strategy approaches the (37%) rule.
Explore one selection
You will observe the candidates sequentially. Smaller relative ranks are better, and relative rank (1) means that the current candidate is the best observed so far.
Absolute ranks remain hidden while you make decisions. After a game ends, the complete sequence is revealed for learning. Moving the candidate-count slider affects the next game, not the current one.
EXPLORE
Can you hire the best candidate?
Decide whether to reject or hire each candidate using only the information available at that moment.
RELATIVE RANK
This candidate is the best observed so far.
Observed relative ranks
Complete sequence of absolute ranks
Absolute rank \(1\) is the overall best.
Simulate a threshold strategy
Choose a total number of candidates (n), a rejection threshold (r), and the number of simulated repetitions.
The strategy rejects the first (r) candidates and then accepts the first subsequent record. If there is no later record, the trial fails. A new simulation is required after any input is changed.
SIMULATE
Can your threshold beat the 37% rule?
Compare a Monte Carlo estimate with the exact success probability and the optimal finite-sample threshold.
Understand the mathematics
For (r), the exact probability of selecting the overall best is
\[ P_n(r) = \frac{r}{n} \sum_{j=r+1}^{n}\frac{1}{j-1}. \]
If (r=0), the first candidate is selected, so
\[ P_n(0)=\frac1n. \]
The graph below displays (P_n(r)) for every admissible rejection threshold.
UNDERSTAND
The probability curve
The blue curve gives the exact probability for each integer threshold. The selected threshold is shown in coral and the optimum in gold; the dashed line indicates the continuous approximation \(n/e\).
The curve plots the exact success probability at each integer rejection threshold. On a narrow screen, scroll the chart horizontally to see the full graph.
What the experiments show
The simulations illustrate three important facts:
- A nonrecord candidate cannot be the overall best.
- Rejecting too few candidates provides insufficient information.
- Rejecting too many candidates leaves too few opportunities to select a later record.
The optimal threshold balances these competing risks.
For large (n),
\[ r^\star\approx \frac{n}{e}, \qquad P_n(r^\star)\approx\frac1e. \]
Therefore, both the optimal rejection fraction and the maximum success probability approach approximately (37%).
Monte Carlo simulation provides numerical evidence, but it does not prove optimality. The exact probability formula and the backward-induction argument establish the mathematical result.