How To Find Nullspace Of A Matrix

7 min read

The nullspace of a matrix represents one of the most fundamental concepts in linear algebra, serving as the gateway to understanding the solutions of homogeneous linear systems. In real terms, finding this space is not merely an academic exercise; it reveals the intrinsic structure of a linear transformation, indicating where information is lost or compressed. Here's the thing — at its core, the nullspace—often denoted as $N(A)$ or $\text{Null}(A)$—is the set of all vectors $\mathbf{x}$ that satisfy the equation $A\mathbf{x} = \mathbf{0}$. Whether you are analyzing the stability of a mechanical structure, compressing data in machine learning, or solving differential equations, the ability to compute the nullspace is an indispensable tool.

This changes depending on context. Keep that in mind.

Understanding the Concept: What Exactly Is the Nullspace?

Before diving into the computational mechanics, it is vital to visualize what the nullspace represents geometrically. Consider a matrix $A$ as a linear transformation mapping vectors from $\mathbb{R}^n$ to $\mathbb{R}^m$. The nullspace consists of every input vector that gets crushed into the zero vector in the output space No workaround needed..

If the matrix represents a system of linear equations, the nullspace represents all solutions to the homogeneous version of that system. This distinction is critical: while a non-homogeneous system $A\mathbf{x} = \mathbf{b}$ might have zero, one, or infinite solutions, the homogeneous system $A\mathbf{x} = \mathbf{0}$ always has at least one solution—the trivial solution $\mathbf{x} = \mathbf{0}$. The nullspace is the collection of all these solutions Most people skip this — try not to..

The dimension of the nullspace is called the nullity of the matrix. And the Rank-Nullity Theorem provides a profound relationship: $\text{rank}(A) + \text{nullity}(A) = n$, where $n$ is the number of columns. This theorem tells us that the "information preserving" dimension (rank) and the "information destroying" dimension (nullity) must sum to the total dimension of the domain Simple, but easy to overlook..

Easier said than done, but still worth knowing.

The Standard Algorithm: Gaussian Elimination to RREF

The most reliable, universal method for finding the nullspace involves reducing the matrix to its Reduced Row Echelon Form (RREF). Day to day, this process systematically eliminates variables until the structure of the solution set becomes transparent. Here is the step-by-step workflow.

Step 1: Augment and Row Reduce

Start with the matrix $A$. You do not strictly need to augment it with a zero column (since the right-hand side is $\mathbf{0}$ and row operations won't change it), but writing $[A | \mathbf{0}]$ helps keep track of the system. Perform Gaussian elimination (row operations) until the matrix is in RREF Surprisingly effective..

Recall the conditions for RREF:

    1. Each leading 1 is the only non-zero entry in its column. Which means the leading entry (pivot) in each non-zero row is 1. Worth adding: 2. But the leading 1 in a lower row appears farther to the right than the leading 1 in the row above. 3. Rows of all zeros are at the bottom.

Step 2: Identify Pivot Columns and Free Variables

Once in RREF, scan the columns from left to right. Columns containing a leading 1 are pivot columns (basic variables). Columns without a leading 1 are free columns (free variables). The number of free variables equals the nullity of the matrix.

Step 3: Express Basic Variables in Terms of Free Variables

Write out the system of equations corresponding to the RREF matrix. For each pivot row, solve for the basic variable in terms of the free variables.

Take this: if the RREF yields: $x_1 - 2x_3 + x_4 = 0$ $x_2 + 3x_3 - 2x_4 = 0$ Then $x_1$ and $x_2$ are basic variables, while $x_3$ and $x_4$ are free. Rearranging gives: $x_1 = 2x_3 - x_4$ $x_2 = -3x_3 + 2x_4$

Step 4: Construct the Basis Vectors (Special Solutions)

This is the constructive heart of the process. Assign values to the free variables to generate basis vectors for the nullspace. The standard convention is to set one free variable to 1 and the rest to 0, repeating for every free variable Worth knowing..

  • Vector 1: Set $x_3 = 1, x_4 = 0 \rightarrow \mathbf{v}_1 = \begin{bmatrix} 2 \ -3 \ 1 \ 0 \end{bmatrix}$
  • Vector 2: Set $x_3 = 0, x_4 = 1 \rightarrow \mathbf{v}_2 = \begin{bmatrix} -1 \ 2 \ 0 \ 1 \end{bmatrix}$

The nullspace is the span of these vectors: $N(A) = \text{span}{\mathbf{v}_1, \mathbf{v}_2}$. These vectors are linearly independent by construction and form a basis for the nullspace.

A Complete Worked Example

Let’s solidify the algorithm with a concrete $3 \times 5$ matrix $A$:

$A = \begin{bmatrix} 1 & 2 & 3 & 4 & 5 \ 2 & 4 & 6 & 8 & 10 \ 1 & 2 & 1 & 2 & 1 \end{bmatrix}$

1. Row Reduce to RREF:

  • $R_2 \leftarrow R_2 - 2R_1$
  • $R_3 \leftarrow R_3 - R_1$ $ \sim \begin{bmatrix} 1 & 2 & 3 & 4 & 5 \ 0 & 0 & 0 & 0 & 0 \ 0 & 0 & -2 & -2 & -4 \end{bmatrix} $
  • Swap $R_2$ and $R_3$; Scale $R_2$ by $-\frac{1}{2}$ $ \sim \begin{bmatrix} 1 & 2 & 3 & 4 & 5 \ 0 & 0 & 1 & 1 & 2 \ 0 & 0 & 0 & 0 & 0 \end{bmatrix} $
  • $R_1 \leftarrow R_1 - 3R_2$ (Clear above pivot) $ \text{RREF} = \begin{bmatrix} 1 & 2 & 0 & 1 & -1 \ 0 & 0 & 1 & 1 & 2 \ 0 & 0 & 0 & 0 & 0 \end{bmatrix} $

2. Identify Variables:

  • Pivot columns: 1 and 3 $\rightarrow$ Basic variables: $x_1, x_3$.
  • Free columns: 2, 4, 5 $\rightarrow$ Free variables: $x_2, x_4, x_5$.
  • Nullity = 3.

3. Write Equations: $x_1 + 2x_2 + x_4 - x_5 = 0 \implies x_1 = -2x_2 - x_4 + x_5$ $x_3 + x_4 + 2x_5 = 0 \implies x_3 = -x_4 - 2x_5$

4. Generate Basis Vectors (Special Solutions): We have three free variables, so we need three basis vectors That alone is useful..

  • Free var $x_2=1, x_4=0, x_5=0$: $x_1 = -2, x_3 = 0 \rightarrow \mathbf{v}_1 = \begin

Setting the free variables as described yields the following three special solutions:

  • Free variable (x_{2}=1,;x_{4}=0,;x_{5}=0)
    [ x_{1}= -2(1)-0+0 = -2,\qquad x_{3}= -0-2(0)=0 ] Hence
    [ \mathbf{v}_{1}= \begin{bmatrix}-2\ 1\ 0\ 0\ 0\end{bmatrix}. ]

  • Free variable (x_{4}=1,;x_{2}=0,;x_{5}=0)
    [ x_{1}= -2(0)-1+0 = -1,\qquad x_{3}= -1-2(0)= -1 ] Hence
    [ \mathbf{v}_{2}= \begin{bmatrix}-1\ 0\ -1\ 1\ 0\end{bmatrix}. ]

  • Free variable (x_{5}=1,;x_{2}=0,;x_{4}=0)
    [ x_{1}= -2(0)-0+1 = 1,\qquad x_{3}= -0-2(1)= -2 ] Hence
    [ \mathbf{v}_{3}= \begin{bmatrix}1\ 0\ -2\ 0\ 1\end{bmatrix}. ]

These three vectors are linearly independent by construction, and every solution of (A\mathbf{x}=0) can be written uniquely as a linear combination
[ \mathbf{x}=c_{1}\mathbf{v}{1}+c{2}\mathbf{v}{2}+c{3}\mathbf{v}{3},\qquad c{1},c_{2},c_{3}\in\mathbb{R}. ]

Therefore the nullspace of (A) is the three‑dimensional subspace
[ N(A)=\operatorname{span}!\left{\begin{bmatrix}-2\ 1\ 0\ 0\ 0\end{bmatrix}, \begin{bmatrix}-1\ 0\ -1\ 1\ 0\end{bmatrix}, \begin{bmatrix}1\ 0\ -2\ 0\ 1\end{bmatrix}\right}. ]


Conclusion

The procedure for finding a basis of the nullspace of any matrix (A) proceeds in four clear stages: (1) row‑reduce (A) to its reduced row‑echelon form; (2) identify pivot and free columns, thereby distinguishing basic from free variables; (3) solve each pivot equation for its basic variable in terms of the free variables; and (4) assign convenient values to the free variables—one at a time—to produce a set of mutually independent vectors that span all solutions. When applied to the concrete (3\times5) matrix above, this algorithm yields three basis vectors, confirming that the nullity of (A) equals three. The method is systematic, works for matrices of any size, and provides a complete description of the solution space of the homogeneous linear system (A\mathbf{x}=0) Not complicated — just consistent..

Just Added

Hot New Posts

If You're Into This

See More Like This

Thank you for reading about How To Find Nullspace Of A Matrix. We hope the information has been useful. Feel free to contact us if you have any questions. See you next time — don't forget to bookmark!
⌂ Back to Home