Maths Olympiad Prep

Library / /64 of 71

Combinatorics Difficulty 5.7 AIME, harder Prove it United States

Problem:
Let SS be the set {1,2,,2012}\{1,2, \ldots, 2012\}. A perfectutation is a bijective function hh from SS to itself such that there exists an aSa \in S such that h(a)ah(a) \neq a, and that for any pair of integers aSa \in S and bSb \in S such that h(a)a,h(b)bh(a) \neq a, h(b) \neq b, there exists a positive integer kk such that hk(a)=bh^{k}(a)=b. Let nn be the number of ordered pairs of perfectutations (f,g)(f, g) such that f(g(i))=g(f(i))f(g(i))=g(f(i)) for all iSi \in S, but fgf \neq g. Find the remainder when nn is divided by 2011.

Solution

Solution:
Answer: 2

Note that both ff and gg, when written in cycle notation, must contain exactly one cycle that contains more than 1 element. Assume ff has kk fixed points, and that the other 2012k2012-k elements form a cycle, (of which there are (2011k)!(2011-k)! ways).

Then note that if ff fixes aa then f(g(a))=g(f(a))=g(a)f(g(a))=g(f(a))=g(a) implies ff fixes g(a)g(a). So gg must send fixed points of ff to fixed points of ff. It must, therefore, send non-fixed points to non-fixed points. This partitions SS into two sets, at least one of which must be fixed by gg, since gg is a perfectutation.

If gg fixes all of the non-fixed points of ff, then, since any function commutes with the identity, gg fixes some mm of the fixed points and cycles the rest in (km1)!(k-m-1)! ways. So there are m=0k2(km)(km1)!\sum_{m=0}^{k-2}\binom{k}{m}(k-m-1)! choices, which is m=0k2k!(km)m!\sum_{m=0}^{k-2} \frac{k!}{(k-m) m!}.

If gg fixes all of the fixed points of ff, then order the non-fixed points of ff a1,a2,,a2012ka_{1}, a_{2}, \ldots, a_{2012-k} such that f(ai)=ai+1f\left(a_{i}\right)=a_{i+1}. If g(ai)=ajg\left(a_{i}\right)=a_{j} then f(g(ai))=aj+1f\left(g\left(a_{i}\right)\right)=a_{j+1} thus g(ai+1)=aj+1g\left(a_{i+1}\right)=a_{j+1}. Therefore the choice of g(a1)g\left(a_{1}\right) uniquely determines g(ai)g\left(a_{i}\right) for the rest of the ii, and g(am)=am+jig\left(a_{m}\right)=a_{m+j-i}. But gg has to be a perfectutation, so gg cycles through all the non-fixed points of ff, which happens if and only if jij-i is relatively prime to 2012k2012-k. So there are ϕ(2012k)\phi(2012-k) choices.

Therefore for any ff there are m=0k2k!(km)m!+ϕ(2012k)\sum_{m=0}^{k-2} \frac{k!}{(k-m) m!}+\phi(2012-k) choices of gg, but one of them will be g=fg=f, which we cannot have by the problem statement. So there are 1+m=0k2k!(km)m!+ϕ(2012k)-1+\sum_{m=0}^{k-2} \frac{k!}{(k-m) m!}+\phi(2012-k) options.

Now note that a permutation can not fix all but one element. So
n=k=02010(2012k)(2011k)!(1+m=0k2k!(km)m!+ϕ(2012k)) n=\sum_{k=0}^{2010}\binom{2012}{k}(2011-k)!\left(-1+\sum_{m=0}^{k-2} \frac{k!}{(k-m) m!}+\phi(2012-k)\right)
Modulo 2011 (which is prime), note that all terms in the summand except the one where k=1k=1 vanish. Thus, n(2010)!(1+(1))2(mod2011)n \equiv (2010)!(-1+(-1)) \equiv 2 \pmod{2011} by Wilson's Theorem.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.