A chessboard has its rows and columns numbered in order from 1 to . The square is colored A, B, or C according to whether modulo 3 has remainder 0, 1, or 2, respectively. A chip is placed on every square, and each chip has color A, B, or C. There are chips of each of the three colors.
Suppose we can arrange a rearrangement of the chips satisfying the following: each chip moves a distance of at most , chips of color A replace chips of color B, chips of color B replace chips of color C, and chips of color C replace chips of color A. Prove that there is another rearrangement of the chips such that each chip moves a distance of at most , and after the move every square contains a chip of the same color as that square.
Problem 1460
Official solution
Without loss of generality, it suffices to prove that all the color-A chips (abbreviated as A-chips) can be moved to distinct color-A squares (abbreviated as A-squares), such that each A-chip moves a distance of at most from its original square. That is to say, we can form a perfect matching between the A-chips and the A-squares such that the distance between each matched pair is at most .
In order to find this perfect matching, we construct a bipartite graph: all the A-squares form one group of vertices, and all the A-chips form another group of vertices.
Divide the original chessboard into trominoes; each tromino contains exactly one A-square. Find a permutation that sends A-chips to B-chips, B-chips to C-chips, and C-chips to A-chips, such that every move has distance at most . For any A-square and any A-chip , if or lies in the tromino containing , then we connect and with an edge in the bipartite graph. It is easy to see that this graph may have multiple edges; a square and a chip may be connected by up to three edges. It is easy to see that every edge in the graph has length at most ; here the length of an edge refers to the distance between the square and the chip it connects.
Every A-chip is connected to three A-squares: these are the A-squares belonging to the trominoes that contain , , and . Hence in this bipartite graph, every chip has degree 3. Next we prove that every square also has degree 3. Let be some A-square, and let
be the chips on the tromino containing . For , if is an A-chip, then is connected to ; if is a B-chip, then is connected to ; and finally if is a C-chip, then is connected to . This proves that every A-square also has degree 3.
Since every A-square has degree 3, from any set of A-squares there emanate edges. These edges reach at least chips, because every A-chip also has degree 3. Therefore, any set of A-squares has at least A-chips as its neighbors.
Thus, by Hall's marriage theorem, there exists a perfect matching between the two groups of vertices in this bipartite graph. Hence there exists a perfect matching between the A-squares and the A-chips in which every edge has distance at most ; therefore the rearrangement required by the original problem exists, which completes the proof.