This question already has an answer here:


Six friends hold a Christmas present swap. Each person brings a present, and puts it into a sack. Once all six presents are in the sack, each participant in turn then draws out a present at random (presents are not replaced once drawn). The swap is deemed lucky if no participant draws out the present that he or she put in. What is the probability that the swap is lucky?

Where I am at so far:

Let A B C D E F be the 6 people. Let $A_P$ $B_P$ $C_P$ $D_P$ $E_P$ $F_P$ be the 6 gifts.

The set {A, B, C, D, E, F} has 6! permutations. Now each permutation gives the order in which order people choose presents from the sack. Let's call the set of all these permutations R. There are also 6! permutations of {$A_P$ , $B_P$ , $C_P$ , $D_P$ , $E_P$ , $F_P$}. Each one of these permutations give the order in which present are chosen from the sack. Let's call the set of all these permutations S.

R x S gives the set of all possible ways the 6 people choose presents. For example, ( (A, B, C, D, E, F), ($B_P$ , $A_P$ , $D_P$ , $C_P$ , $F_P$ , $E_P$) ) means A chooses first and selects $B_P$, B chooses second and selects $A_P$, C chooses thirds and selects $D_P$ etc.

Counting the number of unlucky swaps

Now all I can count so far are the number of possibilities where the 6 people choose their own presents. That's just $720$. But I know there are more but I don't know how to count them.

Counting the number of luck swaps

I was thinking if I figured out how many ways there are to rearrange the first row of the following table so that A does not appear in column A more than once, B does not appear in column B more than once, C does not appear in column C more than once etc. Then may be I could figure out how many lucky swaps there are. But again I don't know how many permutations like this exist.

\begin{array}{|c|} \hline \hline A& B& C& D& E& F&\\ \hline B& C& D& C& F& E&\\ \hline C& E& A& F& B& D&\\ \hline D& E& F& A& B& C&\\ \hline E& C& B& F& A& D& \hline & & &\\ \hline. & & &\\ \hline. & & &\\ \hline. \end{array}


marked as duplicate by JMoravitz combinatorics Jul 17 at 19:16

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


This is the classic case of derangements, and the number of such derangements here is $!6 = 265$. Divide that by the total number of distinguishable selections, $6! = 720$.

  • $\begingroup$ G. Sotrk Thanks for your help. I now know how to answer my question! :) $\endgroup$ – CubbyKushi Jul 17 at 19:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.