There were 5 family members who each brought their own gift, and then the 5 gifts were exchanged within the family.
How many ways could they have exchanged the gifts such that none of them got their own?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
This can be solved by the derangement formula:
! n ≡ n ! ( 1 − 1 ! 1 + 2 ! 1 − 3 ! 1 + ⋯ + ( − 1 ) n n ! 1 ) = n ! k = 0 ∑ n k ! ( − 1 ) k
! 5 = 4 4
Using the derangement formula = 5 ! ( 1 1 − 1 1 + 2 1 − 6 1 + 2 4 1 − 1 ) = 1 2 0 ( 3 0 1 1 ) = 4 4
Sir you made a mistype here : 1 2 0 ( 3 0 1 1 ) = 2 6 5 .
Problem Loading...
Note Loading...
Set Loading...
There are 2 scenarios that would suit the conditions:
Let's consider the former case first: there are ( 3 5 ) = 3 ! 2 ! 5 ! = 1 0 ways to separate 5 into groups of 3 and 2 people. Then within the pair of people, there is only one way they can exchange gifts.
Now for group of 3 people, there are ( 3 − 1 ) ! = 2 ! = 2 ways to exchange gifts in the ring of 3 people. Alternatively, we can rethink the scenario as joining the vertices of a triangle without repeating the line twice, and there are only 2 possible ways to draw a triangle as shown below:
As a result, for the first scenario, there are 1 0 × 2 = 2 0 ways to exchange the gifts.
Now within the ring of 5 people, it is as if everyone was getting in a circle and passed the gift to the person to their right. Again, we can rethink of the scenario as joining the vertices of a pentagon:
So first, the first person (A) has a choice of 4 gifts to choose from, and when one is chosen, the owner of that chosen gift will make the next choice. However, he or she can't choose A's gift as it will form a ring of 2 people as previously done, so that person will have 3 choices left to choose. Continuing on like this, we can calculate the combinations as ( 5 − 1 ) ! = 4 ! = 2 4 ways.
Finally, there are 2 0 + 2 4 = 4 4 ways they can exchange gifts among the 5 people.