Maths Olympiad Prep

Library / /12 of 13

Combinatorics Difficulty 7.3 National olympiad, round 2 Find the answer

Some squares of a n×nn \times n table (n>2)(n>2) are black, the rest are white. In every white square we write the number of all the black squares having at least one common vertex with it. Find the maximum possible sum of all these numbers.

A number or a short expression. Spacing and $ signs are ignored.

Solution

The answer is 3n25n+23n^{2}-5n+2. The sum attains this value when all squares in even rows are black and the rest are white. It remains to prove that this is the maximum value. The sum in question is the number of pairs of differently coloured squares sharing at least one vertex. There are two kinds of such pairs: sharing a side and sharing only one vertex. Let us count the number of these pairs in another way. We start with zeroes in all the vertices. Then for each pair of the second kind we add 1 to the (only) common vertex of this pair, and for each pair of the first kind we add 12\frac{1}{2} to each of the two common vertices of its squares. For each pair the sum of all the numbers increases by 1, therefore in the end it is equal to the number of pairs. Simple casework shows that (i) 3 is written in an internal vertex if and only if this vertex belongs to two black squares sharing a side and two white squares sharing a side; (ii) the numbers in all the other internal vertices do not exceed 2; (iii) a border vertex is marked with 12\frac{1}{2} if it belongs to two squares of different colours, and 0 otherwise; (iv) all the corners are marked with 0. Note: we have already proved that the sum in question does not exceed 3×(n1)2+12(4n4)=3n24n+13\times(n-1)^{2}+\frac{1}{2}(4n-4)=3n^{2}-4n+1. This estimate is valuable in itself. Now we prove that the numbers in all the vertices cannot be maximum possible simultaneously. To be more precise we need some definitions. Definition. The number in a vertex is maximum if the vertex is internal and the number is 3, or the vertex is on the border and the number is 12\frac{1}{2}. Definition. A path is a sequence of vertices such that every two consecutive vertices are one square side away. Lemma. In each colouring of the table every path that starts on a horizontal side, ends on a vertical side and does not pass through corners, contains a number which is not maximum. Proof. Assume the contrary. Then if the colour of any square containing the initial vertex is chosen, the colours of all the other squares containing the vertices of the path is uniquely defined, and the number in the last vertex is 0. Now we can prove that the sum of the numbers in any colouring does not exceed the sum of all the maximum numbers minus quarter of the number of all border vertices (not including corners). Consider the squares 1×1,2×2,,(N1)×(N1)1\times 1, 2\times 2, \ldots, (N-1)\times(N-1) with a vertex in the lower left corner of the table. The right side and the upper side of such square form a path satisfying the conditions of the Lemma. Similar set of N1N-1 paths is produced by the squares 1×1,2×2,,(N1)×(N1)1\times 1, 2\times 2, \ldots, (N-1)\times(N-1) with a vertex in the upper right corner of the table. Each border vertex is covered by one of these 2n22n-2 paths, and each internal vertex by two. In any colouring of the table each of these paths contains a number which is not maximum. If this number is on the border, it is smaller than the maximum by (at least) 12\frac{1}{2} and does not belong to any other path. If this number is in an internal vertex, it belongs to two paths and is smaller than the maximum at least by 1. Thus the contribution of each path in the sum in question is less than the maximum possible at least by 12\frac{1}{2}, q.e.d.

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: Omni-MATH, licensed Apache-2.0. Statement and solution reproduced as published; topic and difficulty added by this site.