Drag the slider (or press ← →) to change the class size; press R to run a room, M for 1 000 rooms.
Where's the maths? This is probability — the branch of mathematics that measures how likely something is on a scale from 0 to 1. Each person on screen is given one birthday out of 365 equally likely days, so a single day is a simple event with probability 1/365. The surprise is about a pair: we are not asking whether anyone matches one chosen date, we are asking whether any two of them match, and a room of 23 people already hides 253 different pairs. The clean way to handle "at least one match" is to work out the opposite — everybody different — by multiplying probabilities one person at a time, then subtract from 1. That multiplication rule for independent events, and the complement rule P(at least one) = 1 − P(none), are exactly the tools in the syllabus. Running a thousand rooms then shows the law of large numbers: the measured fraction settles onto the calculated curve.
Beyond the syllabus: factorials and the general product formula.
Seat the people one at a time and ask each one to be different from everyone already seated. The 1st person may take any day: 365/365. The 2nd must dodge 1 day: 364/365. The 3rd must dodge 2 days: 363/365 — and so on. Because the birthdays are independent, these chances multiply:
P(no match) = 365/365 × 364/365 × … × (365−n+1)/365Every factor is a little smaller than the one before, so the product slides downhill fast. Then use the complement — the two outcomes "no match" and "at least one match" fill the whole sample space:
P(at least one shared birthday) = 1 − P(no match)At n = 23 the product falls just below 1/2, so P(shared) = 50.7 % — the 50 % crossing marked on the graph. By n = 41 it is 90 %, and by n = 60 it is over 99 %. The reason it happens so early is pairs: n people make n(n−1)/2 pairs, which is 253 pairs at n = 23 and 1 128 pairs at n = 48 — the count of chances grows like n², not like n.
Switch to “Same as YOU” and the maths changes completely: now only the pairs that include you count, so each other person misses your date with probability 364/365 and P(match) = 1 − (364/365)n−1. You need 253 other people to reach 50 %. That gap — 23 against 253 — is why the answer feels wrong: our intuition quietly answers the "same as me" question instead.
Drag the slider to set the class size · Run once fills the seats one by one · Run 1 000 rooms adds a measured point to the graph.
Gold: exact curve · blue dots: measured from simulated rooms.