Formula and Method for the Null Space of a Matrix
The null space (also called the kernel) of an m×n matrix A is the set of every vector x that satisfies the homogeneous equation Ax = 0. It always contains at least the zero vector, and it forms a subspace of Rn — meaning any linear combination of solutions is also a solution. The number of independent vectors needed to span that subspace is called the nullity of A, and it is linked to the matrix's rank by the rank-nullity theorem: rank(A) + nullity(A) = n.
How the calculation works
Enter the number of rows and columns (up to 5×5) and type the matrix, one row per line, with entries separated by spaces or commas. The calculator uses Gauss-Jordan elimination to reduce A to its reduced row echelon form (RREF): it picks a pivot in each column (swapping rows as needed for numerical stability), scales the pivot row so the pivot equals 1, and clears every other entry in that column, both above and below the pivot. Columns that end up without a pivot correspond to free variables in the system Ax = 0. For each free variable, the calculator sets that variable to 1, sets every other free variable to 0, and reads the pivot variables directly off the RREF rows (each pivot variable equals the negative of the RREF entry in the free column). The resulting vector is one basis vector for the null space; the total count of free variables equals the nullity.
Common mistakes
- Wrong entry count: each row must contain exactly as many numbers as the selected column count, and the textarea must contain exactly as many rows as selected — extra or missing entries will be rejected.
- Confusing null space with row space or column space: the null space lives in Rn (the input/domain space) and answers "what does A send to zero?" — it is not the same subspace as the column space, which lives in Rm and answers "what outputs can A produce?"
- Assuming a matrix always has a nontrivial null space: if A has full column rank (rank = n), the only solution to Ax = 0 is x = 0 — the null space is trivial, containing just the zero vector, and nullity is 0.
Real-world applications
- Solving homogeneous systems of linear equations directly: any physical system described by Ax = 0 (equilibrium conditions, balanced circuits, conservation laws) has its full solution set described by the null space basis.
- Detecting linear dependence among columns: a nonzero null space vector gives the exact combination of columns that sums to zero, which is how it is used to identify redundant variables in regression and data matrices.
- Control theory and robotics use the null space of a Jacobian to find joint motions that do not change a robot's end-effector position (useful for avoiding obstacles without disturbing a task).
- Computer graphics and structural engineering use null spaces to find "free" deformation modes or degrees of freedom left unconstrained by a system of equations.