Total number of elements in $$\bigl|\mathrm{GL}_2(\mathbb{Z}/p^{r+1}\mathbb{Z})\bigr|=p^{4r}(p^2-1)(p^2-p).$$ Let us count the number of matrices with a given trace $s$. It is $$\sum_{a\in \mathbb{Z}/p^{r+1}\mathbb{Z}} \bigl|(c,d):p\, \text{does not divide}\, a(s-a)-cd\bigr|.$$ Clearly it depends only on the remainder of $s$ modulo $p$. For $s$ divisible by $p$, we have $p^{2r}(p-1)^2$ pairs $(c,d)$ for any $a$ divisible by $p$ and $p^{2r+2}-(p^{r+1}-p^r)$ pairs for $a$ not divisible by $p$. The total number is $$p^{3r}(p-1)^2+(p^{2r+2}-(p^{r+1}-p^r))(p^{r+1}-p^r)\\=(p^{r+1}-p^r)(p^{2r}(p-1)+p^{2r+2}-p^{r+1}+p^r).$$ So, for any given remainder $s$ modulo $p^{r+1}$, which is divisible by $p$, the probability that a random matrix from $\mathrm{GL}_2(\mathbb{Z}/p^{r+1}\mathbb{Z})$ has a trace equal to $s$, equals $$\frac{p^{r}(p-1)+p^{r+2}-p+1}{p^{2r+1}(p^2-1)}.$$
3 of 3
I changed $a$ to $s$ in the last sentence, to be in harmony with earlier notation.
GH from MO
- 105.4k
- 8
- 294
- 398
Fedor Petrov
- 108.9k
- 9
- 264
- 459