Problem 54390. That's not my hat!
There exists a highly secretive hat consortium. Members possess identical hats. The members are invited to a meeting. All of them bring their hats, but are required to leave them in the shared cloakroom. During the meeting an earthquake strikes the region, leaving the cloakroom a mess. When the members return to the cloakroom, they find all the hats lying on the floor, rendering it impossible to determine the owners. Unwilling to dwell on this, the members each pick up a random hat and leave. Given the number of attendees n>0, the function c computes the number of distinct events where none of the members pick up their original hat. Your task is to define this function.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers8
Suggested Problems
-
Check to see if a Sudoku Puzzle is Solved
333 Solvers
-
Number of 1s in the Binary Representation of a Number
464 Solvers
-
Selecting books on MATLAB for experts and beginners (blindfolded)
77 Solvers
-
89 Solvers
-
Sum the real and imaginary parts of a complex number
142 Solvers
More from this Author2
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!