<s>[INST] What mistake am I making when trying to do REF? I hope this kinda of question is allowed. I know that you're all uh.. very.. particular, for a lack of a better term, about the kinds of questions you get. I am just practicing a the most basic of reducing a matrix into row echelon form. I am getting a similar, but different answer in the book, but I cannot identify what I am doing incorrectly. Please help.
Matrix A = $ \begin{pmatrix}
2 & 2 & -5 & 2 \\
1 & 1 & -2 & 1 \\
1 & 0 & -3 & 4 
\end{pmatrix}  $
I start by permuting rows 1 & 3 then proceeding to multiply R1 by -1 and adding it to row 2 giving:
Matrix A = $ \begin{pmatrix}
1 & 0 & -3 & 4 \\
0 & 1 & 1 & -3 \\
3 & 2 & -5 & 2 
\end{pmatrix}  $
From here I multiply R1 by -3 and adding R3:
Matrix A = $ \begin{pmatrix}
1 & 0 & -3 & 4 \\
0 & 1 & 1 & -3 \\
0 & 2 & 4 & -10 
\end{pmatrix}  $
Followed by multiplying row 2 by -2 and adding row 3:
Matrix A = $ \begin{pmatrix}
1 & 0 & -3 & 4 \\
0 & 1 & 1 & -3 \\
0 & 0 & 2 & -4 
\end{pmatrix}  $
Lastly, I multiply row 3 by 1/2 giving:
Matrix A = $ \begin{pmatrix}
1 & 0 & -3 & 4 \\
0 & 1 & 1 & -3 \\
0 & 0 & 1 & -2 
\end{pmatrix}  $
The book says the answer is:
Matrix A = $ \begin{pmatrix}
1 & 1 & -1 & 1 \\
0 & 1 & 2 & 1 \\
0 & 0 & 0 & 1 
\end{pmatrix}  $
One problem may be that I don't have the pivot column correct so I am not doing it correctly because 1 should be in the last column of the last row, but I tried another example of a 4x4 matrix, using the same operations, and I definitely know the correct pivot column in that situation, but the answer was still different. Are any of these operations now allowed? Anyone notice what I am doing wrong here? Thanks!
 [/INST] In the first step we should have
$$\begin{pmatrix}
1 & 0 & -3 & 4 \\
0 & 1 & 1 & -3 \\
\color{red}2 & 2 & -5 & 2 
\end{pmatrix}$$
moreover we don't need to exchange rows at first, we can proceed as follow
$$\begin{pmatrix}
2 & 2 & -5 & 2 \\
1 & 1 & -2 & 1 \\
1 & 0 & -3 & 4 
\end{pmatrix} \stackrel{R3-R2}\to \begin{pmatrix}
2 & 2 & -5 & 2 \\
1 & 1 & -2 & 1 \\
0 & -1 & -1 & 3 
\end{pmatrix}$$$$\stackrel{2R2-R1}\to \begin{pmatrix}
2 & 2 & -5 & 2 \\
0 & 0 & 1 & 0 \\
0 & -1 & -1 & 3 
\end{pmatrix}\stackrel{exhange\,R3,R2}\to \begin{pmatrix}
2 & 2 & -5 & 2 \\
0 & -1 & -1 & 3 \\
0 & 0 & 1 & 0 
\end{pmatrix}$$
</s>