$m\times n$ matrix with an even number of 1s in each row and column

So I want to find the number of ways to fill an $m\times n$ matrix with only 0s and 1s such that each row and column has an even number of 1s. I'm pretty stumped here. I've set up m+n equations summing the respective rows and columns yielding 0 mod2, but other than that I'm not too sure of a clean way to approach this.

The subsequent part asks for the same thing except that there's an odd number of 1s. Any hints and/or tips very much welcome.


Solution 1:

Hint: If $m=1$ or $n=1$, the problem is simple. So suppose they are both $\gt 1$.

Fill in everything with $0$'s and/or $1$'s except the bottom row and the rightmost column, in an arbitrary way.

Forget temporarily about the bottom right-hand corner. There is exactly one way to choose the rest of the bottom row and the rest of the rightmost column.

Now show that the bit in the bottom right corner that makes the sum of the full bottom row have even sum is the same bit that makes the full rightmost column have even sum. For this, use an old accounting principle.

Remark: For the question that was mentioned but not asked (odd sums) there will be parity considerations involving $m$ and $n$,