The total number of
Question:

The total number of $3 \times 3$ matrices A having entries from the set $(0,1,2,3)$ such that the sum of all the diagonal entries of $\mathrm{AA}^{\mathrm{T}}$ is 9 , is equal to____________.

Solution:

Let $\mathbf{A}=\left[\begin{array}{lll}\mathrm{a} & \mathrm{b} & \mathrm{c} \\ \mathrm{d} & \mathrm{e} & \mathrm{f} \\ \mathrm{g} & \mathrm{h} & \mathrm{i}\end{array}\right]$

diagonal elements of $\mathrm{AA}^{\mathrm{T}}, \quad \mathrm{a}^{2}+\mathrm{b}^{2}+\mathrm{c}^{2}, \mathrm{~d}^{2}+\mathrm{e}^{2}+\mathrm{f}^{2}, \mathrm{~g}^{2}+\mathrm{b}^{2}+\mathrm{c}^{2}$

Sum $=a^{2}+b^{2}+c^{2}+d^{2}+e^{2}+f^{2}+g^{2}+h^{2}+i^{2}=9$

$\mathrm{a}, \mathrm{b}, \mathrm{c}, \mathrm{d}, \mathrm{e}, \mathrm{f}, \mathrm{g}, \mathrm{h}, \mathrm{i} \in\{0,1,2,3\}$

Total no. of ways $=1+9+8 \times 63+63 \times 4=766$