The number of $2 × 2$ invertible matrices with entries from field $\mathbb{Z}_p$ Let $p$ be a prime number and let $\mathbb{Z}_p$ denote the field of integers modulo $p$. Find the number of $2 × 2$ invertible matrices with entries from this field.
an I get some help how to solve the problem.
thanks.
 A: Hints: 


*

*A square matrix is invertible if and only if its columns are linearly independent.

*Two non-zero vectors are linearly independent if and only if one is not a scalar multiple of the other.


How many choices are there for the first column? How many choices are there for the second column?
A: Remember that a matrix is invertible iff the columns are linearly independent. Then, how many choices for linearly independent columns you got?
Say for the first column, how many vectors are there in $\mathbb{Z}_{p}^2$ ? You have no retrictions there other than the vector being different than 0. So you got $p^2 -1$ for the first vector ( there are $p^2$ vectors and you get rid of the 0 vector ).
Now for your second column, once you fix the first one you only have to make sure it is not a multiple of the first one, how many of those are? Well, there are exactly p-1 linear combinations of the first vector because you have exactly p-1 scalars to pmultiply the first one.
So you got $(p^{2}-1)$ choices for the first one and $p^{2}-1-(p-1)=p^{2}-1-p+1=p^{2}-p$. So you have exactly $(p^{2}-1)(p^{2}-p)$ choices for linealy independent vectors. This is the number of invertible matrices in $\mathbb{Z}_{p}$
