2

There seems to be a simple answer for this problem, but I just can't figure it out. I know there must be at least 3-9 zeros for a valid arrangement, and that there are $3!$ (6) possible combinations for 3 zeros yet only 1 combination for 9 zeros. Yet I am stuck on how to calculate the other possibilities.

joriki
  • 238,052
  • 2
    for 6 zeroes, it's clear that there are 6 ways to fail: you can have all three ones in a single row or column. there are C(9, 6) = 84 ways to arrange six zeroes, and 78 of them will work. for 7 and 8 zeroes, all possible layouts work, there are 36 and 9 layouts respectively. that leaves 4 and 5, which are the hard ones. – Dan Uznanski Apr 05 '16 at 20:20
  • 2
    I can't answer your question about your specific strategy, counting the number of possibilities with a specific number of zeros. But there's a different solution to the original problem here: http://math.stackexchange.com/questions/439596/number-of-0-1-m-times-n-matrices-with-no-empty-rows-or-columns – Chris Culter Apr 05 '16 at 20:50

2 Answers2

2

Dan Uznaski has already counted the number of ways of doing it with $6$ to $8$ zeros in a comment, leaving the cases of $4$ or $5$ zeros.

With $4$ zeros, there will be one row and one column with two zeros each. There are $3\cdot3=9$ ways to choose them. Then there is $1$ arrangement in which their intersection has a one, and otherwise there are $2\cdot2=4$ ways to place the zeros in them, fixing the position of the fourth zero, for a total of $9(1+4)=45$.

For $5$ zeros, continuing in the spirit of Dan's count for $6$ zeros, there are $4$ ones, and to fail, three of them must be in exactly one row or one column. There are $6$ choices, and then in each case $6$ choices where to place the fourth one, so $6\cdot6=36$ arrangements out of $\binom95=126$ fail, leaving $90$.

Putting it all together, including your results and Dan's, we get

$$6+45+90+78+36+9+1=265$$

valid arrangements, in agreement with Brian's result from the answer that Chris Culter linked to in a comment:

$$ \sum_{k=0}^3\binom3k(-1)^k\left(2^{3-k}-1\right)^3=343-81+3=265\;. $$

joriki
  • 238,052
2

This is an alternate approach, which admittedly is more complicated than joriki's answer and Brian's result:

Let S be the set of all ways to fill these matrices, and

let $A_i$ for $1\le i\le3$ be the set of matrices with all 1's in row $i$, and

let $A_i$ for $4\le i\le 6$ be the set of matrices with all 1's in column $i-3$.

Then $\big|\overline{A_1}\cap\cdots\cap\overline{A_6}\big|=\big|S\big|-\sum\big|A_i\big|+\sum\big|A_i\cap A_j\big|-\sum\big|A_i\cap A_j\cap A_k\big|+\cdots+\big|A_1\cap\cdots\cap A_6\big|$

$\displaystyle=2^9-6(2^6)+[3(2^3)+3(2^3)+3(3)(2^4)]-[2(1)+2(3)(3)(2^2)]+[6(1)+3(3)(2^1)]-6(1)+1(1)$

$=265$.

user84413
  • 27,211