Hilbert’s Hotel Reassignment Calculator
Hilbert’s Hotel (Infinite Hotel) — Reassignment Explained
Hilbert’s Hotel is a classic thought experiment from set theory that highlights why infinite collections behave differently from finite ones. Imagine a hotel with rooms numbered 1, 2, 3, … and assume every room is occupied (one guest per room). In an ordinary hotel, “full” means no new guests can be admitted. In a hotel with countably infinite rooms, however, it’s possible to create vacancies using a systematic reassignment rule.
This calculator models the most common “make room” strategy for a finite
number of arriving guests k: move each existing guest from room n to room 2n.
That shift opens every odd-numbered room (1, 3, 5, …), which can then be assigned to the new arrivals.
How to use this calculator
- Number of newly arriving guests (k): how many new guests you want to fit into the already-full infinite hotel.
- How many existing guests to display: the output is an infinite reassignment, but the table previews only the first N existing guests so you can see the pattern.
- Press Reassign Rooms to generate the mapping table.
The reassignment rule (the “doubling trick”)
The key idea is a one-to-one mapping (a bijection) from the original occupied rooms to a proper subset of rooms.
Existing guests
If an existing guest is currently in room n, move them to: newRoom = 2n
New arrivals
The j-th new guest (where j starts at 1) is assigned to the odd room: newRoom = 2j − 1
Formulas (with MathML)
Here are the rules in standard mathematical form:
Existing guest reassignment
New guest room assignment
Conceptually, this illustrates the cardinal arithmetic fact that adding finitely many elements to a countably infinite set does not change its size: (for any finite k).
Introduction: Why this works (interpreting the output)
After reassignment:
- All existing guests occupy even rooms: 2, 4, 6, 8, …
- All new guests occupy odd rooms: 1, 3, 5, 7, …
No two guests collide because no number is both odd and even, and every existing guest’s destination (2n) is unique. In other words, this reassignment is deterministic and conflict-free.
Worked example (matches the default inputs)
Suppose k = 5 new guests arrive, and you choose to display the first N = 10 existing guests. The calculator will show:
- Old Guest 1: 1 → 2
- Old Guest 2: 2 → 4
- …
- Old Guest 10: 10 → 20
- New Guest 1: → 1
- New Guest 2: → 3
- …
- New Guest 5: → 9
Notice the structure: every original room number shows up again as an even room, while the new guests
neatly fill the odd room numbers up to 2k − 1.
Comparison table: Before vs. after reassignment
The table below summarizes what changes and what stays the same.
| Aspect | Before | After using n→2n and assigning odd rooms |
|---|---|---|
| Which rooms are occupied by existing guests? | All positive integers (1, 2, 3, …) | All even rooms (2, 4, 6, …) |
| Which rooms are available for newcomers? | None (hotel appears “full”) | Odd rooms (1, 3, 5, …) are free |
| Collision risk (two guests assigned same room) | N/A | None: evens and odds are disjoint; mapping 2n is one-to-one |
| What the calculator can display | Not applicable | A finite preview of the first N existing guests plus k new guests |
| Big idea illustrated | “Full” implies no space (finite intuition) | Countable infinity allows a bijection to a proper subset |
About the “infinite bus” extension (important scope note)
Many explanations of Hilbert’s Hotel go further and discuss admitting countably infinite new arrivals (an infinite bus). The same even/odd strategy can be described conceptually: existing guests move to even rooms and bus passengers take odd rooms.
This page’s calculator, however, accepts a finite input k and generates a finite table preview.
The infinite-bus scenario is mentioned only as context and is not computed here.
Assumptions & limitations
- Rooms are the positive integers (1, 2, 3, …) and there is exactly one guest per room initially.
- Reassignment rule is fixed: existing guests move by
n → 2n; newcomers are assigned2j − 1. - Inputs must be positive integers. Non-integers, zeros, and negatives are rejected.
- Display is only a preview: the hotel has infinitely many existing guests, but the page shows only the first N existing guests you request.
- Practical constraints are ignored (time to move, coordination, luggage, etc.). This is a mathematical illustration of bijections and cardinality, not a scheduling tool.
- Large values may be slow because the page generates an HTML table in your browser.
Takeaway
The reassignment isn’t “magic”—it’s a precise mapping that reorganizes an infinite list without losing anyone.
By exploring different values of k and different display sizes, you can see how a simple rule creates space
even when the hotel starts out fully occupied.
Arcade Mini-Game: Hilbert’s Hotel Reassignment Calculator Calibration Run
Use this quick arcade run to practice separating useful scenario inputs from common planning mistakes before you rely on the calculator output.
Start the game, then use your pointer or arrow keys to catch useful inputs and avoid bad assumptions.
Status messages will appear here.
