The Height of Counterintuitive Mathematics — the Birthday Problem

Ansh Pincha
Quantaphy
Published in
5 min readJan 28, 2024

Let me ask you this: say there’s a room filled with some number of people. There are no twins/triplets/quadruplets/… in this room. Each birthday is equally likely. And no one is born on February 29th. How many people would you need in the room to have at least a 50% chance of two people sharing the same birthday.

Well, to the untrained eye, it would seem that you would need about 365/2=182.5 people in the room. But is that really the case? To understand this, we turn to rigorous mathematics.

The Rigorous Approach

We treat this problem from a permutations perspective. First, we define two events: Let F (Fail) denote the event in which a group of n people have no shared birthdays amongst them. Similarly, let S (Success) denote the event in which a group of n people have at least one shared birthday.

It is axiomatically obvious that P(S) = 1 — P(F). We then notice by the pigeonhole principle that if n > 365, P(S) is trivially equal to zero. Next, our approach involves computing P(F) and then correcting for P(S). Since our method is one of permutations, we begin by arbitrarily numbering the people in the room from 1 through n. Since we’re computing for P(F), we are computing for nothing but the probability that person 2 doesn’t have the same birthday as person 1, person 3 doesn’t have the same birthday as person 2 or person 1, and so on, until person n — who doesn’t have the same birthday as any of the persons from 1 through n — 1.

The intersection of all these sub-events can be computed rigorously using conditional probability. But heuristics make our work much easier. We can let person 1 have any birthday in the year. Then, person 2 must have any birthday but that of person 1. This yields a probability 364/365. Person 3 can have any birthday but that of 1 and 2. This yields a probability of 363/365. And so on. All the way to person n, whose birthday needs to be different from everyone else. This yields a probability of (365 — (n — 1))/365.

Then, we see a simple product for P(F):

Collecting terms yields a neat simplification:

Then, in accordance with our method of permutations, we notice the numerator can be represented as a permutation:

Then, we correct for P(S) and we have:

Now, instead of going through the trouble of manually solving for P(S)=0.5, we simply exploit software and reach a neat tabulation and a neat graph of our results:

Image: Wikipedia
Image: EdsCave

Analysing our images, it is apparent that we, in fact, need only 23 people to have greater than a 50% chance of two people sharing a birthday. While this seems immensely counter-intuitive, there is quite a good reason for this. To put things into picture, with 23 people, there are 23C2 = 253 pairs of people. And that makes this answer incomparably more plausible.

Also, notice from the graph that the probability very quickly tends to 100%. This can be explained with a reasoning similar to that of the previous one. As the group size increases, the number of pairs grow very large very quickly and the probability of a shared birthday is far more likely.

What About Someone Sharing the Same Birthday as You?

Now, let’s assume you are a part of the group of n people. What is the probability that someone else has the same birthday as you? We take a similar approach to the previous method and number everyone 1 through n with You being person 1. Now, since our consideration doesn’t give merit to any two other people sharing a birthday and only merits someone else sharing your birthday, our calculations become much easier. Let A denote the event that someone shares your birthday and let B denote the event that no one shares your birthday. We begin, in a similar manner to the previous section, by treating the complement of the event, i.e., P(B).

This can be explained very easily in the following way. Since we are only considering matches with your birthday, our event fails if no one is born on the day you’re born. So, each person can be born on any of the 364 other days which has probability 364/365. Then, upon correcting for its complement, we have:

This is much much smaller than P(S). To put things into perspective, when n=23, P(S) = 0.57 and P(A) is a mere 0.061. In fact, for P(A) to be greater than 0.5, n ≥ 253. This number is significantly higher than 365/2=182.5 simply because it is also likely that there are some birthday matches among the other people in the room.

With this, we’ve successfully beat counterintuitive mathematics by taking a principled stance on a seemingly paradoxical result. For further generalizations of this problem, I direct the reader here. This problem is also called the Birthday Problem and is a famous result in mathematics. It is often used as an example for the often-counter-intuitive nature of probability. But it’s nothing mathematics can’t defeat!

Thank you for reading and I hope you have a great day!

--

--

Ansh Pincha
Quantaphy

High-school maths enthusiast. I particularly enjoy (prime) number theory, probability and analysis.