Prove that no matter how each cell of a 5 x 41 table is filled with a 0 or 1, one can choose 3 rows and 3 columns which intersect in 9 cells filled with identical numbers.

Prove that 41 is the lowest possible n for 5 x n table; i.e., the statement is not true for a 5 x 40 table.

Source: Colorado math contest.

Well, it is clear that 40 is not enough. There are 10 ways to arrange 3 0's and 2 1's, and another 10 ways to arrange 3 1's and 2 0's. If we have 2 of each of those in a 5 by 40 grid, there are clearly not three rows and columns that intersect in 9 identical numbers.

It is not hard convince myself that 41 is enough, with a little hand-waving. No matter what 41st row is added to the above grid, there are three rows and columns that intersect in 9 identical numbers. And the situation can hardly get better if any of the above rows are changed to 4 or 5 identical numbers. Not a rigorous proof, I know.