Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

The birthday paradox: why 23 people is a coin flip

Chapters

Narration

There are three hundred and sixty five days in a year. So how many people do you need in a room before two of them share a birthday, with a fifty fifty chance? Have a number in your head. It is twenty three. Here is the trap, and everybody falls into it. You are asking: what are the odds that someone in this room shares my birthday? That is a low number, and your gut is right about it. But nobody asked about you. The question is whether any two of them match. And pairs do not grow like people do. Six people already make fifteen pairs. Twenty three people make two hundred and fifty three. Every one of those is a separate chance to collide. And because it is pairs, it climbs fast and then it stops being interesting. Forty one people gets you to ninety percent. Fifty seven gets ninety nine. Seventy people is a thousand to one, and seventy is nowhere near three hundred and sixty five. Now the part that matters. A hash function turns a file into a fingerprint. If two different files ever land on the same fingerprint, a signature can be lifted off one and pasted onto the other. That is called a collision, and this is exactly the arithmetic that decides how likely it is. So the next time you are in a room with about thirty people, the odds are better than even that two of them already share a birthday. Nobody in that room will believe you, and the reason is always the same: they are counting people, and the maths is counting pairs. Twenty three people. Two hundred and fifty three chances. Your intuition was not bad at arithmetic: it was answering a different question.

Based on the board The Birthday Paradox.

Try it in the labs: O(1) yaad and The birthday collision.

Covered in The Birthday Paradox.

Saved in this browser, and to your account when you sign in.