Exercise 12. We place 9 integers in the cells of a $3 \times 3$ grid such that the sum of the numbers in any column or row is always odd. What values can the number of even cells in such a configuration take?
Solution to Exercise 12: We denote by $a_{i, j}$ the number located at the cell of the $i$-th row and $j$-th column, where $1 \leqslant i, j \leqslant 3$. Since the sum over the three rows is odd, the sum of the $a_{i, j}$ is odd, and thus there is an odd number of odd numbers. The number of cells containing an even number can therefore be $0, 2, 4, 6$ or 8. It remains to see which of these values are actually achievable.

$\triangleright 0$ is possible because it suffices to put nine 1s in the grid.

$\triangleright 8$ is not possible, because otherwise, the pigeonhole principle would ensure the existence of a row containing 3 even numbers (thus having an even sum).

$\triangleright 4$ is possible; we choose $a_{11}=a_{12}=a_{21}=a_{22}=0$ and the rest equal to 1. The sums are 1 or 3 and are therefore odd.

$\triangleright 6$ is possible. We set $a_{11}=a_{12}=a_{22}=a_{23}=a_{31}=a_{33}=0$ and the rest equal to 1. All the sums are 1 and are odd.

$\triangleright 2$ is impossible because every row must contain an odd number of odd numbers, so our two even numbers must be in the same row. But then the same reasoning applies to the columns, and thus they are in the same column and therefore the same cell, which is absurd.

The number of cells with an even number can therefore take the values 0, 4, and 6.