Rank of a Matrix

Learn about the rank of a matrix and its properties.

Rank

The rank of a matrix AA, denoted by r(A)r(A), is defined as the number of linearly independent rows of AA.

By definition, a coefficient matrix, AA, represents a linearly independent system of r(A)r(A) equations. The number of linearly independent rows is called row rank, and the number of linearly independent columns is called column rank. However, because row rank is always equal to column rank, these terms are seldom used. Instead, we simply refer to them as rank.

Calculating rank through Python

The following Python code calculates the rank of a matrix.

Press + to interact
import numpy as np
mat = np.array([[2, 3, -4, 7],
[1, 6, -5, 1],
[-2, 1, 10, -4]])
print(mat)
rank = np.linalg.matrix_rank(mat)
print("The rank of the matrix is", rank)

Rank and rrefrref

The rank of a matrix, AA, equals the number of pivots in the rrefrref of AA."

This follows from our previous discussion on linearly dependent rows in rrefrref. All linearly dependent rows are converted into all-zero rows in rrefrref, and we’re left with only the linearly independent rows as the nonzero rows. Each nonzero row in ...