ProbabilityProbability Spaces

Products of Chances: The Birthday Problem

Find "at least one match" through its complement, a product of shrinking fractions: in a group of 23, a shared birthday is slightly more likely than not.

Not started Jump to practice

How many people must be in a room before two of them probably share a birthday? Most people guess about 180. The answer is 23. The calculation uses the complement rule and the counting from probability with counting, and it shows why "at least one" questions are usually answered through their complement.

Key idea

If each of $n$ people independently gets one of $d$ equally likely values, then $$P(\text{all different}) = \frac{d}{d}\cdot\frac{d - 1}{d}\cdots\frac{d - n + 1}{d},$$ and $$P(\text{at least two match}) = 1 - P(\text{all different})$$

Why it works

There are $d^{n}$ equally likely lists of values. A list with all values different is built one person at a time: $d$ choices for the first, $d - 1$ for the second, and so on, so there are $d(d - 1)\cdots(d - n + 1)$ of them. Dividing gives the product above. "At least two match" covers many cases (one pair, two pairs, a triple, …), but its complement is a single clean case, so we compute the complement.
Why 23 is enough: matches can happen between any two people, and 23 people form $\binom{23}{2} = 253$ pairs. Each pair matches with chance $\frac{1}{365}$. Using $1 - \frac{i}{365} \approx e^{-i/365}$, the product is about $$e^{-(0 + 1 + \cdots + 22)/365} = e^{-253/365} \approx 0.50$$
365 equally likely birthdays (leap days ignored). The chance passes one half at 23 people.
People $n$510202330405057
$P(\text{a shared birthday})$0.0270.1170.4110.5070.7060.8910.9700.990

Worked examples

Worked example: Birth months

Four people each have a birth month, all 12 equally likely and independent. Find the probability that at least two share a month.
  1. All different: $$\frac{12}{12} \cdot \frac{11}{12} \cdot \frac{10}{12} \cdot \frac{9}{12} = \frac{11880}{20736} = \frac{55}{96}$$
  2. At least two match: $1 - \frac{55}{96} = \frac{41}{96} \approx 0.427$.

Answer: $\frac{41}{96}$

Worked example: Matching you, or matching anyone

You are in a room with 22 other people. Compare the chance that someone shares your birthday with the chance that some two people share a birthday.
  1. Someone matches you: each of the 22 misses your birthday with probability $\frac{364}{365}$, independently, so $1 - \left(\frac{364}{365}\right)^{22} \approx 0.059$.
  2. Any match among the 23 people: from the table, about $0.507$.
  3. The second is much larger because it counts all 253 pairs, not only the 22 pairs that include you.

Answer: About $0.059$ against about $0.507$.

Worked example: How many people for a digit match?

People each pick a random digit from 0 to 9. What is the smallest group in which a repeated digit is more likely than not?
  1. $n = 4$: all different with probability $\frac{10 \cdot 9 \cdot 8 \cdot 7}{10^{4}} = 0.504$, so a match has chance $0.496$.
  2. $n = 5$: all different with probability $0.504 \cdot \frac{6}{10} = 0.3024$, so a match has chance $0.6976$.

Answer: 5 people.

Common mistake

Two shortcuts give badly wrong answers. Multiplying $\frac{1}{365}$ by the number of people ($\frac{23}{365} \approx 0.06$) treats the matches as if they could not overlap and grows past 1 for large groups. Comparing everyone with one chosen person misses most of the pairs. Check: a correct method gives a probability that rises toward 1 but never passes it.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 2 XP.

Loading practice…

Builds on

Leads to

This is one of the top rungs of Probability.

Sources and further reading

  • Grinstead and Snell, Introduction to Probability (2nd revised edition, American Mathematical Society; free from Dartmouth College), chapter 3 (Combinatorics), section 3.1, the birthday problem
  • MIT OpenCourseWare 18.05, Introduction to Probability and Statistics (Spring 2014), readings on counting and probability
@teddyrookbook GitHub