Number of non-singular $3\times3$ matrices with elements $1$ or $-1$ I am searching for number of non-singular $3×3$ matrices with elements $1$ or $-1$. I tried using basic combinatorics but I couldn't count in a systematic manner and therefore got confused. Would someone please help?
Thanks in advance!
 A: A matrix is non-singular when the row (column) vectors are linearly independent.
Total number of 3-vectors is only $2^3=8$, namely,
$$(1,1,1), (-1,-1,-1) $$
$$(1,1,-1), (-1,-1,1) $$
$$(1,-1,1), (-1,1,-1) $$
$$(-1,1,1), (1,-1,-1) $$
Notice I have arranged these in pairs, so one in each pair is negative of another.
To make a non-singular matrix, we can choose one from each pair and arrange them in any order. Their number is
$$ {4\choose 3} \cdot 2^3 \cdot 3! = 192$$
as confirmed by OEIS link mentioned in comment.
Edit :
Here one should show that no three of ${(1,1,1), (1,1,-1),(1,-1,1),(-1,1,1)}$ are linearly dependent i.e., none of these is linear combination of any other two. This can be argued geometrically - no plane through any of these three points passes through origin.
A: This is really more of a comment than an answer, but I can't fit it in a comment box.  There are $2^3=8$ choices for the first row,  The second row can't be the same as the first row, nor the negative of the first row, leaving $6$ choices for the second row.  The third row can't be a scalar multiple of either of the first two, leaving $4$ choices, so we have at most $8\cdot6\cdot4=192$ matrices.  Of course, it's possible that the third row is a linear combination of the first two, even though it's not a scalar multiple of either of them.
I wrote a little python script to count the number of non-singular $3\times3$ matrices with $\pm1$ entries by brute force, and surprisingly, it cam up with $192$.  So, if we can somehow show that in this case, if no two rows are linearly dependent, then all three rows are linearly independent, we are done.  I've been thinking about this for a bit, but I don't see how to do it, and I'm going to bed now.
Here's the script:
import numpy as np
from itertools import product

count =0
for p in product((-1,1), repeat=9):
    A = np.array(p).reshape((3,3))
    if np.linalg.det(A):
        count += 1
print(count)
    

