A 0 or 1 is to be placed in each of the nine squares in the grid shown so that each row contains at least one 0 and at least one 1, and each column contains at least one 0 and at least one 1.
The number of ways in which this can be done is
A 0 or 1 is to be placed in each of the nine squares in the grid shown so that each row contains at least one 0 and at least one 1, and each column contains at least one 0 and at least one 1.
The number of ways in which this can be done is
Pick one
Since each row in the grid must contain at least one 1, then there must be at least three 1s in the grid.
Since each row in the grid must contain at least one 0, then there must be at least three 0s in the grid. Since there are nine entries in the grid, then there must be at most six 1s in the grid.
Thus, there are three 1s and six 0s, or four 1s and five 0s, or five 1s and four 0s, or six 1s and three 0s.
The number of grids with three 1s and six 0s must be equal to the number of grids with six 1s and three 0s. This is because each grid of one kind can be changed into a grid of the other kind by replacing all of the 0s with 1s and all of the 1s with 0s.
Similarly, the number of grids with four 1s and five 0s will be equal to the number of grids with five 1s and four 0s.
Therefore, we count the number of grids that contain three 1s and the number of grids that contain four 1s, and double our total to get the final answer.
Counting grids that contain three 1s
Since each row must contain at least one 1 and there are only three 1s to use, then there must be exactly one 1 in each row.
Since each column must also contain a 1, then the three rows must be 1 0 0 , 0 1 0 , and 0 0 1 in some order.
There are thus 3 choices for the first row.
For each of these choices, there are 2 choices for the second row. The first and second rows completely determine the third row.
Therefore, there are (or ) configurations for the grid.
We note that each of these also includes at least one 0 in each row and in each column, as desired.
Counting grids that contain four 1s
Since each row must contain at least one 1 and there are four 1s to use, then there must be two 1s in one row and one 1 in each of the other two rows. This guarantees that there is at least one 0 in each row.
Suppose that the row containing two 1s is 1 1 0 .
One of the remaining rows must have a 1 in the third column, so must be 0 0 1 .
The remaining row could be any of 1 0 0 , 0 1 0 , and 0 0 1
We note that in any combination of these rows, each column will contain at least one 0 as well.
With the rows 1 1 0 , 0 0 1 , and 0 0 1, there are 3 arrangements.
This is because there are 3 choices of where to put the row 1 1 0 , and then the remaining two rows are the same and so no further choice is possible.
With the rows 1 1 0 , 0 0 1 , and 0 1 0 there are 6 arrangements, using a similar argument to the counting in the “three 1s” case above.
Similarly, with rows 1 1 0 , 0 0 1 , and 1 0 0 there are 6 arrangements.
So there are configurations that include the row 1 1 0 .
Using similar arguments, we can find that there are 15 configurations that include the row 1 0 1 and 15 configurations that include the row 0 1 1 .
Therefore, there are configurations that contain four 1s.
Finally, by the initial comment, this means that there are configurations.