Maths WorkshopMaths problems with full solutions
Exercise 1307Combinatorics › Counting principlesOlympiadAdded 5 Nov 2026

A 7 × 7 grid with no rectangle of marked cells

#double counting#convexity#Fano plane#extremal

Statement

Some cells of a 7×77\times7 board are marked so that no four marked cells are the corners of a rectangle with sides parallel to the grid. What is the largest possible number of marked cells?

Hint

Count pairs of marked cells that lie in the same row. Each pair of columns can occur in at most one row. Then use convexity.

Show solutionHide solution

Solution

Idea. Count (row, pair of marked columns in that row).

Upper bound. Let rir_i be the number of marked cells in row ii, and T=∑riT=\sum r_i. A pair of columns can appear in at most one row. There are (72)=21\binom72=21 pairs of columns, so
∑i=17(ri2)≤21.\sum_{i=1}^7\binom{r_i}2\le21.
By convexity, ∑(ri2)≥T(T−7)14\sum\binom{r_i}2\ge\frac{T(T-7)}{14}. If T≥22T\ge22, this is at least 22⋅1514>23>21\frac{22\cdot15}{14}>23>21, a contradiction. So T≤21T\le21.

Construction with 2121. Number rows and columns 0,…,60,\dots,6 and mark in row ii the columns i, i+1, i+3(mod7)i,\ i+1,\ i+3\pmod7. The set {0,1,3}\{0,1,3\} is a perfect difference set modulo 77: any two rows share exactly one marked column, so there is no rectangle; 7⋅3=217\cdot3=21 marked cells.

Answer. 2121. (This is the incidence matrix of the Fano plane.)

Lesson. Count pairs inside each row, apply convexity, and look for a design that achieves the bound.