MATHEMATICS PUZZLES · EPISODE 5 OF 10 · 11 min

Why do 23 people probably share a birthday?

Here's a bet. Walk into a room of 23 people, chosen at random, and offer even money that two of them share a birthday. Not your birthday, just any two people, same day and month. With 365 days to choose from, it sounds like a terrible bet. So should you take the bet at 23?

▶ Watch on YouTubePlay the whole Mathematics Puzzles series ▶

The full story

This is the episode's narration, word for word. Headings jump to that point in the video.

The bet 0:00

Here's a bet. Walk into a room of 23 people, chosen at random, and offer even money that two of them share a birthday. Not your birthday, just any two people, same day and month. With 365 days to choose from, it sounds like a terrible bet. So should you take the bet at 23?

The question your gut hears 0:23

Here's what most people's gut is actually working out: will someone share my birthday? Each other person has 364 chances in 365 of missing your birthday, and the chances are independent, so they multiply. With 22 other people in the room, the chance that at least one of them lands on your day is only about 6%. On that question, the gut is right, and you'd lose the bet.

A student in Manchester 0:52

The puzzle has a slippery history. Around 1927, a Manchester maths student named Harold Davenport showed it to George Tyson, or so Tyson remembered when he wrote it down in 1983. Davenport went on to Cambridge and a long career in number theory. As far as anyone has found, he never published the puzzle himself, and he never claimed it as his own.

How many to match you? 1:20

So how many people would you need for an even chance that someone shares your birthday? You might guess half of 365, about 183. The real answer is 253. Why so many? Because their birthdays land on each other as well as on yours. Throw 253 people at a calendar and, on average, they only cover about 183 different days, the half a year your gut was picturing.

Every pair is a chance 1:54

But the bet wasn't about you. It was about any two people, and that changes everything. A match can happen between any pair in the room. Person one can pair up with 22 others. Person two with 21 new ones, person three with 20, all the way down to one. Add those up and 23 people make 253 pairs. Same number as before, and that's not entirely luck.

Why 253 twice 2:25

In both questions, you're making about 253 attempts at a one-in-365 coincidence, which is just enough to make a hit about as likely as a miss. In the first question, every attempt involves you. In the second, they're spread across the whole room. The pairs overlap, though, so that's an estimate, and for the exact answer we need a cleaner way to count.

The man who couldn't believe it 2:52

Decades later, the puzzle historian David Singmaster wrote to Davenport's widow, Anne, about Tyson's story. She wrote that, as she and her son understood it, he didn't claim to be its discoverer because he could not believe it had not been stated earlier. Singmaster also asked Coxeter, a friend of Davenport's from Cambridge, and Davenport's former student C. A. Rogers. Neither of them thought Davenport had invented it.

Why you can't just add 3:27

Here's the tempting shortcut: add up 253 one-in-365 chances. You get about 0.69. But that's the average number of matching pairs, not a probability, and with 28 people the shortcut tops 100%. The pairs aren't either-or: Anna and Ben can match in the same room where Chloe and Dan match too, and adding counts that room twice.

Flip the question 3:57

So turn the question inside out. "At least one match" is messy: it could be one pair, two pairs, three people on the same day. Its opposite is simple: everyone has a different birthday. Every possible room is one or the other, so their chances add up to exactly one. Mathematicians call that opposite the complement. Work out the easy one, take it away from one, and you've got the hard one.

Seating the room 4:26

Now let people into the room one at a time. The first person can have any birthday. The second must avoid one day, so they're safe 364 times in 365. The third must avoid two days: 363 in 365. Keep going, and the twenty-third person must dodge 22 birthdays already taken: 343 in 365. Each step is a chance given that everyone so far is different, and because birthdays don't influence each other, you can multiply that chain of chances together.

Fifty point seven 5:07

Multiply them out and the chance that all 23 birthdays are different comes to 0.4927, a little under a half. So the chance of at least one shared birthday is 0.5073: 50.7%. With 22 people it's 47.6%, so 23 is the smallest room where the bet is in your favour. Take the bet. It's a slight edge, but it's yours.

Two 1939s 5:39

The first printed version Singmaster found is in the 1939 edition of a famous puzzle book, Rouse Ball's Mathematical Recreations and Essays, edited by Coxeter, which credits Davenport. That same year, Richard von Mises published a paper on shared birthdays in Istanbul.

Who gets the credit 6:04

Some books name von Mises as the first to publish the birthday problem, starting with William Feller's 1957 probability textbook. But Singmaster, who read the paper, says von Mises worked out how many shared birthdays to expect in a group, not the 23, so Feller's credit was a mistake. So the fairest version is this: often credited to Davenport, the usual puzzle first printed in 1939, and nobody can show who thought of it first.

Why it sneaks up on you 6:40

Why does it surprise us? Because people grow one at a time, but pairs grow much faster. Ten people make 45 pairs; 50 make 1,225. So the chance climbs fast: 12% at ten people, 71% at 30, and 99% by 57. A rough rule: for an even chance, you need about one and a fifth times the square root of the number of days.

The fine print 7:10

That 50.7% rests on three assumptions. Every day is equally likely to be a birthday, there's no 29 February, and everyone's birthday is independent of everyone else's. Real life breaks all three. But here's the surprise: lumpy birthdays can only make a match more likely, never less. If more people are born on some days than others, they crowd onto those days, and collisions get easier.

Australia's birth calendar 7:41

So what does the Australian Bureau of Statistics say? Across the ten years from 2012 to 2021, there were just over three million births in Australia. Per day, February and March were the busiest months, about 3% above average, and December the quietest, about 5% below. The United States publishes daily figures, and there, Christmas Day has about 43% fewer births than an average day, and mid-September up to 12% more.

Does 23 survive? 8:15

Put the real calendars into the same calculation. Adding 29 February, at a quarter of an ordinary day's weight, nudges the chance for 23 people down to 50.69%, because it adds a rarely used extra day. Australia's uneven months, added on top, push it back up to 50.70%; America's daily pattern gives 50.79%. Every version still crosses 50% at exactly 23. Twins are a different story: in Australia, about one baby in every 35 is a twin or more, and one pair of twins in the room almost guarantees a match.

Fingerprints for files 9:01

Now swap birthdays for something that matters. Computers fingerprint files with a hash function, which turns a message of any length into a short code of fixed length. Two different files with the same code is a collision, and a good hash makes collisions practically impossible to find. But it's the birthday problem again. A short 32-bit code, like a simple checksum, has about 4.3 billion possible values, yet among just 77,000 files there's an even chance of a collision.

How to swindle Rabin 9:37

In 1979, Gideon Yuval published the attack, in a cheekily titled paper, How to Swindle Rabin, though others, like Ralph Merkle, had seen the danger too. Write a fair contract and a crooked one. Make enormous numbers of versions of each that differ in invisible ways, like a tab instead of a space. Hash them all and look for a fair version and a crooked version with the same fingerprint. Get your victim to sign the fair one, and because a digital signature signs the fingerprint, it fits the crooked one too.

Half the bits 10:17

That's called a birthday attack, and it's why security standards halve the numbers. The US standards agency, NIST, says a hash with 256 bits only gives you 128 bits of protection against collisions. So to get 128 bits of protection against collisions, you need a 256-bit hash.

Two questions 10:41

So 23 people probably share a birthday because 23 people make 253 pairs, and the gut only counts the ones involving you. The same trick decides how long a fingerprint must be. But a fingerprint is just what gets signed. The signature comes from a special kind of lock, one anyone can close but only you can open, used the other way round, so only you can sign and anyone can check. The first practical version, called RSA, is built from two huge prime numbers. So why do prime numbers keep your bank account safe?

Sources

Every factual claim in the episode is tied to one of these. Spotted an error? Tell us.

  1. Eric W. Weisstein, "Birthday Problem", MathWorld, Wolfram Research — mathworld.wolfram.com
  2. OpenStax, Introductory Statistics 2e, section 3.2 "Independent and Mutually Exclusive… — openstax.org
  3. David Singmaster, Sources in Recreational Mathematics: An Annotated Bibliography,… — puzzlemuseum.com
  4. J. J. O'Connor and E. F. Robertson, "Harold Davenport", MacTutor History of… — mathshistory.st-andrews.ac.uk
  5. OpenStax, Introductory Statistics 2e, section 3.1 "Terminology" (complement of an event) — openstax.org
  6. W. W. Rouse Ball, Mathematical Recreations & Essays, 11th ed., revised by H. S. M.… — lccn.loc.gov
  7. Australian Bureau of Statistics, Births, Australia, 2024 (released 15 October 2025) — abs.gov.au
  8. Australian Bureau of Statistics, Data API: dataflows BIRTHSMONTHOCCURRENCE (births… — data.api.abs.gov.au
  9. US Social Security Administration daily births 2000 to 2014, as republished by… — github.com
  10. Quynh Dang, NIST Special Publication 800-107 Revision 1, Recommendation for… — nvlpubs.nist.gov
  11. A. Menezes, P. van Oorschot and S. Vanstone, Handbook of Applied Cryptography (CRC… — cacr.uwaterloo.ca
  12. A. Menezes, P. van Oorschot and S. Vanstone, Handbook of Applied Cryptography,… — cacr.uwaterloo.ca
  13. NIST Computer Security Resource Center, "Hash Functions" project page (holds the… — csrc.nist.gov
  14. A. Menezes, P. van Oorschot and S. Vanstone, Handbook of Applied Cryptography (CRC… — cacr.uwaterloo.ca

Image credits

  • illustration (AI-generated), not the actual room
  • illustration (AI-generated)

Researched and scripted with AI assistance, fact-checked claim by claim, with synthetic narration and diagrams drawn in code. How we make episodes.

More from Mathematics Puzzles