2026-11-20

Problem — 2026-11-20

Medium

MediumCombinatorics

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 66 people avoiding 1212 forbidden giver-receiver pairs (self and partner), which form three 2×22\times2 blocks. Let rkr_k be the number of ways to pick kk forbidden pairs with distinct givers and distinct receivers. One block gives 1+4x+2x21+4x+2x^2, so ∑rkxk=(1+4x+2x2)3=1+12x+54x2+112x3+108x4+48x5+8x6\sum r_kx^k=(1+4x+2x^2)^3=1+12x+54x^2+112x^3+108x^4+48x^5+8x^6. By inclusion-exclusion the count is ∑(−1)krk(6−k)!=720−1440+1296−672+216−48+8=80\sum(-1)^k r_k(6-k)!=720-1440+1296-672+216-48+8=80.