Pick your spot in line
A movie theater manager announces a deal: the first person in line whose birthday matches someone who already bought a ticket wins a free ticket. You can choose any position. Which spot maximizes your chance of winning?
Watch a single trial unfold
Before doing any math, let's see what one round of this game actually looks like. People step up one at a time, reveal their birthday, and we check for a match:
Notice the tension. Early on, there are very few birthdays ahead — a match is unlikely. Later, there are many birthdays ahead, but by then someone else may have already matched first. Your ideal position is somewhere in between.
Running many trials
Now run hundreds of trials at once and see which position wins most often:
If you've seen the birthday paradox, this problem is a close relative. But instead of asking "does any pair match?", it asks "does person match someone among the first , given no earlier match occurred?"
Two competing forces
Why is there a sweet spot around position 20? Two forces compete as you move further back in line:
The green product curve — your actual winning probability — rises then falls. The peak is where the "more birthdays to match" benefit exactly balances the "earlier collision risk."
Visualizing P(n) for every position
Here's plotted for every position from 1 to 50:
The curve rises as grows (more birthdays to match) then falls (too likely someone else already matched). The peak is at .
Setting up the formula
Now let's make this precise. Suppose you choose to be the -th person in line. For you to win:
- No earlier match: The first people must all have different birthdays
- Your birthday matches: Your birthday must equal one of those distinct birthdays
These are independent (your birthday is chosen after theirs), so:
The first factor is the probability that people all have distinct birthdays — exactly the complement of the birthday problem. The second factor is the chance your birthday is among those distinct ones.
Finding the peak: when does P(n) start declining?
When is small, adding one more person ahead of you helps because the extra birthday to match outweighs the slightly higher risk of an earlier collision. At some point, the collision risk overtakes. We need to find the transition.
We want the crossover point: the where but .
This ratio plot makes the crossover visible. When the ratio drops below 1, moving further back in line hurts:
When the ratio drops below 1, moving further back hurts more than it helps.
A sequence is unimodal if it first increases then decreases (possibly with a flat plateau at the peak). for the birthday line problem is unimodal, which is why there's a single optimal position.
The answer
You should be the 20th person in line, giving you a winning probability of about 3.23%.
That probability seems low — only about 1 in 31. But it's the best you can do. Any other position gives you a strictly lower chance.
Connection to the birthday paradox
In the classic birthday problem, with 23 people the probability of some match exceeds 50%. Here, we're asking something stricter: not just "does a match exist?" but "is person specifically the first match?" The answer appears before the famous 23, which makes sense — we need the match to happen at our position, not just anywhere.
| Problem | Key question | Answer |
|---|---|---|
| Birthday paradox | P(any match in group of ) ≥ 50% | |
| Birthday line | Which maximizes P(person is first match)? |
Competition appearances
This problem appears in:
- Quant finance interviews (Jane Street, Two Sigma): tests conditional probability reasoning
- AMC/AIME preparation: unimodal optimization over discrete distributions
- Putnam training sets: the ratio test technique for finding discrete maxima
- Programming contests: efficient computation of birthday probability products
Takeaway
The birthday line problem extends the famous birthday paradox by pinning down who gets the first match. The product of "no earlier collisions" times "your collision probability" creates a unimodal curve peaking at position 20. The ratio test — comparing to 1 — is a general technique for finding peaks in discrete probability sequences.