Daily

Random

Practice set

Baltic Way 2010 · Problem 6

Combinatorics

An n×nn \times n board is coloured in nn colours such that the main diagonal (from top-left to bottom-right) is coloured in the first colour; the two adjacent diagonals are coloured in the second colour; the two next diagonals (one from above and one from below) are coloured in the third colour, etc.; the two corners (top-right and bottom-left) are coloured in the nn-th colour. It happens that it is possible to place on the board nn rooks, no two attacking each other and such that no two rooks stand on cells of the same colour. Prove that n≡0( mod 4)n \equiv 0(\bmod 4) or n≡1n \equiv 1 ( mod 4)(\bmod 4).

Change pool

When you’re ready

Review material becomes available with the next Daily.

Review

Topics

Invariants and monovariants

Solutions

Solution

Use the usual coordinate system for which the cells of the main diagonal have coordinates (k,k)(k, k), where k=1,…,nk = 1, \dots, n. Let (k,f(k))(k, f(k)) be the coordinates of the kk-th rook. Then by color restrictions for rooks we have

∑k=1n(f(k)−k)2=∑i=0n−1i2=n(n−1)(2n−1)6.\sum_{k=1}^{n} (f(k) - k)^2 = \sum_{i=0}^{n-1} i^2 = \frac{n(n-1)(2n-1)}{6}.

Since the rooks are non-attacking we have

∑k=1n(f(k))2=∑i=1ni2=n(n+1)(2n+1)6.\sum_{k=1}^{n} (f(k))^2 = \sum_{i=1}^{n} i^2 = \frac{n(n+1)(2n+1)}{6}.

By subtracting these equalities we obtain

∑k=1nkf(k)=n(2n2+9n+1)12.\sum_{k=1}^{n} k f(k) = \frac{n(2n^2 + 9n + 1)}{12}.

Now it is trivial to check that the last number is integer if and only if n≡0 or 1(mod4)n \equiv 0 \text{ or } 1 \pmod{4}.

Contest context

Results from Baltic Way 2010

10 teams

Mean score
0.9 / 5
Scores of 4 or 5
2 / 10
Estonia
4 / 5

Score distribution

08
10
20
30
41
51
All team scores
TeamScore
Poland5 / 5
Lithuania0 / 5
Germany0 / 5
Latvia0 / 5
Denmark0 / 5
Sweden0 / 5
Estonia4 / 5
Norway0 / 5
Finland0 / 5
Iceland0 / 5