Sum of all diagonal elements is equal to sum of square of each element of the matrix. i.e., A=[
a1
a2
a3
b1
b2
b3
c1
c2
c3
] then tr(A⋅AT) =a12+a22+a32+b12+b22+b32+c12+c22+c32 ∵ai,bi,ci∈{−1,0,1} for i=1,2,3 ∴ Exactly three of them are zero and rest are 1 or −1. Total number of possible matrices 9C3×26 =