Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/notebooks/Chapter 10 -Null Space vs Col Space, Row Space and Rank.ipynb
Views: 449
Null Space
The null space, denoted as is the solution set of a homogeneous linear system, i.e. .
A null space is a always a subspace of , why? Because one solution can always be the origin .
As an example, consider a linear system.
The augmented matrix is
Before solving the system, we have already known there is no unique solution since a free variable presents, due to the fact that two equation with three variables.
Solve for the reduced echelon form.
is a free variable, the solution set can be written as
which is a line passing both origin and , also a subspace of .
Now consider another example, suppose we have an augmented matrix
The solution can be written as:
The is a subspace in with .
Null Space vs Col Space
Consider matrix
Column space is a subspace in , what is ? It is the number of rows, .
Null space is a subspace in , what is ? It is the number of columns, .
How to find any nonzero vector in and in ?
Any column in a matrix can be a nonzero vector in , for instance first column: .
But to find a nonzero vector in null space requires some effort, construct the augmented matrix then turn it into rref.
The solution set with a free variable (because column 3 has no pivot) is
If we pick , a nonzero vector in is
Now consider two vectors
$$u = \left[ \begin{matrix} 3 \\ -2 \\ -1\\ 0 \end{matrix} \right],\qquad v = \left[ \begin{matrix} 3 \\ -1\\3 \end{matrix} \right]\\$$Is in ? It can be verified easily
, therefore is not in .
Is in ? Construct an augmented matrix with , then solve it
The augmented matrix show there are solutions, i.e. is a linear combination of its column space basis, so is in .
Row Space
The Row space denoted as , contains all linear combination of row vectors and subspace in .
If we perform row operations on to obtain , both matrices have the same row space, because 's rows are linear combinations of 's. However, row operation will change the row dependence.
An Example
Find the row, column and null space of
The basis of the row space of is its first 3 rows: which are also the basis of the row space of . However it does not necessarily mean that first 3 rows of forms the basis for row space, because the dependence among rows changed by row operation.
In constrast, the basis of col space of is .
The null space is
Rank
Definition of rank: The rank is the dimension of the column space of . The nullity of is the dimension of the null space.
The Rank Theorem
The dimensions of the column space and the row space of an matrix are equal. Therefore, the rank is the same for either column space and row space.
This common dimension, the rank of , also equals the number of pivot positions in and satisfies the equation:
The intuition behind this is that when a matrix is converted into its reduced row echelon form (rref) , we can indirectly determine the basis of the column space by matching the columns of with those of . The columns in that correspond to pivot columns in form the basis of the column space.
In the rref, we can also directly see the basis of the row space. Each row in the basis of the row space must contain a pivot. The rows that do not contain pivots correspond to the free variables, which determine the dimension of the null space.
Example 1
If is matrix with a -dimension nullity, what is the rank of ?
- nullity means 10 free variables, so the pivots are , which is also the rank of .
Example 2
The matrices below are row equivalent.
Find rank and Nul
Find bases for Col and Row .
What is the next step to perform to find a basis for Nul ?
How many pivot columns are in a row echelon form of
, because has two pivots. And nullity is the number of free variables, there are 3, so .
Bases for is , and for is .
The and basis is
Perform rref on augmented
Transpose then do rref.
There are 2 pivot columns.
Actually, we don't need any calculation to know the rank of , because
Orthogonality of and
Here is the intersting connections of these subspaces we have discussed. Consider
The basis of row space of is and .And the is
The is
Now we can visualize their relations geometrically. Again keep in mind that Matplotlib does not render 3D properly, so you need some imagination as well.
Here is what we observe.
The is a plane and is a line which is perpendicular to the plane (maybe 3D plot not so obvious about it). It is easy to grasp the idea if you notice that in a homogeneous system , it breaks down into dot products
where are the rows of . In later chapters we will prove when the dot product of two vectors equals zero, they are geometrically perpendicular.
Let me write a summary:
The dimension of the row space is equal to the dimension of the column space (both are the rank of the matrix).
The row space of is orthogonal to the null space of .
The column space of is orthogonal to the left null space of .
The nullity of is
The is
The is
is a plane and is a line perpendicular to the plane. The intuition is similar to , here you can think of a system look like .
Rank Decomposition
Consider a matrix , the purpose is to decompose it into the multiplication of , , which are the bases of column space and row space respectively.
Get the basis of .
Then get the .
Multiply , we are getting back .
Verify if equals .