The correct option is C (p−1)2
a cannot be equal to 0 as the trace would be divisible by p.
Hence, a can acquire values from {1,2,...,p−1}
Now let us select some value of a from the given set of values.
Let the remainder of a2 be r when divided by p.
Now, a2−bc must be divisible by p. Hence, bc must have the remainder r when divided by p.
Now, b or c cannot be 0.
If we select some value of b from {1,2,...,n−1} , we can exactly have one value of c such that the remainder of bc is r.
We can select b in p−1 ways.
For every value of a, b can be selected in p−1 ways.
a can be selected in p−1 ways.
Hence, total number of possible matrices =(p−1)×(p−1)