Three of the Strangest Paradoxes in Mathematics

A barber shaves all men who don’t shave themselves. Does he shave himself? Mathematics offers explanations for this and other curious contradictions

Impossible Penrose triangle w/ orange blue and purple sides on brown background

Ner1/Getty Images

Sometimes your gut feelings lead you astray—particularly in mathematics, in which one constantly comes across results that seem impossible. For example, infinity does not always equal infinity, and tortoises may outpace human athletes—at least from a certain mathematical point of view.

There are also many scenarios that appear contradictory at first glance (or second or third). These paradoxes can be explained, however. They are not errors but rather reminders that we should not rely too heavily on our intuition in mathematics. Here are three of the strangest paradoxes in the field.

Hilbert’s Hotel


On supporting science journalism

If you're enjoying this article, consider supporting our award-winning journalism by subscribing. By purchasing a subscription you are helping to ensure the future of impactful stories about the discoveries and ideas shaping our world today.


Imagine you are traveling to a city and have forgotten to book a room beforehand. Fortunately, you come across a beautiful hotel named after the famous German mathematician David Hilbert, whose work you greatly appreciate. You step up to reception and see that the hotel has an infinite number of rooms: the room numbers correspond to the natural numbers 1, 2, 3, 4, ... without ever coming to an end.

The receptionist tells you that the hotel is fully booked, however. But you know your way around math, so you don’t let yourself be fobbed off so easily. You know a trick that will allow you—and all the other endless guests—to find a room, too. You suggest to the receptionist that each guest move to the room numbered one higher than their current lodging. So the person from room 1 goes to room 2, the person from room 2 to room 3, and so on.

Because Hilbert’s hotel has an unlimited number of rooms available, even when fully booked, there is still room for more guests. And that’s not just the case for one person: the hotel could take in a whole busload of people who also wanted a room. In that case, the guests would have to move not just one but several room numbers away.

It gets stranger. Even if you bring an infinite number of people to Hilbert’s hotel, you can still accommodate them in the fully booked building. The guest in room 1 will have to move to room 2, the guest in room 2 to room 4, the guest in room 3 to room 6, and so on. As each person moves into a room with a number that is twice their current room number, an infinite number of odd-numbered rooms become available.

Sequences of numbers show how an infinite number of people could each be assigned a room in a hotel with an infinite number of rooms.

By moving each guest into a room with a number twice their current one, there is space for an infinite number of additional people.

Jan Beránek/Wikimedia (CC BY-SA 4.0), restyled by Amanda Montañez

Hilbert presented this supposed paradox during a 1925 lecture on infinity. The example illustrates that some concepts cannot be transferred from finite to infinite cases: the statements “every room is occupied” and “the hotel cannot take any more guests” are synonymous in the real world—but not in a world with infinities.

The Birthday Paradox

The next paradox is more familiar to many. When I was in school, it was not uncommon for several of my classmates to have birthdays on the same day. In fact, I shared a birthday with a classmate. At first it seems like a huge coincidence. After all, a year has 365 days (or 366 in leap years, but we’ll ignore that for the sake of simplicity), and a school class consists of around 20 to 30 students. Our gut feeling tells us that it therefore should be unlikely that two children in a class were born on the same day.

But it isn’t. In fact, the probability that two people in a group of 23 have the same birthday is more than 50 percent. To better understand this calculation, it helps to look not at the number of people but at the number of pairs of people. Among 23 people, (23 × 22)⁄2 = 253 pairs can be formed—and this number is greater than half of the number of days in a year. The probability that one pupil in a school class of 23 students was born on a particular date, however, is only 1 − [(365−1) ⁄365]23 = 6.1 percent.

The birthday paradox therefore arises from the fact that looking at pairs of students gives you a greater number of possibilities than looking only at individuals.

Line graph shows the probability that two people in a group share a birthday compared with the probability that one person in a group was born on a certain date.

The blue line indicates the probability that two people from a group (group size noted on the x axis) have the same birthday. The orange line corresponds to the probability that a person has a birthday on a certain date.

Toobaz/Wikimedia (CC BY-SA 4.0), restyled by Amanda Montañez

This fact has tangible effects in cryptography, for example. In digital contracts, “hash functions” are used: The document is converted into a character string (a “hash”) of a fixed length when it is signed. If even the smallest change is made to the original document, the hash that is formed from it is completely different. By keeping their hash, the signatory retains proof of what they originally signed—making the process tamper-proof. There is, however, an extremely low probability that two completely different documents will generate the same hash, and that poses a security risk.

As a rule, the length of the hash function is chosen so that such “collisions” (where two different data records produce the same hash) are extremely rare. A hacker can carry out a “birthday attack,” however: they can generate many different documents and compare their hash functions in pairs—just as a teacher might compare the birthdays of classmates instead of focusing on a specific date and a single student.

In practice, a birthday attack could look like this: I first create two contracts, V1 and V2. V1 is a fair contract, but V2 has wording that is in my favor. Then I change both contracts in various places: I add spaces, tabs and line breaks to create variations of V1 and V2. These changes are virtually invisible to a reader, but they drastically change the hash function of the documents.

If I compare the individual hash functions of the modified contracts V1 and V2 in pairs, I will find a matching hash much more quickly than if I specifically try to reproduce a particular hash (such as that of V1). If I find a matching pair of V′1 and V′2, I can give you the contract V′1 to sign but claim afterward that you signed V′2. Because both contracts generate the same hash, the fraud cannot be detected by digital signature software.

Russell’s Antinomy

British philosopher Bertrand Russell formulated a paradox in 1901 sometimes called Russell’s antinomy—a term for a statement that describes two seemingly contradictory ideas. Unlike Hilbert’s hotel and the birthday paradox, Russell’s antinomy is not a result that merely eludes our intuition. It contradicts the rules of logic per se. The antinomy produces statements that can be neither false nor true.

There are several examples that can illustrate Russell’s antinomy, but one frequently used case is the “barber paradox.” Suppose a barber shaves all the men in town who do not shave themselves—and only those men. Does the barber shave himself? If he shaves himself, then he no longer belongs to the group of people who do not shave themselves. But if he does not shave himself, then, by definition, he would have to shave himself (because all residents who do not shave themselves go to him).

This problem arises because of poorly defined sets. At the time that Russell presented his antinomy, a set generally referred to a collection of things: the natural numbers, for example, form a set, as do all inhabitants of the barber’s town who do not shave themselves. This definition allows sets to contain themselves or refer to themselves as a whole—and these properties lead to contradictions. This antinomy therefore led to the end of what mathematicians call “naive set theory.”

The foundation of mathematics continues to rely on set theory. But sets in this construct no longer are mere collections and instead must fulfill certain conditions. For example, sets must be composed of already existing sets and must not refer to themselves. These criteria rule out antinomies such as the barber paradox.

To put this idea in mathematical notation: people in town who can grow a beard and are men form a set M. That set includes the men who shave themselves and those who do not. Next, the set C includes all the barber’s customers. To form C, you have to follow the rules of modern set theory: if the barber is a man with a beard, or part of M, then the set of customers cannot be defined as “all male residents who do not shave themselves”—because in that case the definition would refer to itself with both the barber and the customers as part of M. Modern set theory simply does not permit such a definition. But if the barber is not part of M—for instance, if the barber is a woman or unable to grow a beard—then the definition is permitted.

We can now breathe a sigh of relief: the paradoxes have been solved, and mathematics is not doomed to failure. There is no guarantee that the mathematical rules will not at some point produce an unresolvable contradiction, however. Logician Kurt Gödel proved this in the 1930s—and in doing so made it clear that there is no certainty that mathematics will work forever in a self-contained way. The best we can do is hope that an unsolvable contradiction never arises.

This article originally appeared in Spektrum der Wissenschaft and was reproduced with permission.

Manon Bischoff is a theoretical physicist and an editor at Spektrum der Wissenschaft, the German-language sister publication of Scientific American.

More by Manon Bischoff
SA Special Editions Vol 34 Issue 4sThis article was published with the title “Three of the Strangest Paradoxes in Mathematics” in SA Special Editions Vol. 34 No. 4s (), p. 33
doi:10.1038/scientificamerican122025-5TrumnUAvSjJDO53xTd77R

It’s Time to Stand Up for Science

If you enjoyed this article, I’d like to ask for your support. Scientific American has served as an advocate for science and industry for 180 years, and right now may be the most critical moment in that two-century history.

I’ve been a Scientific American subscriber since I was 12 years old, and it helped shape the way I look at the world. SciAm always educates and delights me, and inspires a sense of awe for our vast, beautiful universe. I hope it does that for you, too.

If you subscribe to Scientific American, you help ensure that our coverage is centered on meaningful research and discovery; that we have the resources to report on the decisions that threaten labs across the U.S.; and that we support both budding and working scientists at a time when the value of science itself too often goes unrecognized.

In return, you get essential news, captivating podcasts, brilliant infographics, can't-miss newsletters, must-watch videos, challenging games, and the science world's best writing and reporting. You can even gift someone a subscription.

There has never been a more important time for us to stand up and show why science matters. I hope you’ll support us in that mission.

Thank you,

David M. Ewalt, Editor in Chief, Scientific American

Subscribe