Compute the rank and nullity of the $\,3\times 3$ matrix over $\Bbb Z^3$ 
Compute the rank and nullity of the following matrix over $\mathbb{Z}^3$
$$ \begin{pmatrix} 1&1&2 \\ 2&1&2 \\ 2&0&0 \end{pmatrix} $$

Okay, by reducing the matrix, I get:
$$ \begin{pmatrix} 1&0&0 \\ 0&1&2 \\ 0&0&0 \end{pmatrix} $$
Great, so easily it is rank $=2$ and nullity $=1$. 
I feel that my answer is wrong, that question seemed to fast to complete and the fact that it was in $\mathbb{Z}^3$ was irrelevant (when I solved it) makes me worried that I did this problem wrong. So, I am hoping just for some advice, did I do the above problem incorrectly?
Thanks
 A: I'm assuming that the question refers to a matrix over ${\Bbb Z}_3$, the integers modulo $3$, not over $Z^3$, which makes no sense as far as I know.
To reduce row $2$ you could for example add row $1$. giving
$$2+1=3=0\ ,\quad 1+1=2\ ,\quad 2+2=4=1\ .$$
Continuing in the same way gives your result.
It is true that in this case if you reduce using normal arithmetic (that is,over ${\Bbb R}$ or ${\Bbb Q}$) you get the same result.  For a more interesting example you could try
$$\pmatrix{2&1&2\cr 1&1&2\cr 0&2&1\cr}\ .$$
This has rank $2$ over ${\Bbb Z}_3$ but rank $3$ over ${\Bbb R}$.
A: Row-reducing will always give you the answer. However, looking at the definition of rank here can help you see the answer faster. Rank is the number of linearly independent vectors in the matrix. You can clearly see that $2(1, 1, 0) = (2, 2, 0)$. Thus, you can throw one of the three vectors out. Now can you form $(1, 2, 2)$ from a linear combination of $(1, 1, 0)$? Obviously not, because of the $0$ in the third component of $(1, 1, 0)$. Thus, $(1, 2, 2)$ and $(1, 1, 0)$ are linearly independent. Similarly, $(1, 2, 2)$ and $(2, 2, 0)$ are linearly independent. So you have at most a set with two linearly independent vectors, so the rank is $2$. And we know that in a $3 \times 3$ matrix, the dimension of the space is $3$. So $Rank(M) + Nul(M) = 3$. Given that, $Nul(M) = 1$.  
