Brainteasers & Puzzles

Birthday Line

Pick a spot in a long line to be the first birthday match and win a free ticket. Which position should you choose?

solvedmedium1 min

At a cinema the manager gives a free ticket to the first person in line whose birthday matches that of someone already ahead of them. You may take any spot in line. Birthdays are uniform over 365 days and you know no one else's. Which position gives you the best chance?

Reveal solutionHide solution

#When I win

I win at position kk on two conditions. The k1k-1 people ahead of me must all have different birthdays, or the prize is already gone. And my birthday must match one of those k1k-1. The two are independent, so

P(win at k)=i=1k1365(i1)365first k1 distinctk1365I match one.(1)\PP(\text{win at } k) = \underbrace{\prod_{i=1}^{k-1}\frac{365-(i-1)}{365}}_{\text{first } k-1 \text{ distinct}} \cdot \underbrace{\frac{k-1}{365}}_{\text{I match one}}. \tag{1}

#Where it peaks

Early in line the match term (k1)/365(k-1)/365 is tiny. Late in line a clash ahead of me has probably already claimed the prize. The product peaks in between. Comparing position k+1k+1 with position kk, the ratio exceeds one exactly while k2k365<0k^2 - k - 365 < 0, that is k<1+1461219.6k < \tfrac{1 + \sqrt{1461}}{2} \approx 19.6. So the chance climbs through position 20 and falls after.

110203040
Early positions are likely still all distinct but give you few birthdays to match, while late positions are likely already spoiled by a clash ahead of you. The chance peaks at position 20.

Stand twentieth.