๐ฅ The Room
๐ Statistics
๐ MATCH FOUND!
Two people share:
๐ฒ Monte Carlo Simulation
Run 1000 trials to empirically verify the paradox
Why 23 People Is All You Need
Two people share:
Run 1000 trials to empirically verify the paradox
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!
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.
Instead of counting matches, we calculate the probability that everyone is different:
Then:
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!
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!