Three layers of this place answer the question how many tries? — and all three answer it with the same humble sum. Two of them turn out to be, secretly, the very same problem.
This is a portal — a layer whose job is to make the whole exceed the stack. It rests on three strata already on the ground:
· The Last One Is the Worst — how many random draws to collect a full set of n coupons.
· Look, Then Leap — the secretary problem: how to pick the best of n strangers seen one at a time.
· The Loop That Saves Them — the hundred prisoners and the boxes, and the strategy that saves them a third of the time.
Each was built on its own night, about its own problem. None of them says the thing this page says — because the load-bearing fact lives between them. It is this: a single sum,
— the harmonic number — is the answer to all three, wearing a different costume each time. In the coupon collector it is a waiting time: E[draws] = n·Hn. In the secretary problem it is a count: the expected number of record-breakers in a shuffled list is Hn. Among the prisoners it is a tail probability: the chance of a fatal over-long loop is Hn − Hn/2. One sum; three masks.
That alone would be a pleasing coincidence. The real surprise — the reason these three sit together — is deeper, and it is provable: two of them are not analogies at all. They are the same object.
First, meet the sum itself. Hn grows, but barely — like ln n + γ, where γ ≈ 0.5772 is the Euler–Mascheroni constant. Doubling n adds only about 0.69 (that is ln 2). This glacial growth is exactly why the three answers are humane: a thousand candidates yield only ~7.5 records, a hundred coupons take only ~519 draws. Drag n and watch all three costumes update from the one sum.
Here is the heart of the portal. Take a shuffled list and mark each record — a value larger than all before it (the secretary problem's high-water marks). Now take a random shuffle as a permutation and break it into cycles — the disjoint loops you follow box to box (the prisoners' loops). These look like different things. They are the same statistic.
The proof is a bijection (Foata's fundamental transformation): write each cycle starting from its largest element, list the cycles in increasing order of those largest elements, and erase the parentheses. The word you get is an ordinary permutation — and its records are exactly the cycle-leaders. So the number of records equals the number of cycles, for every permutation. Shuffle below and watch the two counts move in lockstep, always equal.
So the secretary problem and the prisoners' problem are not cousins; they are one family seen from two rooms. “How many records?” and “how many loops?” have the same answer with the same average, Hn, because a bijection carries one exactly onto the other. The coupon collector is the third sibling — the same Σ 1/k, now totting up waiting times instead of counting structure.
Push each problem to its limit and the harmonic series hands back a famous constant — a different one each time, all read off the same Σ 1/k. The secretary's win rate tends to 1/e. The prisoners' survival tends to 1 − ln 2. And the collector's cost carries γ inside n·Hn = n ln n + γn + …. Watch them settle:
The bijection (records ≡ cycles) is exact and proved here by full enumeration over every permutation up to n = 7 — the distributions match the Stirling numbers of the first kind to the integer. The three limits (1/e, 1 − ln 2, γ) are each derived and checked on their own member pages and re-confirmed here. What the portal asserts beyond the members is only the unifying frame: that one sum answers all three, and that two of the three are the same statistic. It does not claim the coupon collector is the same object as the other two — it shares the engine Σ 1/k, not the permutation structure; that distinction is kept honest above.