logo

Birthday Problem: Probability of Sharing the Same Birthday 📂Lemmas

Birthday Problem: Probability of Sharing the Same Birthday

Formula

Disregarding leap years, let 11 be the number of years and 365365 be the number of days in a year. The probability that there is at least one pair of people with the same birthday among nn people is given by the following formula.

p(n)=1365!365n(365n)! p(n) = 1 - \dfrac{365!}{365^n(365-n)!}

Explanation

I recall that during my middle school years, this formula was introduced in a particular chapter of our math textbook (likely under permutations and combinations) as an “explore more” or “advanced content” section. Intuitively, because each person has 365365 options for their birthday, it seems like a large group would be necessary for any birthdays to overlap, but it was intriguing to find that this isn’t the case. We verified this by checking the birthdays of everyone in our class along with our teacher; even with about 3535 people, we found two pairs with the same birthday proving that the book wasn’t misleading. Indeed, upon referring to the table below, 3535 people is actually a sufficiently sized group for overlapping birthdays to occur.

The following table provides the actual calculated probabilities using the formula. Initially, the probabilities appear negligible, but with just 2323 people, the probability surpasses half, and when 4141 people gather, the probability of at least one pair having the same birthday exceeds 90%90\%.

nnp(n)p(n)nnp(n)p(n)
2200.27%00.27 \%151525.29%25.29 \%
3300.82%00.82 \%202041.14%41.14 \%
4401.64%01.64 \%232350.73%50.73 \%
5502.71%02.71 \%252556.87%56.87 \%
6604.05%04.05 \%303070.63%70.63 \%
7705.62%05.62 \%353581.44%81.44 \%
8807.43%07.43 \%404089.12%89.12 \%
9909.46%09.46 \%414190.32%90.32 \%
101011.70%11.70 \%

Derivation

The probability p(n)p(n) that there exists at least one pair of people with the same birthday among nn people can be expressed using the probability p~(n)\tilde{p}(n) that all individuals have different birthdays.

p(n)=1p~(n) p(n) = 1 - \tilde{p}(n)

First, consider two people. For these two individuals to have different birthdays, the second person’s birthday must differ from the first person’s. Thus, the second person’s birthday must be one of the 364364 days, excluding the day of the first person’s birthday.

p~(2)=364365 \tilde{p}(2) = \dfrac{364}{365}

For the birthdays of three people to all be different, the third person must have a different birthday from both the first and second persons. Consequently, the third person can be born on any of the remaining 363363 days, leading to the probability that all three have different birthdays being,

p~(3)=364365×363365 \tilde{p}(3) = \dfrac{364}{365} \times \dfrac{363}{365}

Following the same logic, the probability that all four people have different birthdays is,

p~(4)=364365×363365×362365 \tilde{p}(4) = \dfrac{364}{365} \times \dfrac{363}{365} \times \dfrac{362}{365}

The probability that all nn people have distinct birthdays is as follows.

p~(n)=364365×363365×362365××365(n1)365 \tilde{p}(n) = \dfrac{364}{365} \times \dfrac{363}{365} \times \dfrac{362}{365} \times \cdots \times \dfrac{365-(n-1)}{365}

Thus, the probability that there exists at least one pair of people with the same birthday among nn people is,

p(n)=1p~(n)=1364365×363365××365(n1)365=1364365×363365××365(n1)365×365n365n××22×11=1364!365n1(365n)!=1365!365n(365n)! \begin{align*} p(n) &= 1 - \tilde{p}(n) \\[1em] &= 1 - \dfrac{364}{365} \times \dfrac{363}{365} \times \cdots \times \dfrac{365-(n-1)}{365} \\[1em] &= 1 - \dfrac{364}{365} \times \dfrac{363}{365} \times \cdots \times \dfrac{365-(n-1)}{365} \times \dfrac{365-n}{365-n} \times \cdots \times \dfrac{2}{2} \times \dfrac{1}{1} \\[1em] &= 1 - \dfrac{364!}{365^{n-1}(365-n)!} \\[1em] &= 1 - \dfrac{365!}{365^n(365-n)!} \end{align*}