Maths Olympiad Prep

Library / USA Tstst /12 of 33

USA Tstst

Combinatorics Difficulty 6.5 National Olympiad Prove it United States

Find all positive integers nn for which it is possible to color some cells of an infinite grid of unit squares red, such that each rectangle consisting of exactly nn cells (and whose edges lie along the lines of the grid) contains an odd number of red cells.

Solution

Proof. This can be achieved as follows: assuming the cells are labeled with (x,y)∈Z2(x, y) \in \mathbb{Z}^2, color a cell red if x≡0(mod2m)x \equiv 0 \pmod{2^m} and y≡0(mod2k−m)y \equiv 0 \pmod{2^{k-m}}. For example, a 4×24 \times 2 rectangle gets the following coloring:

Figure 1

A 2m×2k−m2^m \times 2^{k-m} rectangle contains every possible pair (x(mod2m),y(mod2k−m))(x \pmod{2^m}, y \pmod{2^{k-m}}) exactly once, so such a rectangle will contain one red cell (an odd number).

On the other hand, consider a 2ℓ×2k−ℓ2^\ell \times 2^{k-\ell} rectangle with ℓ>m\ell > m. The set of cells this covers is (x,y)(x, y) where xx covers a range of size 2ℓ2^\ell and yy covers a range of size 2k−ℓ2^{k-\ell}. The number of red cells is the count of xx with x≡0(mod2m)x \equiv 0 \pmod{2^m} multiplied by the count of yy with y≡0(mod2k−m)y \equiv 0 \pmod{2^{k-m}}. The former number is exactly 2ℓ−k2^{\ell-k} because 2k2^k divides 2ℓ2^\ell (while the latter is 0 or 1) so the number of red cells is even. The ℓ<m\ell < m case is similar. □\square

Finally, given these k+1k+1 colorings, we can add them up modulo 2, i.e. a cell will be colored red if it is red in an odd number of these k+1k+1 colorings. We illustrate n=4n=4 as an example; the coloring is 4-periodic in both axes so we only show one 4×44 \times 4 cell.

Figure 2

This solves the problem.

Alternate proof of (ii) using generating functions

We will commit to constructing a coloring which is nn-periodic in both directions. (This is actually forced, so it's natural to do so.) With that in mind, let
f(x,y)=∑i=02k−1∑j=02k−1λi,jxiyj f(x, y) = \sum_{i=0}^{2^k-1} \sum_{j=0}^{2^k-1} \lambda_{i,j} x^i y^j
denote its generating function, where f∈F2[x,y]f \in \mathbb{F}_2[x, y].

For this to be valid, we need that for any 2p×2q2^p \times 2^q rectangle with area nn, the sum of the coefficients of ff over it should be one, modulo x2k=y2k=1x^{2^k} = y^{2^k} = 1. In other words, whenever p+q=kp+q=k, we must have
f(x,y)(1+⋯+x2p−1)(1+⋯+y2q−1)=(1+⋯+x2k−1)(1+⋯+y2k−1), f(x, y)(1 + \cdots + x^{2^p-1})(1 + \cdots + y^{2^q-1}) = (1 + \cdots + x^{2^k-1})(1 + \cdots + y^{2^k-1}),
taken modulo x2k=y2k=1x^{2^k} = y^{2^k} = 1. The idea is to rewrite these expressions: because we're in characteristic 2, the given assertion is (x+1)2k=(y+1)2k=0(x+1)^{2^k} = (y+1)^{2^k} = 0, and the requested property is
f(x,y)(x+1)2p−1(y+1)2q−1=(x+1)2k−1(y+1)2k−1. f(x, y)(x + 1)^{2^p - 1}(y + 1)^{2^q - 1} = (x + 1)^{2^k - 1}(y + 1)^{2^k - 1}.
Whenever p+q=kp+q=k, we must have
g(x,y)x2p−1y2q−1=x2k−1y2k−1, g(x, y)x^{2^p-1}y^{2^q-1} = x^{2^k-1}y^{2^k-1},
g(x,y)=∑p+q=kx2k−2py2k−2q g(x, y) = \sum_{p+q=k} x^{2^k-2^p} y^{2^k-2^q}
works. The end.

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

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.