Difference Between the Dimension and Rank of a Matrix
At a glance
- 1. Identify matrix size
An m×n matrix has m rows and n columns; this is its shape, not usually called its dimension.
- 2. Interpret rank
Rank is the dimension of the matrix’s row space or column space.
- 3. Reduce the matrix
Use Gaussian elimination to count the pivot positions; that count is the rank.
- 4. Apply rank–nullity
For an m×n matrix, rank plus nullity equals n, the number of columns.
A matrix’s size and its rank describe different things. If a matrix has rows and columns, it is an matrix. Its rank measures how many independent rows or columns it contains.
The word “dimension” can be confusing here because it is used in two related ways. The matrix itself has a shape, while spaces associated with the matrix—such as its column space, row space, null space, or domain—have mathematical dimensions.
Matrix size: rows and columns
For example,
has 2 rows and 3 columns, so its size is .
Some texts informally call this the “dimension” of the matrix. More precisely, a matrix is an array with rows and columns, or an element of the matrix space , where is usually or .
The numbers and do not tell you the rank. They only tell you the largest rank that could be possible:
For the matrix above, the rank can be at most 2, because there are only two rows.
Rank is a dimension
Let be an matrix. It defines a linear transformation
The column space of , denoted , is the subspace of spanned by the columns of . The rank is defined by
A fundamental theorem says that the row space and column space always have the same dimension. Therefore,
So rank is itself a dimension—but it is the dimension of a particular vector space associated with the matrix, not the number of rows and columns.
How to calculate rank
You can find the rank by reducing the matrix to row-echelon form. The number of nonzero rows, or equivalently the number of pivot positions, is the rank.
Consider
Use row operations:
There are two nonzero rows and two pivots. Hence
This is a matrix, but its rank is 2. Its three columns do not provide three independent directions: one of them can be expressed as a linear combination of the others.
Rank and the four fundamental spaces
For an matrix, four spaces are commonly associated with it:
| Space | Where it lies | Its dimension |
|---|---|---|
| Column space | ||
| Row space | ||
| Null space | ||
| Left null space |
Here . The dimensions of the column and row spaces are equal to the rank, while the null-space dimensions are determined by the rank–nullity theorem. The table uses the algebraic convention for the left null space. Over , some authors instead define it using the conjugate transpose , in which case it is ; its dimension is still . Over , .
For the example, and . Therefore the nullity—the dimension of the solution space of —is
The rank–nullity theorem in general is
where is the number of columns, or equivalently the dimension of the domain of the associated linear transformation.
Important examples
A matrix can have rank at most 3. If its rank is 3, all three columns are independent, even though there are four rows. If its rank is 1, all columns are scalar multiples of one nonzero column.
A zero matrix of any size has rank 0. For example, a zero matrix has size but rank 0.
An matrix has rank exactly when it is invertible. Such a matrix is called full rank. A square matrix with rank less than is singular and has no inverse.
Common mistakes
Treating “dimension” as a standard matrix invariant
There is no single universally standard number called “the dimension of a matrix.” In elementary settings, “dimension” often means the matrix size, such as . In linear algebra, dimension usually refers to a vector space, such as the column space or null space.
Assuming rank equals the number of rows
Rank equals the number of independent rows, not necessarily the total number of rows. Dependent rows do not increase rank.
Counting nonzero entries
Rank is not the number of nonzero entries. A matrix can contain many nonzero entries but have rank 1. For example,
has four nonzero entries but rank 1, because its second row is twice its first row.
Using the original columns after row reduction
Row reduction preserves rank, but the columns of the reduced matrix are not generally the original column-space basis. To select a basis for the original column space, identify pivot columns in the reduced matrix and take the corresponding columns from the original matrix.
The concise distinction is therefore: matrix size tells you how many rows and columns the array has; rank tells you how many independent directions its rows or columns contain.
References
- Linear Algebra Done Right, Sheldon Axler
- Introduction to Linear Algebra, Gilbert Strang
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.