Maths Olympiad Prep

Library / /47 of 49

, 2022

Combinatorics Difficulty 7.3 National Olympiad, round 2 Prove it Bulgaria

Let p=(a1;a2;;a12)p = (a_1; a_2; \dots; a_{12}) be a permutation of the numbers 1,2,,121, 2, \dots, 12. Denote by Sp=a1a2+a2a3++a11a12S_p = |a_1 - a_2| + |a_2 - a_3| + \dots + |a_{11} - a_{12}|. We will call pp "optimistic", if ai>min(ai1;ai+1)a_i > \min(a_{i-1}; a_{i+1}) for every i=2,,11i = 2, \dots, 11.

a) Determine the maximal possible value of SpS_p? For how many permutations pp the maximum is achieved?

b) Find the number of all optimistic pp?

c) Determine the maximal possible value of SpS_p for an optimistic pp? For how many optimistic pp the maximum is achieved?

Solution

a) Place the elements of pp along the real axis. Then SpS_p equals the length of the "walk", starting from a1a_1, then reaching a2a_2, then reaching a3a_3 and so on until we end at a12a_{12}. In such a walk, the segments:

11-22 and 1111-1212 appear at most twice (before and after 11; before and after 1212);

22-33 and 1010-1111 appear at most 44 times (before and after 11, 22, 1111, and 1212);

33-44 and 99-1010 appear at most 66 times (before and after 11, 22, 33, 1010, 1111, and 1212);

44-55 and 88-99 appear at most 88 times (before and after 11, 22, 33, 44, 99, 1010, 1111, and 1212);

55-66 and 77-88 appear at most 1010 times (before and after 11, 22, 33, 44, 55, 88, 99, 1010, 1111, 1212);

66-77 may appear in all 1111 paths aiai+1a_i-a_{i+1}.

Therefore, Sp2(2+4+6+8+10)+11=230+11=71S_p \le 2(2+4+6+8+10)+11 = 2 \cdot 30+11 = 71. Furthermore Sp=71S_p = 71 iff all the inequalities above become equalities. This is possible only if {a1,a12}={6,7}\{a_1, a_{12}\} = \{6, 7\} (2 cases). For the case a1=6a_1 = 6, (a2,a4,,a10)(a_2, a_4, \dots, a_{10}) must be a permutation of {8,9,,12}\{8, 9, \dots, 12\} (5!5! cases) and (a3,a5,,a11)(a_3, a_5, \dots, a_{11}) must be a permutation of {1,2,,5}\{1, 2, \dots, 5\} (5!5! cases), while in the case a1=7a_1 = 7 it is vice versa. Therefore, the total number of permutations with Sp=71S_p = 71 is 25!5!=288002 \cdot 5! \cdot 5! = 28800.

b) In order for pp to be an optimistic permutation, the number 11 should be at one of the end positions. Then, the number 22 should be at one of the end positions of the remaining pp-sub-permutation of {2,3,,12}\{2, 3, \dots, 12\}, 33 should be at one of the end positions of the remaining pp-sub-permutation of {3,,12}\{3, \dots, 12\} and so on. It is easy to check that all such permutations are indeed optimistic. Therefore, their number is 211=20482^{11} = 2048.

c) Let pp be an optimistic permutation and k{1,2,,12}k \in \{1, 2, \dots, 12\} be the position of 1212 in it (i.e., ak=12a_k = 12). Then, it is trivial to check that ai>ai1a_i > a_{i-1}, for all i=2,,ki = 2, \dots, k, while aj>aj+1a_j > a_{j+1}, for all j=k,,11j = k, \dots, 11. Thus, Sp=12a1+12a1221212=21S_p = 12 - a_1 + 12 - a_{12} \le 2 \cdot 12 - 1 - 2 = 21. Equality is achieved iff {a1,a12}={1,2}\{a_1, a_{12}\} = \{1, 2\}. According to b), the total number of such permutations is 211/2=210=10242^{11}/2 = 2^{10} = 1024.

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.