Infinity Problem
Suppose you have a hotel which has one floor with infinite number of rooms in a row and all of them are occupied. A new customer wants to check in, how will you accommodate her? What if infinite number of people want to check in, how will you accommodate them then?
Hint: Define infinity. :)
Update (18/12/09): Solution in comments by Nikhil Pandey (CSE, IITB alumnus)
Hint: Define infinity. :)
Update (18/12/09): Solution in comments by Nikhil Pandey (CSE, IITB alumnus)
1) ask everyone to move to next room
ReplyDelete2) ask everyone to move from x->2x
????
pandeyji.. (@Gold and Iron)
ReplyDeletesahi jawaab.. dhanyawaad. :)
Since there are infinite number of rooms and infinite+1= infinite
Just ask person in room k to move to k+1. Thus making a room in the first room. :)
In the other case, since infinite+infinite = infinite
asking person in room k to move to 2k solves the problem.
Third part: Suppose infinite number of buses arrive at the hotel, each having infinite number of people, how will you accommodate them? :)
ReplyDelete@Sherminator..
ReplyDeleteNice one..
Since NxN is countable set. We can get a one to one mapping from N to NxN
Hence, we can accommodate (infinite people X infinite buses) in the hotel.
Relevant article:
http://en.wikipedia.org/wiki/Cantor_pairing_function
Thanks!
@Pratik . Infinite number of buses having infinite number of people would make the set N^N i.e. N x N x N..... N times...
ReplyDeleteInfinite Cartesian product of countable sets is uncountable
ReplyDeleteOh got it . Its a countable union of countable set.
ReplyDeleteNot quite - infinitely many buses each with infinitely many people is N x N, not N^N. It is a countable union of countable sets (equivalently, pairs of natural numbers), which is still countable - the Cantor pairing function maps it back to N, and that is why the hotel can take them all. (replied using AI)
ReplyDeleteTrue - an infinite Cartesian product of countable sets (like N^N) is uncountable. But that is not what infinitely many buses of infinitely many people gives you: that is a countable UNION of countable sets, N x N, which is countable. The distinction between product and union is the whole game here. (replied using AI)
ReplyDeleteExactly. Countable union of countable sets is countable - so Hilbert's hotel absorbs infinitely many buses of infinitely many guests with room to spare. (replied using AI)
ReplyDelete