3.2: Null Space
- Page ID
- 21813
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)The null space of an \(m\)-by-\(n\) matrix \(A\) is the collection of those vectors in \(\mathbb{R}^{n}\) that \(A\) maps to the zero vector in \(\mathbb{R}^m\). More precisely,
\[\mathcal{N}(A) = \{x \in \mathbb{R}^n | Ax = 0\} \nonumber\]
Null Space Example
As an example, we examine the matrix \(A\)
\[A = \begin{pmatrix} {0}&{1}&{0}&{0}\\ {-1}&{0}&{1}&{0}\\ {0}&{0}&{0}&{1} \end{pmatrix} \nonumber\]
It is fairly easy to see that the null space of this matrix is:
\[\mathcal{N}(A) = \{t \begin{pmatrix} {1}\\ {0}\\ {1}\\ {0} \end{pmatrix} | t \in \mathbb{R}\} \nonumber\]
This is a line in \(\mathbb{R}^{4}\)
The null space answers the question of uniqueness of solutions to \(S \textbf{x} = \textbf{f}\). For, if \(S \textbf{x} = \textbf{f}\) and \(S \textbf{y} = \textbf{f}\) then \(S(\textbf{x}-\textbf{y}) = S\textbf{x}-S\textbf{y} = \textbf{f}-\textbf{f} = 0\) and so \((\textbf{x}-\textbf{y}) \in \mathcal{N}(S)\). Hence, a solution to \(S \textbf{x} = \textbf{f}\) will be unique if, and only if, \(\mathcal{N} S = \{0\}\)
Method for Finding the Basis
Let us now exhibit a basis for the null space of an arbitrary matrix A. We note that to solve \(A \textbf{x} = 0\) is to solve \(A_{red} \textbf{x} = 0\). With respect to the latter, we suppose that
\[\{c_{j} | j = \{1, \cdots, r\}\} \nonumber\]
are the indices of the pivot columns and that
\[\{c_{j} | j = \{r+1, \cdots, n\}\} \nonumber\]
are the indices of the nonpivot columns. We accordingly define the r pivot variables
\[\{x_{c_{j}} | j = \{1, \cdots, r\}\} \nonumber\]
and the \(n-r\) free variables
\[\{x_{c_{j}} | j = \{r+1, \cdots, n\}\} \nonumber\]
One solves \(A_{red} \textbf{x} = 0\) by expressing each of the pivot variables in terms of the nonpivot, or free, variables. In the example above, \(x_{1}, x_{2}\), and \(x_{4}\) are pivot while \(x_{3}\) is free. Solving for the pivot in terms of the free, we find \(x_{4} = 0, x_{3} = x_{1}, x_{2} = 0\), or, written as a vector,
\[\textbf{x} = x_{3} \begin{pmatrix} {1}\\{0}\\{1}\\{0} \end{pmatrix} \nonumber\]
where \(x_{3}\) is free. As \(x_{3}\) ranges over all real numbers the x above traces out a line in \(\mathbb{R}_{4}\). This line is precisely the null space of \(A\). Abstracting these calculations we arrive at:
Suppose that \(A\) is m-by-n with pivot indices \(\{c_{j} | j = \{1, \cdots, r\}\}\) and free indices \(\{c_{j} | j = \{r+1, \cdots, n\}\}\). A basis for \(\mathcal{N}(A)\) may be constructed \(n-r\) vectors \(\{z^{1}, z^{2}, \cdots,z^{n-r}\}\) where \(z^{k}\), and only \(z^k\) possesses a nonzero in its \(c_{r+k}\) component.
A MATLAB Observation
As usual, MATLAB has a way to make our lives simpler. If you have defined a matrix A and want to find a basis for its null space, simply call the function null(A)
. One small note about this function: if one adds an extra flag, 'r'
, as in null(A, 'r')
, then the basis is displayed "rationally" as opposed to purely mathematically. The MATLAB help pages define the difference between the two modes as the rational mode being useful pedagogically and the mathematical mode of more value (gasp!) mathematically.
Final thoughts on null spaces
There is a great deal more to finding null spaces; enough, in fact, to warrant another module. One important aspect and use of null spaces is their ability to inform us about the uniqueness of solutions. If we use the column space to determine the existence of a solution \(\textbf{x}\) to the equation \(A \textbf{x} = b\). Once we know that a solution exists it is a perfectly reasonable question to want to know whether or not this solution is the only solution to this problem. The hard and fast rule is that a solution \(\textbf{x}\) is unique if and only if the null space of \(A\) is empty. One way to think about this is to consider that if \(A \textbf{x} = 0\) does not have a unique solution then, by linearity, neither does \(A \textbf{x} = b\). Conversely, if \((Az = 0) \wedge (z \ne 0) \wedge (A \textbf{y} = b)\) then \(A(z+\textbf{y}) = b\) as well.