Hilbert’s Hotel Reassignment Calculator

Stephanie Ben-Joseph headshot Stephanie Ben-Joseph

Hilbert’s Hotel Reassignment: Making Odd Rooms Available

Hilbert’s Hotel is a set-theory thought experiment about a hotel whose rooms are numbered 1, 2, 3, … and are all occupied, one guest per room. Although a finite hotel with every room occupied has no vacancy, this hotel has countably infinite rooms. Its guests can be moved according to a consistent rule, leaving specified rooms available without displacing anyone.

This calculator displays the even-and-odd reassignment for a finite number of arriving guests k. Every existing guest in room n moves to room 2n, so the odd-numbered rooms 1, 3, 5, … become available. New arrival j then receives room 2j − 1.

The room numbers are labels in a mathematical model, not measurements of distance or a suggested moving order. The point is that a single rule covers every occupied positive-integer room. A finite hotel cannot make this move while retaining all of its guests, because its last room would have no corresponding next destination. In Hilbert’s Hotel there is no last positive integer, so doubling remains defined for each existing guest.

How to use the Hilbert’s Hotel reassignment calculator

The two controls have different jobs in this Hilbert’s Hotel preview. The arrival value determines the number of new-guest rows and the initial odd rooms used by those arrivals. The display value does not change the underlying infinite reassignment; it only limits how many existing guests the browser shows. This distinction helps avoid treating the preview boundary as the end of the hotel.

Hilbert’s Hotel reassignment rule: the doubling map

The Hilbert’s Hotel calculation separates existing and incoming guests by mapping the original occupied rooms onto the even positive integers.

Existing Hilbert’s Hotel guests

For an existing guest currently in room n, the calculator assigns: newRoom = 2n

New Hilbert’s Hotel arrivals

For the j-th arriving guest, with j beginning at 1, the calculator assigns the odd room: newRoom = 2j − 1

Hilbert’s Hotel reassignment formulas (with MathML)

These are the two room-number rules used in the Hilbert’s Hotel preview:

Existing guest reassignment

n 2 n

New guest room assignment

j 2 j 1

For finite k, the Hilbert’s Hotel reassignment demonstrates that adjoining k guests to a countably infinite collection does not change its cardinality: 0 + k = 0 .

Read the two formulas together: doubling sends old room labels into the even numbers, while subtracting one after doubling sends successive arrival labels into the odd numbers. Neither rule needs to inspect the other guest’s destination. That is why the assignment scales cleanly from the first few displayed rows to the full countably infinite set of original occupants.

Introduction: Why the Hilbert’s Hotel output has no collisions

In this Hilbert’s Hotel reassignment, the result divides room numbers into two disjoint groups:

No two guests receive the same room: the map n to 2n gives distinct old guests distinct destinations, and an even room cannot also be an odd room. The preview therefore shows a deterministic, conflict-free assignment.

Within either group, uniqueness also follows directly from the labels. If two old guests had the same destination after doubling, their original room numbers would have to be the same. Likewise, two different arrival positions cannot produce the same odd room under 2j − 1. The calculator expresses this idea row by row, but the no-collision argument concerns the rule itself rather than the number of rows currently visible.

Worked example: default Hilbert’s Hotel room assignments

With the default values k = 5 and N = 10, the preview lists old guests 1 through 10 in rooms 2 through 20, respectively, and five new guests in rooms 1, 3, 5, 7, and 9.

The displayed rows are only a finite sample. The same doubling rule continues for every existing guest, while the finite arrival count determines how many of the initial odd rooms are assigned to newcomers.

In this example, room 11 is not assigned to one of the five newcomers, but it is still available under the reassignment because it is odd. More generally, a finite batch uses only finitely many odd rooms, leaving every later odd room unoccupied. The calculator lists the arrivals requested by k; it does not claim that those are the only vacancies created by the doubling map.

Comparison table: Hilbert’s Hotel before and after reassignment

This Hilbert’s Hotel table contrasts the initially full room list with the even-and-odd arrangement produced by the calculator.

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

The before-and-after comparison concerns occupancy labels, not a change in the size of the existing guest collection. Every old guest remains represented after the move, and every even room has exactly one old guest assigned to it. The odd rooms form a separate set of destinations, which is precisely what makes the reassignment useful for accommodating the new finite group.

Hilbert’s Hotel and the “infinite bus” extension

Hilbert’s Hotel is often also used to describe admitting countably infinitely many bus passengers. Conceptually, the same even-and-odd division works: existing guests take even rooms and passengers take odd rooms.

This calculator does not accept an infinite arrival count. It accepts a finite value of k and renders a finite table preview, so the infinite-bus version is context rather than a computed result here.

The finite-arrival case and the infinite-bus case share the same destination pattern for the original guests, but their input descriptions are different. Here, k is an ordinary positive integer and the new rows stop after that many arrivals. The output should therefore be read as an illustration of the finite extension, even though the old-guest rule is the familiar rule used in the broader Hilbert’s Hotel discussion.

Hilbert’s Hotel reassignment assumptions & limitations

The Hilbert’s Hotel assumptions matter because ordinary hotel language can suggest constraints that are absent from the model. No guest is assigned room zero, no fractional room labels are used, and the calculator does not simulate a sequence of physical moves. It simply states each guest’s destination under the rule. Check that both entries are positive whole numbers, and use a modest preview size when the purpose is to inspect the pattern rather than to generate many rows.

Hilbert’s Hotel takeaway

Hilbert’s Hotel makes room through a precise room-number mapping, not by removing any existing guest. Change k or the preview size to inspect how doubling every old room number leaves odd-numbered rooms for the finite set of arrivals, even though the hotel began with every positive-integer room occupied.

Enter a positive integer. New guests will be assigned to odd rooms (1, 3, 5, …).
The hotel has infinitely many existing guests; this controls how many “Old Guest n” rows are shown.

Arcade Mini-Game: Hilbert’s Hotel Reassignment Calculator Calibration Run

Use this quick arcade run to identify the two inputs that control the Hilbert’s Hotel preview and avoid unrelated assumptions.

Score: 0 Timer: 30s Best: 0

Start the game, then use your pointer or arrow keys to catch useful inputs and avoid bad assumptions.

Enter arrival details to generate the reassignment table.

Status messages will appear here.