Olympiad Maths Prep

Track / Stage 6 / 252 of 400 #1252 of 2000

Problem 1252

National olympiad, first round
Combinatorics Difficulty 6.5 Find the answer

In how many ways every unit square of a 20182018 x 20182018 board can be colored in red or white such that number of red unit squares in any two rows are distinct and number of red squares in any two columns are distinct.

Official solution

1. Lemma Proof:
We need to show that the nn distinct numbers of red squares in rows and columns must be either {1,2,,n}\{1, 2, \ldots, n\} or {0,1,2,,n1}\{0, 1, 2, \ldots, n-1\}.

- Suppose some 1<i<n1 < i < n is not contained in the rows (or columns). This implies that both 00 and nn must be contained in the rows (or columns).
- Therefore, the nn distinct numbers of red squares for each column (or row), denoted as c(i)c(i) for 1in1 \leq i \leq n, must satisfy 1c(i)n11 \leq c(i) \leq n-1, which gives us n1n-1 distinct numbers in total.
- This is a contradiction because we need nn distinct numbers. Hence, the distinct numbers must be either {1,2,,n}\{1, 2, \ldots, n\} or {0,1,2,,n1}\{0, 1, 2, \ldots, n-1\}.

2. Equivalence of Cases:
- The number of ways to color the board using {1,2,,n}\{1, 2, \ldots, n\} is equal to the number of ways using {0,1,2,,n1}\{0, 1, 2, \ldots, n-1\}.
- This is because we can consider white squares instead of red squares, effectively swapping the roles of red and white.

3. Counting the Ways:
- We denote (r1,r2,,rn;c1,c2,,cn)(r_1, r_2, \ldots, r_n; c_1, c_2, \ldots, c_n) as a possible way of coloring, where rir_i denotes the number of red squares in the ii-th row, and cic_i denotes the number of red squares in the ii-th column.
- We need to prove that there exists a unique way satisfying ri=air_i = a_i and ci=bic_i = b_i for any distinct 1ai,bin1 \leq a_i, b_i \leq n.

4. Existence Proof:
- Consider the original way (mij)1i,jn(m_{ij})_{1 \leq i, j \leq n} where mijm_{ij} is red if iji \leq j.
- Rearrange the rows and columns so that the way satisfies (a1,a2,,an;b1,b2,,bn)(a_1, a_2, \ldots, a_n; b_1, b_2, \ldots, b_n).
- It is easy to check that the new way is as desired. When swapping, the number of blocks in rows and columns does not affect each other.

5. Uniqueness Proof:
- For n=1n = 1, the solution is trivial.
- Assume it works for any i<ni < n. For the case nn, without loss of generality, let the first row's number be nn and the first column's number be 11.
- Remove these two lines, and we obtain the uniqueness for n1n-1.
- Each line we remove, which is full of red squares, is also unique for any possible way. This completes the proof.

6. Final Calculation:
- The number of ways to arrange the rows is n!n! and the number of ways to arrange the columns is also n!n!.
- Therefore, the total number of ways is 2×(n!)22 \times (n!)^2.

2×{(r1,r2,,rn;c1,c2,,cn)1rirjn,1cicjn,1i,jn}=2(n!)2 2 \times \left| \left\{ (r_1, r_2, \cdots, r_n; c_1, c_2, \cdots, c_n) \mid 1 \leq r_i \neq r_j \leq n, 1 \leq c_i \neq c_j \leq n, 1 \leq i, j \leq n \right\} \right| = 2 \cdot (n!)^2

The final answer is 2(2018!)2\boxed{2 \cdot (2018!)^2}

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