Hilbert's Hotel Paradox Calculator

Enter a scenario for the fully-booked, countably infinite Hilbert's Hotel to see which room an existing guest moves to and which room a new guest receives.

Quick Facts

Finite group (k guests)
n → n + k
Existing guest shifts up by k rooms; new guest j moves into room j.
One infinite bus
n → 2n, guest j → 2j − 1
Existing guests take even rooms, freeing all odd rooms for new arrivals.
Infinitely many infinite buses
n → 2ⁿ, bus i guest j → p_i^j
p_i is the i-th prime from 3 up (3, 5, 7, 11, ...); unique prime factorization prevents collisions.

Your Results

Calculated
Existing guest's new room
-
Where the room-n occupant moves to
New guest's room
-
Room assigned to the new arrival
Formula used
-
Mapping applied for this scenario
Rooms freed
-
Which rooms became available

Ready

Choose a scenario and press Calculate.

How Hilbert's Hotel Paradox works

Hilbert's Hotel, introduced by mathematician David Hilbert, is a hotel with a countably infinite number of rooms numbered 1, 2, 3, ... and every room is occupied. The paradox is that even when "full," the hotel can always make room for more guests — one more, infinitely many more, or even infinitely many infinite groups more — by relabeling which room each guest occupies. This calculator computes the actual room-reassignment formulas for the three classic versions of the paradox.

Formula and method

All three scenarios work by defining an injective (one-to-one) function that reassigns every existing guest to a new room, freeing up exactly the rooms the new guests need:

  • Finite group of k new guests: shift every existing guest from room n to room n + k. This vacates rooms 1 through k, so new guest number j (for 1 ≤ j ≤ k) simply checks into room j.
  • One infinite bus of new guests: shift every existing guest from room n to room 2n (the even rooms). This vacates every odd-numbered room, so new guest number j checks into room 2j − 1.
  • Infinitely many infinite buses: shift every existing guest from room n to room 2ⁿ. For bus i, guest j checks into room p_i^j, where p_i is the i-th prime number starting the count at 3 (so p_1 = 3, p_2 = 5, p_3 = 7, p_4 = 11, ...). Because every positive integer factors into primes in exactly one way (the Fundamental Theorem of Arithmetic), no two guests — old or new, from any bus — are ever assigned the same room.

Why this demonstrates countable infinity

These formulas show that adding a finite number, or even countably infinitely many countably infinite groups, of guests to a countably infinite set does not increase its size — the result is still a set that can be listed 1, 2, 3, .... In cardinal-number terms, ℵ₀ + k = ℵ₀, ℵ₀ + ℵ₀ = ℵ₀, and ℵ₀ × ℵ₀ = ℵ₀. This is the key fact used to prove, for example, that the set of all rational numbers is countable, while Cantor's diagonal argument shows the real numbers are not — the hotel trick stops working if uncountably many buses show up.

Frequently Asked Questions

What is Hilbert's Hotel Paradox?
Hilbert's Hotel is a thought experiment by mathematician David Hilbert about a hotel with a countably infinite number of rooms (numbered 1, 2, 3, ...), all occupied. It illustrates that a countably infinite set can absorb more elements — even infinitely many more — without changing its cardinality, unlike a finite hotel which simply cannot accept guests when full.
How does the hotel fit finitely many new guests when full?
Every current guest moves from room n to room n + k, where k is the number of new guests. This frees rooms 1 through k for the new arrivals, and no existing guest loses their room.
How does the hotel fit one infinite busload of new guests?
Every current guest moves from room n to room 2n, which frees every odd-numbered room (1, 3, 5, ...). The new guest in position j on the bus moves into room 2j − 1, so all infinitely many new guests get a room.
How does the hotel fit infinitely many buses, each with infinitely many guests?
Every current guest in room n moves to room 2^n. The guest in seat j on bus i moves to room p_i^j, where p_i is the i-th prime number starting from 3 (3, 5, 7, 11, ...). Because every integer has a unique prime factorization, no two guests are ever assigned the same room.