TITLE: Find the probability that a matrix is diagonalizable
QUESTION [12 upvotes]: The original question is as follows,
Let $p$ be an odd prime number. The entries of a $2\times2$ matrix $A\in M_2(\mathbb Z_p)$ are selected at random.
(a) Find the possibility that $f_A(x)$ splits
(b) Find the possibility that $A$ is diagonalizable.
So I started by calculating probability with very small $p$. But this did not give me any useful information. I would like to seek for some hint to get me start with the question. Thanks for any help.

REPLY [2 votes]: Say $A=(a,b; c,d)\in M_2(\mathbb{F}_p)$. The characteristic polynomial splits if and only if the discriminant of the characteristic polynomial, $(a+d)^2-4(ad-bc)$, is a square in $\mathbb{F}_p$. Consider two cases:
Case 1 ($b\neq 0$) There are $(p+1)/2$ squares in $\mathbb{F}_p$, and for fixed $a,b,d$, the map $c\mapsto (a+d)^2-4(ad-bc)$ is bijective on $\mathbb{F}_p$, so the discriminant is a square with probability $(p+1)/(2p)$.
Case 2 ($b=0$) In this case the discriminant is $(a-d)^2$ (always a square).
Case 1 happens with probability $(p-1)/p$ and Case 2 with probability $1/p$, so the probability the characteristic polynomial splits is
$$
\frac{p-1}{p}\frac{p+1}{2p}+\frac{1}{p}1=\frac{1}{2}+\frac{1}{p}-\frac{1}{2p^2}.
$$
To compute the probability of diagonalizability: a $2\times 2$ matrix has a defective eigenvalue if and only if it is of the form $\lambda\cdot I+M$, with $\lambda\in\mathbb{F}_p$, $I$ the $2\times 2$ identity matrix, and $M$ a non-zero matrix having 0 as an eigenvalue with multiplicity 2. Let’s count the number of such $M$. One checks that $M$ must have the form $M=(a,b;c,-a)\neq 0$,
with $a^2+bc=0$.
If $a=0$ we need $b=0$ or $c=0$ but not both, so there are $2(p-1)$ possibilities. 
For fixed $a\neq 0$, we need $bc=-a^2$, so each non-zero $b$ determines a values of $c$, giving $p-1$ possibilities. There are $p-1$ possibilities for $a$, so there are $(p-1)^2$ matrices of this form (with $a\neq 0$). This gives a total of $2(p-1)+(p-1)^2=p^2-1$ matrices $M$. There are $p$ possible values of $\lambda$, so we get $p(p^2-1)$ matrices with a defective eigenvalue. A matrix is diagonalizable if and only if its characteristic polynomial splits and there are no defective eigenvalues, so the probability a matrix is diagonalizable is
$$
\frac{1}{2}+\frac{1}{p}-\frac{1}{2p^2}-\frac{p(p^2-1)}{p^4}=\frac{1}{2}-\frac{1}{2p^2}+\frac{1}{p^3}.
$$