Any unevenness brings the match sooner
Worth reading first: Twenty-three people.
Twenty-three people is the answer for a year in which every day is equally likely to be somebody’s birthday, and no year is like that. Births bunch in late summer in much of the northern hemisphere, thin out at weekends wherever deliveries are scheduled, and avoid public holidays for the same reason. The calculation that produces twenty-three assumes all of that away.
The standard remark is that the assumption is conservative: unevenness can only make a shared birthday more likely, so twenty-three is an upper bound for real rooms. It is a claim worth checking rather than repeating, because it is not obvious in the way it sounds. An uneven calendar has busy days, where collisions pile up, and quiet days, where they become rarer. That the busy days always win — for every calendar, every room size, every shape of unevenness — is a theorem, and it has a short proof with a picture in it.
A swing of ten per cent either way is roughly the size of the seasonal effect in national birth records, and it moves the answer in the second decimal place. That is the first thing worth knowing: the famous number is robust. The second is the direction, which never reverses, and the rest of this essay is why.
The chance of no match, for any calendar
The even-year calculation deals people in one at a time and asks each to avoid the days already taken. That works because every day has the same weight, so “avoid taken days” has the same probability whichever days they are. On an uneven calendar it does not, and the product breaks.
The repair is to count configurations instead. Label the days to with probabilities . The chance that people land on different days, in some order, is the sum over every set of distinct days of the product of their probabilities, times the orders in which the people could have been assigned to them:
where is the elementary symmetric polynomial — the sum of all products of distinct ’s. It is the coefficient of in , which is how it is computed: multiply in one day at a time, keep the first coefficients, and the exact answer comes out for any calendar at all.
On an even year every is , the polynomial is , and times that is the familiar product . The figures hold the two computations to each other at every size they draw.
The weekly calendar is worth a second look, because it shows that the eye is a poor judge of which unevenness matters. The seasonal bars sweep dramatically across the year; the weekly ones are a fine comb that reads almost as noise. The comb does more. What decides the size of the effect turns out not to be how dramatic the pattern looks but how far each individual day sits from the average — and every weekend day in that calendar is a full fifth below it, while most seasonal days are within a few per cent.
Moving the share between two days
Here is the move the proof is built from. Take any calendar, pick two days and , and leave every other day alone. Their combined share is fixed; only the split between them changes.
Every term of contains both of those days, exactly one, or neither. So it can be written as
where the ’s are symmetric polynomials of the other days and do not move. The middle term sees only the sum, which is fixed. The last term sees neither day. The split enters only through the product , and a product of two numbers with a fixed sum is largest when they are equal.
The curve is a parabola because when the imbalance is written . Its second differences are constant and its top is at the even split, which the figure computes directly rather than trusting the algebra.
So evening out any two days never lowers the chance that everybody differs, and raises it strictly whenever the two were unequal and is positive — which it is whenever at least other days are possible at all. Read in the other direction: making any two days less equal never lowers the chance of a match.
From two days to the whole calendar
One move on two days is not yet a theorem about calendars, and the step from one to the other is where a hurried version of this argument goes wrong.
It is tempting to say: keep averaging pairs of days until the calendar is flat. Repeated averaging does drive a calendar toward uniform, but it never arrives in finitely many steps, and an argument that needs a limit needs continuity to carry the inequality across. It is available — is a polynomial — but there is a cleaner route that avoids the process altogether.
The set of all calendars on days is a closed, bounded region: non-negative numbers adding to one. A continuous function on such a region attains its maximum somewhere. Take a calendar where the chance of all-different is as large as it can be. If any two of its days were unequal, averaging them would make it strictly larger, contradicting maximality. So every pair is equal, which means the maximum is the even year and nowhere else.
That is the whole theorem. For every room size up to the number of days and every calendar, the chance of a shared birthday is at least the even-year value, with equality only on the even year. Twenty-three is therefore an upper bound on the threshold for any population whatever, and a room drawn from a real one needs twenty-three people or fewer.
Nothing in the argument mentions seasons, weekends or any particular shape. It never needed to. The only fact it uses is that the probability of all-different is a symmetric function that rewards balance between any two coordinates, and the same shape of argument settles the isoperimetric inequality by symmetrisation and Jensen’s inequality for averages. A function that improves every time two coordinates are pulled together is maximised where they all agree.
Comparing two uneven calendars
The theorem compares every calendar with the even one. It says nothing yet about two uneven calendars compared with each other, and the sweeps below draw curves that never fall as a calendar is made more lopsided — which is a stronger claim than the even year is the minimum, and needs a stronger reason.
The reason is that the two-day step proves more than was used. It does not need the two days to be made equal: moving any amount of share from the busier of two days toward the quieter one, without overshooting, moves the product toward its top and so never lowers the chance of all-different. A transfer of that kind — from richer to poorer, stopping before they swap places — is what economists call a Robin Hood transfer, and a calendar that can be reached from another by a sequence of them is said to be majorised by it.
So the result is a monotone statement along a whole partial order. If one calendar can be turned into another by Robin Hood transfers, the first produces matches sooner at every room size. A function with that property is called Schur-convex, and the chance of a shared birthday is one.
The seasonal family is an instance. A calendar with a swing of is exactly a mixture of the even year with the calendar whose swing is , taken in equal parts, and mixing any calendar with the even year is a sequence of Robin Hood transfers — every busy day gives some of its excess to every quiet one in proportion. So each calendar in the family majorises every smaller swing, and the chance of a match has to climb as the swing grows. The weekly family is the same argument in a less obvious form. Thinning the weekend moves share away from days that are already below average, which is the opposite of a Robin Hood transfer, so the comparison has to be read from the other end. Every calendar in the family gives one value to all 261 weekdays and another to all 104 weekend days, and calendars of that shape lie on a single line through the even year. The fuller weekend therefore sits between the even year and the emptier one — a mixture of the two — and a mixture with the even year is majorised by what was mixed. The emptier weekend wins, and the curve cannot fall.
Not every pair of calendars is comparable. A year that is busy in September and one that is busy on weekends cannot be reached from each other by transfers of this kind, and for such pairs the ordering of their answers depends on the room size and can in principle change as the room grows. Majorisation is a partial order, and the theorem is exactly as strong as the order is.
How far the answer moves
The theorem gives a direction. The size is a separate question, and the answer is that ordinary unevenness moves the threshold by very little, while extreme unevenness moves it a long way.
It takes a swing of forty per cent either side of the mean — a September with nearly two and a half times the daily births of a March — before a room of twenty-two has an even chance. Real seasonal variation is a small fraction of that, which is why measurements on birth records leave the answer at twenty-three.
The curve is also flat at its start, and that flatness is the more informative feature. A small swing changes the answer by an amount proportional to the square of the swing, not the swing itself. That is exactly what the two-day parabola predicts: at the even split the curve is at its top, where the slope is nought, so a small departure costs only a second-order amount.
The weekly sweep ends at a calendar that is simply shorter — 261 equally likely weekdays — and the even-year formula for 261 days gives a threshold of 20. The seasonal sweep ends at a calendar that is not a shortened year of anything, but it lands at nineteen, which is what an even year of about 243 days would give. That coincidence is the next thing to explain.
One number for any calendar
An even year of days has a threshold that depends only on . An uneven calendar has 364 free parameters. It would be surprising if a single number could stand in for all of them, and it very nearly can.
The quantity is the chance that two particular people share a birthday. Each lands on day with probability , so they match with probability
On an even year that is . On an uneven calendar it is larger, and the excess is exactly the calendar’s spread:
because the cross term sums to nought. So is a number of days — the size of an even year with the same pairwise collision chance — and it is at most , with equality only on the even year. Call it the effective number of days.
The reason it nearly determines the threshold is the pair-counting argument that explained twenty-three in the first place. A room of holds pairs, each matching with chance , and treating them as independent gives a chance of no match close to . The calendar enters that estimate only through the one sum. Everything else about its shape is a correction of higher order — involving the sums of cubes of the ’s, which govern three people landing together — and those corrections are small until the calendar is very lopsided.
The four that sit above the curve are the instructive ones. They are the calendars with a few very heavy days, where three people landing on the same day stops being negligible — and every one of them needs one more person than the effective count predicts, never one fewer. A heavy day makes triple coincidences common, and a triple is one event that the pair count had been counting three times, so the pair estimate is slightly optimistic about how soon a match comes.
The same sum, counting species and markets
The sum of squared shares has been invented independently at least three times, for three purposes that have nothing to do with birthdays, and in each it was chosen for the same reason.
In 1949 the statistician Edward Simpson proposed measuring the diversity of an ecological community by the chance that two individuals drawn at random belong to the same species. That is with species in place of days. Its reciprocal is used as the effective number of species — the number of equally common species that would give the same chance of a same-species draw — which is precisely the effective number of days above, applied to a meadow.
In economics the same sum, applied to the market shares of the firms in an industry, is the Herfindahl–Hirschman index, and competition regulators set their thresholds for scrutinising mergers in terms of it. A market with four equal firms scores a quarter and behaves, in this sense, like four firms; a market where one firm holds most of the trade scores near one and behaves like one.
And in cryptography it is the collision probability of a key source: a random number generator whose outputs are not quite uniform has a larger , and an attacker searching for two equal outputs needs about draws rather than the square root of the output space. That is why randomness has to be earned rather than assumed: a small bias costs little in any one output and shortens every collision search by exactly the factor above.
All three are asking the birthday question — how likely is it that two draws agree — and all three found that the answer is carried by one number that the even case makes as small as possible.
When pairs are the wrong thing to count
The proof above works for every room size, but the effective-days summary is a statement about pairs, and there are questions it gets wrong.
Three people sharing is governed by rather than , and two calendars with the same effective number of days can have quite different cube sums. A calendar with one enormous day and a calendar with a moderately uneven spread might both behave like 200 days for pairs while the first produces triple birthdays far sooner. The averaging argument still shows the even year is the worst case for triples, since is the right object for any , but the one-number shortcut does not transfer.
Near-birthdays — two people within a day of each other — depend on how the busy days are arranged, not just on their sizes. Put all the heavy days next to each other and near-matches become much commoner than if the same days were scattered. Nothing symmetric in the ’s can see that, and the averaging argument does not apply, because moving share between two days that are not neighbours changes the adjacency structure.
And dependence between people is outside the model entirely. Twins, or a room assembled from a school year, break the assumption that each person’s birthday is an independent draw from the calendar. The inequality says nothing about such rooms, and the direction of the effect is not fixed: a room of people born in one school year has a calendar confined to twelve months, which helps matches, but also skews away from the cut-off date, which may help or hinder depending on how the year is defined.
What a flat line of bars hides
Every calendar drawn above is a model, and saying so is not a formality. The seasonal cosine, the weekly comb, the blocks and the spikes are shapes chosen to exhibit the theorem, not measurements of any population, and their numbers should not be read as statements about any country’s births.
The effective-days figure also shows less than it seems to. Eighteen calendars, all sitting within one person of the curve, is evidence about eighteen calendars. That no calendar can sit two people above the curve is not proved here, and the four that sit one above show that the pair approximation is not exact; a sufficiently strange calendar — many medium-heavy days arranged so that the cube sum is large while the square sum is modest — might do worse.
And the averaging parabola is drawn on twelve slots and four people because a year of 365 days and a room of 23 produces a curve so flat that its top cannot be told from its ends at any printable scale. The algebra that makes the curve a parabola does not depend on the size, but the picture of it does, and the picture is of the small case.
Still open: which lopsided calendars are worst
The theorem fixes the best case for avoiding matches: the even year, uniquely. The opposite question is much less tidy. Among calendars with a given effective number of days, which one needs the largest room for an even chance, and by how much can it exceed the even-year value at that many days?
The figure suggests the excess is at most one person for anything resembling a birth record, and the reason offered — that the cube sum is what pushes a calendar above the curve — suggests the worst calendars concentrate their weight in a few very heavy days while keeping the square sum fixed. Whether the gap stays bounded as the calendar grows, or can be made as large as desired by a clever enough arrangement, is a question about the higher symmetric sums of a distribution with a prescribed second moment. It is a question about concentration of a count around its mean rather than about birthdays, and the figures here do not answer it.
A proof that never looks at the whole calendar
The argument is worth keeping for its shape more than for its conclusion. It never examines a whole calendar. It looks at two days at a time, shows that bringing them together always helps one side of an inequality, and lets compactness do the rest. That shape — improve locally, conclude globally at the maximiser — is how most inequalities that say the symmetric case is extreme are proved, from the arithmetic–geometric mean inequality to the coupon collector’s slowest calendar, where the same even distribution turns out to be the one that finishes the collection fastest.
The birthday version has the unusual merit that the local step can be drawn — a parabola with its top at the even split — and that its global conclusion is one a reader can check against a real room. Anyone expecting a lopsided calendar to spread people out has the direction backwards: busy days gather people together faster than quiet days keep them apart, and the gathering always wins.
Reads more easily once this is understood
Essays that name this one as worth reading first.
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- A collision that finds a factor — both name birthday problem, collision
- An average that never settles — both name independence, variance
- Sampling where the answer lives — both name independence, variance
- The average settles and the wobble does not — both name independence, variance
- The shape that averaging leaves alone — both name independence, variance
Named objects
A dashed tag is an object no other essay names yet.
Birthday problemCollisionComplementary countingConvexityIndependenceSymmetric functionVariance