Maths Olympiad Prep

Track / Stage 7 / 46 of 300 #1446 of 1964

Problem 1446

National olympiad second round; IMO P1/P4
Combinatorics Difficulty 7.1 Prove it

All the chairs in a classroom are arranged in a square n×nn\times n array (in other words, nn columns and nn rows), and every chair is occupied by a student. The teacher decides to rearrange the students according to the following two rules:
(a) Every student must move to a new chair.
(b) A student can only move to an adjacent chair in the same row or to an adjacent chair in the same
column. In other words, each student can move only one chair horizontally or vertically.
(Note that the rules above allow two students in adjacent chairs to exchange places.)
Show that this procedure can be done if nn is even, and cannot be done if nn is odd.

This one wants a proof. Work it on paper, then read the official solution and mark yourself. Be honest about it: the record is only any use to you if it is.

Official solution

1. **Checkerboard Coloring Argument for Odd n n :**

Suppose n n is odd. We can color the n×n n \times n grid in a checkerboard pattern, where each square is either black or white, and adjacent squares have different colors.

- In a checkerboard pattern, the number of black squares and white squares are not equal when n n is odd. Specifically, there are n212\frac{n^2 - 1}{2} squares of one color and n2+12\frac{n^2 + 1}{2} squares of the other color.
- When a student moves to an adjacent chair, they move from a black square to a white square or vice versa.
- Since the number of black and white squares are unequal, it is impossible for every student to move to a new chair while maintaining the checkerboard pattern. This is because there would be an imbalance in the number of students moving to black squares versus white squares.

Therefore, it is impossible to rearrange the students according to the given rules if n n is odd.

2. **Constructive Argument for Even n n :**

Suppose n n is even. In this case, the number of black squares and white squares in the checkerboard pattern are equal. Specifically, there are n22\frac{n^2}{2} black squares and n22\frac{n^2}{2} white squares.

- We can rearrange the students by having each student swap seats with the student right next to them in the same row. For example, if the students in a row are initially seated as 1,2,3,,2k1, 2, 3, \ldots, 2k, we can have:
- Student 1 swap with Student 2
- Student 3 swap with Student 4
- And so on, up to Student 2k12k-1 swapping with Student 2k2k.

- This ensures that every student moves to a new chair, and since n n is even, this swapping can be done for every row without any issues.

Therefore, it is possible to rearrange the students according to the given rules if n n is even.

\blacksquare

Source: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic, difficulty and ordering added by this site.