Skip to main content
OlympiadHQ

Browse · MathNet

Print

International Mathematical Olympiad

counting and probability

Problem

The Bank of Oslo issues coins made out of two types of metal: aluminium (denoted ) and copper (denoted ). Morgane has aluminium coins, and copper coins, and arranges her coins in a row in some arbitrary initial order. Given a fixed positive integer , she repeatedly performs the following operation: identify the largest subsequence containing the -th coin from the left which consists of consecutive coins made of the same metal, and move all coins in that subsequence to the left end of the row. For example, if and , the process starting from the configuration would be Find all pairs with such that for every initial configuration, at some point of the process there will be at most one aluminium coin adjacent to a copper coin.
Solution
Define a block to be a maximal subsequence of consecutive coins made out of the same metal, and let denote a block of coins of metal . The property that there is at most one aluminium coin adjacent to a copper coin is clearly equivalent to the configuration having two blocks, one consisting of all -s and one consisting of all -s.

First, notice that if , the sequence remains fixed under the operation, and will therefore always have 4 blocks. Next, if , let , . Then , , so the configuration will always have four blocks: Therefore a pair can have the desired property only if . We claim that all such pairs in fact do have the desired property. Clearly, the number of blocks in a configuration cannot increase, so whenever the operation is applied, it either decreases or remains constant. We show that unless there are only two blocks, after a finite amount of steps the number of blocks will decrease.

Consider an arbitrary configuration with blocks. We note that as , the leftmost block cannot be moved, because in this case all coins of one type are in the leftmost block, meaning there are only two blocks. If a block which is not the leftmost or rightmost block is moved, its neighbor blocks will be merged, causing the number of blocks to decrease.

Hence the only case in which the number of blocks does not decrease in the next step is if the rightmost block is moved. If is odd, the leftmost and the rightmost blocks are made of the same metal, so this would merge two blocks. Hence must be even. Suppose there is a configuration of blocks with the -th block having size so that the operation always moves the rightmost block: Because the rightmost block is always moved, for all . Because , summing this over all we get , so . But this contradicts . Hence at some point the operation will not move the rightmost block, meaning that the number of blocks will decrease, as desired.
Final answer
All pairs (n, k) with n ≤ k ≤ (3n+1)/2

Techniques

Invariants / monovariantsColoring schemes, extremal argumentsAlgorithms