I am interested in calculating the number of binary matrices of dimension $n$ by $k$ where each row has at least one non-zero element and each column has at least one non-zero element. I got the following equation: $M(n, k) = 2^{n \times k} - \sum_{i=1}^{n} (-1)^i \binom{n}{i} 2^{k \times (n - i)} - \sum_{i=1}^{k} (-1)^i \binom{k}{i} 2^{n \times (k - i)} + \sum_{i=1}^{n} \sum_{j=1}^{k} (-1)^{i+j} \binom{n}{i} \binom{k}{j} 2^{(n - i) \times (k - j)} $ is it correct?
Asked
Active
Viewed 20 times
0
-
1Is there a question? – PC1 May 05 '23 at 16:41
-
yes, is this equation correct? – K.D. May 05 '23 at 16:53
-
1Your formula is confirmed by Brian M Scott's answer. To see this, expand the $\left(2^{n-k}-1\right)^m$ in his formula using the binomial theorem. – Mike Earnest May 05 '23 at 17:07