Imagine a room with 23 people. Would you expect two of them to share a birthday? Most people wouldn’t. There are 365 possible dates, after all, and 23 seems tiny by comparison. Yet, under a simple model, the chance of a match is just over 50 percent.
The trick is that nobody asked whether someone shares your birthday. We’re looking for a match between any two people. That small change creates far more opportunities for a coincidence than it first appears.

One person’s birthday versus any pair
If you walk into the room and ask whether anyone shares your birthday, each other person has roughly a 1-in-365 chance of saying yes. With 22 other people, your chance of finding a match is only about 6 percent.
But if anyone can match anyone, every pair matters. Person 1 can match any of the other 22; person 2 can match any of the remaining 21; and so on. Counting this way gives 22 + 21 + ··· + 1 = 253 pairs. You can also calculate it as 23 × 22 ÷ 2: choose the first person, choose a different second person, then divide by two because each pair was counted twice.
That is the heart of the birthday paradox. Twenty-three people sounds like a small sample of 365 dates, but they create 253 chances for a pair to match.
Calculate the chance by avoiding matches
Adding up the chances of all 253 pairs matching would be tempting, but it wouldn’t give the answer. Those possibilities overlap: three people could share one birthday, producing several matching pairs at once. It’s easier to calculate the opposite event—no shared birthdays at all—and subtract its probability from 1.
Assume birthdays are independent and equally likely on each of 365 dates, ignoring leap day. The first person can have any birthday. The second must avoid that date, so their chance of being different is 364/365. The third must avoid both dates already taken, giving them a 363/365 chance. Each new person has one fewer available date.
For 23 people, multiply those chances:
P(no match) = (365/365) × (364/365) × (363/365) × ··· × (343/365) ≈ 0.4927.
So P(at least one match) = 1 − 0.4927 = 0.5073, or about 50.7 percent. The first match isn’t guaranteed, of course. We’ve simply reached the group size where a match is slightly more likely than not.
Why the odds climb so quickly
With n people, the number of pairs is n(n − 1)/2. If you roughly double the number of people, you create nearly four times as many pairs. The opportunities for a collision grow much faster than the head count.
There’s a handy estimate when the number of people is small compared with the number of possible dates. If there are N equally likely possibilities, the chance of at least one match among n independent picks is approximately 1 − e^(−n(n − 1)/(2N)), where e is a mathematical constant of about 2.718. The exponent is, roughly, the number of pairs divided by the number of possibilities.
For birthdays, 23 people give 253 pairs. Since 253/365 is about 0.693, the estimate gives 1 − e^(−0.693) ≈ 0.50. That agrees closely with the exact calculation. As a quick rule of thumb, a 50–50 chance of a match arrives at around 1.18 × √N picks—not at N/2 picks.
The same surprise in randomly generated codes
Suppose a small service assigns each new customer a random six-digit code, allowing codes from 000000 through 999999. That gives it one million possibilities. A million sounds ample for its first thousand customers, but the birthday calculation tells a different story.
Those 1,000 customers form 1,000 × 999 ÷ 2 = 499,500 pairs. Using the approximation, the chance of at least one duplicate is 1 − e^(−499,500/1,000,000) ≈ 39.3 percent. At about 1,180 customers, it rises to roughly 50 percent.
A duplicate need not become a disaster. The service can check whether a generated code is already in use and try again. But it should not assume that drawing from a million possibilities makes collisions negligible. If the codes must be unique, uniqueness needs to be checked or built into the assignment method.
The question to ask when coincidences appear
Real birthdays are not perfectly uniform, and people’s birth dates are not always independent. Those details shift the precise percentage. They don’t change the central lesson: when any pair can count as a match, the number of comparisons is often more important than the number of possibilities.
The next time a coincidence feels impossibly unlikely, ask: “How many chances were there for something like this to happen?” In a room, a database, or a pile of randomly assigned codes, the answer may be much larger than the number of people—or records—you first noticed.


Leave a Reply