4. consider a table with $m$ rows and $n$ columns. In how many ways can this table be filled with all zeros and ones so that there is an even number of ones in every row and every column?
## 1st solution:

Name an admissible table that fulfills the requirements of the task. We first show that an admissible table is already uniquely determined by the entries in the upper left $m-1 \times n-1$ table. This is because the entries in the last column, with the exception of the field at the bottom right, must be 0 or 1, depending on whether the corresponding row already contains an even or an odd number of ones. Now the entries in the bottom row are also determined, because they are 0 or 1, depending on whether there is already an even or an odd number of ones in the corresponding column. Now we show that every $m-1 \times n-1$ table can be completed to an admissible table by adding another column on the right and another row at the bottom. This can then be done in exactly one way as described above. To do this, we proceed as follows: write a 0 or 1 in each field of the last column except the one at the bottom right, so that the number of ones in the corresponding row is even. Proceed in the same way with the fields in the bottom row except the one at the bottom right. If the last column and the bottom row now contain either twice an even
or twice an odd number of ones, then write a 0 or a 1 in the bottom right field. The table constructed in this way is then obviously valid. However, we can always do this, because the following applies:

The number of ones in the last column is odd.

![](https://cdn.mathpix.com/cropped/2024_04_28_a1eacb5182fb15703b28g-06.jpg?height=257&width=1311&top_left_y=494&top_left_x=475)

$\Longleftrightarrow$ The number of ones in the bottom line is odd.

Now we can fill the upper left $m-1 \times n-1$ table with zeros and ones in exactly $2^{(m-1)(n-1)}$ ways, and each such table can be completed to an admissible table in exactly one way. Therefore, the solution to the problem is

$$
2^{(m-1)(n-1)}
$$