Maths Olympiad Prep

Library / /8 of 8

Combinatorics Difficulty 7.2 National olympiad, round 2 Prove it Ireland

How many sequences a1,a2,,a2008a_1, a_2, \dots, a_{2008} are there such that each of the numbers 1,2,,20081, 2, \dots, 2008 occurs once in the sequence, and i{a1,a2,,ai}i \in \{a_1, a_2, \dots, a_i\} for each ii such that 2i20082 \le i \le 2008?

Solution

There are several different solutions:

Solution 1: The function f:{1,,2008}{1,,2008}f: \{1, \dots, 2008\} \to \{1, \dots, 2008\} given by f(i)=aif(i) = a_i is a bijection. Let us consider its inverse f1:{1,,2008}{1,,2008}f^{-1}: \{1, \dots, 2008\} \to \{1, \dots, 2008\}. The condition that i{a1,,ai}i \in \{a_1, \dots, a_i\} for i2i \ge 2 is equivalent to f1(i){1,,i}f^{-1}(i) \in \{1, \dots, i\} for all i2i \ge 2. Therefore, there are two choices for f1(2)f^{-1}(2), two choices for f1(3)f^{-1}(3) (since one of {1,2,3}\{1, 2, 3\} has been 'used already' for f1(2)f^{-1}(2)), two choices for f1(4)f^{-1}(4), ..., two choices for f1(2008)f^{-1}(2008). Thus there are 220072^{2007} possibilities for the function f1f^{-1}. Therefore there are 220072^{2007} such sequences.

Solution 2: We will say that a 2008-tuple is good if it has the required properties. Let A=(a1,...,a2008)A = (a_1, ..., a_{2008}) be a good 2008-tuple. Let SA={i:2i2008 and aii}S_A = \{i : 2 \le i \le 2008 \text{ and } a_i \neq i\}. We will show that ASAA \mapsto S_A is a bijection between the set of good 2008-tuples and the set of subsets of {2,...,2008}\{2, ..., 2008\}.
First we observe that the function iaii \mapsto a_i is a bijection from {1,...,2008}\{1, ..., 2008\} to itself.
Lemma: If AA is good then for each i=1,...,2008i = 1, ..., 2008, either ai=1a_i = 1 or aiia_i \ge i.
Proof: This is obvious for i=1i = 1 and i=2i = 2. Suppose that i3i \ge 3 and ai{2,...,i1}a_i \in \{2, ..., i - 1\}. Property (a) implies in particular that aiaja_i \neq a_j for j=1,2,...,ai1j = 1, 2, ..., a_i - 1. That is,
ai{a1,a2,...,aai1}. a_i \notin \{a_1, a_2, ..., a_{a_i - 1}\}.
Therefore we must have aai=aia_{a_i} = a_i. Therefore i=aii = a_i (bijectivity again) which contradicts our assumption that ai<ia_i < i. \square
Now suppose that AA is a good 2008-tuple and that SA={n1,n2,...,nk}S_A = \{n_1, n_2, ..., n_k\} where n1<n2<<nkn_1 < n_2 < \dots < n_k. Clearly ai=ia_i = i for all iSA{1}i \notin S_A \cup \{1\}. So for iS{1}i \in S \cup \{1\} we must have aiS{1}a_i \in S \cup \{1\} also. That is to say, iaii \mapsto a_i is a bijection SA{1}SA{1}S_A \cup \{1\} \to S_A \cup \{1\}. Now the lemma above clearly implies that a1=an1,anj=nj+1a_1 = a_{n_1}, a_{n_j} = n_{j+1} for j=1,...,k1j = 1, ..., k-1 and ank=1a_{n_k} = 1. In other words AA is determined by the set SAS_A. So ASAA \mapsto S_A is an injection.
Now suppose that S={n1,...,nk}{2,...,2008}S = \{n_1, ..., n_k\} \subset \{2, ..., 2008\}. Let ai=ia_i = i for all iSi \notin S. Define a1=n1,anj=nj+1a_1 = n_1, a_{n_j} = n_{j+1} for j=1,...,k1j = 1, ..., k-1 and let ank=1a_{n_k} = 1. Then is easily seen that A=(a1,...,a2008)A = (a_1, ..., a_{2008}) is good and clearly SA=SS_A = S. Therefore ASAA \mapsto S_A is a surjection. \square

Solution 3: (By induction.) We claim that, for integers n2n \ge 2,

the number of bijections f:{1,,n}{1,,n}f: \{1, \dots, n\} \to \{1, \dots, n\} such that i{1,,f(i)}i \in \{1, \dots, f(i)\} for all i2i \ge 2, is 2n12^{n-1}. Let us call such functions good. This easily checked for n=2n=2. Suppose that the statement is true for some n=2,,kn=2, \dots, k where k2k \ge 2. Now consider a good function f:{1,,k+1}{1,,k+1}f: \{1, \dots, k+1\} \to \{1, \dots, k+1\}. There are 2008 possible choices for f(1)f(1). If f(1)=1f(1)=1 then we must have f(i)=if(i)=i for all ii, so there is one such function. If f(1)>1f(1)>1, then f(i)=if(i)=i for i=2,,f(1)1i=2, \dots, f(1)-1. Now it is easy to see that the number of possible such functions ff is the same as the number of good functions from {1,,kf(1)}\{1, \dots, k-f(1)\} to itself. The induction hypothesis implies that there are 2kf(1)12^{k-f(1)-1} of these. Therefore, the number of good functions on {1,,k+1}\{1, \dots, k+1\} is
1+2k1+2k2++2+1=2k. 1+2^{k-1}+2^{k-2}+\dots+2+1=2^k.
This completes the induction step.

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 and solution reproduced as published; topic and difficulty added by this site.