โ† Back to Paradoxes

๐ŸŽ‚ The Birthday Paradox

Why 23 People Is All You Need

๐Ÿ‘ฅ The Room

0 people
200ms
Unique birthday
Birthday match!

๐Ÿ“Š Statistics

People in room 0
Possible pairs 0
Theoretical P(match) 0%

๐ŸŽ‰ MATCH FOUND!

Two people share:

๐ŸŽฒ Monte Carlo Simulation

Run 1000 trials to empirically verify the paradox

๐Ÿ“ˆ Probability Curve: P(at least one match) vs. Number of People

๐Ÿคฏ Why Does This Happen?

Most people guess you need around 183 people (half of 365) for a 50% chance of a shared birthday. But the real answer is just 23 people!

๐Ÿ’ก The Key Insight: It's About Pairs!

With 23 people, there are 253 possible pairs!
Formula: n(n-1)/2 = 23 ร— 22 รท 2 = 253

We don't ask "does anyone share MY birthday?" (that would need ~253 people for 50%). We ask "do ANY two people share A birthday?" โ€” and that creates exponentially more comparisons.

The Mathematics:

Instead of counting matches, we calculate the probability that everyone is different:

P(all different) = 365/365 ร— 364/365 ร— 363/365 ร— ... ร— (366-n)/365

Then:

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

At n=23: P(match) = 1 - 0.4927 = 50.73%

Think of it like this: maintaining uniqueness across 253 comparisons is like flipping a slightly-biased coin 253 times and getting heads every time. Each individual comparison is likely to succeed (364/365 = 99.7%), but multiplied together, the odds plummet!

๐Ÿ” Real-World Application: Cryptography

The "Birthday Attack" exploits this paradox to find hash collisions. If a hash function has N possible outputs, you only need about โˆšN inputs to have a 50% chance of finding two that hash to the same value!