devarshi-dt-logo

Question:

How many 3x3 matrices M with entries from {0, 1, 2} are there, for which the sum of the diagonal entries of MTM is 5?

198

135

126

162

Solution:

Let M be a 3x3 square matrix, M = ⎡⎢⎣abcdefghi⎤⎥⎦
Thus, MTM = ⎡⎢⎣adgbehcfi⎤⎥⎦⎡⎢⎣abcdefghi⎤⎥⎦
The sum of the diagonal elements of MTM will be S = a2 + b2 + c2 + d2 + e2 + f2 + g2 + h2 + i2
For S = 5 ⇒ a2 + b2 + c2 + d2 + e2 + f2 + g2 + h2 + i2 = 5
out of {0, 1, 2}, there are only two possibilities:

  1. One element is 2, one element is 1 and the rest are 0 = 9C2 * 2! = 72
  2. Five elements are 1 and the rest are all 0 = 9C5 = 126
    Hence, total number of matrices M = 72 + 126 = 198
    Hence, option B is correct.