Problem #25 MEDIUM

The Hotel That Never Fills Up

Apple Google Infinity Philosophy

Problem Statement

Imagine a hotel with a room for every positive integer — room 1, room 2, room 3, and so on without end. Every single room is currently occupied. A new traveler arrives at the front desk and asks for a room. The manager smiles and says there is no problem. Later that evening, an infinitely long coach arrives carrying a passenger for every positive integer. The manager accommodates all of them too. How?

Answer & Quick Explanation

Think you've got it? Click below to check your answer.

For 1 new guest: shift everyone to room n+1. For infinite new guests: move everyone to even rooms (n → 2n), freeing all odd rooms for the new arrivals. Countably infinite sets absorb countably infinite additions.

Detailed Editorial Solution

Want to see the step-by-step breakdown? Click below to reveal the editorial.

The hotel illustrates that 'countably infinite' sets can absorb any countable addition because you can always establish a one-to-one mapping between them — the formal idea of cardinality. Step 1: Starting state: rooms 1, 2, 3, 4, ... all occupied. One new guest arrives. Step 2: Solution for 1 guest: broadcast an announcement — each guest moves from their current room n to room n+1. The guest in room 1 moves to room 2, room 2 to room 3, and so on. Room 1 is now empty. New guest checks in. Step 3: Now a coach arrives with passengers numbered 1, 2, 3, ... stretching to infinity. Step 4: Solution for infinite guests: ask every current guest to move from room n to room 2n. Guest in room 1 → room 2; room 2 → room 4; room 3 → room 6. All even-numbered rooms are now taken. Step 5: Count the now-empty rooms: 1, 3, 5, 7, 9, ... — every odd-numbered room is free. That is infinitely many available rooms. Step 6: Coach passenger number k checks into room 2k − 1. Passenger 1 → room 1; passenger 2 → room 3; passenger 3 → room 5. Everyone is housed. Key Insight: The natural numbers can be put into perfect one-to-one correspondence with the even numbers, the odd numbers, or even the set of all rational numbers. 'Countably infinite' means exactly this: no matter how you redistribute, there is always a bijection available.