Maths Olympiad Prep

Library / Irish Mathematical Olympiad /221 of 236

Irish Mathematical Olympiad

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 2≤i≤20082 \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 f−1:{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 i≥2i \ge 2 is equivalent to f−1(i)∈{1,…,i}f^{-1}(i) \in \{1, \dots, i\} for all i≥2i \ge 2. Therefore, there are two choices for f−1(2)f^{-1}(2), two choices for f−1(3)f^{-1}(3) (since one of {1,2,3}\{1, 2, 3\} has been 'used already' for f−1(2)f^{-1}(2)), two choices for f−1(4)f^{-1}(4), ..., two choices for f−1(2008)f^{-1}(2008). Thus there are 220072^{2007} possibilities for the function f−1f^{-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:2≤i≤2008 and ai≠i}S_A = \{i : 2 \le i \le 2008 \text{ and } a_i \neq i\}. We will show that A↦SAA \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 i↦aii \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 ai≥ia_i \ge i.
Proof: This is obvious for i=1i = 1 and i=2i = 2. Suppose that i≥3i \ge 3 and ai∈{2,...,i−1}a_i \in \{2, ..., i - 1\}. Property (a) implies in particular that ai≠aja_i \neq a_j for j=1,2,...,ai−1j = 1, 2, ..., a_i - 1. That is,
ai∉{a1,a2,...,aai−1}. 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 i∉SA∪{1}i \notin S_A \cup \{1\}. So for i∈S∪{1}i \in S \cup \{1\} we must have ai∈S∪{1}a_i \in S \cup \{1\} also. That is to say, i↦aii \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,...,k−1j = 1, ..., k-1 and ank=1a_{n_k} = 1. In other words AA is determined by the set SAS_A. So A↦SAA \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 i∉Si \notin S. Define a1=n1,anj=nj+1a_1 = n_1, a_{n_j} = n_{j+1} for j=1,...,k−1j = 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 A↦SAA \mapsto S_A is a surjection. □\square

Solution 3: (By induction.) We claim that, for integers n≥2n \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 i≥2i \ge 2, is 2n−12^{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 k≥2k \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,…,k−f(1)}\{1, \dots, k-f(1)\} to itself. The induction hypothesis implies that there are 2k−f(1)−12^{k-f(1)-1} of these. Therefore, the number of good functions on {1,…,k+1}\{1, \dots, k+1\} is
1+2k−1+2k−2+⋯+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,604 problems in a working order, from Junior Challenge level to the IMO shortlist.

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