Browse · MathNet
PrintInternational Mathematical Olympiad
counting and probability
Problem
Let be a positive integer. Define a chameleon to be any sequence of letters, with exactly occurrences of each of the letters , , and . Define a swap to be the transposition of two adjacent letters in a chameleon. Prove that for any chameleon , there exists a chameleon such that cannot be changed to using fewer than swaps.
Solution
To start, notice that the swap of two identical letters does not change a chameleon, so we may assume there are no such swaps. For any two chameleons and , define their distance to be the minimal number of swaps needed to transform into (or vice versa). Clearly, for any three chameleons , , and .
Lemma. Consider two chameleons Then .
Proof. For any chameleon and any pair of distinct letters , we define to be the number of pairs of positions in such that the left one is occupied by , and the right one is occupied by . Define . Notice that and , so and .
Now consider some swap changing a chameleon to , say, the letters and are swapped. Then and differ by exactly 1, while and . This yields , i.e., on any swap the value of changes by 1. Hence for any two chameleons and . In particular, , as desired.
Back to the problem, take any chameleon and notice that by the lemma. Consequently, , which establishes the problem statement.
---
Alternative solution.
We use the notion of distance from Solution 1, but provide a different lower bound for it. In any chameleon , we enumerate the positions in it from left to right by . Define as the sum of positions occupied by . The value of changes by at most 1 on each swap, but this fact alone does not suffice to solve the problem; so we need an improvement.
For every chameleon , denote by the sequence obtained from by removing all letters . Enumerate the positions in from left to right by , and define as the sum of positions in occupied by . (In other words, here we consider the positions of the 's relatively to the 's only.) Finally, denote Now consider any swap changing a chameleon to . If no letter is involved into this swap, then ; on the other hand, exactly one letter changes its position in , so . If a letter is involved into a swap, then , so and . Thus, in all cases we have .
As in the previous solution, this means that for any two chameleons and . Now, for any chameleon we will indicate a chameleon with , thus finishing the solution.
The function attains all integer values from to . If , then we put the letter into the last positions in ; otherwise we put the letter into the first positions in . In either case we already have .
Similarly, ranges from to . So, if , then we put the letter into the last positions in which are still free; otherwise, we put the letter into the first such positions. The remaining positions are occupied by . In any case, we have , thus , as desired.
Lemma. Consider two chameleons Then .
Proof. For any chameleon and any pair of distinct letters , we define to be the number of pairs of positions in such that the left one is occupied by , and the right one is occupied by . Define . Notice that and , so and .
Now consider some swap changing a chameleon to , say, the letters and are swapped. Then and differ by exactly 1, while and . This yields , i.e., on any swap the value of changes by 1. Hence for any two chameleons and . In particular, , as desired.
Back to the problem, take any chameleon and notice that by the lemma. Consequently, , which establishes the problem statement.
---
Alternative solution.
We use the notion of distance from Solution 1, but provide a different lower bound for it. In any chameleon , we enumerate the positions in it from left to right by . Define as the sum of positions occupied by . The value of changes by at most 1 on each swap, but this fact alone does not suffice to solve the problem; so we need an improvement.
For every chameleon , denote by the sequence obtained from by removing all letters . Enumerate the positions in from left to right by , and define as the sum of positions in occupied by . (In other words, here we consider the positions of the 's relatively to the 's only.) Finally, denote Now consider any swap changing a chameleon to . If no letter is involved into this swap, then ; on the other hand, exactly one letter changes its position in , so . If a letter is involved into a swap, then , so and . Thus, in all cases we have .
As in the previous solution, this means that for any two chameleons and . Now, for any chameleon we will indicate a chameleon with , thus finishing the solution.
The function attains all integer values from to . If , then we put the letter into the last positions in ; otherwise we put the letter into the first positions in . In either case we already have .
Similarly, ranges from to . So, if , then we put the letter into the last positions in which are still free; otherwise, we put the letter into the first such positions. The remaining positions are occupied by . In any case, we have , thus , as desired.
Techniques
Invariants / monovariantsColoring schemes, extremal arguments