Hilbert's Hotel Paradox Simulator

Simulate Hilbert's Hotel thought experiment — accommodate new guests in a fully-occupied infinite hotel and explore cardinal arithmetic interactively.

Hilbert's Hotel Paradox Simulator

Number of rooms to show in the visualization
Can Accommodate?
✅ Yes
Infinite hotel always has room for countably many guests
Reassignment Rule
f(n) = n + 1
Move guest in room n to room n+1. Put new guest in room 1.
Scenario
1 guest
Type of new arrivals at the fully-occupied hotel
Hotel Cardinality
ℵ₀
The hotel has countably infinite rooms: one for each natural number
New Guests Cardinality
1
Countable arrivals can always be accommodated
Key Insight
ℵ₀ + ℵ₀ = ℵ₀
Arithmetic of infinite cardinals differs radically from finite arithmetic

Room Visualization — Before & After

Before (Full Hotel)

Room 1
G#1
Room 2
G#2
Room 3
G#3
Room 4
G#4
Room 5
G#5
Room 6
G#6
Room 7
G#7
Room 8
G#8
Room 9
G#9
Room 10
G#10
Room 11
G#11
Room 12
G#12

After (Rearranged)

Room 1
★ New Gues
Room 2
Guest #1
Room 3
Guest #2
Room 4
Guest #3
Room 5
Guest #4
Room 6
Guest #5
Room 7
Guest #6
Room 8
Guest #7
Room 9
Guest #8
Room 10
Guest #9
Room 11
Guest #10
Room 12
Guest #11
Room 13
Guest #12

New guests   Moved   Unchanged

Reassignment Table

Room #BeforeAfterStatus
1Guest #1★ New Guest★ New
2Guest #2Guest #1→ Moved
3Guest #3Guest #2→ Moved
4Guest #4Guest #3→ Moved
5Guest #5Guest #4→ Moved
6Guest #6Guest #5→ Moved
7Guest #7Guest #6→ Moved
8Guest #8Guest #7→ Moved
9Guest #9Guest #8→ Moved
10Guest #10Guest #9→ Moved
11Guest #11Guest #10→ Moved
12Guest #12Guest #11→ Moved

Cardinal Arithmetic Reference

OperationResultExample
ℵ₀ + 1ℵ₀1 new guest fits
ℵ₀ + nℵ₀n new guests fit
ℵ₀ + ℵ₀ℵ₀1 infinite bus fits
ℵ₀ × ℵ₀ℵ₀Countably many buses fit
2^ℵ₀𝔠 > ℵ₀Uncountable guests DON'T fit
Planning notes, formulas, and examples

About the Hilbert's Hotel Paradox Simulator

Hilbert's Hotel is one of the most famous thought experiments in mathematics. Proposed by the German mathematician David Hilbert in the 1920s, it illustrates the counter-intuitive properties of infinite sets. Imagine a hotel with infinitely many rooms — one for every natural number — and every room is occupied. A new guest arrives. Can the hotel accommodate them?

Surprisingly, the answer is yes. The manager simply asks every existing guest to move from room n to room n + 1, freeing room 1 for the newcomer. In fact, this trick extends far beyond a single guest: the hotel can accommodate any finite number of new guests, a countably infinite bus of passengers, or even countably many infinite buses — all without anyone leaving.

This simulator lets you explore each scenario step by step. Watch existing guests shift rooms, see new guests fill in the gaps, and trace the bijection that makes it all work. The tool also covers the one scenario that *fails*: when uncountably many guests arrive, Cantor's diagonal argument proves that no rearrangement can make room for everyone. It is a vivid demonstration of the difference between ℵ₀ and 𝔠.

When This Page Helps

Hilbert's Hotel is a cornerstone example in set theory and mathematical logic courses. However, reading about room reassignment in a textbook can feel abstract. This interactive simulator makes the bijections concrete — you see which guest moves where, watch the color-coded room cards rearrange, and verify that every room ends up occupied.

Whether you are a student preparing for a discrete mathematics exam, a teacher building a lecture demonstration, or a curious mind exploring the nature of infinity, this page turns an abstract paradox into a tangible, explorable experience.

How to Use the Inputs

  1. Choose a scenario: 1 guest, n guests, infinite bus, multiple infinite buses, or uncountable guests.
  2. For finite guests, enter how many new arrivals there are.
  3. For multiple buses, enter the number of infinite buses.
  4. Adjust the display rooms slider to see more or fewer rooms in the visualization.
  5. Read the output cards for the reassignment formula and cardinality information.
  6. Examine the before/after room cards and color-coded reassignment table.
  7. Check the cardinal arithmetic reference table to link each scenario to formal set theory.
Formula used
1 guest: f(n) = n + 1. n guests: f(n) = n + k. Infinite bus: existing f(n) = 2n, new g(k) = 2k − 1. K buses: use prime powers f_j(n) = p_j^n. Cardinal arithmetic: ℵ₀ + ℵ₀ = ℵ₀, ℵ₀ × ℵ₀ = ℵ₀, 2^ℵ₀ = 𝔠 > ℵ₀.

Example Calculation

Result: All ∞ bus passengers accommodated

Existing guest n moves to room 2n (even rooms). Bus passenger k goes to room 2k−1 (odd rooms). Every natural number is either even or odd, so every room is filled exactly once.

Tips & Best Practices

  • Start with the "1 Guest" scenario to build intuition before tackling infinite buses.
  • Increase display rooms to 20+ to see the visual pattern of even/odd room assignments clearly.
  • Try the multiple-bus scenario with 2 and 3 buses to see why prime-power encoding works.
  • Select the 'Uncountable' scenario last — it's the dramatic twist that shows infinity has levels.
  • Use the cardinal arithmetic table at the bottom as a quick-reference cheat sheet.
  • Compare this with the Galileo's Paradox calculator for a deeper understanding of bijections.

The Mathematics Behind the Hotel

Hilbert's Hotel rests on a simple but profound truth: a countably infinite set can be put in bijection with a proper subset of itself. This is, in fact, the *definition* of an infinite set (Dedekind's criterion). The natural numbers ℕ = {1, 2, 3, …} are countably infinite, and the hotel's rooms are in bijection with ℕ. Any operation that produces another countable set from ℕ (shifting, doubling, prime-power encoding) preserves countability, so the rearranged hotel still has exactly one guest per room.

Why Uncountable Guests Fail

When uncountably many guests arrive — say, one for every real number between 0 and 1 — no room-assignment function works. Cantor's diagonal argument constructs a real number that differs from the guest in room n at the nth decimal digit, proving it cannot appear anywhere in the list. This is the fundamental result that 2^ℵ₀ = 𝔠 > ℵ₀.

Connections to Modern Mathematics

Hilbert's Hotel has analogs throughout mathematics. In functional analysis, an infinite-dimensional Hilbert space has the property that removing a finite-dimensional subspace leaves a space of the same dimension. In computability theory, the set of all computable functions is countable, while the set of all functions is not — echoing the hotel's countable-vs-uncountable divide. The paradox also connects to Zermelo-Fraenkel set theory and the Axiom of Choice, which is needed to handle some of the more exotic rearrangement scenarios.

Sources & Methodology

Last updated:

Frequently Asked Questions

  • A thought experiment by David Hilbert illustrating properties of infinite sets: a fully-occupied hotel with infinitely many rooms can still accommodate new guests through clever reassignment.