Olympiad Maths Prep

Library / /11 of 11

, 2010

Combinatorics Difficulty 7.8 National olympiad, round 2 Prove it Ukraine

Numbers 11, 22, ..., nn are placed in a row in a certain order. We are allowed to do the following operation: take any two pairs of consecutive elements, that have no common elements, and exchange their positions. Is it possible to get a monotone sequence of elements after a finite number of steps if:

a) n=2009n = 2009;
b) n=2010n = 2010?

Solution

Answer: a) not always; b) always possible.

If we consider 55 consecutive elements, then from combination 1234512345 we can get the following:
123451452323514512345341212453. 12345 \rightarrow 14523 \rightarrow 23514 \rightarrow 51234 \rightarrow 53412 \rightarrow 12453.
Last three permutations were cyclically rearranged, so, similarly, we can get three numbers 1253412534. If we make symmetric permutations, then we can also permute first three elements of our five numbers:
123453412525134234514523131245. 12345 \rightarrow 34125 \rightarrow 25134 \rightarrow 23451 \rightarrow 45231 \rightarrow 31245.
Consider some four positions with numbers 10011001-10041004, for example. We first locate 11, 22, 33, ..., 10001000. The following shows how this can be done on the example of 500500. Let us suppose that numbers 11-499499 are already on their positions. Further we will not touch their permutations. If 500500 is next right from 499499 (on its position), everything is done. If 500500 is on the last position or nn-labeled, then we swap positions of pairs that occupy positions with numbers (n3,n2)(n-3, n-2) and (n1,n)(n-1, n) and 500500 is already not on the last position. If 500500 is on one position after 499499 (labeled as 501501), then we change positions of pairs with following labels at first: (500,501)(500,501) and (502,503)(502,503). Let us suppose that 500500 is already on some position k{502,503,...,n1}k \in \{502, 503, ..., n-1\}, then we are swapping positions of pairs labeled as: (500,501)(500,501) and (k,k+1)(k, k+1) and number 500500 is taking its position. So we will place on their seats all the numbers 11-10001000. After this, we similarly symmetrical interchange places of numbers 10051005-nn. That means that we always can get next permutation:

11, 22, ..., 10001000, aa, bb, cc, dd, 10051005, 10061006, ..., nn,

where the set of numbers (a,b,c,d)(a, b, c, d) is some permutation of numbers (1001,1002,1003,1004)(1001, 1002, 1003, 1004). Let's see what permutations of (a,b,c,d)(a, b, c, d) we can get. There are just 2424 of them. If we will take in attention next 55 numbers (1000,a,b,c,d)(1000, a, b, c, d), then using the scheme above we will gain also: (1000,a,c,d,b)(1000, a, c, d, b) and (1000,a,d,b,c)(1000, a, d, b, c). If we will add right-side 10051005 to gained sets of four numbers (a,b,c,d)(a, b, c, d), (a,c,d,b)(a, c, d, b) and (a,d,b,c)(a, d, b, c) and use the scheme above, so we will obtain next permutations: (b,c,a,d)(b, c, a, d), (c,a,b,d)(c, a, b, d), (c,d,a,b)(c, d, a, b), (d,a,c,b)(d, a, c, b), (d,b,a,c)(d, b, a, c), (b,a,d,c)(b, a, d, c). Apply again the scheme to some of obtained permutations and we will get another 33 variants: b,d,c,ab, d, c, a, c,b,d,ac, b, d, a and d,c,b,ad, c, b, a. So, we could get 1212 out of 2424. We now have to show that to arrange remaining 1212 numbers in ascending order is impossible.

For any permutation of numbers 11, 22, ..., nn call as inversion the case when a larger number is left of a smaller, for example the position of 55 numbers 2351423514 has an inversion: (2,1)(2,1), (3,1)(3,1), (5,1)(5,1) and (5,4)(5,4). Call the quantity of such inversions as "position invariant". Let's show that after performing any authorized operation, the invariant of positions varies by a number which is divisible by 22. Let us suppose that we have changed numbers (a,b)(a, b) and (c,d)(c, d), that occupied positions (k,k+1)(k, k+1) and (l,l+1)(l, l+1), k<lk < l. Then the quantity of inversions will not change after permutation. We have only mentioned inversions associated with numbers located on positions 11, 22, ..., (k1)(k-1) and (l+2)(l+2), (l+3)(l+3), ..., nn. That means that the quantity of inversions is constant. The quantity of inversions that use the numbers on positions (k+2)(k+2), (k+3)(k+3), ..., (l1)(l-1) is not changing relative to each other. But if we consider some number ee, which occupies one of mentioned positions, then with attention to each of those pairs of numbers (a,b)(a, b) and (c,d)(c, d), that are transposed, it will change. And this is changing necessarily from 11 to 00 or vice versa from 00 to 11. Hence the total quantity of changes will be even, so the parity of position invariant will not change. And about the numbers aa, bb, cc, dd, behind aa and bb, and cc and dd nothing is changing and behind all other pairs (44 at all) will be the same situation. So, the parity of inversions will stay the same.

So, it's easy to understand that we would not move on from position 11, 22, 33, 44, ..., nn (invariant is equal to 00) to position 22, 11, 33, 44, 55, ..., nn (invariant is 11). So we would not obtain other 1212 permutations inside of aa, bb, cc, dd permutation.

But all this applies only to try to arrange the numbers in ascending order. Completely the same way you can try to arrange them in descending order. As we see, all the positions were broken into two large groups (with even and odd invariant), that cannot be translated.

Let's count the invariant of such a position: nn, n1n - 1, n2n - 2, ..., 33, 22, 11. Every pair here is an inversion, so their total amount is Cn2=n(n1)2C_n^2 = \frac{n(n-1)}{2}. If it's an even number, then both of monotone positions locate in the same half and we can transform them between each other. But we cannot get all the positions in general. If this number is odd, vice versa, then any start position with its invariant would be transformed into increasing or decreasing one. So, we just have to find the parity of number Cn2=n(n1)2C_n^2 = \frac{n(n-1)}{2}. So if nn and n1n - 1 have different parity, then that number will be even if one of them is divisible by 44. That means that n=4mn = 4m or n=4m+1n = 4m + 1, else it's odd. Hence for n=20091(mod4)n = 2009 \equiv 1 \pmod{4} not all the positions could be transformed one to another. And for n=20102(mod4)n = 2010 \equiv 2 \pmod{4} from any position with the same scheme we can obtain increasing or decreasing set of numbers instead.

Looking for a route rather than 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.