Skip to main content

2012 AIME II Problem 14

Problem 14 of 15HarderCombinatoricsProblem-Solving Techniques

In a group of nine people each person shakes hands with exactly two of the other people from the group. Let NN be the number of ways this handshaking can occur. Consider two handshaking arrangements different if and only if at least two people who shake hands under one arrangement do not shake hands under the other arrangement. Find the remainder when NN is divided by 1000.1000.

Your answer

Integer from 0 to 999
Show solution

Solution

An arrangement in which everyone shakes exactly two hands is a disjoint union of cycles of length at least 33 covering all nine people. The possible cycle-length partitions of 99 are 3+3+3,3+3+3, 3+6,3+6, 4+5,4+5, and 9.9. On kk given people, the number of distinct cycles is (k−1)!2.\frac{(k-1)!}{2}. For 3+3+3:3+3+3: split into three unordered triples in 13!(93)(63)=280\frac{1}{3!}\binom{9}{3}\binom{6}{3} = 280 ways, one cycle each: 280.280. For 3+6:3+6: (93)⋅1⋅5!2=84⋅60=5040.\binom{9}{3} \cdot 1 \cdot \frac{5!}{2} = 84 \cdot 60 = 5040. For 4+5:4+5: (94)⋅3!2⋅4!2\binom{9}{4} \cdot \frac{3!}{2} \cdot \frac{4!}{2} =126⋅3⋅12=4536.= 126 \cdot 3 \cdot 12 = 4536. For a single 99-cycle: 8!2=20160.\frac{8!}{2} = 20160. In total N=280+5040N = 280 + 5040 +4536+20160=30016,+ 4536 + 20160 = 30016, so the remainder modulo 10001000 is 16.16.
AoPS wiki

Tagged: graph theory · circular arrangements · casework

More practice