How to Find the Dimension of the Kernel of a Square Matrix
At a glance
- 1. Identify the size
An n × n matrix represents a linear map from an n-dimensional space to itself.
- 2. Find the rank
Row-reduce the matrix and count its pivot columns.
- 3. Apply rank-nullity
Subtract the rank from n: kernel dimension equals n minus rank.
- 4. Check special cases
An invertible matrix has kernel dimension zero; the zero matrix has kernel dimension n.
A square matrix does not have one fixed kernel dimension. If is an matrix, its kernel can have any dimension from through , depending on the entries of .
The key formula is the rank–nullity theorem:
Therefore,
Here, means the set of vectors satisfying . The dimension of the kernel is also called the nullity of .
Why the formula applies
An matrix defines a linear transformation
where is usually or . The kernel consists of all input vectors sent to the zero vector:
The rank is the dimension of the image, or column space, of . Rank–nullity says that the dimensions of the kernel and image add up to the dimension of the domain. Since the domain is , its dimension is .
The fact that the matrix is square only tells you that the domain and codomain have the same dimension. It does not tell you the rank.
How to calculate the dimension
For an matrix :
- Row-reduce to echelon form or reduced row-echelon form.
- Count the pivots. This number is .
- Subtract the rank from .
Equivalently, the number of free variables in the homogeneous system is the dimension of the kernel. Each free variable produces one parameter in the general solution, and the corresponding parameter vectors form a basis for the kernel.
Worked example
Consider
The second row is twice the first, so it contributes no new pivot. Row-reducing gives
There are two pivots, so . Because is a matrix,
To see the kernel directly, solve . The reduced equations are
Let . Then and , so
Thus
which confirms that the kernel has dimension .
Important special cases
For an matrix, the following cases are useful:
| Matrix property | Rank | Kernel dimension |
|---|---|---|
| Invertible | ||
| Singular with rank | ||
| Zero matrix |
If is invertible, the only solution to is . The kernel is then , whose dimension is . This is sometimes described as a trivial kernel.
At the other extreme, if is the zero matrix, then for every vector . Consequently, the kernel is all of and has dimension .
For example, a matrix of rank has a one-dimensional kernel, while a matrix of rank has a three-dimensional kernel.
Using the determinant carefully
For a square matrix,
is equivalent to invertibility. Therefore, a nonzero determinant immediately gives
However, only tells you that the kernel has positive dimension. It does not tell you exactly what that dimension is. You still need the rank, or an equivalent calculation, to distinguish between nullity , , and so on.
For instance, both a rank-two matrix and the zero matrix have determinant zero, but their kernel dimensions are respectively and .
Common mistakes
Assuming every square matrix has a zero-dimensional kernel
Only invertible square matrices have a zero-dimensional kernel. A singular square matrix has at least one nonzero vector in its kernel.
Confusing the number of rows with the rank
An matrix has rows, but some rows may be linearly dependent. The rank is the number of independent rows or columns, not simply the number of rows.
Counting nonzero rows before reducing
The rank is found from an echelon form, where the nonzero rows are counted after row reduction. Counting nonzero rows in the original matrix can give the wrong answer.
Forgetting the field
The dimension is normally taken over or . In some problems the matrix is considered over a finite field, such as . The same rank–nullity formula holds, but rank and kernel are computed using that field’s arithmetic.
Thinking the determinant gives the exact nullity
A zero determinant proves only that the nullity is at least . Row reduction is needed to determine its exact value.
References
- Linear Algebra Done Right, Sheldon Axler
- Introduction to Linear Algebra, Gilbert Strang
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.