The Secretary Problem Site
  • Home
  • Classical Problem
  • Simulations
  • Backward Induction
  • Variants
  • Resources
  • Timeline
  • References
  • About
  • Español

On this page

  • Explore. Simulate. Understand.

Secretary Problem Simulations

Explore the secretary problem and compare rejection thresholds, empirical success probabilities, and the optimal 37% rule in interactive 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.

Candidate 1 / 10

RELATIVE RANK

1

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.

Empirical probability Not run
Exact probability —
Optimal threshold —
Optimal probability —
Run the experiment to compare simulation and theory.

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\).

Exact probability Your threshold Optimal threshold \(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.

Selected threshold —
Finite-\(n\) optimum —
Approximation \(n/e\) —

What the experiments show

The simulations illustrate three important facts:

  1. A nonrecord candidate cannot be the overall best.
  2. Rejecting too few candidates provides insufficient information.
  3. 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%).

NoteSimulation versus proof

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.


Leer en español

© 2026 José Ángel Islas Anguiano

Secretary problems and optimal stopping

Facultad de Ciencias Naturales y Exactas (FACINE), Universidad Autónoma de Sinaloa (UAS)