Imagine a classroom with 23 students. Ask "is there a pair among them who share a birthday?" and most people answer "no way — a year has 365 days." But work out the actual math, and that probability really does pass 50%. It clashes so sharply with intuition that this problem is called the birthday paradox. Despite the name, there's no logical contradiction at all — it's simply a spot where our intuition tends to go wrong.
The mistake usually happens because people picture "someone who shares my birthday." Finding someone who shares a birthday with one specific person really does take a huge number of people. But that's not what the problem is asking. Any two people at all, out of the 23, matching counts as success. The key is that what you should be comparing isn't "me versus everyone else" — it's "every possible pair."
With 23 people, the number of possible pairs is 23×22÷2 = 253 pairs. That's 253 separate chances to check "might these two share a birthday?" — so the probability that at least one of them hits climbs sharply. The real reason for the illusion is that while there are only 23 people, the number of pairs you have to compare is more than 10 times that.
The exact probability is calculated by first finding "the probability that no one matches," then subtracting that from 1. The first person's birthday never matches anyone yet (365/365); the second person has to differ from the first, so 364/365; the third has to differ from the first two, so 363/365... and so on — multiplying (365−i)/365 together n times gives you "the probability that no one matches." Carry this product out to 23 people and the value drops to about 0.493, or 49.3%; subtract that from 1 and the probability of a match comes out to about 50.7%.
If the numbers alone don't quite click, try thinking of it this way. With 5 people, the probability of a match is only 2.7%. But at 23 people it jumps to 50.7%, at 40 people it's 89%, and at 70 people it's 99.9% — nearly certain. The group only grew 14-fold, from 5 to 70 people, yet the probability shot up from 2.7% to nearly 100%. This happens because the number of pairs grows roughly as the square of the number of people.
On our activity page, you can change the number of people yourself with a slider and watch on a graph exactly how the theoretical probability changes, and compare a bar chart across different group sizes to see just how steeply the probability jumps around 23 people. There's also a simulation button for drawing actual random birthdays, so you can watch with your own eyes how the real match rate gets closer and closer to the theoretical value the more times you draw.