The problem of counting the number of ways $n$ people randomly take $n$ hats, assuming that they can take their own hat, is quite intuitive: the first person has $n$ hats to choose from, the second person, once the first person has chosen a hat, has $n-1$ to choose from... So there are $n!$ ways.
However, the reasoning for the case where no one takes his hat is not so simple, since to know the number of hats from among which a person can choose, it must be known whether or not his own hat is among those remaining to be chosen.
What would be the intuitive way to reason this problem? Let's say, for example, for $n=4$ people, for which the solution is $!4=9$.