🧮 Brain Teaser

The Shared Birthday Secretary

There are nn people in a room. Each person independently and uniformly selects a birthday from {1,2,,365}\{1, 2, \ldots, 365\}. You interview them one by one, learning each person's birthday as you go.

Question: What is the expected number of people you must interview until you find the first person who shares a birthday with someone you've already interviewed (i.e., the first "collision")?

For concreteness, find a clean closed form in terms of n=365n = 365 and compare to your intuition from the birthday paradox.

birthday paradoxexpected valuetail sumcoupon collectorcollision

Answer: The Shared Birthday Secretary

Key Idea / Intuition

The birthday paradox tells us there's about a 50% chance of a collision among just 23 people — far fewer than the 183 one might naively expect. The expected number of interviews until the first collision captures the same phenomenon algebraically. At step kk, the probability that the kk-th person is new (no collision yet) is 365(k1)365\frac{365-(k-1)}{365}, so we can compute the expected stopping time by summing the probability of "no collision in the first kk people" over all kk.

The key trick is: E[stopping time]=k=0P(first k people all have distinct birthdays)E[\text{stopping time}] = \sum_{k=0}^{\infty} P(\text{first } k \text{ people all have distinct birthdays}), which is a standard tail-sum formula for expectations.


Formal Proof / Solution

Let NN be the number of people interviewed until the first collision (including the person who causes the collision). We want E[N]E[N].

Tail-sum formula. For any non-negative integer-valued random variable, E[N]=k=0P(N>k).E[N] = \sum_{k=0}^{\infty} P(N > k).

Now P(N>k)P(N > k) is the probability that the first kk people all have distinct birthdays (so no collision has happened yet after kk interviews):

P(N>k)=365365364365363365365k+1365=j=0k1365j365.P(N > k) = \frac{365}{365} \cdot \frac{364}{365} \cdot \frac{363}{365} \cdots \frac{365 - k + 1}{365} = \prod_{j=0}^{k-1} \frac{365 - j}{365}.

Setting n=365n = 365 for brevity:

E[N]=k=0nj=0k1(1jn).E[N] = \sum_{k=0}^{n} \prod_{j=0}^{k-1} \left(1 - \frac{j}{n}\right).

(The sum terminates at k=nk = n because after interviewing n+1n+1 people a collision is guaranteed by pigeonhole.)

Numerical value. Computing this sum for n=365n = 365:

E[N]24.6.E[N] \approx 24.6.

Approximate closed form. Since j=0k1(1j/n)ek(k1)/(2n)\prod_{j=0}^{k-1}(1 - j/n) \approx e^{-k(k-1)/(2n)} for large nn, we approximate the sum by an integral:

E[N]0ek2/(2n)dk=πn2.E[N] \approx \int_0^{\infty} e^{-k^2/(2n)} \, dk = \sqrt{\frac{\pi n}{2}}.

For n=365n = 365:

π365257323.9.\sqrt{\frac{\pi \cdot 365}{2}} \approx \sqrt{573} \approx 23.9.

The surprise. You only need to interview about πn/224\sqrt{\pi n / 2} \approx 24 people on average — roughly n\sqrt{n} rather than nn. This is the birthday paradox in quantitative form: collisions happen shockingly early because the number of pairs grows as k2/2k^2/2, and a collision becomes likely once k2/2nk^2/2 \approx n, i.e., k2nk \approx \sqrt{2n}.

Summary table:

| Quantity | Value (n=365n=365) | |---|---| | Naive guess | 183183 | | Expected interviews to first collision | 24.6\approx 24.6 | | Approximation πn/2\sqrt{\pi n/2} | 23.9\approx 23.9 |

Written to: questions/2026-06-17_pm.md Answer: questions/2026-06-17_pm_answer.md

Source: Fifty Challenging Problems in Probability with Solutions (Mosteller) — inspired by birthday-type problems; classical folklore

Type: ProbabilitySource: Fifty Challenging Problems in Probability with Solutions (Mosteller) — inspired by birthday-type problems; classical folkloreEdit on GitHub ↗