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.