Problem #88 EASY
The Probability of Two Strangers Sharing a Birthday
Paradox Probability Combinatorics Statistics
Problem Statement
You walk into a room of 23 strangers. Someone bets you ₹100 that at least two people in the room share the same birthday. You think: 365 days in a year, only 23 people — surely the odds are against them. You take the bet. Who wins? Now here is the follow-up that makes it even stranger: how many people do you need before the probability of a shared birthday exceeds 99%?
Answer & Quick Explanation
Think you've got it? Click below to check your answer.
With 23 people: P(shared birthday) ≈ 50.7% — the bet-maker wins. For 99% probability: only 57 people are needed. The reason: 23 people create 253 pairs, each with a 1/365 chance — these accumulate past 50% far earlier than intuition suggests.
WOW Moment:
- 23 people -> 50.7% chance of a shared birthday.
- 30 people -> 70.6% chance.
- 50 people -> 97.0% chance.
- 57 people -> 99.0% chance.
- 70 people -> 99.9% chance.
- In a room of just 70 people, you need 999 bets to expect even ONE room with no shared birthdays.
- There are 8 billion people on Earth. The chance that YOU share a birthday with someone in a group of 253 random strangers exceeds 50%. But that is the wrong question — pairs are the right question.
Detailed Editorial Solution
Want to see the step-by-step breakdown? Click below to reveal the editorial.
The Birthday Paradox is one of probability's most famous counterintuitive results. The conflict between human intuition and mathematical reality comes from how we frame the problem.
Why our intuition fails:
When we enter a room of 23 people, we instinctively think about the probability of someone sharing *our* birthday. The probability that any specific person shares a birthday with you is small (1/365). For 23 people, the probability that someone shares *your* birthday is only about 6.1%.
Why the math is different:
The bet is not about someone sharing *your* birthday; it is about *any two* people in the room sharing a birthday. Instead of comparing 23 people to 365 days, we must look at the number of unique pairs we can form from 23 people.
The number of pairs is given by the combination formula:
Pairs = C(23, 2) = (23 × 22) / 2 = 253 pairs.
Each of these 253 pairs has a 1/365 chance of sharing a birthday. Although the pairs are not completely independent, the probability of at least one collision accumulates rapidly.
Let's calculate the exact probability of no shared birthdays (the complement):
- The 1st person can have any birthday.
- The 2nd person must have a different birthday: 364/365.
- The 3rd person must have a different birthday from both: 363/365.
- The nth person must have a different birthday from all previous: (365 - n + 1)/365.
Multiplying these probabilities together for n = 23:
P(All 23 different) = (365/365) × (364/365) × ... × (343/365) ≈ 0.4927.
Therefore, the probability of at least one shared birthday is:
P(At least one match) = 1 - 0.4927 = 0.5073 (or 50.73%).
To explain the WOW part:
- With just 57 people, the number of pairs is C(57, 2) = 1,596. This massive number of pairs drives the probability of a match to 99.01%.
- With 70 people, the pairs grow to 2,415, pushing the probability of a match to 99.9%. This means it is virtually certain that a match exists, making a room of 70 people without a shared birthday an extreme statistical anomaly.