๐Ÿงฎ Brain Teaser

The Absent-Minded Secretary

A secretary types nn letters and nn envelopes, then stuffs the letters into envelopes completely at random (one letter per envelope). What is the probability that no letter ends up in the correct envelope?

Now here is the surprising part: what does this probability approach as nโ†’โˆžn \to \infty?

derangementsinclusion-exclusioncombinatoricsepermutations

Answer: The Absent-Minded Secretary

Key Idea / Intuition

This is the classic derangement problem. The clever approach uses inclusion-exclusion: instead of counting directly, we subtract out all the "bad" permutations where at least one letter is correctly placed. The magical punchline is that the answer converges โ€” rapidly and exactly โ€” to 1/e1/e, no matter how large nn gets. The series truncates at a familiar friend.


Formal Proof / Solution

Setup. Let AiA_i be the event that letter ii goes into the correct envelope. We want: P(noย letterย correct)=Pโ€‰โฃ(โ‹‚i=1nAic)=1โˆ’Pโ€‰โฃ(โ‹ƒi=1nAi).P(\text{no letter correct}) = P\!\left(\bigcap_{i=1}^n A_i^c\right) = 1 - P\!\left(\bigcup_{i=1}^n A_i\right).

Inclusion-Exclusion. By inclusion-exclusion: Pโ€‰โฃ(โ‹ƒi=1nAi)=โˆ‘k=1n(โˆ’1)k+1(nk)(nโˆ’k)!n!.P\!\left(\bigcup_{i=1}^n A_i\right) = \sum_{k=1}^n (-1)^{k+1} \binom{n}{k} \frac{(n-k)!}{n!}.

The term (nk)(nโˆ’k)!/n!\binom{n}{k}(n-k)!/n! counts the probability that kk specific letters are all correct (the remaining nโˆ’kn-k are free): there are (nโˆ’k)!(n-k)! completions out of n!n! total.

This simplifies beautifully: (nk)(nโˆ’k)!n!=n!k!โ€‰(nโˆ’k)!โ‹…(nโˆ’k)!n!=1k!.\binom{n}{k} \frac{(n-k)!}{n!} = \frac{n!}{k!\,(n-k)!} \cdot \frac{(n-k)!}{n!} = \frac{1}{k!}.

So: P(noย letterย correct)=1โˆ’โˆ‘k=1n(โˆ’1)k+1k!=โˆ‘k=0n(โˆ’1)kk!.P(\text{no letter correct}) = 1 - \sum_{k=1}^n \frac{(-1)^{k+1}}{k!} = \sum_{k=0}^n \frac{(-1)^k}{k!}.

The Answer: Dn=โˆ‘k=0n(โˆ’1)kk!=1โˆ’1+12!โˆ’13!+โ‹ฏ+(โˆ’1)nn!.D_n = \sum_{k=0}^n \frac{(-1)^k}{k!} = 1 - 1 + \frac{1}{2!} - \frac{1}{3!} + \cdots + \frac{(-1)^n}{n!}.

As nโ†’โˆžn \to \infty: Recall eโˆ’1=โˆ‘k=0โˆž(โˆ’1)kk!e^{-1} = \sum_{k=0}^\infty \frac{(-1)^k}{k!}, so: Dnโ†’1eโ‰ˆ0.3679.D_n \to \frac{1}{e} \approx 0.3679.

How fast? The error โˆฃDnโˆ’eโˆ’1โˆฃ|D_n - e^{-1}| is less than 1(n+1)!\frac{1}{(n+1)!}, which is already tiny for n=3n = 3 or 44. In fact, the integer number of derangements Dnโ‹…n!D_n \cdot n! equals the nearest integer to n!/en!/e for all nโ‰ฅ1n \geq 1.

Sanity check for small nn:

| nn | Derangements | Probability | |-----|-------------|-------------| | 1 | 0 | 0 | | 2 | 1 | 1/2 | | 3 | 2 | 1/3 | | 4 | 9 | 3/8 |

All converging quickly to 1/eโ‰ˆ0.3681/e \approx 0.368.

The beautiful surprise: no matter how many letters there are, you always have roughly a 36.8%36.8\% chance that nobody gets their own letter back โ€” a fact that astonishes people every time.

Source: Fifty Challenging Problems in Probability with Solutions (Frederick Mosteller)

Type: ProbabilitySource: Fifty Challenging Problems in Probability with Solutions (Frederick Mosteller)Edit on GitHub โ†—