IMO 1986 · Problem 6

One is given a finite set of points in the plane, each point having integer coordinates. Is it always possible to color some of the points in the set red and the remaining points white in such a way that for any straight line \(L\) parallel to either one of the coordinate axes the difference (in absolute value) between the numbers of white point and red points on \(L\) is not greater than 1?

Official text of the problem. Official problem paper (PDF)

Answer

Yes, it is always possible.

Solution

Let \(S\) be the given finite set. If \(S\) is empty, the conclusion is immediate. Otherwise, construct pairs of points as follows:

  • On each horizontal line containing points of \(S\), list those points from left to right and pair the first with the second, the third with the fourth, and so on. At most one point on that line remains unpaired.
  • Independently, do the same on each vertical line, listing its points from bottom to top.

Form a graph whose vertices are the points of \(S\), with an edge joining each chosen pair. Call an edge horizontal or vertical according to the pairing that produced it. Two distinct points cannot form both a horizontal and a vertical pair, since that would require both their coordinates to agree.

Each vertex belongs to at most one horizontal pair and at most one vertical pair, so its degree is at most two. Consequently, every connected component is an isolated vertex, a path, or a cycle. To see this, if a component contains a cycle, each vertex on that cycle already has two incident edges, so no additional vertices can attach to it. If it contains no cycle, a longest path exhausts the component: an additional vertex would either extend the path or force an internal vertex to have degree at least three.

Every cycle has even length. Indeed, the two edges meeting at any vertex of a cycle must be one horizontal and one vertical. Thus horizontal and vertical edges alternate around the cycle, which requires an even number of edges.

We can therefore color every component so that the endpoints of every edge have opposite colors: color isolated vertices arbitrarily, alternate red and white along each path, and alternate around each cycle. The latter coloring is consistent because every cycle has even length.

Now let \(L\) be any horizontal line. Each horizontal pair on \(L\) contributes one red point and one white point. Since these pairs cover all points of \(S\) on \(L\) except possibly one, the two color counts differ by at most one. The identical argument using vertical pairs applies to every vertical line. Lines containing no points have difference zero.

Hence the required coloring always exists.

The solution was checked against John Scholes' IMO solution archive (Kalva).