Why Secretary Problem Matters
You may inspect a sequence of opportunities, but can accept only one. Each opportunity disappears forever when rejected. Waiting gives a better comparison sample, yet risks discarding the best option; choosing early avoids that risk but uses little information. The secretary problem makes this tradeoff precise as a problem of optimal stopping.
In the classical model, the number of candidates is known, their qualities are distinct, and their order is a uniformly random permutation. You can compare the current candidate with those already seen, but cannot inspect unseen candidates or recall rejected ones. The objective is to maximize the probability of selecting the single best candidate overall—not the expected numerical quality or an approximately good candidate.
The optimal rule has a simple shape: reject an initial sample, then accept the first later candidate better than everyone seen so far. For large populations, both the optimal skipped fraction and the best achievable success probability approach $1/e\approx0.3679$. These are asymptotic statements. For a small known population, the exact integer cutoff and its exact probability matter.
This lesson derives those finite probabilities, explains why a cutoff rule is optimal, and implements a controller that receives only a current record flag. A separate driver supplies comparisons and audits the eventual outcome. We use opportunities and hiring as mathematical motivations; actual decision processes can have recall, ties, uncertain horizons, multiple choices or nonrandom order, all of which change the problem. The prerequisite algorithm-analysis material helps separate the number of observations from the probability of success.
The secretary problem asks when to stop a random-order sequence to maximize the chance of choosing its unique best element. Reject a planned sample to establish a comparison standard, then select the first later record; the exact finite cutoff approaches a skipped fraction of $1/e$ as the population grows.
Core Concepts and Terminology
Fix a known horizon $n\ge1$. There are n distinct candidates in a uniformly random order: each of the $n!$ permutations is equally likely. After each observation, choose irrevocably between accepting the current candidate and ending the process, or rejecting it and continuing. At most one selection is allowed, and rejected candidates cannot be recalled. The permitted information consists of n, the position, and the relative ranking of candidates already observed.
The payoff is 1 if the chosen candidate is the unique global best, and 0 otherwise. The optimality claim is over all stopping rules using that relative-rank information, with probability taken over the random arrival order. The standard optimal cutoff policy is deterministic; no private random coin is needed to obtain its random-order probability. One fixed permutation has outcome either 0 or 1.
Call position k a record when its candidate is better than every earlier candidate. The first candidate is necessarily a record. A nonrecord cannot be globally best. Although the model allows the full relative ranking of the observed prefix, the optimal rule needs only whether the current candidate is a record. The controller in our programs receives that Boolean and cannot read absolute quality values.
Define r to mean the number initially rejected, with $0\le r\lt n$. Reject positions 1 through r unconditionally. Starting at position r+1, select the first record. Thus r=3 means the first eligible position is 4; some references instead name that first eligible position as their threshold. Match definitions before comparing formulas.
Our implementation always makes one choice by accepting the final candidate if no eligible record has appeared. If that final candidate is a nonrecord, this fallback necessarily loses, because a better candidate was already rejected. A version that makes no choice in the same situation also loses; therefore the fallback changes the selected position in those cases but leaves the best-selection success probability unchanged. If the last candidate is a record, it is accepted by the ordinary record rule first.
For debugging, the driver represents hidden qualities by a permutation of 1 through n, with larger labels better and n globally best. It knows the full test input, computes record flags from the observed prefix, and reveals full labels only in the final audit. The policy never receives those labels: giving it known absolute rank n would expose information forbidden in the relative-rank model. The diagrams' numerical quality annotations are auditor views, not extra policy inputs.
For example, n=8 has optimal r=3. After observing labels $[4,1,6]$, the relative ordering by arrival position is 3 above 1 above 2. Only the record flags $[1,0,1]$ have entered the policy, and all three candidates were rejected. Future order is still unknown, including whether anyone will beat the current prefix maximum. The diagram shows this information boundary.
| Term | Exact example | Role |
|---|---|---|
| Known horizon n | Eight opportunities will exist | Enables a precommitted finite cutoff |
| Uniform random order | All $8!$ candidate permutations equally likely | Probability model behind the guarantee |
| Relative rank | Third observed candidate is best among the first three | Allowed information; not absolute global rank |
| Record | Current candidate beats every observed predecessor | Only a record can still be globally best |
| Skip count r | r=3 rejects positions 1, 2 and 3 | First eligible position is r+1=4 |
| Sample phase | Reject a record at position 3 | Learns comparison context without selecting |
| Search phase | Accept the first record at position 6 | Applies the stopping condition after sampling |
| Final fallback | Accept position n if still unselected | Guarantees a choice; nonrecord fallback cannot win |
| Success event | Chosen hidden label equals n in the audit | Binary best-selection objective |
| Online controller | Receives only record=true or false | Prevents future/absolute-rank leakage |
| Exact probability | $459/1120$ for n=8, r=3 | Random-order probability, not an observed outcome |
| Asymptotic guide | $r/n\to1/e$ | Large-n limit, not a finite-n rounding formula |
How Secretary Problem Works, Step by Step
Choose the cutoff before any observations. For every possible skip count, compute its exact random-order success probability. If r=0, accept the first candidate, so
$$P_n(0)=\frac1n.$$
For $1\le r\lt n$, consider the position k of the global best. It must arrive after the sample. Conditional on its position, it is selected exactly when the best among the first k−1 candidates occurred within the initial r positions; otherwise a later record would already have caused an acceptance. The global best's position is uniform, and that earlier maximum's position is uniform within its prefix. Therefore
$$P_n(r)=\sum_{k=r+1}^{n}\frac1n\frac{r}{k-1}=\frac rn\sum_{j=r}^{n-1}\frac1j.$$
This condition remains valid with the final fallback, because selecting a nonrecord cannot add a success. The r=0 formula is separate; substituting zero into a harmonic expression containing $1/r$ is invalid.
The programs compare all finite cutoffs with integer scores. Let D be the least common multiple of 1 through n−1, with D=1 when that range is empty. Every probability can use denominator nD. The score for r=0 is D; for positive r it is $r\sum_{j=r}^{n-1}D/j$. An initial suffix sum and a one-term subtraction per candidate cutoff compute all scores in a linear number of arithmetic steps. Compare with strict greater-than so an equal probability retains the smallest skip count. In particular, n=2 has a tie between r=0 and r=1, and the automatic rule chooses r=0.
Separate comparison from stopping. A comparison adapter remembers the best candidate observed so far. On each actual observation it emits a Boolean indicating whether the new candidate is better, then updates its own prefix maximum. In a real comparison-only setting this can use a retained reference to the best seen candidate; the numerical labels here are only a test convenience. The stopping controller needs no numeric score or distribution of scores.
Process one observation. Validate that the flag is Boolean, the process is still open, and the first flag is true. Increment the seen count. If the position is at most r, return a sample-phase rejection even when the candidate is a record. Otherwise enter search: accept a record immediately; if it is not a record but the position is n, accept it as the final fallback; otherwise reject. A selection stores the chosen position permanently and closes the process.
Stop producing observations. As soon as the controller accepts, the driver breaks its observation loop. It does not call the policy on later positions. An attempted call after selection raises an exception without changing state. The final audit may inspect the full stored test input to identify the global best and report whether the chosen position won, but that result cannot alter the earlier choice.
For n=8, the exact scorer selects r=3. In the worked stream, positions 4 and 5 are nonrecords and are rejected. Position 6 is a record, so the policy accepts and stops. It does not ask whether positions 7 or 8 would be better. No parallel worker scheduling is needed here: each arrival is a sequential information event and a possible stopping point.
flowchart TD
A["Known horizon: choose exact skip count before observations"] --> B["Initialize seen zero and no selection"]
B --> C["Comparator reveals current record flag only"]
C --> D{"Valid flag and open state?"}
D -->|No| E["Reject call without changing state"]
D -->|Yes| F["Increment observed position"]
F --> G{"Position within initial sample?"}
G -->|Yes| H["Reject current candidate"]
G -->|No| I{"Current candidate is a record?"}
I -->|Yes| J["Accept record and close selection"]
I -->|No| K{"Final position?"}
K -->|Yes| L["Accept last candidate and close selection"]
K -->|No| H
H --> C
J --> M["Driver stops observing; evaluate outcome separately"]
L --> M
Worked Example with a Full Trace
Use n=8 and hidden quality order $[4,1,6,2,5,8,3,7]$, with larger labels better. These labels describe the test input to the reader; the policy sees only record flags. Its initial state is seen=0, chosen=NONE. The exact scoring procedure selects r=3 before reading any candidate.
For the selected cutoff,
$$P_8(3)=\frac38\left(\frac13+\frac14+\frac15+\frac16+\frac17\right)=\frac38\cdot\frac{153}{140}=\frac{459}{1120}.$$
For comparison, r=2 gives $223/560=446/1120$, which is smaller. In this small case, simply taking $\lfloor8/e\rfloor=2$ misses the exact best cutoff. The large-n guide is useful intuition, not the implementation's finite optimizer.
- Position 1, hidden quality 4. No earlier candidate exists, so the comparator sends record=true and remembers prefix maximum 4. The policy increments seen to 1. Since $1\le3$, sample phase rejects. Chosen remains NONE.
- Position 2, quality 1. The adapter compares with 4, sends false and keeps maximum 4. Position 2 remains in the sample, so reject; seen=2, chosen=NONE.
- Position 3, quality 6. The adapter sends true because $6\gt4$ and updates maximum to 6. The policy still rejects: position 3 is the last sampled candidate, not the first eligible one. Seen=3, chosen=NONE.
- Position 4, quality 2. The adapter sends false because $2\lt6$. Position 4 is in search, but it is neither a record nor the last position. Reject; seen=4, chosen=NONE; comparator maximum remains 6.
- Position 5, quality 5. Again false because $5\lt6$. Search rejects; seen=5, chosen=NONE; maximum remains 6.
- Position 6, quality 8. The adapter sends true because $8\gt6$ and updates its maximum to 8. The policy sees search-phase record=true, accepts immediately and stores chosen=6. The returned action is ACCEPT_RECORD. Selection is now closed.
- Position 7, hidden quality 3. Unobserved by the stopped policy. No flag is sent and no controller state changes. This value appears only when the driver later audits the complete input.
- Position 8, hidden quality 7. Also unobserved; seen remains 6 and chosen remains 6.
The final audit finds quality 8 at the chosen position and confirms it is globally best, so this fixed permutation's outcome is 1. That is distinct from the exact success probability $459/1120\approx0.4098$ over uniform permutations. Even a perfectly implemented optimal rule loses on many valid input orders.
At every observed rejection in search, no record has appeared since the sample; otherwise the process would have closed already. Thus the adapter's maximum remains the sample maximum until the accepting record. This explains why “first later record” and “first later candidate exceeding the sample maximum” describe the same policy before selection, even though records are formally defined relative to all observed candidates.
Trace It by Hand
Keep n=8 and r=3, but replace the hidden order by $[8,1,2,3,4,5,6,7]$. Predict the chosen position, the action at that position, and the success outcome before reading the reveal.
Reveal: the global best is rejected during the sample at position 1. Every later flag is false, so the policy rejects positions 4 through 7 and accepts position 8 through ACCEPT_LAST. It chooses quality 7 and loses. The fallback ensures a choice, not a win; a no-choice version would also lose this permutation.
Now try n=2. Both r=0 and r=1 win on one of the two equally likely orders, so each has probability $1/2$. The automatic scorer chooses r=0 by its smallest-cutoff tie rule and accepts the first candidate. For n=1, r=0 accepts the only candidate and wins with probability 1. In all cases, a call after acceptance must be rejected without incrementing seen.
Implementation in Python, C++, and Java
Each panel is standalone: run Python 3, compile C++17, or save the Java panel as Main.java and run Main after compiling. The common sample has eight candidates and selects its cutoff automatically. The three programs print byte-identical output below, using exact reduced fractions rather than floating-point cutoff comparisons.
The policy constructor receives only n and r. Its next-candidate method receives only a record flag. The full hidden quality array belongs to run_case/runCase, which validates a permutation of 1 through n, computes flags from the prefix, breaks immediately on selection, and evaluates the full-input outcome afterward. This deliberately gives the test driver more information than the decision-maker. No full-array maximum or quality label enters a policy call.
The supported exact-arithmetic range is $1\le n\le20$. Request −1 selects the best finite cutoff; an explicit request from 0 through n−1 uses that particular cutoff and reports its own success probability. The standalone sample requests the automatic mode. The policy itself requires a concrete legal r. Empty input, duplicate/missing audit labels, an illegal cutoff, a false first flag and calls after acceptance are errors. Python also checks integer/Boolean types explicitly; C++ and Java use their typed parameters. Validation precedes policy mutation.
For n≤20, D is at most 232,792,560 and nD is at most 4,655,851,200. C++ and Java use signed 64-bit integers for all common-denominator, score and probability arithmetic. A simple conservative bound on any intermediate score is $19\cdot19D$, still below 85 billion; this fits comfortably. Do not enlarge n without reviewing LCM growth and integer widths. Python integers are unbounded, but the shared limit deliberately keeps all three versions equivalent.
The output before AUDIT contains only information returned by the record-only controller. chosen=NONE means no acceptance yet; chosen positions are one-based. The first audit line lists positions never observed by the policy. The second exposes the hidden input, selected quality, global best and binary success. The displayed P(best) is a model probability computed before observations; success is the result of one completed test. Treat controller fields as read-only outside the supplied methods.
Identical expected output (each item below is one printed line):
RULE n=8 skip=3 P(best)=459/1120i=1 record=1 phase=SAMPLE action=REJECT chosen=NONEi=2 record=0 phase=SAMPLE action=REJECT chosen=NONEi=3 record=1 phase=SAMPLE action=REJECT chosen=NONEi=4 record=0 phase=SEARCH action=REJECT chosen=NONEi=5 record=0 phase=SEARCH action=REJECT chosen=NONEi=6 record=1 phase=SEARCH action=ACCEPT_RECORD chosen=6AUDIT unobserved_positions=[7,8]AUDIT order=[4,1,6,2,5,8,3,7] choice=6 value=8 best=8 success=1
Complexity, Correctness, and Invariants
State correctness. Before selection, seen is exactly the number of flags processed and chosen is NONE. Sampling rejects every position at most r. In search, every rejected candidate was a nonrecord; the first record is accepted, otherwise the final candidate is accepted. After selection, chosen never changes, the driver stops requesting observations, and any extra policy call fails without mutation. Initialization establishes the invariant, and each branch either advances one position under these rules or closes the process once. The comparison adapter separately maintains the maximum of exactly the observed prefix, so its record flag is correct.
Why cutoff rules suffice. A nonrecord has zero chance of being global best, so accepting it early cannot improve the best-selection objective. At position k, conditional on a record, the chance it is globally best is $k/n$. Under a uniformly random permutation the successive relative ranks are independent and uniform on their respective prefix sizes. Hence the conditional continuation value depends on position, not on the detailed earlier relative ordering.
Let $V_k$ be the optimal success probability before observing position k, provided no selection has occurred, and set $V_{n+1}=0$. Backward induction gives
$$V_k=\frac1k\max\left(\frac kn,V_{k+1}\right)+\left(1-\frac1k\right)V_{k+1}.$$
A record occurs with probability $1/k$. At that record, stop if $k/n\ge V_{k+1}$; otherwise continue. At a nonrecord, continue unless the final forced choice is required, which has payoff zero when it is a nonrecord. The recurrence gives $V_k\ge V_{k+1}$, while $k/n$ increases with k. Once accepting a record is optimal, it remains optimal at all later positions. Thus an optimal rule is a cutoff followed by acceptance of records; enumerating all r includes an optimal rule among all admissible relative-rank policies. Randomizing between actions cannot beat the larger of the two conditional payoffs.
Finite cutoff optimization. The harmonic success formula follows from partitioning the winning event by the global best's position. For $0\le r\le n-2$, consecutive probabilities satisfy
$$P_n(r+1)-P_n(r)=\frac1n\left(\sum_{j=r+1}^{n-1}\frac1j-1\right).$$
At r=0 this identity follows directly from the separate first-candidate formula. The tail sum decreases with r, so the probability sequence rises, may tie at its peak, then falls. The smallest optimal skip count is the first r for which that tail is at most 1, with the empty-tail convention covering n=1. The code instead compares every exact common-denominator score, avoiding both harmonic floating-point rounding and threshold-index ambiguity. The smallest-r tie policy is part of its deterministic output, not a requirement that all optimal cutoffs be unique.
Asymptotic 1/e rule. If $r/n\to\alpha$ for $0\lt\alpha\lt1$, then
$$P_n(r)\to\alpha\int_{\alpha}^{1}\frac{dx}{x}=-\alpha\ln\alpha.$$
Its derivative is $-\ln\alpha-1$, so the maximum occurs at $\alpha=e^{-1}$ with value $e^{-1}$. Thus the optimal skipped fraction and optimal success probability both tend to 1/e, although they are different quantities at finite n. For n=8, the skipped fraction is $3/8$ while the success probability is $459/1120$. This guarantee is neither a per-permutation promise nor a competitive ratio on numerical quality values.
Running time and observations. Given a cutoff and a record flag, the policy uses $\Theta(1)$ work and O(1) scalar state per observation. A comparison adapter needs one prefix-best reference and one comparison per later observation. With r=0 it stops at the first candidate. For positive r, the earliest choice is r+1 and the latest is n. At the optimal asymptotic cutoff, both are $\Theta(n)$; in general report the actual stopping position T rather than assuming every run reads all n candidates.
Under uniform random order and our final-candidate fallback, for $r\ge1$,
$$\Pr(T\gt k)=\frac rk\quad(r\le k\lt n),\qquad \mathbb E[T]=r+r\sum_{k=r}^{n-1}\frac1k=r+nP_n(r).$$
The first equality says no post-sample record has occurred among the first k candidates, exactly when that prefix's maximum lies in the initial sample. Summing the tail probabilities includes the r certain initial observations. For r=0, T=1. At the large-n optimum the expected observed fraction tends to $2/e$, not $1/e$: the latter is the success probability and skipped fraction, not the average stopping fraction. For the sample's policy, $\mathbb E[T]=879/140$, while this particular permutation stops at T=6.
The exact cutoff scorer uses O(n) arithmetic/gcd operations and O(1) scalar accumulators; with the bounded machine integers here that gives linear preparation time. The LCM grows with n, so an unbounded exact-arithmetic implementation must account for larger-integer bit costs instead of claiming constant-cost arithmetic forever. The online policy does not store a history. Its counters require O(log n) bits when the horizon grows, despite using a constant number of scalars.
The demonstration driver stores the entire permutation, sorts a validation copy in $O(n\log n)$ comparison time and O(n) storage, formats observed receipts, and prints the full offline audit. Those costs are separate from the streaming policy. Keeping T receipts adds O(T) records; the returned textual trace/audit has $O((T+n)\log n)$ characters for these integer labels. Enumeration over all n! permutations is a test method, not the runtime of an online decision.
The programs were checked on every permutation and every cutoff through n=7, verifying 28 exact success probabilities against observed counts, plus mixed tests through n=20. An independent backward-induction calculation checks the optimal value for each supported n. The checks also cover end fallback, smallest-cutoff ties, identical observed prefixes with different futures, input errors, first-flag validity and state preservation after a closed-call rejection.
| Strategy or method | Observation/decision cost | Chance of choosing the best | State and assumptions |
|---|---|---|---|
| Exact optimal cutoff, implemented | O(n) bounded-arithmetic preparation; constant work per observed flag | $\max_{0\le r\lt n}P_n(r)$; tends to 1/e | O(1) scalar policy state; known n, distinct qualities, uniform random order |
| Fixed chosen cutoff r | Same constant per-flag decision; no need to optimize r | $P_n(0)=1/n$, or harmonic formula for positive r | Can compare policies exactly on the same random-order model |
| Accept first | Exactly one observation | $1/n$ | No sample; finite-n optimal for n=1 and tied at n=2 |
| Accept last | n observations | $1/n$ | Discards every earlier opportunity |
| Asymptotic skip near n/e | Constant per flag after an approximate cutoff choice | Approaches 1/e; may miss the exact finite optimum | Must specify rounding; n=8 with floor gives r=2 instead of optimal 3 |
| Offline maximum with recall | n observations and linear comparison work | 1 | Retains the option to choose past candidates; different information/action model |
| Backward induction on relative ranks | O(n) rational-state recurrence | Same optimal finite value | Useful proof/oracle; exact rational bit costs grow with n |
Before stopping, the policy has rejected the entire sample and every later nonrecord; its first later record is therefore the first possible winning acceptance after that sample. Uniform random order makes the winning event at position k have probability $(1/n)\,r/(k-1)$, yielding the exact finite success formula and the optimal cutoff.
Variants, Pitfalls, and Optimizations
Do not confuse best so far with best overall. A record certifies only a relative prefix comparison. If a larger candidate arrives after acceptance, the policy has already closed. This is an allowed loss, not an implementation failure. A driver that computes the full-array maximum first and waits for it can report perfect performance only by supplying forbidden future information. The diagram contrasts indistinguishable relative prefixes whose eventual outcomes differ.
Keep the random-order assumption explicit. The probability is uniform over permutations of a fixed set of distinct qualities. It is not a guarantee for an adversarial order, and a fixed cutoff can be defeated by placing the best candidate in its rejected sample. With r=0, placing a non-best first also forces failure for n>1. Observed hiring or market order may be correlated with quality; a simulation should not assume it is uniform merely because its data arrived sequentially. A uniformly shuffled test permutation is a modeling choice, not evidence about real arrival processes.
The 37% rule has two limits and an indexing convention. Skip approximately n/e candidates for large n; the chance of selecting the best also tends to 1/e. Neither says to select exactly at position n/e, to choose any candidate above a fixed numerical score, or to expect to stop after 37% of the stream. The exact mean stopping fraction at the asymptotic optimum is 2/e under the fallback convention here. For small n, compare exact integer cutoffs; r=3 for n=8 is different from floor(8/e)=2. Some texts use r for the first selectable position, shifting the skip count by one.
Handle the final position deliberately. Our fallback always selects someone. Without it, a record-only version may end unselected. Both fail to select the best on the no-later-record event, but their selection counts and stopping-time conventions can differ. Report whether a test measures success probability, probability of any selection, expected rank, or observation cost. For n=1, select the only candidate; reject n=0 as outside this problem instead of inventing a probability.
Ties need a revised quality model. The classical proof assumes a unique total order. Treating equality as a record, randomly breaking ties, choosing any maximum, and selecting a particular unique winner define different success events. The audit driver rejects duplicate labels. A meaningful tied-score extension must state its tie-breaking and objective before changing the comparison operator.
Unknown horizons and additional information change optimal stopping. If n is unknown or random, the cutoff cannot be computed from the realized future length without leaking information. A known distribution over the horizon leads to a different dynamic program. Full-information models use actual observed values and a stated distribution, so magnitudes can matter. Recall, selection costs, multiple accepted candidates, top-k success, expected rank and expected value lead to other stopping rules; the classical best-choice proof does not establish their optimum.
Extensions have different benchmarks. Prophet inequalities typically compare expected selected value with a full-information benchmark under distributional assumptions. Matroid-secretary settings permit several selections subject to an independence constraint and optimize total weight. They are important next steps but do not inherit this scalar best-choice success formula. The existing queue prerequisite does not require buffering future candidates: putting unseen observations into a decision-visible queue would violate the intended information boundary.
Keep experiments reproducible and causal. Use exact enumeration only for tiny n. For larger n, sample uniformly shuffled permutations with a documented generator and seed, count wins across independent runs and report uncertainty. Never tune r after seeing the particular test permutation while evaluating a supposedly precommitted rule. Share the same permutation across policies to compare their outcomes, but do not expose it to their controllers. Preserve chosen positions after selection and keep any hindsight labels clearly within audit output.
A record is not necessarily the global best, and a winning sample run is not a probability estimate. Preserve random order, known horizon, distinct ranks and no recall; use exact finite cutoffs when needed, and never let absolute hidden ranks or future candidates influence the stopping controller.
Practice Problems and Real-World Use
Start with tiny populations. Enumerate all n! permutations for each cutoff and compare the fraction of wins with the harmonic formula. Check n=1, the n=2 tie, increasing and decreasing orders, best-in-sample failures, first-search-position successes, late records and nonrecord final fallback. Separately compute the finite optimum by backward induction and compare its value with the best cutoff probability.
Audit causality at the observation level. Two inputs with the same relative-rank history must produce the same actions until that history diverges. The policy should see no hidden quality array or global-best label. Once it chooses, no later candidate should be observed through its interface. Submit a false first record flag or a call after acceptance and confirm that the state remains unchanged. The small program's known rank labels are only for validating these tests.
For a simulation report, distinguish the skipped fraction r/n, empirical success rate, exact model probability and mean stopping position. They answer different questions. Exact enumeration has no sampling error but factorial cost; Monte Carlo has sampling uncertainty. For n=8, the exact probability 459/1120 gives 16,524 wins among all 40,320 permutations at r=3, an additional manageable exhaustive exercise.
The application rows below are modeling exercises, not claims that an abstract hiring rule should govern actual hiring or any named production system. Sequential offer selection can resemble optimal stopping only when the information, payoff, recall and arrival assumptions match. Before importing the cutoff, decide whether “best” is even the right objective and whether the horizon and random-order assumptions are justified.
Primary reading: Thomas Ferguson's finite-horizon stopping chapter states the classical assumptions and develops the relative-rank threshold argument. His historical article, Who Solved the Secretary Problem? provides context and variants. Watch the cutoff convention: this lesson's r counts rejected candidates. The record-only interface, final-fallback convention, exact integer scorer, audit format and cross-language tests above are specific to this lesson.
| Practice task or modeling exercise | Idea tested | Difficulty |
|---|---|---|
| Trace a record-only stopping controller | Distinguish sample rejection, eligible record and closed state | Beginner |
| Enumerate n≤7 permutations for every cutoff | Derive exact win counts and separate outcomes from probabilities | Intermediate |
| Finite-cutoff optimizer and n=2 tie | Harmonic sums, exact arithmetic and deterministic tie policy | Intermediate |
| Mean stopping-position experiment | Tail probabilities, final fallback and the 2/e asymptotic fraction | Intermediate |
| Sequential offer-selection model | Known horizon, no recall, best-choice objective and arrival assumptions | Intermediate |
| Unknown-horizon variant | Identify which prior information changes the state and recurrence | Advanced |
| Top-k, multiple-choice or tied-rank extension | Redefine payoff and revisit the optimal policy | Advanced |
| Prophet or matroid-secretary comparison | Distinguish best-selection probability from expected-value benchmarks | Advanced |