Skip to main content
Mathematics LibreTexts

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}}\)

    Definition: Null Space

    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:

    Definition: A Basis for the Null Space

    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.


    This page titled 3.2: Null Space is shared under a CC BY 1.0 license and was authored, remixed, and/or curated by Steve Cox via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.