Matrix Rank Calculator
Determine the rank, nullity, linearly independent rows, and fundamental subspace dimensions of any square or rectangular matrix via step-by-step Gaussian row reduction.
Matrix Rank Definition & Theorem
The rank of a matrix is the maximum number of linearly independent row or column vectors. It equals the number of non-zero rows in its Row Echelon Form (REF). For an m × n matrix, 0 ≤ rank(A) ≤ min(m, n).
Matrix Rank Definition & Vector Space Dimension
The rank of an $m \times n$ matrix $A$, denoted $\text{rank}(A)$ or $\text{rk}(A)$, is defined as the dimension of the vector space generated (spanned) by its rows or columns:
Geometrically, if a matrix $A$ acts as a linear transformation mapping vectors from $\mathbb{R}^n$ to $\mathbb{R}^m$, the rank is the spatial dimension of the output image. A $3 \times 3$ matrix with rank 2 compresses all 3D space onto a 2D plane passing through the origin.
Row Rank Equals Column Rank Theorem
One of the deepest theorems in linear algebra states that the maximum number of linearly independent rows always equals the maximum number of linearly independent columns:
Even when a matrix is non-square (e.g. $2 \times 100$), its 100 column vectors in $\mathbb{R}^2$ can span at most a 2-dimensional plane, so the column rank can never exceed 2—matching the row rank exactly.
The Rank-Nullity Theorem & Kernel Dimension
For any linear transformation $T: V \to W$ represented by an $m \times n$ matrix $A$, the total dimension of the domain $n$ is partitioned between the dimension of the image ($\text{rank}$) and the dimension of the kernel ($\text{nullity}$):
The subspace of all possible output vectors $A\mathbf{x}$. Corresponds to pivot columns in REF.
The subspace of all vectors $\mathbf{x}$ mapped to zero ($A\mathbf{x} = \mathbf{0}$). Corresponds to free variables.
Full Rank vs Rank-Deficient Matrices
$\text{rank}(A) = \min(m, n)$.
- For square $n \times n$: $\det(A) \neq 0$, $A$ is invertible ($A^{-1}$ exists).
- Trivial null space: $\text{nullity}(A) = 0$.
- $A\mathbf{x} = \mathbf{b}$ has a unique solution.
$\text{rank}(A) < \min(m, n)$.
- For square $n \times n$: $\det(A) = 0$, non-invertible.
- Non-trivial null space: $\text{nullity}(A) \ge 1$.
- Rows/columns contain linear dependencies.
Applications in Data Science (PCA, SVD & Compression)
Low-Rank Matrix Approximation
Singular Value Decomposition (SVD) truncates high-dimensional data matrices into rank-$k$ approximations, compressing images and recommendation systems (Netflix algorithm).
Principal Component Analysis (PCA)
Identifies the rank (intrinsic dimensionality) of high-dimensional feature datasets, eliminating collinearity and redundant features.
Robotics & Kinematic Singularities
When a robotic arm's Jacobian matrix drops rank (rank deficiency), the robot loses degrees of freedom and cannot move in certain spatial directions.
Graded Step-by-Step Numerical Solutions
Find rank and nullity of $A = \begin{pmatrix} 1 & 3 & 1 & 4 \\ 2 & 6 & 3 & 9 \\ 3 & 9 & 4 & 13 \end{pmatrix}$
1. Forward elimination: $R_2 - 2R_1 \rightarrow R_2 \implies [0, 0, 1, 1]$. $R_3 - 3R_1 \rightarrow R_3 \implies [0, 0, 1, 1]$.
2. Zero out row 3: $R_3 - R_2 \rightarrow R_3 \implies [0, 0, 0, 0]$.
3. Number of non-zero rows = 2, so $\text{rank}(A) = 2$.
4. Total columns $n = 4$, so $\text{nullity}(A) = 4 - 2 = 2$.
Common Pitfalls & Zero-Row Recognition
Lead Developer & Founder of Basic Math Tools. Specializes in browser-native computational algorithms and applied mathematics.
Mathematics & curriculum specialists. Audited against standard algebraic and arithmetic principles.