Advertisement

Hilbert's hotel paradox calculator

Find room assignments in an infinite hotel for a finite group, infinitely many guests, or infinitely many buses.

Calculator

Existing guest moves to room
11
Assignment rule
New guests take rooms 1 through k; existing room n moves to n + k.

Advertisement

How this calculator works

A countably infinite hotel has no final room. Shifting every existing guest by k frees the first k rooms. Moving existing guests to even rooms leaves all odd rooms free for an infinite group. For infinitely many buses, the Cantor pairing function enumerates the bus-seat pairs and assigns that enumeration to odd rooms.

Formula

Finite group: n → n + k. Infinite group: existing n → 2n, arriving s → 2s - 1. Buses: room = 2π(b - 1, s - 1) + 1, where π(x,y) = (x+y)(x+y+1)/2 + y.

Worked example

With 4 arrivals, the guest in room 7 moves to 11. With infinitely many arrivals, room 7 moves to 14 and arriving seat 4 takes room 7. Bus 2, seat 3 takes room 17 under the pairing rule.

Advertisement

Frequently asked questions

Is this possible in a finite hotel?

No. A finite full hotel cannot accommodate an extra guest without adding capacity or moving someone out.

Are any guests assigned the same room?

The rules are injective within each group. Even and odd rooms separate existing guests from the arriving infinite groups.

Must all rooms be used in the bus scenario?

This pairing uses every odd room exactly once because it enumerates every ordered pair of non-negative integers.

Sources

Advertisement