QUESTION:
N people arrive at a party all of whom are wearing hats. We collect all the hats and then redistribute them. What is the probability that no one gets their own hat?
ANSWER REASONING:
$$|\bigcup_{i=1}^N S_i|=\sum_{i=1}^N(-1)^{i+1}\binom{N}{i}(N-i)!=N!\sum_{i=1}^N\frac{(-1)^{i+1}}{i!}$$
What I don't get is the probability of exactly n men getting their own hats back.
So the reasoning given in the book is:P($A_{1} \bigcap A_{2} \bigcap A_{3}\bigcap......A_{n}$) = $N\choose n $ $(\frac{(N-n)!}{N!})$, where each $A_{i}$ is the probability of the i_th person choosing their own hat.
I am not sure why this makes sense because $(N-n)!$ gives us the number of ways in which (N-n) can choose their hats but does not exclude the possibility where (N-n)do not choose their own hats, which is what we want since we want only n people to be able to choose their hats, not the rest?