← All articles

Probability · JMNIO MATH

23 people. One surprisingly likely coincidence.

The birthday paradox, the hidden power of pairs, and the puzzle that started jmnio math.

By John MichaelWatch the birthday paradox reel ↗
THE EXACT MODEL

A small room. A lot of possible pairs.

Probability that at least two people share a birthday.

Birthday-match probability by group sizeProbability rises from zero to nearly 100 percent between 0 and 70 people. At 23 people it is 50.73 percent.0%50%100%23 people · 50.73%01023405070People in the room
Selected group sizes under the 365-day model
PeoplePossible pairsChance of a match
104511.69%
2223147.57%
2325350.73%
3043570.63%
50122597.04%
70241599.92%

Puzzles have a way of making me stop and ask: why does that work?

I enjoy finding the answer, but I’m usually more interested in pulling it apart—getting past what seems obvious and finding the simple ideas underneath. That curiosity is why I started jmnio math.

The birthday paradox felt like a fitting first reel: a puzzle about birthdays to mark the birth of the channel.

A room, a question, and a surprising answer

How many people do you need in a room before the chance that at least two share a birthday exceeds 50%?

If your first guess is somewhere near half of 365, you’re in good company. My intuition wanted a much larger room, too.

The answer is 23 people. Under the usual assumptions, the probability is about 50.73%.

This isn’t a logical contradiction. It’s called a paradox because the result clashes with what many of us expect. To understand it, we need to ask exactly what is being compared.

First, agree on the model

We’ll assume 365 equally likely birthdays, ignore leap days, and treat different people’s birthdays as independent. We compare the day and month, not the year.

Real birthdays are not perfectly uniform, and related people may have dependent birthdays. This is a simplified model that lets us see the mechanism clearly.

Crucially, the question is whether any pair shares a birthday. It is not whether someone shares your birthday.

Count the opposite

Calculating every possible way a match could occur gets messy. There could be one matching pair, several pairs, or three people sharing a birthday.

Instead, count the one situation with no matches: everyone has a different birthday. Then subtract its probability from 1. These two possibilities cover every outcome.

P(at least one match) = 1 − P(all different)

Imagine people entering the room one at a time:

We multiply these conditional probabilities, using the chain rule:

P(all different) = (365/365) × (364/365) × (363/365) × … × ((365 − n + 1)/365)

For whole-number group sizes from 1 to 365, factorial notation makes this shorter:

P(all different) = 365! / [365n · (365 − n)!]

So the answer to our original question is:

P(at least one match) = 1 − 365! / [365n · (365 − n)!]

Substitute n = 23 and we get approximately 0.5073, or 50.73%. With 22 people it’s about 47.57%, so 23 is the first group size to cross 50%.

With 366 people, a match is guaranteed under this 365-day model: there are more people than available birthdays.

The hidden multiplier: everyone can match everyone

Our intuition often imagines one person comparing their birthday with everyone else. With 23 people, that would mean just 22 comparisons.

But our question allows any two people to match. The number of distinct pairs is:

Number of pairs = C(n, 2) = n(n − 1)/2

For 23 people, that’s 253 pairs.

Each new person creates a possible match with every person already in the room. The 23rd person adds 22 new pairs, not just one.

These pair comparisons are not all mutually independent, and several can match at once. So we cannot simply divide 253 by 365 to get the probability of at least one match. That ratio is the expected number of matching pairs, a different quantity.

The exact calculation above handles overlaps correctly. Counting pairs explains why the surprise happens.

A deeper look: why pairs appear in the approximation

The product for no matches can also be written as:

P(all different) = ∏k=1n−1 (1 − k/365)

For small x, the first-order approximation ln(1 − x) ≈ −x is useful. Taking natural logarithms turns the product into a sum:

ln P(all different) = ∑k=1n−1 ln(1 − k/365) ≈ −∑k=1n−1 k/365 = −n(n − 1)/(2 · 365)

Exponentiating and taking the complement gives:

P(at least one match) ≈ 1 − e−C(n,2)/365

There are the pairs again. At n = 23, this approximation gives about 50.00%, compared with the exact 50.73%. It helps explain the pattern; it does not replace the exact result. It becomes less accurate as the fractions k/365 stop being small.

The number of pairs grows quadratically. The probability does not keep growing quadratically or exponentially. It rises toward 100% and eventually flattens out.

Try it in Python

You don’t need enormous factorials to calculate the exact model probability. Multiply the no-match factors directly:

from math import prod, comb, exp


def shared_birthday_probability(n: int) -> float:
    if n < 0:
        raise ValueError("The number of people must be non-negative.")
    if n > 365:
        return 1.0
    return 1 - prod((365 - k) / 365 for k in range(n))


n = 23
exact = shared_birthday_probability(n)
approx = 1 - exp(-comb(n, 2) / 365)

print(f"Pairs: {comb(n, 2)}")
print(f"Exact: {exact:.2%}")
print(f"Approximation: {approx:.2%}")

The output is 253 pairs, an exact probability of 50.73%, and an approximation of 50.00%. Try 10, 30, and 50 people before checking the chart. Does your intuition improve once you think in pairs?

One last comparison

Among 23 people, any pair sharing a birthday has a probability of about 50.73%.

But if you stand in a room with 22 other people, the chance that at least one shares your particular birthday is:

1 − (364/365)22 ≈ 5.86%

Same room. Different question. Very different answer.

That distinction is what I like about this puzzle. The mathematics is accessible, but it asks us to notice an assumption hiding in our first impression.

The surprise comes from counting people when we should be counting pairs.

The first reel. The first question. Plenty more to explore.

Follow jmnio math ↗