How many matrices are there in the vector space $M_{m \times n} (\mathbb{Z}_2)$? I got its answer $2^{mn}$ when I searched this site, but I was wondering how we arrived at this answer. I worked out different explanations for it, but I was unable to justify which one is correct:
First possible explanation:
Consider $M_{2 \times 2} (\mathbb{Z}_2)$, then each $2 \times 2$ matrix has $4$ entries while the field $\mathbb{Z}_2$ has $2$ elements. We can divide all the matrices in $M_{2 \times 2} (\mathbb{Z}_2)$ into $5$ cases: $0$ in $4$ entries, $0$ in $3$ entries and $1$ in rest, $0$ in $2$ entries and $1$ in rest, $0$ in $1$ entry and $1$ in rest and $1$ in $4$ entries. In first and fifth case, we get $1$ matrix, in second and fourth we get $4$ matrices and in third we get $6$ matrices.
Therefore, $1+4+6+4+1=16 \implies ^4C_0 + ^4C_1+^4C_2+^4C_3+^4C_4=2^4$
But then I was wondering if this was the right explanation and why we will use combinations instead of permutations when order of entries in a matrix is important.
Second possible explanation:
Then I thought maybe it can be explained by permutations with repetition: $n^r$ $\{$Here $n=2$ (cardinality of the field) and $r=4$ (number of entries in each matrix)$\}$.
I am not able to justify which explanation is correct (first, second or neither). Please help.
Thanks.

In general, if $F$ is a finite field with $q$ elements and $V$ is a $d$-dimensional vector space over $F$ then $V$ has $q^{d}$ elements ( every $v \in V$ has a unique expression of the form $\sum_{i=1}^{d} f_{i}v_{i}$ with each $f_{i} \in F$ , where $\{v_{i}: 1 \leq i \leq d \}$ is a fixed basis for $V$).
 It is clear that $M_{m \times n}(F)$ has dimension $mn$ (it has a basis consisting of those $mn$ different matrices with a single  entry $1$ and remaining entries zero).
