Find a basis for \(\text{colsp}(X)\). What is \(\text{rank}(X)\)? Why? Hint: Column 5 is a linear combination of columns 1 and 2. With this fact, you should be able to answer this relatively quickly.
Lab 6: Rank, Column Space, Null Space, and Inverses
due for completion at 11:59PM Ann Arbor Time on Wednesday, May 27th, 2026
Each lab worksheet will contain several activities, some of which will involve writing code and others that will involve writing math on paper. To receive credit for a lab, you must complete as many of the activities as you can in 2 hours and submit a PDF of your work to Gradescope. We will provide specific instructions on how to submit programming activities (e.g. submitting the notebook or including a screenshot of some output).
Feel free to work with others in the course, but you must submit individually.
Activities
- Activity 1: Null Space of a Matrix with Linearly Independent Columns
- Activity 2: Fundamentals
- Activity 3: Outer Products
- Activity 4: The Systems of Equations View
- Activity 5: Symbolic Inverses
- Activity 6: Basics of Invertibility
- Activity 7: Programming
Note: You may find it helpful to work on the first few problems of Homework 5 before starting this lab.
Recap: Rank, Column Space, and Null Space (Chapter 5.3 and 5.4)
Suppose \(A\) is an \(n \times d\) matrix. Then, \(\text{rank}(A)\) is the number of linearly independent columns of \(A\).
| Notation | Description | Dimension | Subspace of | |
|---|---|---|---|---|
| Column space | \(\text{colsp}(A)\) | Span of the columns of \(A\) | \(\text{rank}(A)\) | \(\mathbb{R}^n\) |
| Row space | \(\text{colsp}(A^T)\) | Span of the rows of \(A\) | \(\text{rank}(A)\) | \(\mathbb{R}^d\) |
| Null space | \(\text{nullsp}(A)\) | Set of all vectors \(\vec{x}\) such that \(A\vec{x} = \vec{0}\) | \(d - \text{rank}(A)\) | \(\mathbb{R}^d\) |
Additionally, note that you can write the dot product of two vectors \(\vec u, \vec v \in \mathbb{R}^n\) as \(\vec u^T\vec v\):
\(\vec u^T = \begin{bmatrix}u_1 & u_2 & \cdots & u_n\end{bmatrix} \qquad \vec v = \begin{bmatrix}v_1 \\ \vdots \\ v_n\end{bmatrix}\)
\(\displaystyle \vec u^T\vec v = u_1v_1 + \dots + u_nv_n = \sum_{i=1}^{n}(u_iv_i) = \vec u \cdot \vec v\) (not \(\vec u^T \cdot \vec v\))
Activity 1: Null Space of a Matrix with Linearly Independent Columns
Let \(A = \begin{bmatrix} 3 & 0 \\ 0 & 4 \\ 1 & 0 \end{bmatrix}\). What is \(\text{nullsp}(A)\)?
Activity 2: Fundamentals
Let \(X=\begin{bmatrix}1 & 2 & -1 & 3 & 4 & 4 \\ 2 & 5 & -2 & 7 & 11 & 10 \\ 4 & 8 & -4 & 12 & 16 & 16\end{bmatrix}\).
Fill in the blanks: \(\text{colsp}(X^T)\) is a ____-dimensional subspace of ____.
Fill in the blanks: \(\text{nullsp}(X)\) is a ____-dimensional subspace of ____.
Find a basis for \(\text{nullsp}(X)\). Hint: You should be able to answer this without solving equations.
Suppose \(A\) is an \(n \times d\) matrix with rank \(r\). A CR decomposition of \(A\) is a product of two matrices \(C\) and \(R\), where \(A = CR\) and:
\(C\) is an \(n \times r\) matrix and \(R\) is a \(r \times d\) matrix
\(C\) contains the linearly independent columns of \(A\), selected left-to-right
\(R\) tells how to “mix’’ the columns of \(C\) (which are linearly independent) to reconstruct the columns of \(A\)
Let’s keep working with \(X = \begin{bmatrix}1 & 2 & -1 & 3 & 4 & 4 \\ 2 & 5 & -2 & 7 & 11 & 10 \\ 4 & 8 & -4 & 12 & 16 & 16\end{bmatrix}\).
Find a CR decomposition of \(X\). This shouldn’t take very much work; review your work from part a) in finding a basis for \(\text{colsp}(X)\).
The key idea being assessed here is that in \(A = CR\), the columns of \(C\) are linearly independent and a basis for \(\text{colsp}(A)\), while the rows of \(R\) are linearly independent and a basis for \(\text{colsp}(A^T)\)!
Activity 3: Outer Products
Suppose \(A = \vec u \vec v^T + \vec w \vec z^T\), where \(\vec u, \vec v, \vec w, \vec z \in \mathbb{R}^n\) are non-zero vectors.
What is \(\text{rank}(\vec u \vec v^T)\)?
Under what conditions is \(\text{rank}(A) = 2\)? What about \(\text{rank}(A) < 2\)? Hint: First, think about what happens when multiplying \(A\) by a vector \(\vec x \in \mathbb{R}^n\). Can you write this as a linear combination of some other vectors? The case for \(\text{rank}(A) = 2\) is more complicated than “\(\vec u\) and \(\vec w\) are linearly independent.”
Activity 4: The Systems of Equations View
Let \(A\) be an \(n \times d\) matrix of rank \(r\), and suppose there exists vectors \(\vec b \in \mathbb{R}^n\) such that
does not have a solution (meaning no \(\vec x\) makes \(A \vec x = \vec b\)).
What are all inequalities (\(<\) or \(\le\)) that must be true between \(n\), \(d\), and \(r\)?
How do you know that \(A^T\vec y= \vec 0\) has solutions other than \(\vec y=\vec 0\)?
Activity 5: Symbolic Inverses
Given that \(A\) is an invertible \(n \times n\) matrix that satisfies \(A^4 - 3A^2 + 2A - 4I = 0\), find an expression for \(A^{-1}\) in terms of \(A\).
Activity 6: Basics of Invertibility
Suppose \(A\) is an \(n \times n\) matrix. State as many of the equivalent conditions for invertibility as you can.
Activity 7: Programming
Complete the tasks in the lab06.ipynb notebook.
There are two ways to access the supplemental Jupyter Notebook:
Option 1 (preferred): Set up a Jupyter Notebook environment locally, use
gitto clone our course repository, and openlabs/lab06/lab06.ipynb. For instructions on how to do this, see the Environment Setup page of the course website.Option 2: Click here to open
lab06.ipynbon DataHub. Before doing so, read the instructions on the Environment Setup page on how to use the DataHub.
Once you’re done, include a screenshot of your completed Activity 7 implementation in your PDF submission of Lab 6 to Gradescope, making sure to include proof that the (local) autograder passed. Instructions on how to do this are in the lab notebook.