# Number of Matrices having determinant 1

$$S$$ is collection of $$3 \times 3$$ Matrices with entries $$0$$ and $$1$$ real numbers. It is to be proved that number of Matrices in $$S$$ having determinant exactly $$1$$ is equal to the number of Matrices having determinant $$-1$$. How the bijection from these subsets of $$S$$ can be defined? Precisely a bijection from $$S_1$$ and $$S_2$$ is to be defined where $$S_1$$ is the set of Matrices in $$S$$ having determinant exactly $$1$$ and $$S_2$$ is the set of Matrices in $$S$$ having determinant exactly $$-1$$. Would mapping diagonal elements to anti diagonal elements work? This works for identity matrix.

• "would mapping diagonal elements to antidiagonal elements work?" If you rephrase that correctly. A much easier way of describing the bijection you seem to be reaching for is the one where the first row is swapped with the third row. Recall that swapping rows changes the sign of the determinant. – JMoravitz Dec 14 '19 at 14:46
• If you were only touching the diagonal, its possible you might have missed some cases, such as $\begin{bmatrix}0&1&0\\1&0&0\\0&0&1\end{bmatrix}$. Swapping the diagonal with the antidiagonal here (however you meant for that to work) might not have the intended effect. – JMoravitz Dec 14 '19 at 14:47
• In fact multiplying any matrix in $S_1$ by @JMoravitz's $\begin{bmatrix}0&1&0\\1&0&0\\0&0&1\end{bmatrix}$ will give a matrix in what you call $S_2$ (though $S_{-1}$ might be more helpful) and this is a bijection, as multiplying again by that will take you back to the original matrix – Henry Dec 15 '19 at 0:50

Hint: When you swap 2 rows of a matrix, their determinants are negative of each other.

Hint: When 2 rows of a matrix are identical, the determinant is 0.

Hence, we can create the bijection.

• Can we get exact count of such Matrices? – user61681 Dec 14 '19 at 16:10
• By listing and checking, yes. But otherwise, I believe it's not easily done. – Calvin Lin Dec 14 '19 at 16:12
• Can some Combinatorial technique for counting be used? – user61681 Dec 14 '19 at 16:16
• Nothing immediate comes to mind, but there's always some possibility that some obscure technique works for this, so I can't say "definitatly no", but will say "most likely no". – Calvin Lin Dec 14 '19 at 16:17

By Laplace expansion: $$\begin{vmatrix}a_{11}&a_{12}&a_{13}\\ a_{21}&a_{22}&a_{23}\\ a_{31}&a_{32}&a_{33} \end{vmatrix}= a_{11}\begin{vmatrix}a_{22}&a_{23}\\ a_{32}&a_{33} \end{vmatrix}- a_{21}\begin{vmatrix}a_{12}&a_{13}\\ a_{32}&a_{33} \end{vmatrix}+ a_{31}\begin{vmatrix}a_{12}&a_{13}\\ a_{22}&a_{23} \end{vmatrix}\\$$ Each $$2\times 2$$ determinant can be $$-1,0$$ or $$1$$. So can each term. The suitable cases are: $$1) \ 0-0+1\\ 2) \ 1-0+0\\ 3) \ 1-1+1\\ 4) \ -1+1+1\\ 5) \ 1+1-1$$ For case 1: $$a_{31}=a_{12}=a_{23}=1, \ a_{13}\cdot a_{22}=0$$ Then, the determinant is $$-1$$ when: $$a_{31}=a_{13}=a_{22}=1, \ a_{12}\cdot a_{23}=0$$ All other elements will be the same for both determinants $$1$$ and $$-1$$.

The other cases are considered similarly.

Well, it turns out you can also do things like $$\begin{vmatrix} 1 & 1 & 1 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{vmatrix}$$ with determinant 1.

So I wrote a short program to calculate the totals. I get:

count(determinant = -2) = 3
count(determinant = -1) = 84
count(determinant = 0) = 338
count(determinant = 1) = 84
count(determinant = 2) = 3
overall count = 512


Proof by enumeration. :-) I won't try to list them here.

#include <stdio.h>

main()
{
enum { BIAS=10 };
enum { COUNTS=BIAS*2+1 };
int counts[COUNTS];
int count = 0;
for (int i=0; i<COUNTS; i++) counts[i] = 0;

for (int a1 = 0; a1<2; a1++) {
for (int a2 = 0; a2<2; a2++) {
for (int a3 = 0; a3<2; a3++) {

for (int b1 = 0; b1<2; b1++) {
for (int b2 = 0; b2<2; b2++) {
for (int b3 = 0; b3<2; b3++) {

for (int c1 = 0; c1<2; c1++) {
for (int c2 = 0; c2<2; c2++) {
for (int c3 = 0; c3<2; c3++) {

int d = a1*b2*c3 - a1*b3*c2 - a2*b1*c3 + a2*b3*c1 + a3*b1*c2 - a3*b2*c1;

counts[d+BIAS]++;
count++;

} } }
} } }
} } }

for (int i=0; i<COUNTS; i++)
if (counts[i])
printf("count(determinant = %d) = %d\n", i-BIAS, counts[i]);
printf("overall count = %d\n", count);
}