Number of matrices commuting with given matrices. Topics to learn Suppose we are integerested in square $n \times n$ matrices over finite field of order $p$, where $p$ is prime.
Also suppose there are given $m$ such matrices.
The question I should dive in is "What the expected number of matrices each of which commutes with each of given $m$ matrices?".
Please, recommend me some material that can help with this question. Which topics should I learn?
 A: Here $K=\mathbb{Z}/p\mathbb{Z}$. Assume that $p$ is a large number and that $m=2$; when we randomly choose matrices $A,B\in M_n(K)$, each of these matrices has distinct eigenvalues (in an algebraic closure of $K$) with probability close to $1$. If $X$ commute with $A,B$, then $X\in K[A]\cap K[B]$. In general $K[A]\cap K[B]=$the set of scalar matrices; finally, except exceptional cases, the number of convenient $X$ is $p$ and the expected value (in a probabilistic sense) is close to this number (especially if $p$ is a large number).
EDIT. That follows is a heuristic solution. If $A,B$ are chosen, then $Z$ denotes the number of solutions in $X$.
Wacky Proposition.  If $n=2$ then $E(Z)\approx p+1$ and if $n\geq 3$, then $E(Z)=p+O(\dfrac{n}{p^{2n-4}})$. 
Wacky Proof. The cas $n=2$ is easy. Assume that $n\geq 3$. We seek an estimate of $E(Z)-p$; the probability that $A$ AND $B$ have not (each) distinct eigenvalues is negligible. Then we assume that $A$ (only) has distinct eigenvalues and is fixed; for the sake of simplicity, we assume that these eigenvalues are in $K$. Then $X$ is a diagonal matrix $diag(x_1I_{\alpha_1},\cdots,x_kI_{\alpha_k})$, where the $(x_i)$ are distinct and $B$ is in the form $diag(B_1,\cdots,B_k)$. The leading term of $E(Z)$ is obtained when $k=1$ and is $p$; the second term of $E(Z)$ is obtained when $k=2$: for instance $X=diag(x_1,x_2I_{n-1})$ and $B=diag(b_1,B_2)$. Its contribution to the calculation of $E(Z)$ is $\dfrac{p^2p^{(n-1)^2+1}}{p^{n^2}}=\dfrac{1}{p^{2n-4}}$. Finally, one has $n$ choices for the location of $x_1$ and we are done.
