# SubsectionThe Assignment

• Read chapter 3 section 3 of Strang.
• Read the following and do the exercises below.

# SubsectionLearning Goals

Before class, a student should be able to:

• State a definition of the rank of a matrix.
• Compute the rank of a matrix.
• Describe the relation between the rank and the size of the column space.
• Construct the nullspace matrix associated to a matrix.

Some time after class, a student should be able to:

• Use the RREF and special solutions associated to a matrix to describe how free columns are linear combinations of earlier pivot columns.

# SubsectionDiscussion: The Rank of a Matrix

The new concept for this section is the rank of a matrix. There are three definitions of rank given in the first two pages of this section. It is important to know them and see that they are equivalent.

Another important part of what happens here is the realization that putting the matrix into reduced row echelon form, which uses row operations, actually tells us something about the columns of the matrix. This is kind of amazing.

Take a matrix $A$ and put it into reduced row echelon form $R = \mathrm{rref}(A)$. Then $A$ and $R$ have the same shape. In particular, they have the same number of columns. But in $R$ it is easy to see the location of the pivots. This divides up the columns of $R$ into those columns having a pivot, the pivot columns, and those which do not, the free columns. We will label a column of $A$ as a pivot column or a free column in a way that corresponds. Here is the startling fact:

How exactly can we see this? Strang uses the construction of a nullspace matrix. The special solutions we learned about in the last section can be bundled together as the columns of a matrix $N$, called the nullspace matrix. This matrix has two important properties:

• $AN = 0$; and
• Each column of $N$ (i.e. each special solution) holds the coefficients needed to write down a interesting linear combination equation on the columns of $A$.

Finally, please use some caution when reading through the area with blue boxes and equations (4) and (5) on page 147. Note that Strang introduces a big simplifying assumption that makes his work easier. The general principles will hold, but those nice, neat equations won't always look so good for an arbitrary matrix.

# SubsectionSageMath and the Rank

SageMath has a built-in command for the rank of a matrix. It is called .rank(), of course.

SageMath knows how to do the underlying computations, too. Let's have Sage compute the reduced row echelon form of A:

Nice! Note that this fits the “special case” form that Strang uses on page 147. Let's see what else it can do.

We can make SageMath give us just the matrix in that last response.

That is almost Strang's version of a nullspace matrix in this case. Part of what we need to do is make the rows into columns. The transpose command is the way to do that:

That is NOT exactly Strang's nullspace matrix. But it is very close. In fact, it still has this crucial property:

What has happened here is that SageMath constructs a different version of the nullspace matrix than Strang does. Strang's version is easier to find by hand and tends to have $1$'s and $0$'s and the end. The SageMath version comes from a routine that strongly prefers to start with $1$'s and $0$'s.

The two version of nullspace matrix are related, of course. Let's see how:

That is Strang's nullspace matrix.

Where does this relationship come from? I have a hint: Column Operations. How can we use the structure of matrix multiplication to see why left multiplication by E.inverse() performs some column operations?

Here is another thing to think about: where does that E come from? Compare A and N. Notice anything? Remember that Strang wants the nullspace matrix to have $1$'s and $0$'s in the free columns.

# SubsectionExercises

Give an example of a $5 \times 3$ matrix which has
• rank equal to 3, and
• all non-zero entries,
or explain why no such example is possible.
Give an example of a $3 \times 3$ matrix which has
• a nullspace of $\{0\}$, and
Consider the matrix \begin{equation*} A = \begin{pmatrix} 2 & 1 & 5 \\ 1 & 1 & 7 \end{pmatrix}.\end{equation*} Find the reduced row echelon form $R = \mathrm{rref}(A)$ of $A$. Track the row operations you use, and use them to find an invertible matrix $E$ so that $EA = R$.
Contine with the matrix of the last exercise. Find the null space matrix of $A$. Use the information contained in the nullspace matrix to write down a linear combination equation on the columns of $R = \mathrm{rref}(A)$ of the form \begin{equation*} a * \text{(column1)} + b * \text{(column2)} + c * \text{(column3)} = 0. \end{equation*} Explain why the matrix $E$ allows us to translate this equation into this one on the columns of $A$: \begin{equation*} a\begin{pmatrix} 2 \\ 1 \end{pmatrix} + b \begin{pmatrix} 1 \\ 1 \end{pmatrix} + c \begin{pmatrix} 5 \\ 7 \end{pmatrix} = \begin{pmatrix}0\\ 0 \end{pmatrix}. \end{equation*}
Consider the matrix $N$ given below. Make an example of two different matrices $A$ and $B$ which have different shapes and each have $N$ as nullspace matrix, or explain why such an example is not possible. \begin{equation*} N = \begin{pmatrix} -3 & 2 & -1 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \\ 2 & 6 & 1 \\ 0 & 0 & 1 \end{pmatrix} \end{equation*}
Consider the matrix $T = \left(\begin{smallmatrix} 2 & 1 \\ 1 & 1 \end{smallmatrix}\right)$. What is the nullspace matrix of $T$?