Maths Olympiad Prep

Library / /12 of 34

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 x0(mod2m)x \equiv 0 \pmod{2^m} and y0(mod2km)y \equiv 0 \pmod{2^{k-m}}. For example, a 4×24 \times 2 rectangle gets the following coloring:

Figure 1

A 2m×2km2^m \times 2^{k-m} rectangle contains every possible pair (x(mod2m),y(mod2km))(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×2k2^\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 22^\ell and yy covers a range of size 2k2^{k-\ell}. The number of red cells is the count of xx with x0(mod2m)x \equiv 0 \pmod{2^m} multiplied by the count of yy with y0(mod2km)y \equiv 0 \pmod{2^{k-m}}. The former number is exactly 2k2^{\ell-k} because 2k2^k divides 22^\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=02k1j=02k1λ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 fF2[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++x2p1)(1++y2q1)=(1++x2k1)(1++y2k1), 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)2p1(y+1)2q1=(x+1)2k1(y+1)2k1. 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)x2p1y2q1=x2k1y2k1, g(x, y)x^{2^p-1}y^{2^q-1} = x^{2^k-1}y^{2^k-1},
g(x,y)=p+q=kx2k2py2k2q 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,000 problems in a working order, from AMC 10 level to the IMO shortlist.

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