I.As related by the mathematician X, he was once visited by the brothers N, who, upon entering, took off their hats and hung them up on a rack in the hall. Later, when the guests were leaving and getting ready to put on their hats, it turned out to the host's chagrin that one hat was missing, although nobody had entered the hall during the time of the visit.
II.When the brothers N visited A'on another occasion, they again hung up their hats on the rack in the hall. Later, when the guests were leaving and getting ready to put on their hats, it turned out that there was an extra hat, although both the host and the guests were certain that there had been no hat on the rack when the guests arrived.
III. On the next visit, the guests put on their hats and left, and the host accompanied them to the street. Upon returning, he discovered the same number of hats on the rack as before the guests had left.
IV. Finally, on still another visit, the guests arrived without hats, and, upon leaving, put on the hats left over from the last visit. After accompanying the guests to the street, the host returned to discover once again the same number of hats on the rack as before the guests had left.
Explain all seemingly paradoxical events!
Found this riddle in Shilov's real and complex analysis. It is supposed to be an exercise on countable and uncountable sets. However I'm stuck!