Mathwords logoMathwords

Rank of a Matrix — Definition, Formula & Examples

The rank of a matrix is the number of linearly independent rows (or equivalently, columns) it contains. It tells you the dimension of the vector space spanned by the matrix's rows or columns.

The rank of an m×nm \times n matrix AA, denoted rank(A)\text{rank}(A), is the dimension of the column space (or row space) of AA, which equals the number of pivot positions in any row echelon form of AA. For any matrix, rank(A)min(m,n)\text{rank}(A) \leq \min(m, n).

Key Formula

rank(A)=number of pivot columns in the row echelon form of A\text{rank}(A) = \text{number of pivot columns in the row echelon form of } A
Where:
  • AA = An m × n matrix
  • rank(A)\text{rank}(A) = A non-negative integer satisfying rank(A) ≤ min(m, n)

How It Works

To find the rank, row-reduce the matrix to row echelon form using elementary row operations. Then count the number of nonzero rows (rows containing a leading 1 or pivot). That count is the rank. A matrix with rank equal to min(m,n)\min(m,n) is said to have full rank. If the rank is less than min(m,n)\min(m,n), the matrix is called rank-deficient, meaning some rows or columns are linear combinations of others.

Worked Example

Problem: Find the rank of the matrix A = [[1, 2, 3], [2, 4, 6], [0, 1, 1]].
Step 1: Perform R₂ ← R₂ − 2R₁ to eliminate the first entry of row 2.
[123000011]\begin{bmatrix} 1 & 2 & 3 \\ 0 & 0 & 0 \\ 0 & 1 & 1 \end{bmatrix}
Step 2: Swap R₂ and R₃ to move the zero row to the bottom.
[123011000]\begin{bmatrix} 1 & 2 & 3 \\ 0 & 1 & 1 \\ 0 & 0 & 0 \end{bmatrix}
Step 3: Count the nonzero rows (rows with pivots). There are 2 pivots: in column 1 and column 2.
rank(A)=2\text{rank}(A) = 2
Answer: The rank of A is 2. Row 2 of the original matrix was just twice row 1, so only 2 of the 3 rows are linearly independent.

Why It Matters

The rank determines whether a system of linear equations has solutions: an m×nm \times n system Ax=bAx = b is consistent only if the rank of the augmented matrix equals the rank of the coefficient matrix. Rank also appears in the Rank-Nullity Theorem, which connects the dimension of the solution space to the number of variables, and is essential in fields like data science (e.g., principal component analysis) and engineering (controllability of systems).

Common Mistakes

Mistake: Counting all nonzero rows of the original matrix instead of its row echelon form.
Correction: A row can be nonzero yet still be a linear combination of other rows. Always row-reduce first, then count the rows that contain pivots.