Maths Olympiad Prep

Library / /219 of 520

Combinatorics Difficulty 6.8 National olympiad Find the answer

Given is a n×nn\times n grid with all squares on one diagonal being forbidden. You are allowed to start from any square, and move one step horizontally, vertically or diagonally. You are not allowed to visit a forbidden square or previously visited square. Your goal is to visit all non forbidden squares. Find, with proof, the minimum number of times you will have to move one step diagonally

A number or a short expression. Spacing and $ signs are ignored.

Solution

1. Coloring the Grid:
- Color the cells of the n×n n \times n grid in a checkerboard pattern, with alternating black and white cells. This means that any two adjacent cells (horizontally or vertically) will be of different colors, while any two diagonally adjacent cells will be of the same color.

2. Forbidden Diagonal:
- The main diagonal of the grid is forbidden. This means that for an n×n n \times n grid, there are n n forbidden cells.

3. Counting Black and White Cells:
- Let W W be the number of white cells and B B be the number of black cells in the grid excluding the forbidden diagonal.
- For an even n n :
- The grid has an equal number of black and white cells, but the forbidden diagonal will have n2 \frac{n}{2} black cells and n2 \frac{n}{2} white cells.
- Thus, W=B=n2n2 W = B = \frac{n^2 - n}{2} .
- For an odd n n :
- The grid will have one more cell of one color than the other. The forbidden diagonal will have n12 \frac{n-1}{2} black cells and n+12 \frac{n+1}{2} white cells (or vice versa).
- Thus, W=n2n+12 W = \frac{n^2 - n + 1}{2} and B=n2n12 B = \frac{n^2 - n - 1}{2} .

4. Difference in Number of Cells:
- Let A A be the positive difference between the number of white and black cells in the grid excluding the forbidden diagonal.
- For even n n , A=0 A = 0 .
- For odd n n , A=1 A = 1 .

5. Movement Constraints:
- In any horizontal or vertical move, the two cells will be of different colors.
- In any diagonal move, the two cells will be of the same color.

6. Balancing the Colors:
- To visit all non-forbidden cells, the total number of black and white cells lying on a horizontal or vertical segment of the path will be the same.
- Since there are extra A A white cells (assuming white cells are in excess), these cells will lie on some diagonal segment of the path.

7. Minimum Diagonal Moves:
- Therefore, there must be at least A1 A - 1 diagonal moves to balance the excess cells.
- For even n n , A=0 A = 0 , so no diagonal moves are needed.
- For odd n n , A=1 A = 1 , so at least 11=0 1 - 1 = 0 diagonal moves are needed.

8. General Case:
- The minimum number of diagonal moves required is 2n21 2\lfloor\frac{n}{2}\rfloor - 1 .

The final answer is 2n21 \boxed{ 2\lfloor\frac{n}{2}\rfloor - 1 } .

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

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