I came across a problem in which we had to find the number of $3 \times 3$ matrices whose entries are $\pm 1$ and whose determinant is positive. By making a few possible matrices, I found out that the only possible values the determinant can take is are $0$ and $\pm 4$ but I have no idea how to find the number of matrices whose determinant is $4$.
Any help would be greatly appreciated! Thanks in advance!
Best Answer
Rewriting the membership constraint $x \in \{ \pm 1 \}$ as the quadratic equality constraint $x^2 = 1$, one cheeky way of finding the number of $3 \times 3$ matrices with $\pm 1$ entries and determinant equal to $4$ is to find the number of solutions of the following system of $10 = 1 + 3^2$ polynomial ($1$ cubic and $3^2$ quadratic) equations (in the $3^2$ entries) over $\Bbb R$:
$$\begin{aligned} \det({\rm X}) &= 4 \\ x_{11}^2 &= 1 \\ x_{12}^2 &= 1 \\ &\vdots \\ x_{33}^2 &= 1\end{aligned}$$
Using Macaulay2:
Thus, there are $\color{blue}{96}$ matrices.
Bernd Sturmfels, Ideals, Varieties and Macaulay 2 [PDF]
systems-of-equations polynomials ideals real-algebraic-geometry macaulay2