I used to have an uneasy relationship with mathematics. I had long been a bit put off by math’s condescending demeanor, and by its tendency to micromanage every tiny detail of my universe. But over time I have come to the realization that math is not the problem. Humans are the problem(s).

Consider the following example: If you’re sitting in a room with 40 people in it, how likely is it that two of those people share a birthday? For simplicity’s sake, for this exercise we’ll ignore leap years, and assume that birthdays are evenly distributed throughout the year. What are the statistical odds that two of those 40 people were born on the same day of the same month?

A reasonable, intelligent person might rightly point out that the odds don’t reach 100% until there are 366 people in the room. After all, it is possible (though very unlikely) that the first 365 people each have a different birthday, so to reach 100% certainty it is necessary to have more people than there are days in a year. This is correct.

The same reasonable, intelligent person might then calculate that 40 is about 11% of 366, therefore can one estimate that the odds of two people in 40 sharing a birthday are about 11%? This reasonable-looking extrapolation is far from correct. In reality, due to the way that mathematics deviates from human intuition, the odds of two people in 40 sharing a birthday are about 90%. This phenomenon is known as the Birthday Paradox.

Even more startling, if the set of people is increased to 60, the likelihood of birthday overlap climbs to above 99%. This means that with only 60 people in a room, even though there are 365 possible birthdays, it is almost certain that two people have a birthday on the same day.

It’s tricky to explain the phenomenon in a way that feels intuitive. Consider the real underlying question: “How many possible pairings are in our set, and given that number, how likely is it that one or more pairs have the same birthday?” The formula to calculate the number of possible unique pairs in a set is n * (n-1)) / 2, where n is the number of people. Therefore, n = 40 gives us 40 * 39 / 2 = 780. It feels more intuitive that one of 780 couples would likely share a birthday, and crunching the numbers, the trend becomes clear:

n Possible pairings Probability of at least 1 shared birthday
0 0 0%
10 45 11.614023654879%
20 190 40.622945949247%
30 435 69.681629995395%
40 780 88.233563098422%
50 1,225 96.529148675144%
60 1,770 99.221821960151%
70 2,415 99.867390740453%
80 3,160 99.982824054691%
90 4,005 99.998309094385%
100 4,950 99.999873476848%
110 5,995 99.999992804308%
120 7,140 99.999999688952%
130 8,385 99.99999998978%
140 9,730 99.999999999745%
150 11,175 99.999999999995%
160 12,720 99.999999999999%
99.999999999999%
366 66,795 100%

So does this mean that you can walk into a classroom of 40 students, bet them that at least two people in the room share a birthday, and win 90% of the time? Almost, but not exactly. In real life, where math is isn’t always welcome in polite company, birthdays are not distributed perfectly throughout the year. More people are born in fairer weather months, and seasons differ depending on one’s latitude and elevation⁠—these factors create perennial dips and rises in birth rates. Also, as a result of the way that hospitals operate (e.g., induced labor, cesarian sections), fewer babies are born on weekends and holidays, which further complicates the problem. Twins, triplets, etc. also contribute to an imperfect distribution. Depending on the group of people and how evenly distributed their birthdays are, the results can vary. But most of the time, given a mostly random group, you’ll probably win that bet.

Imperfection among biological birthdays aside, there is at least one highly practical application for this numerical phenomenon: computer hacking. There is a classic cryptographic computer attack known as the “birthday attack” which exploits the math of the birthday paradox. Using this method, a programmer can precalculate and store the results of the birthday math in memory to decrease overall processing time when doing certain computationally useful things, such as attempting to crack a digital signature. The details are fairly impenetrable for those who are neither hackers nor mathematicians, but the usefulness of the technique is well documented.

On the subject of birthdays and multiplying, it turns out that a one followed by fifty-one zeros is called one sexdecillion. I knew those mathematicians were hiding something in those big numbers.

If all of this is giving you a bit of a headache, just divide by zero and math will leave you alone for a little while. Probably.

Editor’s Note: This article has been revised for clarity and tone since its original publication, so some of the comments below may seem nonsensical. Some of them were nonsensical anyway, so it’s hard to tell.