Question:
The number of all $3 \times 3$ matrices $A$, with enteries from the set $\{-1,0,1\}$ such that the sum of the diagonal elements of $A A^{T}$ is 3, is________.
Solution:
Let $\mathrm{A}=\left[a_{\mathrm{ii}}\right]_{3 \times 3}$
It is given that sum of diagonal elements of $\mathrm{AA}^{\mathrm{T}}$ is 3
i.e., $\operatorname{tr}\left(\mathrm{AA}^{\mathrm{T}}\right)=3$
$a_{11}^{2}+a_{12}^{2}+a_{13}^{2}+a_{21}^{2}+\ldots . .+a_{33}^{2}=3$
Possible cases are
$\left.\begin{array}{ll}0,0,0,0,0,0,1,1,1 & \rightarrow 1 \\ 0,0,0,0,0,0,-1,-1,-1 & \rightarrow 1 \\ 0,0,0,0,0,0,1,1,-1 & \rightarrow 3 \\ 0,0,0,0,0,0,-1,1,-1 & \rightarrow 3\end{array}\right\}^{9} C_{6} \times 8=84 \times 8=672$