# Consider the set of all $n\times n$ matrices, how many of them are invertible modulo $p$. [duplicate]

Possible Duplicate:
Groups/Linear maps

Given a natural number $n$, consider the set of all $n\times n$ matrices where each element is a member of $\mathbb Z_p$, where $p$ is a prime.

How many of these matrices are invertible modulo $p$?

What you're looking for is Theorem 2.1.1 in the following PDF notes: $$| {\rm GL}(n, \mathbb{Z}_p) | = \prod_{i=0}^{n-1} (p^n- p^i)$$
You can learn more about ${\rm GL}(n,\mathbb{Z}_p)$ here on Wikipedia.