Null Space Basis Calculator
Find a basis for the null space, also known as the kernel, of a matrix by solving the homogeneous system Ax = 0. The null space contains every vector that the matrix maps to the zero vector, and its dimension is called the nullity.
A
Learn About Null Space Basis
In linear algebra, the null space (or kernel) of a matrix $\mathbf{A} \in \mathbb{R}^{m \times n}$ is the set of all vectors $\mathbf{x} \in \mathbb{R}^n$ that the matrix maps to the zero vector:
The null space is a vector subspace of the domain $\mathbb{R}^n$. It describes the kernel of the linear transformation $T(\mathbf{x}) = \mathbf{A}\mathbf{x}$. When $\operatorname{Null}(\mathbf{A}) = \{\mathbf{0}\}$, the transformation is one-to-one (injective); when $\operatorname{Null}(\mathbf{A})$ contains non-zero vectors, distinct inputs collapse to identical outputs.
Basis Extraction via RREF and Free Variables
To compute a basis for the null space:
- Reduce to RREF: Row reduce $\mathbf{A}$ to $\operatorname{RREF}(\mathbf{A})$. Because $\mathbf{A}\mathbf{x} = \mathbf{0}$ is homogeneous, elementary row operations preserve the exact solution space:
- Identify Pivot and Free Variables:
- Columns containing leading $1$s correspond to basic (pivot) variables.
- Columns without leading $1$s correspond to free variables.
- Parameterize Free Variables: Assign independent parameters ($x_{f_i} = t_i$) to each free variable.
- Solve for Basic Variables: Express pivot variables in terms of the free parameters:
- Vector Parametric Form: Decompose into a linear combination of basis vectors:
The vectors $\{\mathbf{v}_1, \dots, \mathbf{v}_k\}$ form a basis for $\operatorname{Null}(\mathbf{A})$.
Dimension and the Rank-Nullity Theorem
The dimension of the null space is the nullity of $\mathbf{A}$. The Rank-Nullity Theorem states:
If $\operatorname{rank}(\mathbf{A}) = n$, there are no free variables, so $\operatorname{Null}(\mathbf{A}) = \{\mathbf{0}\}$ and $\operatorname{nullity}(\mathbf{A}) = 0$.
Worked Numerical Example
Find a basis and dimension for the null space of:
- Row Reduce to RREF:
- $R_2 \leftarrow R_2 - 2R_1 \implies [0, 0, 1, 2]$
- $R_1 \leftarrow R_1 - R_2 \implies [1, 2, 0, 1]$
- Identify Variables:
- Pivot columns: $1$ and $3 \implies x_1, x_3$ are basic.
- Non-pivot columns: $2$ and $4 \implies x_2, x_4$ are free.
- Solve Equations:
- Assign Free Parameters ($x_2 = t_1, x_4 = t_2$):
- Resulting Basis:
Verification: $\operatorname{rank}(\mathbf{A}) (2) + \operatorname{nullity}(\mathbf{A}) (2) = n (4)$.
What does it mean if the null space contains only the zero vector?
When $\operatorname{Null}(\mathbf{A}) = \{\mathbf{0}\}$, the matrix has full column rank ($\operatorname{rank}(\mathbf{A}) = n$). Its column vectors are linearly independent, the transformation is one-to-one (injective), and any solvable system $\mathbf{A}\mathbf{x} = \mathbf{b}$ has a unique solution.
Why is the null space orthogonal to the row space?
The equation $\mathbf{A}\mathbf{x} = \mathbf{0}$ means that the dot product of $\mathbf{x}$ with every row $\mathbf{r}_i$ of $\mathbf{A}$ is zero ($\mathbf{r}_i \cdot \mathbf{x} = 0$). Being perpendicular to every row makes $\mathbf{x}$ perpendicular to every linear combination of rows, establishing $\operatorname{Null}(\mathbf{A}) = (\operatorname{Row}(\mathbf{A}))^\perp$.
How does the null space relate to the general solution of Ax = b?
The general solution to $\mathbf{A}\mathbf{x} = \mathbf{b}$ is $\mathbf{x} = \mathbf{x}_p + \mathbf{x}_h$, where $\mathbf{x}_p$ is any particular solution ($\mathbf{A}\mathbf{x}_p = \mathbf{b}$) and $\mathbf{x}_h \in \operatorname{Null}(\mathbf{A})$ ($\mathbf{A}\mathbf{x}_h = \mathbf{0}$). The null space determines the dimension of the solution set.
Can a wide matrix (fewer rows than columns) have a trivial null space?
No. For an $m \times n$ matrix with $m < n$, rank is bounded by rows: $\operatorname{rank}(\mathbf{A}) \le m < n$. By the Rank-Nullity Theorem, $\operatorname{nullity}(\mathbf{A}) = n - \operatorname{rank}(\mathbf{A}) \ge n - m > 0$. A wide matrix always has at least $n - m$ free variables and infinitely many non-trivial null solutions.
- Kernel and Fiber Bundles: In geometry, the null space forms the kernel of the linear map. Preimages $\mathbf{A}^{-1}(\mathbf{b})$ form parallel affine planes in $\mathbb{R}^n$, each being a geometric translation of $\operatorname{Null}(\mathbf{A})$ by a particular solution $\mathbf{x}_p$.
- Zero Eigenvalue Eigenspace: The null space of a square matrix $\mathbf{A}$ is identical to the eigenspace for eigenvalue $\lambda = 0$: $E_0 = \operatorname{Null}(\mathbf{A} - 0\mathbf{I}) = \operatorname{Null}(\mathbf{A})$. A matrix is singular ($\det(\mathbf{A}) = 0$) if and only if $\operatorname{nullity}(\mathbf{A}) \ge 1$.