Three couples (six people) hold a Secret Santa. The organiser accepts any assignment in which each person gives exactly one gift, receives exactly one gift, and nobody is assigned to themselves or to their own partner. How many acceptable assignments (who gives to whom) are there?
Enter an integer
Show solution
Count permutations of 6 people avoiding 12 forbidden giver-receiver pairs (self and partner), which form three 2×2 blocks. Let rk be the number of ways to pick k forbidden pairs with distinct givers and distinct receivers. One block gives 1+4x+2x2, so ∑rkxk=(1+4x+2x2)3=1+12x+54x2+112x3+108x4+48x5+8x6. By inclusion-exclusion the count is ∑(−1)krk(6−k)!=720−1440+1296−672+216−48+8=80.