\(\newcommand{\augmatrix}[2]{\left(\begin{array}{@{}#1 |c@{}} #2 \end{array}\right)} \newcommand{\lt}{ < } \newcommand{\gt}{ > } \newcommand{\amp}{ & } \)

Section3.2The Nullspace

SubsectionThe Assignment

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

SubsectionLearning Goals

Before coming to class, a student should be able to:

  • Find the special solutions associated to a matrix.
  • Compute the reduced row echelon form of a matrix.
  • Identify the free variables and the pivot variables associated to a matrix.
  • Describe the nullspace of a matrix with the “simplest” set of equations possible.

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

  • Describe the complete solution to a homogeneous system of equations \(Ax = 0\).
  • Give an argument for why the nullspace is a vector subspace.

SubsectionDiscussion: The Nullspace, RREF, and Special Solutions

Strang aims right at the heart of things in this section, and does not waste any space. Let me highlight a few things:

Let \(A\) be an \(m\times n\) matrix. We do not require that \(A\) is a square matrix, that is, it may not be the case that \(m=n\). What we are most interested in is solving the equation \(Ax = 0\). Note that if \(A\) is not square, then the vectors \(x\) and \(0\) have different sizes.

By the way, an equation like \(Ax=0\) where the right hand side is zero is called a homogeneous equation.

  • The nullspace of \(A\) is the set of vectors \(x\) such that \(Ax=0\). It is a theorem that this is a vector subspace of \(\mathbb{R}^n\). It is a common to use the synonym the kernel of \(A\) in place of the terminology the nullspace of \(A\).
  • The key to everything is to not mind that your matrix isn't square. Just do Gauss-Jordan elimination anyway. The end result is called the reduced row echelon form of the matrix, or RREF for short.
  • Note that there is no discussion of using an augmented matrix in this section, even though we are solving systems of equations \(Ax=0\). This is because the vector on the right hand side is zero and will stay zero. There is nothing interesting to track!
  • The RREF is good for several things. One that is often overlooked is that one can use it to rewrite the system of equations in a “simplest form.” I mean that the equations left over in the RREF are somehow the easiest equations to use to cut out the solution as an intersection of hyperplanes.
  • In the RREF, all of the structure can be inferred from the splitting of the columns into two types: the pivot columns and the free columns. Since each column is associated to a variable in our system of linear equations (the columns hold coefficients!), it is also common to refer to pivot variables and free variables.
  • The number of free columns basically determines the “size” of the nullspace. This is an entry point to the concept of the dimension of a vector space. We shall see this in more detail later.
  • Strang points out an easy way to find some individual vectors in the null space: he calls these the special solutions. This is because they are solutions to the equation \(Ax=0\).

SubsectionSageMath and the Nullspace

The main idea in this section is to get solutions to homogeneous systems \(Ax=0\) by using the reduced row echelon form. This will compute the nullspace of the matrix \(A\). SageMath has some useful built in commands for this. Let us explore an example.

The most direct way is to ask SageMath for the nullspace. But SageMath doesn't call it that. It uses the synonym kernel. Also, because we do matrix vector multiplication with vectors on the right, we have to tell SageMath to do it that way.

Notice that SageMath returns the nullspace by specifying a basis. This is a complete set of special solutions! How can we be sure?

Let's check that those vectors are actually in the nullspace. This command should return two zero vectors in \(\mathbb{R}^3\).

Remember that the method to find the reduced row echelon form is .rref().

What this means is that the null space is described by the two equations \begin{equation*} \left\{ \begin{array}{rrrrrrrrr} v & & & - & y & - & 2 z & = & 0 \\ & & x & + & 2y & + & 3 z & = & 0 \end{array}\right. \end{equation*} That is, the nullspace is the intersection of these two hyperplanes in \(\mathbb{R}^4\).

Aha! SageMath is trying to tell us that the pivot variables \(v\) and \(x\) should be written in terms of the free variables \(y\) and \(z\). Strang's "easy way out" is to choose the free variables to be \(0\)'s and \(1\)'s in combination. Here we have two of them, so we will alternate. One special solution will be to choose \(y = 1\) and \(z=0\). Then we solve to get \(v = 1\) and \(x = -2\).

Similarly, we can choose \(y=0\) and \(z=1\) to get a second special solution. This leads to \(v=2\) and \(x = -3\).

These two vectors form a basis for the nullspace. Every vector in the nullspace can be written as a linear combination of these two vectors.

What is weird is that SageMath always wants its basis to look like \(1\)'s and \(0\)'s at the beginning, and our process makes them look like that at the end!

How can we be sure everything lines up? Well, it is possible to express the two vectors that SageMath gives us as a linear combination of the ones we just found, and vice versa. So we are getting two descriptions of the same space.

Can you see the matrix and its inverse hiding behind that? I found those relationships using row operations and a matrix inverse.

Anyway, what has happened is that SageMath has performed our calculations above, and then taken the extra steps of putting the matrix of basis vectors into reduced row echelon form, too.


For the first three exercises, your job is to find both

  • The minimal set of equations which cuts out the nullspace of the given matrix as an intersection of hyperplanes; and
  • the size of the nullspace, expressed through the number “independent directions” it contains.
As always, it will be crucial to explain how you know you are correct.

Consider the matrix \begin{equation*} A = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 8 & 5 \\ -1 & -2 & 0 \end{pmatrix} \end{equation*}
Consider the matrix \begin{equation*} A = \begin{pmatrix} 2 & 1 & 3 & 7 \\ 1 & 1 & 1 & -3 \end{pmatrix} \end{equation*}
Consider the matrix \begin{equation*} A = \begin{pmatrix} 2 & 3 & 5 & 6 \\ 1 & 1 & 2 & 3 \\ 0 & 1 & 1 & 0 \\ -1 & -1 & -2 & -3 \\ 1 & 1 & 2 & 3 \end{pmatrix} \end{equation*}

For the next three exercises, your job is to find a complete set of special solutions to the homogeneous equation \(Ax=0\). By a “complete set,” we mean “enough special solutions so that any vector in the nullspace of \(A\) can be expressed as a linear combination of your vectors.”

As always, it will be crucial to explain how you know you are correct.

Consider the matrix \begin{equation*} A = \begin{pmatrix} 6 & 7 \\ 7 & 8 \\ 1 & 0 \\ 4 & 5 \end{pmatrix} \end{equation*}
Consider the matrix \begin{equation*} A = \begin{pmatrix} 23 & 17 & 9 & 2 \\ 1 & -2 & 4 & 1 \\ 22 & 19 & 5 & 1 \end{pmatrix} \end{equation*}
Consider the matrix \begin{equation*} A = \begin{pmatrix} -3 & -6 & -9 & -12 \\ 1 & 2 & 3 & 4 \\ 1 & 4 & 9 & 16 \\ 1 & 8 & 27 & 64 \\ -1 & -1 & -1 & -1 \\ 0 & 0 & 1 & 0 \end{pmatrix} \end{equation*}