2012 AIME II Problem 14

Attempt Problem 14 of the 2012 AIME II below, then check your answer against the professionally curated solution from LIVE by Po-Shen Loh. You can also try the full timed exam, view all 2012 AIME II solutions, or check the answer key.

All problems are used with official legal permission of the Mathematical Association of America (MAA).

14.

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.
Answer: 16
Concepts:graph theorycircular arrangementscasework
Small hint:
Everyone shaking exactly two hands splits the nine people into cycles of length at least 33
Big hint:
A cycle on kk chosen people can be formed in (k−1)!2\frac{(k-1)!}{2} ways; sum over the partitions 3+3+3,3+3+3, 3+6,3+6, 4+5,4+5, and 99
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.
LIVE by Po-Shen Loh
Programs

LIVE Classes

Self-Paced Classes

Stars

Scholarship

About Us

Who Is Po-Shen Loh?

Email Contact

Newsletter

Jobs

Become a Star

For a more Thought Full world.

© 2026 Expii, Inc.