Series Impossible paradoxes See the full series
Paradojas imposibles: La paradoja del cumpleaños

Impossible paradoxes: The birthday paradox

Have you ever found yourself at a party, surrounded by friends, and suddenly someone mentions that they share the same birthday as you?

Surprising, right? Now imagine being in a room with 23 people and someone bets that two people in the group share the same birthday. You'd probably think the odds are very low, but that's a mistake.

What seems like a rare phenomenon is actually much more common than you might imagine. The birthday paradox is one of those problems that challenges our intuition, showing us that probabilities are not always what they seem, and it's surprising how small crowds need to be for this coincidence to occur.

What does the paradox say?

The birthday paradox poses an intriguing question:

How many people do you need in a room for there to be a more than 50% chance that two of them share the same birthday?

Intuitively, many people would answer that there should be more than 183 people, as there are 365 days in a year, and it seems unlikely that with less than half that number, someone would share a birthday. However, the paradox shows that with only 23 people in a room, the probability that two of them share the same birthday is 50%. And if you increase the number to 57 people, the probability rises to 99%.

This phenomenon occurs because as the number of people increases, the number of possible pairs that can share a birthday grows rapidly. Instead of thinking about one person comparing their birthday with everyone else's, we are comparing all birthdays against each other, which creates many more opportunities for a match.

What does it intend to demonstrate on a physical or mathematical level?

Mathematically, the birthday paradox illustrates how the number of possible combinations grows exponentially when the number of elements in a set increases. In this case, the “set” is the days of the year (assuming 365 days), and the “elements” are the people. The increase in people generates more possible combinations of pairs that can share a birthday, explaining why the coincidence occurs more often than we might think.

The problem can be solved using a combinatorial probability formula that calculates the probability that none of the people share a birthday, and then subtracting from 1 to get the probability that at least two share the same birthday. The calculation uses the following ideas:

  • For the first person, any day can be their birthday, so the probability is 1.
  • For the second person, the probability that they do not share a birthday with the first is \(\frac{364}{365}\).
  • For the third person, the probability that they do not share a birthday with the first two is \(\frac{363}{365}\), and so on.

The general formula for the probability that there are no shared birthdays among n people is:

\(P(\text{no coincidence}) = \frac{365}{365} \times \frac{364}{365} \times \frac{363}{365} \times \cdots \times \frac{365 - (n-1)}{365}\)

The probability that there is a shared birthday is simply \(1 - P(\text{no coincidence})\).

What are its technical foundations?

The technical foundations behind the birthday paradox are based on combinatorics and conditional probability. The key is to understand that we are not asking about the probability that a specific person shares their birthday with another, but about the probability that any pair of people in the group share a birthday. As the number of people increases, the number of possible pairs of people grows exponentially, increasing the chances of a match.

The total number of possible pairs among n people is:

\(\binom{n}{2} = \frac{n(n-1)}{2}\)

That is, with 23 people, there are 253 possible pairs that could match in birthdays, increasing the likelihood that at least one pair shares a birthday.

Conclusions

The birthday paradox is a brilliant example of how human intuition can fail when it comes to probabilities. Although it initially seems unlikely that two people would share a birthday in a small group, the exponential growth in possible combinations makes coincidences much more common than we think. This phenomenon highlights the importance of using mathematics to analyze situations where our perceptions might be misleading.

Curiosities about the paradox

  • Although the calculation assumes that birthdays are evenly distributed across the 365 days of the year, in real life there are certain days that are more common for births, which would make the probability of coincidences even higher in certain contexts.
  • This paradox is part of a broader phenomenon known as the collision problem in cryptography. In the design of hash functions, for example, it is crucial to minimize “collisions,” where two different inputs produce the same output, a problem closely related to the birthday paradox.
  • An extended version of this paradox is known as the “anniversary problem,” which also includes situations with more than one “special event” per person, such as anniversary days or family holidays, increasing the chances of a coincidence.

Relationship of the paradox with the real world

The principle behind the birthday paradox has important applications in cryptography and computer security. In the context of hash functions, which are used in security systems and in blockchain, there is the problem of “collisions,” where two different inputs generate the same hash value. This problem is analogous to the birthday paradox, as the probability of a collision increases with the number of attempts. Therefore, designers of security systems must take into account the birthday paradox when creating hash functions robust enough to avoid frequent collisions.

Additionally, in social contexts, such as event planning, the paradox can help predict how many people are needed for a birthday coincidence to occur, which can surprise more than one organizer or attendee.

Frequently asked questions about the birthday paradox

What is the birthday paradox?

The birthday paradox is the probability result that just 23 people give better than even odds that at least two share a birthday. Most people guess it would take far more, often around 183, half the days in a year. It is called a paradox because the true number defies intuition, even though the math involves no logical contradiction at all.

Why does the birthday paradox work with only 23 people?

It works because what matters is the number of pairs, which grows much faster than the number of people. A group of 23 contains 253 different pairs, and each pair is a chance for a match. Assuming all 365 days are equally likely, the probability that at least two people share a birthday is 50.7%. With 30 people it rises to 70.6%, and with 41 it passes 90%.

How many people do you need for a 99% chance of a shared birthday?

You need 57 people for a 99% chance that at least two share a birthday, and 70 people push it to 99.9%. Absolute certainty takes 367 people, counting February 29, because of the pigeonhole principle. With more people than possible dates, at least two must repeat. Between 70 and 367 the probability keeps rising, but only in ever smaller decimal places.

What are the odds that someone shares my birthday?

The odds that someone matches your specific birthday are much lower than the odds that any two people match. In a group of 23, the chance that one of the other 22 was born on your day is only about 5.9%. You would need 253 other people to pass 50%. The paradox fools us because we instinctively think about our own birthday and overlook all the other possible pairs.

How do you calculate the birthday paradox?

The easiest route is to calculate the probability that nobody matches and subtract it from 1. The second person has 364 out of 365 ways to miss the first, the third has 363 out of 365, and so on. Multiply all those fractions for n people. For 23 people the product is 0.493, so the probability of at least one shared birthday is 1 minus 0.493, or 0.507.

What is a birthday attack in cryptography?

A birthday attack is a method for finding collisions in hash functions, meaning two different inputs that produce the same output. It uses the same pair-counting logic. For an n-bit hash, trying roughly 2 to the power of n/2 inputs gives a good chance of a collision, far fewer than 2 to the power of n. That is why a 256-bit hash offers about 128 bits of collision resistance.

Do real birthday patterns change the odds?

Yes, and they make a match even more likely. The textbook calculation assumes every day is equally probable. Real births cluster in certain months, and fewer scheduled deliveries happen on holidays and weekends. Mathematicians have proved that any uneven distribution of birthdays raises the probability of a shared one, so 23 people remain enough in practice.

Does the birthday paradox hold up with real data?

Yes, and soccer offers a neat test. At the 2014 World Cup each team registered 23 players, exactly the magic number. A BBC analysis found that 16 of the 32 squads had at least one pair of players sharing a birthday, precisely the half the theory predicts. You can try it yourself in any classroom or office with about 25 people.

Back to blog

Leave a comment