[Math] How are these matrices row equivalent

linear algebramatrices

According to Morris, a. O. (Linear Algebra-an introduction, second edition) the following two matrices are row equivalent.
$$
\begin{pmatrix}
1 & 0 & 1 \\
2 & 1 & 0 \\
1 & -1 & 1
\end{pmatrix} \hspace{5ex} \begin{pmatrix}
3 & -1 & 1 \\
0 & 2 & 1 \\
1 & -1 & 1
\end{pmatrix}
$$
Reducing each matrix to echelon form, I get

$$
\begin{pmatrix}
1 & 0 & 1 \\
0 & 1 & -2 \\
0 & 0 & 1
\end{pmatrix} \hspace{5ex} \begin{pmatrix}
3 & -1 & 1 \\
0 & 2 & 1 \\
0 & 0 & 1
\end{pmatrix}
$$
I am not able to reduce the matrices to exactly the same entries (except if I have to reduce each matrix into canonical form, in which case they both become identity matrices), so my contention was that they are row equivalent because a) they have the same rank and b) the pivot elements are in the exact same places.
What is the correct answer?
Correction to first row of first matrix is (1 0 1). Further correction to row reduced echelon form of the first matrix.

Best Answer

$$\pmatrix{1&0\cr0&0\cr}{\rm\ and\ }\pmatrix{1&1\cr0&0\cr}$$ have the same rank, and have pivot elements in exactly the same places, but they aren't row equivalent. You do have to go to what you call canonical form (what I call reduced row echelon form).