The Birthday Paradox — Why 23 People Are Enough
Put just 23 people in a room and there is already a better-than-even chance that two share a birthday. How can that possibly be true?
Best level: GCSE upwards
Area: Probability, complementary events, combinations and simulation
Investigation time: 20–40 minutes, with optional spreadsheet extensions
Make Your Guess Before Reading On
How many people would you need in a room before there is at least a 50% chance that two of them share a birthday?
By birthday, we mean the same day and month. They do not need to have been born in the same year.
Would you choose 100 people? Perhaps 150? Or would you halve 365 and suggest about 183?
The answer, under the usual simplified assumptions, is just 23.
With 23 people, the probability of at least one matching birthday is approximately 50.73%.
This is called the birthday paradox. There is no mathematical contradiction: the result simply conflicts with what many people expect.
What appeals to me as a teacher is that the surprise gives us a reason to investigate. A probability calculation becomes much more interesting when it challenges an answer we felt quite confident about.
The Question Your Brain May Have Answered Instead
Imagine standing in a room with 22 other people.
If you ask, “Does anyone here share my birthday?”, you are looking for one particular date. Each of the other 22 people gives you another opportunity to find it.
Under our simplified model, the probability that at least one of them shares your birthday is only about 5.86%.
But that is not the birthday paradox question.
We are asking:
“Do any two people in the room share a birthday?”
Two people on the other side of the room could share 17 March. Another pair could share 4 October. Your own birthday does not have to be involved at all.
Changing “my birthday” to “any birthday” changes the problem enormously.
This is a useful habit for students: before choosing a formula, say clearly what event you are trying to measure.
Twenty-Three People Create 253 Pairs
Start with a smaller group.
With two people, there is one pair to compare.
Add a third person and there are two new comparisons: the newcomer with each person already present. That gives three pairs altogether.
The fourth person adds three more comparisons. The fifth adds four.
For n people:
Number of pairs = n x (n - 1) / 2
We divide by two because comparing Alice with Ben is the same pair as comparing Ben with Alice.
For 23 people:
Number of pairs = 23 x 22 / 2 = 253
That is the first clue. A modest-sized group produces a surprisingly large number of comparisons.
However, 253 pairs does not mean 253 independent attempts. In particular, if Alice shares Ben's birthday and Ben shares Chloe's, Alice must share Chloe's too.
The pair count explains the intuition, but it does not by itself give the exact probability.
Solve the Opposite Problem First
Trying to count all the ways birthdays can match soon becomes awkward.
There could be one matching pair, two separate pairs, three people sharing a date, or several overlapping groups.
Fortunately, the opposite event is much easier:
Everyone has a different birthday.
For this calculation, assume that:
- There are 365 possible birthdays; we leave out 29 February.
- Every date is equally likely.
- Different people's birthdays are independent.
Now imagine people entering the room one at a time.
Person 1: Any birthday is acceptable. There is nobody to match.
Probability of keeping all birthdays different = 365/365.
Person 2: Must avoid the first person's birthday.
Probability = 364/365.
Person 3: If the first two birthdays are different, must avoid both dates.
Probability = 363/365.
Person 4: Must avoid the three different dates already present.
Probability = 362/365.
Continue until person 23, who must avoid 22 dates:
Probability = 343/365.
Multiply these successive conditional probabilities:
P(no shared birthday) = (365/365) x (364/365) x (363/365) x ... x (343/365)
This gives approximately 0.4927.
Either everyone has a different birthday, or at least two people share one. These are complementary events, so their probabilities add to one.
P(at least one shared birthday) = 1 - P(no shared birthday)
P(at least one shared birthday) = 1 - 0.4927 = 0.5073
That is approximately 50.73%.
For 22 people the probability is about 47.57%, so 23 is the smallest group size that passes 50% in this model.
How Quickly Does the Probability Rise?
| People in the room | Different pairs | Chance of at least one shared birthday |
|---|---|---|
| 10 | 45 | 11.69% |
| 20 | 190 | 41.14% |
| 23 | 253 | 50.73% |
| 30 | 435 | 70.63% |
| 40 | 780 | 89.12% |
| 50 | 1,225 | 97.04% |
By 50 people, a match is very likely. But even 97.04% is not a guarantee.
In this 365-date model, a match becomes certain at 366 people. If you put 366 people into 365 birthday categories, at least one category must contain more than one person. This is an example of the pigeonhole principle.
Notice the distinction between likely and certain. Probability questions often depend on it.
Practical Investigation: Test a Real Group
A class, family gathering or club meeting provides a good starting point.
- Ask everyone to predict whether there will be a match.
- Record birthdays by day and month only; birth years are unnecessary.
- Agree in advance how to treat 29 February. For a direct comparison with the model, use simulated dates instead if this creates a complication.
- Check for repeated dates.
- Compare what happened with the prediction for that group size.
Participation can be voluntary, and anonymous date slips work well.
The important discussion comes afterwards.
A room of 23 people without a match has not disproved the mathematics. That outcome has a probability of about 49.27%: it is entirely ordinary.
Equally, finding a match in a group of ten does not disprove an 11.69% prediction. Less likely events still happen.
One group gives one outcome. To investigate the probability properly, we need many repeated groups.
Simulate Birthdays Without Finding Hundreds of Volunteers
Label the possible birthdays with the integers 1 to 365. We do not need actual calendar dates because we are only checking whether two values match.
For one simulated room of 23 people:
- Generate 23 independent random integers between 1 and 365.
- Look for any repeated number.
- Record “match” or “no match”.
- Generate a completely new room and repeat.
If using numbered slips, replace and mix each slip after every draw. Drawing without replacement would prevent the very repeats we are investigating.
After many rooms:
Estimated probability = rooms containing at least one match / total rooms tested
For example, if 512 out of 1,000 simulated rooms contain a match:
Estimated probability = 512/1000 = 0.512 = 51.2%
This is an illustrative result, not a reported experiment. Your results will vary.
A larger simulation generally gives a more stable estimate, but it does not guarantee that every new batch moves closer to the theoretical answer.
A Spreadsheet That Makes the Pattern Visible
Use Excel or Google Sheets to simulate 1,000 rooms.
Each row represents one room; each of 23 columns represents one person.
- In A2, enter
=RANDBETWEEN(1,365). - Fill across to W2, then down to row 1001.
- In X2, enter
=IF(SUMPRODUCT(COUNTIF(A2:W2,A2:W2))>23,1,0). - Fill X2 down to X1001.
- In a separate cell, enter
=AVERAGE(X2:X1001)and format it as a percentage.
The formula in column X returns 1 when a room contains a match and 0 otherwise. If all 23 values are different, each occurs once and the count total is 23. Any duplicate pushes the total above 23.
Random-number formulas recalculate. Copy and paste values if you want to preserve a particular set of results before discussing it.
Repeat the investigation for 10, 20, 30, 40 and 50 people, adjusting the row range and the comparison number in the match formula. For example, 30 people require A2:AD2 and a comparison with 30.
Before running each simulation, predict the result. Then compare the experimental percentage with the table.
Three Tempting Mistakes Worth Discussing
“Surely the answer is about half of 365?”
This treats the calendar as though birthdays were filling dates without repetition. In our model, each new person can have any of the 365 birthdays, including one already present.
“There are 253 pairs, so the probability is 253/365.”
253/365 is about 0.693, but it is not the probability of at least one match.
It is the expected number of matching pairs. A room can contain several matching pairs, so that average count is different from the probability that a room contains any match at all.
Simply adding pair probabilities counts some rooms more than once.
“A 50% chance means exactly half our rooms must match.”
Probability describes a pattern across repeated trials. It does not impose a quota on a small experiment.
Even the theoretical probability here is slightly above 50%, rather than exactly half.
How Realistic Is the Model?
Real birthdays are not perfectly evenly distributed throughout the year. Leap days exist, and groups involving twins or selected birth dates can differ from a collection of independent random birthdays.
Those details affect the precise probability. The table describes a mathematical model, not an exact forecast for every real gathering.
That makes a useful extension: how would the result change if some dates were much more common than others?
As an extreme thought experiment, imagine that everyone could be born on only ten equally likely dates. Matches would become common in much smaller groups.
Students can explore a less extreme version by simulating a deliberately uneven distribution and comparing it with the uniform model.
Why I Like This as a Maths Lesson
The birthday paradox brings together several habits I want students to develop:
- Define the event before calculating.
- Count comparisons carefully.
- Look for an easier complementary event.
- Distinguish a model from the real world.
- Compare experimental evidence with a theoretical prediction.
It also gives students permission to revise an initial guess. Being surprised is a useful starting point for learning.
At Hemel Private Tuition, I want students to see mathematics as something they can question, test and explain. Investigations like this can begin with GCSE probability and develop into combinations, conditional probability and computer simulation.
The most valuable moment is when a student can explain why the answer makes sense, rather than simply remember the number 23.
The Real Surprise Is the Number of Connections
Twenty-three people do not seem like many. Two hundred and fifty-three possible pairs feel rather different.
Our intuition notices the people. The mathematics makes us count the relationships between them.
That is the lasting lesson: when a problem involves any pair matching, the number of opportunities can grow much faster than we first expect.
Next time you are in a room of around 23 people, make a prediction. Then ask about birthdays. A familiar group can become a surprisingly good mathematics laboratory.

No comments:
Post a Comment