Matrix Rank Calculator
Determine the rank of a matrix, which is the maximum number of linearly independent rows or columns. Rank is an important measure of a matrix's information content and helps determine the dimensions of its fundamental subspaces.
A
Learn About Matrix Rank
Definition of Matrix Rank
The rank of an $m \times n$ matrix $\mathbf{A}$, denoted $\operatorname{rank}(\mathbf{A})$, is the maximum number of linearly independent row vectors in the matrix, which fundamentally equals the maximum number of linearly independent column vectors:
Geometrically, $\operatorname{rank}(\mathbf{A})$ represents the dimension of the image or column space $\operatorname{dim}(\operatorname{Col}(\mathbf{A})) \subseteq \mathbb{R}^m$ formed by the linear transformation $\mathbf{x} \mapsto \mathbf{A}\mathbf{x}$.
Fundamental Rank Boundaries
For any $m \times n$ rectangular matrix:
- The only matrix with rank $0$ is the zero matrix ($\mathbf{0}$).
- A matrix achieves full rank if $\operatorname{rank}(\mathbf{A}) = \min(m, n)$.
- If $\operatorname{rank}(\mathbf{A}) < \min(m, n)$, the matrix is rank-deficient.
Full Rank Classifications
- Full Column Rank ($\operatorname{rank}(\mathbf{A}) = n \le m$): Columns are linearly independent. The null space is trivial ($\operatorname{Null}(\mathbf{A}) = \{\mathbf{0}\}$), the mapping is injective (one-to-one), and a left inverse exists: $\mathbf{A}_L = (\mathbf{A}^T\mathbf{A})^{-1}\mathbf{A}^T$.
- Full Row Rank ($\operatorname{rank}(\mathbf{A}) = m \le n$): Rows are linearly independent. The mapping is surjective (onto $\mathbb{R}^m$), $\mathbf{A}\mathbf{x} = \mathbf{b}$ is solvable for every $\mathbf{b}$, and a right inverse exists: $\mathbf{A}_R = \mathbf{A}^T(\mathbf{A}\mathbf{A}^T)^{-1}$.
- Full Rank Square ($m = n$): $\operatorname{rank}(\mathbf{A}) = n \iff \det(\mathbf{A}) \ne 0 \iff \mathbf{A}$ is invertible.
Calculation via Row Echelon Reduction
The calculator computes rank by applying Gauss-Jordan elimination to reduce $\mathbf{A}$ to Reduced Row Echelon Form (RREF). Because elementary row operations preserve linear combinations, the rank equals the count of non-zero rows (pivot positions) in the echelon form:
The Rank-Nullity Theorem
For any $m \times n$ matrix, the sum of its rank and nullity (dimension of the kernel) strictly equals the number of columns:
Worked Numerical Example
Determine the rank of the $3 \times 3$ matrix $\mathbf{A} = \begin{bmatrix} 1 & 2 & 1 \\ -2 & -4 & -2 \\ 3 & 7 & 4 \end{bmatrix}$:
- Row 2 Elimination (Add $R_2 \leftarrow R_2 + 2 R_1$):
- Row 3 Elimination (Add $R_3 \leftarrow R_3 - 3 R_1$):
- Swap Rows 2 and 3 ($R_2 \leftrightarrow R_3$) and eliminate above pivot:
There are exactly $2$ non-zero pivot rows. Therefore, $\operatorname{rank}(\mathbf{A}) = 2$. The matrix is rank-deficient ($2 < 3$), with nullity $n - r = 3 - 2 = 1$.
1. Why is row rank always equal to column rank?
Although the $m$ row vectors live in $\mathbb{R}^n$ and the $n$ column vectors live in $\mathbb{R}^m$, row rank and column rank are mathematically identical. When a matrix is row reduced to echelon form, row operations do not change the linear dependencies between columns. The number of independent rows (non-zero rows) equals the number of pivot columns, forcing row rank and column rank to be equal.
2. How does matrix rank determine the solvability of linear systems?
By the RouchΓ©-Capelli Theorem, a linear system $\mathbf{A}\mathbf{x} = \mathbf{b}$ has a solution if and only if the rank of the coefficient matrix equals the rank of the augmented matrix:
If the augmented matrix has greater rank, the system is inconsistent (no solution). If ranks are equal and equal to $n$, there is a unique solution; if less than $n$, there are infinitely many solutions.
3. What is the rank of a matrix product $\mathbf{A}\mathbf{B}$?
Multiplying matrices cannot create new dimensions:
The rank of a product is bounded by the rank of its constituent factors.
1. The Eckart-Young-Mirsky Theorem and Data Compression
In data science, machine learning, and image processing, high-dimensional matrices often have near-redundant rows. The Eckart-Young-Mirsky Theorem proves that the optimal rank-$k$ approximation of a matrix $\mathbf{A}$ is obtained by truncating its Singular Value Decomposition (SVD) to the $k$ largest singular values:
This low-rank matrix approximation compresses images, reduces noise, and powers Principal Component Analysis (PCA).
2. Rank of Outer Products
While multiplying two large matrices can yield high rank, the outer product of any two non-zero vectors $\mathbf{u} \in \mathbb{R}^m$ and $\mathbf{v} \in \mathbb{R}^n$ forms a matrix $\mathbf{A} = \mathbf{u} \mathbf{v}^T$ that has rank strictly equal to 1. Every column is simply a scalar multiple of $\mathbf{u}$.