Generator

When a shared birthday becomes likely

A generator in the probability library, called 29 times across 7 essays. Below: what it draws with nothing chosen and at each mode an essay asks for, what it checks while drawing, and everywhere it is used.

birthday is one function. Everything below came out of it during this build, at parameters taken from the essays rather than invented for this page — so a figure here is the same figure a reader meets in an essay, and if the generator changes, this page changes with it.

With nothing chosen

When a shared birthday becomes likely. The chance that some pair in a group shares a birthday, against group size. It passes a half at 23 people, where the probability is 50.7%.

The walk x² + 1 modulo 337, drawn as the letter ρ

The walk x² + 1 modulo 337, drawn as the letter ρ. Starting at 2 and squaring and adding 1 modulo 337, the walk visits 8 values once on a tail and then runs round a cycle of 11 values for ever.

How long x² + 1 runs before repeating, over 400 primes

How long x² + 1 runs before repeating, over 400 primes. For 400 primes the length of the walk x² + 1 before its first repeated value, in units of √p, drawn as the share still unrepeated against e^(−t²/2), the birthday curve for a function chosen at random. The two differ by at most 3.6 percentage points.

Pollard's method splitting 8051

Pollard's method splitting 8051. A table of 3 steps of Pollard's rho method on 8051: the tortoise and hare values, the same values reduced modulo 83 and 97, and the greatest common divisor of their difference with 8051, which stays 1 until step 3 and then returns 97.

What Pollard's method costs, against the smaller prime

What Pollard's method costs, against the smaller prime. Steps to the first factor for 60 products of two primes, plotted against the smaller prime on logarithmic axes. The points follow a line of slope 0.47, close to the one half of √p.

Nobody alone: a half at 3,064 people

Nobody alone: a half at 3,064 people. The probability that no person in a room has a birthday unshared by anyone else, against the number of people, exactly and by a Poisson estimate.

What it checks while it draws

Collected by running the family and recording what it asserted, not written here. The count is how many separate times the claim was put to the test while these drawings were made.

Where it is called

Every figure on this list is drawn by the same rule, so a change to the rule changes all of them at once. That is why the list is published.

Probability

A collision that finds a factor

A walk through the remainders modulo a number must eventually repeat, and it repeats modulo each hidden prime factor long before it repeats modulo the number. Pollard saw that the earlier repeat can be detected without knowing the prime — and that its timing is the birthday problem, so the cost is the square root of the factor.

Probability

A room where nobody is alone

Twenty-three people probably include two who share a birthday. How many are needed before every single person shares a birthday with somebody else in the room? The answer is 3,064 — more than it takes for every day of the year to be somebody's birthday — and the reason is a count of loners, which rises as the room fills, peaks at 134 when the room is the size of the year, and then falls so slowly that the last loner lingers for thousands of arrivals.

Probability

Any unevenness brings the match sooner

Real birthdays are not spread evenly across the year, and every such departure pushes the famous twenty-three down rather than up. The proof is one move on two days at a time, and what it leaves behind is a single number — the one ecologists use to count species.

Probability

Fourteen people within a day

Twenty-three people probably include two with the same birthday. Fourteen probably include two whose birthdays are at most a day apart, and seven, two within a week. The near miss has an exact formula, found by a trick that takes k days away after every birthday and turns the question back into the plain one on a shorter year, and the pattern behind every threshold is a single square root: a window of k days either side makes each pair 2k + 1 times as likely to collide.

Probability

How long until every one turns up

Draw at random from six equally likely kinds until all six have appeared. The wait is not six draws, and it is not sixty; it is fourteen point seven, and the number is a harmonic sum wearing a hat.

Probability

Nobody gets their own hat

Hand back a pile of hats at random and ask for the chance that not one person gets their own. The answer barely moves as the crowd grows — it is a third and a bit at four people, and a third and a bit at four thousand.

Probability

Twenty-three people

A room needs 253 people before someone probably shares a birthday with you. It needs 23 before two of them probably share one with each other. The gap between those numbers is the whole problem.

The whole library · What the figures prove