Problem: The Wrong Hats

"One of the most perplexing things I have come across lately," said Mr. Wilson, "is this. Eight men had been dining not wisely but too well at a certain London restaurant. They were the last to leave, but not one man was in a condition to identify his own hat. Now, considering that they took their hats at random, what are the chances that every man took a hat that did not belong to him?"

"The first thing," said Mr. Waterson, "is to see in how many different ways the eight hats could be taken."

"That is quite easy," Mr. Stubbs explained. "Multiply together the numbers, $1,$ $2,$ $3,$ $4,$ $5,$ $6,$ $7,$ and $8.$ Let me see—half a minute—yes; there are $40,320$ different ways."

"Now all you've got to do is to see, in how many of these cases no man has his own hat," said Mr. Waterson.

"Thank you, I'm not taking any," said Mr. Packhurst. "I don't envy the man who attempts the task of writing out all those forty-thousand-odd cases and then picking out the ones he wants."

They all agreed that life is not long enough for that sort of amusement; and as nobody saw any other way of getting at the answer, the matter was postponed indefinitely. Can you solve the puzzle?

Solutions: 1

Thank you to the contributors under CC BY-SA 4.0!

Github:

non-Github:
@H-Dudeney

References

Project Gutenberg

1. Dudeney, H. E.: "Amusements in Mathematics", The Authors' Club, 1917

This eBook is for the use of anyone anywhere in the United States and most other parts of the world at no cost and with almost no restrictions whatsoever. You may copy it, give it away or re-use it under the terms of the Project Gutenberg License included with this edition or online at http://www.gutenberg.org. If you are not located in the United States, you'll have to check the laws of the country where you are located before using this ebook.