Is the Birthday Paradox Real?
Why 23 people in a room give you a 50:50 shot at a shared birthday—and what happens when you simulate it, swap in real U.S. birth data, or allow near misses.
The birthday paradox goes as follows: in a room of just 23 people, there is a 50:50 chance that at least two of them share a birthday.
Why is this a paradox? Well, there is a 1/365 chance that another person shares your birthday. I don’t know anyone who shares my birthday. (Besides my twin, of course!) Since I’ve met far more than 23 people, how can this be true?
This reasoning is flawed for several reasons, the first of which is that the question wasn’t asking about whether there was another person in the room with a specific birthday—any pair of people (or more!) can share a birthday to increase the chances of the statement being true.
Why 23 feels small, yet isn’t
When you walk into a room of 23 people and compare everyone solely against your own birthday, you are making only 22 comparisons. The chance someone shares your date is barely 5.9%. To give yourself a 50:50 shot at finding a birthday twin, you’d have to ask 253 other people.
But once we allow any two people in the room to match, the number of pairs grows :
Toggle between the two questions below to see how rapidly the comparison web fills in.
Why 23 People Create 253 Chances to Collide
Allowing any two people to match connects every person to every other person: n(n−1)/2 = 253 pairs. At 23 people, there are already 253 pairs—the very number needed to clear 50%!
The complete analytical answer involves a bit of combinatorial math, but I want to show you an even better way to convince yourself it is true: by simulating the experiment.
Simulation is programming a computer or model to act as if the real thing were happening. Usually, you set this up so that the cost of simulation is much lower than the cost of doing the actual thing—like putting a model airplane wing in a wind tunnel. I’ve simulated the birthday paradox in Python using a , and embedded a live version right below. Indeed, this is much easier than rounding up 23 people.
The simulation
Call the number of people we need to ask before we get a repeated birthday n. This is what is called a because its value is unknown in advance and may change due to conditions we cannot control (like who happens to walk into the room).
Now, we simulate an experiment, realizing a single value for n as follows:
- Pick a random person and ask their birthday.
- Check whether someone else has already given you that answer.
- Repeat steps 1 and 2 until a birthday is said twice.
- Count the number of people who were asked and call that n.
Here is what the Python code looks like to simulate a single instance of this experiment using from a :
import numpy as np
def collect_until_repeat(dist=np.ones(365) / 365):
# dist is the distribution of birthdays.
# If it is not known, it is assumed uniform.
repeat = False
outcomes = np.zeros(dist.shape[0])
# n counts the number of people we meet; each loop is a new person.
n = 0
while not repeat:
n += 1
outcomes += np.random.multinomial(1, dist)
if np.any(outcomes > 1):
repeat = True
return nGetting to step 4 constitutes a single experiment. The number that comes out might be n = 2 or n = 60—it all depends on who happens to be in the room. So we repeat all four steps many, many times and look at how the numbers fall. The more times we repeat, the more data we obtain and the clearer our picture of what is happening.
Try running single experiments or thousands of trials at once below, and watch the histogram lock onto the exact mathematical curve.
How Many People Until the First Repeat?
So what do all those numbers mean? Look at how often n = 2 occurs (click the n=2 pill above). In a one-million-trial run, the result 2 occurs roughly 2,726 times—about 0.273%. Notice how close that is to 1/365 ≈ 0.274%, which is expected since the probability that the second person has the same birthday as the first is exact 1/365.
Each bar’s height represents the probability that we would need to query that exact number of people to find our first shared birthday. Adding up every bar sums to 100% of all experiments.
Now add up the bars starting at n = 2 and moving right until you account for 50% of the total experiments—the . Visually, we are looking for the dividing line that splits the colored area above into two equal parts—vermilion on the left, indigo on the right. That number is the room size needed for a 50:50 shot at a repeated birthday.
Can you guess what it lands on?
Drum roll… 23! Tada! The birthday paradox—simulated and solved by simulation.
But wait! There’s more
What about those leap-year babies? In fact, isn’t the assumption that birthdays follow a across the year completely wrong? If we actually tried this experiment out in real life, would we get 23—or some other number?
Happily, we can test this hypothesis with real data! At least for U.S. births, you can inspect 62.2 million real birth records from the Social Security Administration (2000–2014) on FiveThirtyEight’s GitHub page. Here is what the actual calendar distribution looks like—every single day of the year, including February 29.
Birthdays Are Far From Uniform—Yet 23 Refuses to Budge
Christmas Day — fewest U.S. births of any calendar day (−43%).
It certainly doesn’t look uniform to the eye! You can clearly see massive holiday dips on Christmas Day (Dec 25, down 43% from the daily mean), New Year’s Day (Jan 1), Christmas Eve (Dec 24), and July 4—plus subtle dips on New Year’s Eve, Halloween, and even the 13th of each month—balanced against a late-summer surge peaking on September 12.
Since far fewer people are born on major holidays, you might expect it to be easier to find a shared birthday crowded onto the remaining days. Will that noticeably change the birthday paradox?
Let’s test it: we perform the exact same 4-step experiment, but randomly sample answers from the real U.S. birthday distribution (you can switch Figure II above to Real U.S. Births (366d) and run 10,000 live trials yourself!).
And the answer is… the exact same! Mathematically, any departure from a uniform distribution can only push collision probabilities slightly upward (a result from : the uniform distribution minimizes the chance of repeats). Even with Leap Day added and dramatic holiday troughs, real U.S. birth data nudges the odds at n = 23 from 50.73% to 50.80%—a difference of less than a tenth of a percentage point. The birthday paradox persists stubbornly in the real world.
So close!
If you are one of those people who get excited about “near” birthdays—born one day apart, or within the same weekend—I have good news! As you might expect, if we only need to find two people whose birthdays are close, we need a room with far fewer people.
We modify the experiment slightly to allow a for how far off we consider close. If tolerance = 0, we require the exact same birthday; if tolerance = 1, we allow a difference of a single day (wrapping cyclically across Dec 31 ↔ Jan 1); and so on.
- Pick a random person and ask their birthday.
- Check whether someone else has already given a birthday within the tolerance window.
- Repeat steps 1 and 2 until successful.
- Count the number of people asked and call that n.
The updated Python code looks like this:
import numpy as np
def collect_until_near_repeat(dist=np.ones(365) / 365, tolerance=0):
outcomes = np.zeros(dist.shape[0])
n = 0
days = len(outcomes)
while True:
n += 1
outcomes += np.random.multinomial(1, dist)
for i in range(days):
# Exact repeat on the same calendar day
if outcomes[i] > 1:
return n
# Near repeat within +/- tolerance cyclic days
if tolerance > 0 and outcomes[i] > 0:
for j in range(1, tolerance + 1):
if outcomes[(i + j) % days] > 0 or outcomes[(i - j) % days] > 0:
return nRunning across tolerances from 0 to ±7 days produces the curves and exact thresholds below. Notice how quickly the 50% line collapses—and what happens to a room of 20 people.
How Fast the Paradox Collapses When “Close” Counts
| Tolerance | 50% Odds (n) | Room of 20 | 90% Odds (n) | 99% Odds (n) | Mean n |
|---|---|---|---|---|---|
| Exact (0d) | 23 | 41.1% | 41 | 57 | 24.6 |
| ±1 day | 14 | 80.4% | 24 | 33 | 14.6 |
| ±2 days | 11 | 93.9% | 19 | 26 | 11.5 |
| ±3 days | 9 | 98.3% | 16 | 22 | 9.8 |
| ±4 days | 8 | 99.5% | 14 | 19 | 8.7 |
| ±5 days | 8 | 99.9% | 13 | 17 | 8.0 |
| ±6 days | 7 | 100.0% | 12 | 16 | 7.4 |
| ±7 days | 7 | 100.0% | 11 | 15 | 6.9 |
Exact cyclic calendar probabilities (wrapping Dec 31 ↔ Jan 1 on a 365-day year). Click any row or curve to inspect its threshold.
Just allowing birthdays to be one day apart (±1 day) slashes the 50:50 threshold from 23 people down to 14, and sends a room of 20 people surging to 80.5%. Allow two days (±2) and 20 people reaches 93.9%; three days hits 98.3%.
In other words, if you allow “near” birthdays, you are all but guaranteed to find a pair in a room of roughly 20 people.
Step inside the room
For fun, have a go at the room simulator below. It draws a room full of birthdays—either from an idealized uniform calendar or directly from real U.S. birth records—with exact matches and near misses highlighted.
Try turning Highlight matches off first and scanning the room with your own eyes, then flip it back on—or click +1 Person to watch people file in one by one until a collision pops up.
Step Inside the Room & Spot the Matches Yourself
Human intuition is notoriously terrible at counting pairs—we naturally compare the world against ourselves rather than across every combination in the room. Simulation cuts straight through that blind spot. You don’t need to take a textbook formula on faith when you can fill a thousand rooms in a fraction of a second and watch the 23-person threshold appear before your eyes.