On this page
Imagine checking into a hotel where every single room is occupied. The front desk clerk turns you away because the building is full. But in January 1925, during a winter semester lecture course at the University of Göttingen (Ewald & Sieg, 2013), German mathematician David Hilbert (1862–1943) introduced a thought experiment: a Grand Hotel with countably infinitely many rooms, numbered 1, 2, 3, 4, and onward without end.
Transcribed by assistant Lothar Nordheim under the title *Über das Unendliche* and popularized by George Gamow in 1947, the thought experiment asks what happens when a newcomer arrives at a full hotel. Instead of turning them away, the manager accommodates them without removing anyone.
How can a fully booked infinite hotel make room for new guests?
In any ordinary hotel with a finite number of rooms, the Pigeonhole Principle applies: if n rooms contain n guests, inserting an additional guest requires either putting two people in one room or turning someone out. In Hilbert's Hotel, the manager simply announces that every guest currently in room n must move to room n + 1.
Guest 1 moves to room 2, guest 2 to room 3, and generally occupant n relocates to room n + 1. Because there is no final room, every existing guest keeps a room, leaving room 1 vacant for the newcomer. The shift scales to any finite group of k arrivals:
Guest in room n moves to room n + k.
Rooms 1 through k become vacant.
The k newcomers occupy rooms 1, 2, ..., k.
This shift illustrates the definition of infinity introduced by Richard Dedekind in 1888 (Stanford Encyclopedia of Philosophy). In finite arithmetic, adding 1 to a quantity strictly increases its count. In transfinite set theory, the natural numbers ℕ and the subset starting from 2 share the exact same cardinality: ℵ₀ + 1 = ℵ₀.
How does the hotel accommodate an infinite bus of new arrivals?
The challenge expands when an infinitely long bus pulls up carrying countably infinitely many passengers, with seat numbers 1, 2, 3, and so on. The hotel is still completely full.
Rather than shifting by one door, the manager instructs every guest in room n to move to room 2n:
The guest in room 1 moves to room 2.
The guest in room 2 moves to room 4.
The guest in room 3 moves to room 6.
All existing guests now occupy the even rooms (2, 4, 6, ...). This leaves every odd room (1, 3, 5, ...) vacant. The manager assigns bus passenger m to room 2m − 1: passenger 1 takes room 1, passenger 2 takes room 3, and every traveler receives a room.
This resolves a puzzle Galileo Galilei examined in his 1638 dialogue *Two New Sciences* (Galileo, 1638). Galileo noticed that while perfect squares form a small subset of integers, every integer pairs uniquely with its square, leading him to conclude that comparisons like "greater" or "equal" fail for infinity. Hilbert's Hotel shows that through bijections, countably infinite sets combine without contradiction: ℵ₀ + ℵ₀ = ℵ₀.
What happens when infinitely many infinite buses pull up?
The manager's greatest logistical hurdle arrives with an endless convoy of infinite buses: Bus 1, Bus 2, Bus 3, ..., each filled with infinitely many passengers. How can a single full hotel house infinitely many infinite crowds at once?
The manager resolves this with a prime-power protocol using Euclid's Fundamental Theorem of Arithmetic:
Current guests in room n move to room 2ⁿ (rooms 2, 4, 8, ...).
Passengers from Bus 1 take powers of 3: passenger m takes room 3ᵐ (rooms 3, 9, 27, ...).
Passengers from Bus 2 take powers of 5: passenger m takes room 5ᵐ (rooms 5, 25, 125, ...).
Passengers from Bus k take room (pₖ₊₁)ᵐ, where pₖ₊₁ is the (k+1)-th prime.
Because prime factorisation is unique, no two guests share a room. Rooms like 6 and 10 remain empty, but every passenger receives a bed: ℵ₀ × ℵ₀ = ℵ₀.
Where does Hilbert's Hotel finally run out of room?
Hilbert's Hotel accommodates any countable collection of arrivals. But what happens if an uncountably infinite group tries to check in—such as a bus carrying every real number on the continuous interval between 0 and 1?
Here, the hotel genuinely fails. In his 1874 breakthrough paper in Crelle's Journal (Cantor, 1874), Georg Cantor proved that the real numbers cannot be placed in a one-to-one correspondence with the natural numbers. As detailed in Georg Cantor's discovery that infinities come in different sizes, the continuum has cardinality 2^(ℵ₀), which is strictly greater than ℵ₀. No rearrangement of countably infinite rooms can house the continuous real numbers.
In a 1925 address in Münster and a 1926 paper in *Mathematische Annalen* (Hilbert, 1926), Hilbert defended Cantor's work: "No one shall expel us from the paradise that Cantor has created for us." He saw set theory as a foundational advance, reflected across David Hilbert's famous 23 problems of 1900.
Why does this thought experiment matter for students today?
In the Indian school syllabus, students first study set theory and mappings in the Class 11 sets and relations curriculum. A standard theorem for finite sets states that an injective (one-to-one) function from a set to itself must also be surjective (onto). If you assign n people to n rooms injectively, every room is filled.
Hilbert's Hotel shows why this intuition fails for infinite sets. The shift function f(n) = n + 1 is injective, yet it is not surjective on ℕ because 1 has no pre-image. For infinite sets, injectivity does not imply surjectivity.
When students encounter transfinite sets and relations, misunderstandings usually stem from finite instincts. In the Fermi Concept Library, every concept across mathematics and set theory has its own dedicated lesson, placing abstract definitions into visual context so students can see why functions behave differently across infinite domains.
When practicing proofs on mappings and sets, working step-by-step through why a function is injective or surjective prevents subtle mistakes. The Fermi Problem Library features worked problems with a step-by-step solver that explains the reasoning rather than just printing an answer.



