Maths Olympiad Prep

Library / /6 of 6

Combinatorics Difficulty 7.6 National Olympiad, round 2 Prove it Hong Kong

kk cards numbered 11 to kk are arranged at random in a row. In a move, we may change any block of consecutive cards whose numbers are in ascending or descending order and switch the block around. For example, in the case k=4k = 4, 41324132 may be changed to 14321432 and 32143214 may be changed to 12341234. Suppose that in at most nkn_k moves, we can arrange the kk cards so that their numbers are in ascending or descending order.

a. Prove that n4=3n_4 = 3.

b. Determine or estimate n5n_5.

Solution

a. Consider the same problem but we require the numbers at the end to be in ascending order (i.e. descending order is not allowed). Let mkm_k be the least number of moves needed to guarantee that this can be done when there are kk numbers. By symmetry, this number is the same if we require the numbers at the end to be in descending order. Clearly, we have nkmkn_k \le m_k.

We claim that mk+1mk+1m_{k+1} \le m_k + 1 for k4k \le 4. Given a permutation of 1,2,,k+11, 2, \dots, k+1, one of the numbers 11 and k+1k+1 must be located at the first two or the last two positions since there are at most 55 numbers in total. We can use at most 11 move to put this number to the first or the last position. For the remaining numbers, we need at most mkm_k moves to sort them in the correct order, so that all numbers are in monotonic order. This proves the inequality.

It follows that n4m4m3+1m2+2=3n_4 \le m_4 \le m_3 + 1 \le m_2 + 2 = 3 (obviously, m2=1m_2 = 1). Next, we show that 24132413 cannot be changed to 12341234 or 43214321 in 22 steps. This can be verified by checking all possibilities as follows. (Note that swapping the same block twice is useless.)

241342134123,4231,1243241321431243,2134241324314231,2341,2134 \begin{array}{ccc} \underline{2413} \longrightarrow 4213 \longrightarrow 4123, 4231, 1243 \\ 2413 \longrightarrow 2143 \longrightarrow 1243, 2134 \\ \underline{2413} \longrightarrow 2431 \longrightarrow 4231, 2341, 2134 \end{array}

Therefore, we must have n4=3n_4 = 3.

b. We have n5=4n_5 = 4.

Again, we list out all possibilities.

0 moves1 move2 moves3 moves
31524\underline{31}524135241\underline{3}52415324153245132451324, 1523415234, 1534215342, 1235412354
135241\underline{3}52413254132543125431254, 1235412354, 1324513245
13524\underline{13}52413542135423154231542, 1534215342, 1345213452, 5314253142, 1324513245
13524\underline{13}52453124531243512435124, 5132451324, 5321453214, 5314253142, 5342153421
31524\underline{31}52435124\underline{3}512453124531245132451324, 5321453214, 5314253142, 1352413524, 5342153421
31243\underline{1}2435214352145321453214, 3251432514, 3524135241, 3125431254
31243\underline{1}2435142351425314253142, 3154231542, 3541235412
31243\underline{1}2435421354215342153421, 3452134521, 3524135241, 3541235412, 3245132451, 3124531245
31524\underline{31}52431254\underline{3}125413254132541235412354, 1352413524, 1324513245
31254\underline{3}125432154321542315423154, 3251432514, 3214532145, 1235412354
312543\underline{1}25431245312451324513245, 3214532145, 3142531425, 3421534215, 3154231542, 3542135421
31254\underline{3}125435214352145321453214, 3251432514, 3512435124, 3524135241
31524\underline{31}52431542\underline{3}154213542135421534215342, 1345213452, 1352413524, 5314253142, 1324513245
315423\underline{1}54235142351425314253142, 3541235412, 3512435124
315423\underline{1}54231452314521345213452, 3415234152, 3142531425, 3541235412
31542\underline{3}154231245312451324513245, 3214532145, 3142531425, 3125431254, 3421534215, 3542135421

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.