These are called derangements.
A family of five people randomly picks a name of a family member from a hat to decide for whom to buy a present. What is the probability that nobody picks their own name? If someone picks their own name, all the names are returned and everyone picks again. What is the probability that it took exactly two tries for everyone to pick a name of another family member"
Any help is appreciated
These are called derangements.