# Another counting problem

• Dec 19th 2011, 07:38 AM
alexmahone
Another counting problem
How many 2 x 2 matrices are there with entries from the set {0, 1, ..., k} in which there are no zero rows and no zero columns.

My solution

No. of matrices in which there are zero rows $=2(k+1)^2-1$ (Assume that the first row is a zero row. There are $(k+1)(k+1)=(k+1)^2$ ways of choosing the elements of the second row. Since the second row could as well be the zero row, we get $2(k+1)^2$ ways. Since we have counted the zero matrix twice, we must subtract 1.)
No. of matrices in which there are zero columns $=2(k+1)^2-1$
No. of matrices in which there are both zero rows and zero columns $=4k+1$ ( $4k$ matrices each with one non-zero element and 1 zero matrix.)
No. of matrices in which there are either zero rows or zero columns $=2[2(k+1)^2-1]-(4k+1)=4k^2+4k+1$
Total no. of matrices $=(k+1)^4$
No. of matrices in which there are no zero rows and no zero columns $=(k+1)^4-(4k^2+4k+1)=k^4+4k^3+2k^2$

Could someone please check if my solution is correct? Thanks.
• Dec 19th 2011, 08:11 AM
Plato
Re: Another counting problem
Quote:

Originally Posted by alexmahone
How many 2 x 2 matrices are there with entries from the set {0, 1, ..., k} in which there are no zero rows and no zero columns.
No. of matrices in which there are no zero rows and no zero columns $=(k+1)^4-(4k^2+4k+1)=k^4+4k^3+2k^2$

That is the correct answer. I will show you another way to think of it.
The matrix pattern $~\left(\begin{matrix} x & x\\x & x\end{matrix}\right)$ where $x$ is not zero can be formed in $k^4$ ways.

The matrix pattern $~\left(\begin{matrix} 0 & x\\x & x\end{matrix}\right)$ where $x$ is not zero can be formed in $k^3$ ways, but there 4 of those patterns.

The matrix pattern $~\left(\begin{matrix} 0 & x\\x & 0\end{matrix}\right)$ where $x$ is not zero can be formed in $k^2$ ways and there are 2 of those patterns.