Maths Olympiad Prep

Library / Test 1 /6 of 6

Test 1

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 nk≤mkn_k \le m_k.

We claim that mk+1≤mk+1m_{k+1} \le m_k + 1 for k≤4k \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 n4≤m4≤m3+1≤m2+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.)

2413‾⟶4213⟶4123,4231,12432413⟶2143⟶1243,21342413‾⟶2431⟶4231,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
31‾524\underline{31}52413‾5241\underline{3}52415324153245132451324, 1523415234, 1534215342, 1235412354
13‾5241\underline{3}52413254132543125431254, 1235412354, 1324513245
13‾524\underline{13}52413542135423154231542, 1534215342, 1345213452, 5314253142, 1324513245
13‾524\underline{13}52453124531243512435124, 5132451324, 5321453214, 5314253142, 5342153421
31‾524\underline{31}5243‾5124\underline{3}512453124531245132451324, 5321453214, 5314253142, 1352413524, 5342153421
31‾243\underline{1}2435214352145321453214, 3251432514, 3524135241, 3125431254
31‾243\underline{1}2435142351425314253142, 3154231542, 3541235412
31‾243\underline{1}2435421354215342153421, 3452134521, 3524135241, 3541235412, 3245132451, 3124531245
31‾524\underline{31}5243‾1254\underline{3}125413254132541235412354, 1352413524, 1324513245
3‾1254\underline{3}125432154321542315423154, 3251432514, 3214532145, 1235412354
31‾2543\underline{1}25431245312451324513245, 3214532145, 3142531425, 3421534215, 3154231542, 3542135421
3‾1254\underline{3}125435214352145321453214, 3251432514, 3512435124, 3524135241
31‾524\underline{31}5243‾1542\underline{3}154213542135421534215342, 1345213452, 1352413524, 5314253142, 1324513245
31‾5423\underline{1}54235142351425314253142, 3541235412, 3512435124
31‾5423\underline{1}54231452314521345213452, 3415234152, 3142531425, 3541235412
3‾1542\underline{3}154231245312451324513245, 3214532145, 3142531425, 3125431254, 3421534215, 3542135421

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.