Null Space Calculator
Calculate the null space (kernel) of any matrix step-by-step. Find the nullity, rank, pivot columns, and basis vectors spanning the kernel.
What Is the Null Space (Kernel) of a Matrix?
In linear algebra, the null space (also known as the kernel) of an $m \times n$ matrix $A$ is the set of all vectors $\mathbf{x} \in \mathbb{R}^n$ that satisfy the homogeneous linear system:
$$A\mathbf{x} = \mathbf{0}$$
Mathematically, the null space is denoted as:
$$\operatorname{Null}(A) = \ker(A) = \{\mathbf{x} \in \mathbb{R}^n \mid A\mathbf{x} = \mathbf{0}\}$$
The null space is always a valid vector subspace of $\mathbb{R}^n$. Its dimension is called the nullity of $A$, written as $\operatorname{nullity}(A) = \dim(\operatorname{Null}(A))$.
The Rank-Nullity Theorem
One of the foundational theorems of linear algebra connects the dimension of the column space (the rank) to the dimension of the null space (the nullity). For any $m \times n$ matrix $A$ with $n$ columns:
$$\operatorname{rank}(A) + \operatorname{nullity}(A) = n$$
This equation reveals that every column in the matrix corresponds to either a pivot variable (contributing to rank) or a free variable (contributing to the dimension of the null space).
How to Find the Null Space Step by Step
Finding a basis for the null space involves three systematic steps:
- Row Reduce to RREF: Perform Gauss-Jordan elimination on matrix $A$ to obtain its Reduced Row Echelon Form ($\operatorname{RREF}(A)$).
- Identify Pivots and Free Variables: Columns containing a leading $1$ are pivot columns. All remaining columns correspond to free variables ($x_{f_1}, x_{f_2}, \dots$).
- Write the Parametric Solution: Express pivot variables in terms of free variables. Setting each free variable to $1$ while setting all other free variables to $0$ produces the linearly independent basis vectors $\mathbf{v}_1, \mathbf{v}_2, \dots$ spanning $\operatorname{Null}(A)$.
Worked Example
Consider the $3 \times 3$ matrix $A$:
$$A = \begin{bmatrix} 1 & 2 & -1 \\ 2 & 4 & -2 \\ 3 & 6 & -3 \end{bmatrix}$$
- RREF Form: Eliminating rows $2$ and $3$ gives: $$\operatorname{RREF}(A) = \begin{bmatrix} 1 & 2 & -1 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix}$$
- Pivot and Free Variables: Column $1$ is the only pivot column ($\operatorname{rank} = 1$). Columns $2$ and $3$ are free variables ($x_2, x_3$), giving $\operatorname{nullity} = 3 - 1 = 2$.
- Solve Homogeneous Equation: $x_1 + 2x_2 - x_3 = 0 \implies x_1 = -2x_2 + x_3$.
-
Construct Basis:
- Setting $x_2 = 1, x_3 = 0 \implies \mathbf{v}_1 = \begin{bmatrix} -2 \\ 1 \\ 0 \end{bmatrix}$
- Setting $x_2 = 0, x_3 = 1 \implies \mathbf{v}_2 = \begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix}$
Related Linear Algebra Tools
Explore more matrix calculation and linear algebra tools:
- Column Space Calculator: Find the basis and dimension of the image / column space.
- Matrix Rank Calculator: Calculate matrix rank and determine linear independence.
- Gauss Jordan Elimination Calculator: Solve linear systems and compute RREF step by step.
- Matrix Determinant Calculator: Find the determinant and check matrix invertibility.
- Matrix Inverse Calculator: Compute the inverse matrix $A^{-1}$.
Frequently Asked Questions
What does it mean if the nullity is zero?
If $\operatorname{nullity}(A) = 0$, the only vector that satisfies $A\mathbf{x} = \mathbf{0}$ is the zero vector $\mathbf{x} = \mathbf{0}$. This means the columns of $A$ are linearly independent, and the linear transformation is injective (one-to-one).
Can a square matrix with non-zero determinant have a non-trivial null space?
No. If a square matrix has a non-zero determinant ($\det(A) \neq 0$), it is invertible. Multiplying $A\mathbf{x} = \mathbf{0}$ by $A^{-1}$ yields $\mathbf{x} = A^{-1}\mathbf{0} = \mathbf{0}$. Therefore, invertible matrices always have a trivial null space with nullity equal to zero.
What is the difference between null space and column space?
The null space $\operatorname{Null}(A)$ is a subspace of $\mathbb{R}^n$ containing all input vectors mapped to zero by $A$. The column space $\operatorname{Col}(A)$ is a subspace of $\mathbb{R}^m$ containing all possible linear combinations of the columns of $A$ (the range of the transformation).
How does null space relate to eigenvalues and eigenvectors?
The eigenspace associated with an eigenvalue $\lambda$ is the null space of the matrix $(A - \lambda I)$. Specifically, any non-zero vector in $\operatorname{Null}(A - \lambda I)$ is an eigenvector of $A$ corresponding to $\lambda$.