Maths Olympiad Prep

Library / /125 of 158

Algebra Difficulty 6.6 National Olympiad Prove it Estonia

There are 2n2^n soldiers standing in a line, where nn is a positive integer. The soldiers can rearrange themselves into a new line only in the following way: the soldiers standing at odd numbered positions move to the front of the row, keeping their positions with respect to each other, and the soldiers previously standing at even numbered positions move to the end of the row, keeping their positions with respect to each other. Prove that after nn rearrangements the soldiers stand in the same ordering as in the beginning.

Solutions — 2

Solution 1

The last soldier does not change its position. The rest of the soldiers regroup just as in the case, when the last soldier was not there, and the number of the soldiers was 2n12^n - 1. So, it suffices to prove the claim for 2n12^n - 1 soldiers. We show that after nn rearrangements the soldiers are in positions, which can be found in the original line by counting cyclically every 2i2^i-th soldier (after the last soldier we go to the first one). Indeed, after 0 rearrangements, the claim clearly holds, and every rearrangement makes us cyclically count every second soldier in the previous line (after the last soldier we go to the second one), the first soldier will still be counted first. After nn rearrangements the soldiers in the new line can be found by counting every 2n2^n-th soldier in the old line with 2n12^n - 1 soldiers. Since the remainder of 2n2^n when divided by 2n12^n - 1 is 1, this is equivalent to simply counting the soldiers. This means that we get back the original line.

Solution 2

Enumerate the soldiers starting from 0, and write the numbers in binary form (adding leading zeros to make the lengths of the binary codes equal; for example for n=3n = 3 we have the numbers 000, 001, 010, 011, 100, 101, 110, 111). After a rearrangement the soldiers stand in such a way that when reinterpreting the last digit as the first one (but leaving the order of the rest of the digits the same), the soldiers are again enumerated by consecutive numbers. After nn rearrangements the binary code of the soldiers has returned to the original, so every soldier's position corresponds to their original position in the line.

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.