Let be a positive integer, and let be the set of all words of length containing each of the letters exactly times. Prove that for any word in there exists a word in that cannot be obtained from by less than successive transpositions of adjacent letters.
IMO 2017 Shortlist
Solution
For convenience, a transposition of two adjacent letters in a word will be referred to as a swap. Notice that swapping identical letters does not change a word, so assume that no swaps are performed.
Define the distance of two words and in to be the minimal number of swaps required to transform into (or vice versa). Clearly, if is another word in , then . Consequently, if , then , so it is sufficient to exhibit two words in at least distance apart.
We are presently going to show that the words
are at least distance apart.
For any word in and any pair of distinct letters and in the alphabet , let be the number of pairs of positions in with in the left position and in the right. Let .
In particular, and , so and .
Finally, notice that a swap changes exactly one of , , , the absolute value of the change being 1. Consequently, changes by 1 at each swap, so , whatever words and in . In particular, , as claimed.