If I am having a "secret santa" gift exchange with 5 people, how many possibilities for gift exchanges are there if nobody ends up with the same gift?
The answer could be $5!$ , but I don't think it is correct as the first person only has $4$ options for exchanging their gift.
An idea I had is $4*4*3*2*1$ , as the first person has $4$ options to exchange, then the second person should also have $4$ options, because the gift exchange taken by the first person could have been with the second person's gift.
This is known as derangements. It turns out that the number of permutations of $n$ elements such that none ends up in its place is: $$ D_n = n! \sum_{0 \le k \le n} \frac{(-1)^k}{k!} \approx \frac{n!}{e} $$