Maths Olympiad Prep

Library / /42 of 42

Combinatorics Difficulty 7.4 National olympiad, round 2 Prove it Romania

Let n2n \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,,n1}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(i1){0,1}f(i)-f(i-1) \in \{0, 1\}, with the restriction that there can be at most nkn-k occurrences of 11. This association is bijective, and the number of possibilities of choosing the numbers 00 and 11 as described above is (n10)+(n11)++(n1nk)\binom{n-1}{0} + \binom{n-1}{1} + \dots + \binom{n-1}{n-k} (these are the possibilities of placing 0,1,2,,nk0, 1, 2, \dots, n-k of 11). Therefore:
F=k=1n((n10)+(n11)++(n1nk))=p=0n1(np)(n1p)==n2n1(n1)p=0n1(n2p1)=(n+1)2n2. |\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(i1){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 2n12^{n-1} possibilities. Thus, each fixed point appears in 2n12^{n-1} functions, and fFFix(f)=n2n1\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=Fnk_n = |\mathcal{F}_n|. Also, let sn=fFnFix(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 fFn+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(n1),f(n2),,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 2n12^{n-1} ways. Therefore, we have the recurrence kn+1=2kn+2n1k_{n+1} = 2k_n + 2^{n-1}, and since k2=3k_2 = 3, we obtain kn=(n+1)2n2k_n = (n+1) \cdot 2^{n-2}.

b) Let ai(n)a_i(n) be the number of functions fFnf \in \mathcal{F}_n for which iFix(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 fFn+1f \in \mathcal{F}_{n+1} be a function for which f(k)=kf(k) = k, for knk \le n. Then, using the hypothesis relation, we have:
f(n)f(n1)+1f(k)+(nk)=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 knk \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(n1),,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=n2n1.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 fFf \in \mathcal{F} smaller than \ell. Similarly, if f()==f(+1)f(\ell) = \ell = f(\ell + 1), then there are no fixed points of fFf \in \mathcal{F} greater than \ell. From here we deduce that the fixed points of a function fFf \in \mathcal{F} form a set of kk consecutive numbers {,+1,,+k1}\{\ell, \ell+1, \dots, \ell+k-1\}.

We characterize the functions in F\mathcal{F} that have kn2k \le n - 2 fixed points.
For 2nk2 \le \ell \le n-k, we have f(1)=f(\ell - 1) = \ell and f(+k)=+k1f(\ell + k) = \ell + k - 1. Now for {f(1),f(2),,f(2)}\{f(1), f(2), \dots, f(\ell - 2)\} we have 222^{\ell-2} ways to construct the function ff, and for {f(+k+1),,f(n)}\{f(\ell + k + 1), \dots, f(n)\} we have 2nk2^{n-\ell-k} ways to construct ff, so in total we have 2nk22^{n-k-2} ways to construct ff in this case.
For =1\ell = 1 or =nk+1\ell = n-k+1, we have fixed only one more point besides the kk fixed points, so ff can be constructed in 2nk12^{n-k-1} ways. Therefore, in total we have (nk+3)2nk2(n-k+3) \cdot 2^{n-k-2} functions in F\mathcal{F} having kn2k \le n-2 fixed points. For k=n1k = 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=1n2(nk+3)2nk2=3+k=1n22nk2+k=1n2(nk1)2nk2=k=0n12k+k=0n3(k+1)2k=2n1+(n1)2n22n1+1=(n+1)2n2. \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:
fFFix(f)=3n2+k=1n2k(nk+3)2nk2=n2n1. \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,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.