2 × 2 Matrices with both eigenvalues

in ℤ/pℤ

Michael P. Knapp Mathematical Sciences Department Loyola College 4501 North Charles Street Baltimore, MD 21210-2699 mpknapp@loyola.edu

Suppose that p is a prime number. In a recent article [1] in this MAGAZINE, Gregor Olšavský counted the number of 2 × 2 matrices with entries in the field ℤ/pℤ which have the additional property that both eigenvalues are also in ℤ/pℤ. In particular, he showed that there are

\frac{p^{2}}{2} (p^{2} + 2p − 1)

such matrices.

When I began reading Olšavský’s article, I thought that this would be an interesting theorem to present to my number theory class. Unfortunately for me, the key ingredient in his proof is a theorem from algebra relating the number of elements in a given conjugacy class of a group to the cardinality of the centralizer of an element in that conjugacy class. Since many of my students had not yet taken algebra and would not know about such concepts, I began to look for a proof which could be taught in an undergraduate number theory class. The purpose of this note is to provide such a proof.

Our strategy is to use the quadratic formula to find the roots of the characteristic polynomial of a matrix and then count the number of matrices for which these roots are in ℤ/pℤ. We will follow Olšavský’s notation and abbreviate ℤ/pℤ by F_{p}. Moreover, all of the variables and congruences mentioned in the proof should be interpreted modulo p.

If p = 2, then we cannot divide by 2 and so cannot use the quadratic formula to find roots of polynomials. However, we can verify by a direct calculation that of the 16 possible 2 × 2 matrices with entries in F_{2}, the only two whose eigenvalues are not both in F_{2} are

[ \begin{matrix}1 & 1 \\ 1 & 0 \end{matrix} ]  and  [ \begin{matrix}0 & 1 \\ 1 & 1 \end{matrix} ] .

So there are fourteen 2 × 2 matrices with entries in F_{2} and both eigenvalues in F_{2}, as desired.

If p > 2, then suppose that A is the matrix

A = [ \begin{matrix}a & b \\ c & d \end{matrix} ] .

Calculating the characteristic polynomial of A gives us

Char(A) = λ^{2} − (a + d)λ + (ad − bc).

We want to count the number of choices of a, b, c and d such that both roots of this polynomial are in F_{p}. Since p ≠ 2, we can use the quadratic formula to find that the roots of Char(A) are

λ ≡ \frac{a + d ± \sqrt{(−(a + d))^{2} − 4(ad − bc)}}{2} ≡ \frac{a + d ± \sqrt{(a − d)^{2} + 4bc}}{2},

where we interpret dividing by 2 to mean multiplying by the inverse and square roots are interpreted modulo p. Clearly, Char(A) has both roots in F_{p} if and only if (a − d)^{2} + 4bc is a perfect square in F_{p}. We will count the number of choices of a, b, c, and d such that this is true.

Let a and d be any fixed elements of F_{p}. There are p^{2} choices for their values. If b ≡ 0, then for each of the p possible choices of c, we know that

(a − d)^{2} + 4bc ≡ (a − d)^{2}

is a perfect square in F_{p}. So we have (p^{2})(1)(p) matrices with entries in F_{p}, both eigenvalues in F_{p} and b ≡ 0.

If b is one of the p − 1 possible nonzero values, then we use the fact that including 0 there are precisely (p + 1)/2 perfect squares in F_{p} (these being

0^{2}, 1^{1} ≡ (p − 1)^{2}, …, (\frac{p − 1}{2})^{2} ≡ (\frac{p + 1}{2})^{2}).

Hence there are (p+1)/2 values that can be added to (a−d)^{2} to obtain a perfect square modulo p, and each one of these is a unique multiple of 4b. Thus for each of the p − 1 nonzero values of b, we see that there are (p + 1)/2 values of c such that (a − d)^{2} + 4bc is a perfect square in F_{p}. So the total number of matrices with entries in F_{p}, both eigenvalues in F_{p}, and b ≢ 0 is (p^{2})(p − 1)(p + 1)/2. Therefore the total number of matrices (with any value of b) having entries in F_{p} and both eigenvalues in F_{p} is

(p^{2})(1)(p) + (p^{2})(p − 1) (\frac{p + 1}{2}) = \frac{p^{2}}{2} (p^{2} + 2p − 1) ,

as desired.

References

[1] G. Olšavský, The Number of 2 by 2 Matrices over ℤ/pℤ with Eigenvalues in the Same Field, Math Magazine, 76 (2003), 314–317.