# Reduce a matrix to reduced row echelon form

I have an exercise to find two basis to the null space of the following matrix:

\begin{bmatrix} 1 & 2 & 1 &1 \\[0.3em] 1 & 2 & 2 &-1 \\[0.3em] 2 & 5 & 0 &6 \end{bmatrix}

I'm going to use the fact that $N(A)= N(rref(A))$ ($rref(A)$ is the reduced row echelon form of A) and my basis will be:

• the pivot columns in $rref(A)$
• the corresponding columns in the original matrix $A$.

Ok, however by doing this I ended up a question:

When I get to:

\begin{bmatrix} 1 & 2 & 1 &1 \\[0.3em] 0 & 0 & 1 &-2 \\[0.3em] 0 & 1 & -2 &4 \end{bmatrix}

Should I exchange row 2 with row 3 to have a pivot? Also, does the operation of "exchanging rows" changes the fact that we can choose the equivalent columns in the original matrix as a basis of the null space of the matrix (tell me if I'm not being clear)

Thanks!

• Are you using Gilbert Strang's textbook? Sep 8, 2016 at 11:44
• No, I'm watching the videos on Khan Academy Sep 8, 2016 at 12:07

No, exchanging rows does not change anything about your approach, since we are still approaching the rref of $A$. Row switching is, after all, a valid row-operation. The only time where row-switching is problematic is if we are looking for an $LU$-decomposition (in this context, we disallow row-switches during the row-reduction process).
Note, however, that the method you describe for extracting a basis for the nullspace from the rref is incorrect; you would instead end up with a basis for the column space. It is indeed sufficient, however, to determine the nullspace of $rref(A)$, which will be precisely the same as the nullspace of $A$.