TITLE: A number of men enter a disreputable establishment
QUESTION [6 upvotes]: A number of men enter a disreputable establishment and each one leaves a coat and
an umbrella at the door. When a message is received saying that the establishment is about
to be raided by the police, the men leave hurriedly, and no man gets both the right coat and
the umbrella. If there are n men, show that the number of ways in which this can happen is
$$n!\left( n!-\frac{(n-1)!}{1!} + \frac{(n-2)!}{2!}-...+\frac{(-1)^n}{n!} \right)  $$

REPLY [2 votes]: Let the number of ways in which this can happen for $n$ people be $D_n.$ For each $1\le i \le n,$ let $C_i$ be the set of arrangements in which person $i$ gets both of his items back.
Then by inclusion-exclusion, $D_n = (n!)^2 - \sum |C_i| + \sum |C_i\cap C_j| + \ldots$
But $|C_i| = [(n-1)!]^2,$ $|C_i\cap C_j| = [(n-2)!]^2,$ etc. Clearly the number of terms in each sum involving $k$ people is $\binom{n}{k},$ so the formula follows easily.