Maths Olympiad Prep

Library / Romanian Mathematical Olympiad /270 of 275

Romanian Mathematical Olympiad

Combinatorics Difficulty 7.4 National Olympiad, round 2 Prove it Romania

Let n≥2n \ge 2 be a natural number, and F\mathcal{F} be the set of functions f:{1,2,…,n}→{1,2,…,n}f : \{1, 2, \dots, n\} \to \{1, 2, \dots, n\} such that f(k)≤f(k+1)≤f(k)+1f(k) \le f(k+1) \le f(k)+1, for every k∈{1,2,…,n−1}k \in \{1, 2, \dots, n-1\}.

a) Determine the cardinality of the set F\mathcal{F}.

b) Determine the total number of fixed points of the functions in F\mathcal{F}.

(A fixed point of the function ff is a number x∈{1,2,…,n}x \in \{1, 2, \dots, n\} such that f(x)=xf(x) = x.)

Solutions — 3

Solution 1

a) We count the functions in F\mathcal{F} with f(1)=kf(1) = k, k=1,…,nk = 1, \dots, n. We associate to each i=2,…,ni = 2, \dots, n the number f(i)−f(i−1)∈{0,1}f(i)-f(i-1) \in \{0, 1\}, with the restriction that there can be at most n−kn-k occurrences of 11. This association is bijective, and the number of possibilities of choosing the numbers 00 and 11 as described above is (n−10)+(n−11)+⋯+(n−1n−k)\binom{n-1}{0} + \binom{n-1}{1} + \dots + \binom{n-1}{n-k} (these are the possibilities of placing 0,1,2,…,n−k0, 1, 2, \dots, n-k of 11). Therefore:
∣F∣=∑k=1n((n−10)+(n−11)+⋯+(n−1n−k))=∑p=0n−1(n−p)(n−1p)==n⋅2n−1−(n−1)∑p=0n−1(n−2p−1)=(n+1)2n−2. |\mathcal{F}| = \sum_{k=1}^{n} \left( \binom{n-1}{0} + \binom{n-1}{1} + \dots + \binom{n-1}{n-k} \right) = \sum_{p=0}^{n-1} (n-p) \binom{n-1}{p} = \\ = n \cdot 2^{n-1} - (n-1) \sum_{p=0}^{n-1} \binom{n-2}{p-1} = (n+1)2^{n-2}.

b) We count how many times the fixed point kk appears in the functions from F\mathcal{F}, k=1,…,nk = 1, \dots, n (the same fixed point may appear in multiple functions). We associate to each function for which f(k)=kf(k) = k the numbers f(i)−f(i−1)∈{0,1},i=2,…,nf(i) - f(i-1) \in \{0, 1\}, i = 2, \dots, n.
Since these numbers can be chosen without restrictions, there are 2n−12^{n-1} possibilities. Thus, each fixed point appears in 2n−12^{n-1} functions, and ∑f∈F∣Fix(f)∣=n⋅2n−1\sum_{f \in \mathcal{F}} |\text{Fix}(f)| = n \cdot 2^{n-1}.

Solution 2

Let Fn\mathcal{F}_n be the set from the problem statement, and kn=∣Fn∣k_n = |\mathcal{F}_n|. Also, let sn=∑f∈Fn∣Fix(f)∣s_n = \sum_{f \in \mathcal{F}_n} |\text{Fix}(f)|. For n=2n=2 we have k2=3k_2 = 3 and s2=4s_2 = 4.

a) We notice that if f∈Fn+1f \in \mathcal{F}_{n+1} and f(n)≤nf(n) \le n, then the restriction of ff to {1,2,…,n}\{1, 2, \dots, n\} is a function from Fn\mathcal{F}_n. Conversely, any function from Fn\mathcal{F}_n can be extended to one in Fn+1\mathcal{F}_{n+1} in two ways, since f(n+1)∈{f(n),f(n)+1}f(n+1) \in \{f(n), f(n)+1\}.
For the case f(n)=n+1f(n) = n+1 we have f(n+1)=n+1f(n+1) = n+1, and then, going through the values f(n−1),f(n−2),…,f(1)f(n-1), f(n-2), \dots, f(1), we observe that at each step f(k+1)−f(k)f(k+1) - f(k) can be 00 or 11, so we can construct ff in 2n−12^{n-1} ways. Therefore, we have the recurrence kn+1=2kn+2n−1k_{n+1} = 2k_n + 2^{n-1}, and since k2=3k_2 = 3, we obtain kn=(n+1)⋅2n−2k_n = (n+1) \cdot 2^{n-2}.

b) Let ai(n)a_i(n) be the number of functions f∈Fnf \in \mathcal{F}_n for which i∈Fix(f)i \in \text{Fix}(f). Then we have sn=a1(n)+a2(n)+⋯+an(n)s_n = a_1(n) + a_2(n) + \dots + a_n(n). Let f∈Fn+1f \in \mathcal{F}_{n+1} be a function for which f(k)=kf(k) = k, for k≤nk \le n. Then, using the hypothesis relation, we have:
f(n)≤f(n−1)+1≤⋯≤f(k)+(n−k)=n. f(n) \le f(n-1) + 1 \le \dots \le f(k) + (n-k) = n.
Therefore, the restriction of ff to {1,2,…,n}\{1, 2, \dots, n\} is a function from Fn\mathcal{F}_n, i.e., ff is obtained from a function from Fn\mathcal{F}_n, to which the value f(n+1)f(n+1) is added. But, since f(n)≤nf(n) \le n, the value of f(n+1)f(n+1) can be chosen in two ways, which implies ak(n+1)=2ak(n)a_k(n+1) = 2a_k(n), for any k≤nk \le n.
To determine an+1(n+1)a_{n+1}(n+1), we observe that f(n+1)=n+1f(n+1) = n+1, and going through the values f(n),f(n−1),…,f(1)f(n), f(n-1), \dots, f(1), we observe that at each step f(k+1)−f(k)f(k+1) - f(k) is 00 or 11, i.e., ff can be constructed in 2n2^n ways. Therefore, an+1(n+1)=2na_{n+1}(n+1) = 2^n.
From here we have the recurrence sn+1=2sn+2ns_{n+1} = 2s_n + 2^n, and since s2=4s_2 = 4, we obtain
sn=n⋅2n−1.s_n = n \cdot 2^{n-1}.

Solution 3

We observe that if f(ℓ)=ℓ=f(ℓ−1)f(\ell) = \ell = f(\ell - 1), then there are no fixed points of the function f∈Ff \in \mathcal{F} smaller than ℓ\ell. Similarly, if f(ℓ)=ℓ=f(ℓ+1)f(\ell) = \ell = f(\ell + 1), then there are no fixed points of f∈Ff \in \mathcal{F} greater than ℓ\ell. From here we deduce that the fixed points of a function f∈Ff \in \mathcal{F} form a set of kk consecutive numbers {ℓ,ℓ+1,…,ℓ+k−1}\{\ell, \ell+1, \dots, \ell+k-1\}.

We characterize the functions in F\mathcal{F} that have k≤n−2k \le n - 2 fixed points.
For 2≤ℓ≤n−k2 \le \ell \le n-k, we have f(ℓ−1)=ℓf(\ell - 1) = \ell and f(ℓ+k)=ℓ+k−1f(\ell + k) = \ell + k - 1. Now for {f(1),f(2),…,f(ℓ−2)}\{f(1), f(2), \dots, f(\ell - 2)\} we have 2ℓ−22^{\ell-2} ways to construct the function ff, and for {f(ℓ+k+1),…,f(n)}\{f(\ell + k + 1), \dots, f(n)\} we have 2n−ℓ−k2^{n-\ell-k} ways to construct ff, so in total we have 2n−k−22^{n-k-2} ways to construct ff in this case.
For ℓ=1\ell = 1 or ℓ=n−k+1\ell = n-k+1, we have fixed only one more point besides the kk fixed points, so ff can be constructed in 2n−k−12^{n-k-1} ways. Therefore, in total we have (n−k+3)⋅2n−k−2(n-k+3) \cdot 2^{n-k-2} functions in F\mathcal{F} having k≤n−2k \le n-2 fixed points. For k=n−1k = n-1 fixed points, we have only two such functions in F\mathcal{F}, and for k=nk = n fixed points, we have only one function in F\mathcal{F}.

a) From the above, we deduce:
∣F∣=3+∑k=1n−2(n−k+3)⋅2n−k−2=3+∑k=1n−22n−k−2+∑k=1n−2(n−k−1)2n−k−2=∑k=0n−12k+∑k=0n−3(k+1)2k=2n−1+(n−1)⋅2n−2−2n−1+1=(n+1)⋅2n−2. \begin{align*} |\mathcal{F}| &= 3 + \sum_{k=1}^{n-2} (n-k+3) \cdot 2^{n-k-2} = 3 + \sum_{k=1}^{n-2} 2^{n-k-2} + \sum_{k=1}^{n-2} (n-k-1)2^{n-k-2} \\ &= \sum_{k=0}^{n-1} 2^k + \sum_{k=0}^{n-3} (k+1)2^k = 2^n - 1 + (n-1) \cdot 2^{n-2} - 2^{n-1} + 1 \\ &= (n+1) \cdot 2^{n-2}. \end{align*}

b) Similarly, we deduce:
∑f∈F∣Fix(f)∣=3n−2+∑k=1n−2k(n−k+3)⋅2n−k−2=n⋅2n−1. \sum_{f \in \mathcal{F}} |\text{Fix}(f)| = 3n-2 + \sum_{k=1}^{n-2} k(n-k+3) \cdot 2^{n-k-2} = n \cdot 2^{n-1}.

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.