The birthday paradox
Slide n, the number of people in a room. Each time you move it the computer fills 1000 random rooms with n birthdays and counts how many rooms have at least one shared birthday. That fraction appears as an orange dot; the dark curve is the exact probability. Press Simulate every n to fill in the whole curve with dots. Find where the curve crosses one half, and notice how few people that takes.
exact probability fraction of 1000 simulated rooms one half
One of the simulated rooms: the 365 days of the year, with a tick for each birthday. A shared day is drawn tall and orange.
What's going on
Ask the opposite question: what is the chance that nobody shares? The first person can have any birthday. The second must avoid 1 day: 364/365. The third must avoid 2: 363/365. Multiply all the way to the n-th person, who must avoid n − 1 days. For n = 23 that product is about 0.493, so the chance of at least one match is about 0.507, just over a half.
The reason it feels wrong is that you are picturing your birthday matching someone's. That needs about 253 people to be a coin flip. But a match between any two people is a different question: 23 people make 253 pairs, and each pair is a chance.
The dots jitter around the curve because 1000 rooms is a sample. Press the simulate button a few times at the same n and watch how far the dot wanders: about ±0.03. That wobble is itself a lesson about what a thousand trials can and cannot tell you.
Sheet: The birthday paradox. See also Dice for more probability by experiment.