Maths Olympiad Prep

Library / /240 of 377

Combinatorics Difficulty 5.2 AIME, harder Prove it United States

Problem:

For what positive integers nn do there exist functions f,g:{1,2,,n}{1,2,,n}f, g:\{1,2, \ldots, n\} \rightarrow \{1,2, \ldots, n\} such that for each 1in1 \leq i \leq n, either f(g(i))=if(g(i))=i or g(f(i))=ig(f(i))=i, but not both?

Solution

Solution:

Answer: nn even

We claim that this is possible for all even nn. First, a construction: set f(2m1)=f(2m)=2m1f(2m-1) = f(2m) = 2m-1 and g(2m1)=g(2m)=2mg(2m-1) = g(2m) = 2m for m=1,,n2m = 1, \ldots, \frac{n}{2}. It is easy to verify that this solution works.

Now, we show that this is impossible for odd nn. Without loss of generality, suppose that f(g(1))=1f(g(1))=1 and that g(1)=af(a)=1g(1)=a \Rightarrow f(a)=1. Then, we have g(f(a))=g(a)=1g(f(a))=g(a)=1. Consequently, a1a \neq 1. In this case, call 11 and aa a pair (we likewise regard ii and jj as a pair when g(f(i))=ig(f(i))=i and f(i)=jf(i)=j). Now, to show that nn is even it suffices to show that all pairs are disjoint. Suppose for the sake of contradiction that some integer bab \neq a is also in a pair with 11 (note that 11 is arbitrary). Then, we have f(g(b))=bf(g(b))=b, g(b)=1g(b)=1 or g(f(b))=bg(f(b))=b, f(b)=1f(b)=1. But we already know that g(1)=ag(1)=a, so we must have f(g(b))=bf(g(b))=b, g(b)=1g(b)=1. But that would mean that both f(g(1))=1f(g(1))=1 and g(f(1))=1g(f(1))=1, a contradiction.

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.