Problem:
Marina fills the cells of a grid by writing in each one the number , the number or the number . In how many ways can the grid be filled so that the sum of each row and the sum of each column are divisible by ?
Problem:
Marina fills the cells of a grid by writing in each one the number , the number or the number . In how many ways can the grid be filled so that the sum of each row and the sum of each column are divisible by ?
Pick one
Solution:
The answer is (D). Let us start by filling the sub-table in the top left in any way we like: for each of the cells we have choices, hence in total possibilities. Now we show that, for each of these, the choice of the other cells turns out to be forced and always possible.
Each of the first three cells of the fourth row (call them ) is clearly forced by the sum of the three cells in its own column, and the same holds for the first three cells of the fourth column ().
Now the last remaining cell, in the bottom right, is forced by the sum of the cells in the last row and also by the sum of the cells in the last column: we show that these sums leave the same remainder upon division by , which allows us to conclude. Calling the sum of the numbers chosen at the beginning, is a multiple of , and so is , but then and leave the same remainder upon division by , as we wanted. In particular, in the bottom right corner only the remainder of upon division by can go (doing so, the sum of the columns on the fourth row has the same remainder upon division by as , that is , and similarly for the fourth column).
Therefore for each of the initial choices there is one and only one working completion, so the answer is .