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.

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 𝔠.

Why Use This Hilbert's Hotel Paradox Simulator?

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 tool turns an abstract paradox into a tangible, explorable experience.

How to Use This Calculator

  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

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

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.

Frequently Asked Questions

What is Hilbert's Hotel?

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. Use this as a practical reminder before finalizing the result.

How can a full hotel accept more guests?

Because the hotel has ℵ₀ rooms, shifting guests by a finite or countable amount still leaves ℵ₀ rooms. In infinite arithmetic, ℵ₀ + n = ℵ₀ and ℵ₀ + ℵ₀ = ℵ₀.

What happens with uncountably many guests?

They cannot be accommodated. Cantor's diagonal argument proves no bijection exists between the real numbers (cardinality 𝔠) and the naturals (cardinality ℵ₀).

What are the primes used for in the multiple-bus scenario?

Each bus is assigned a unique prime p. Passenger n from that bus gets room p^n. Since prime powers are all distinct, no two passengers share a room.

Is this relevant to real mathematics?

Absolutely — Hilbert's Hotel illustrates concepts central to set theory, topology, and functional analysis. It's a standard teaching tool in university math courses.

What is ℵ₀?

ℵ₀ (aleph-null) is the cardinality of the set of all natural numbers. It is the smallest infinite cardinal number.

Related Pages