Rank
The rank of a matrix is the number of pivots and the number of dimensions that the column space of a matrix spans.
Contents
Description
A matrix A with n columns (or a linear system with n variables) exists in Rn space. However, the column space of A (notated as C(A)) does not necessarily span all of those dimensions. Consider:
julia> using RowEchelon
julia> rref([1 2 3
1 3 4
1 4 5])
3×3 Matrix{Float64}:
1.0 0.0 1.0
0.0 1.0 1.0
0.0 0.0 0.0The elimination of this matrix reveals that there are two pivot columns and a free variable.
The rank of a matrix is the number of pivots. Equivalent, it is the number of dimensions that the column space of a matrix spans. For a transformation represented by a matrix, rank is also the number of dimensions in the transformation's range.
Relation to Bases
A basis vector must be independent. It follows that a matrix of n columns must be of full rank to be a basis for Rn space.
Note that in the above example, A has two independent columns. If the third column is excluded, then clearly the matrix exists in R2 space rather than R3 space. But the matrix is now of full rank, and therefore forms a basis for R2 space.
Solutions
The rank of a matrix reveals the number of solutions that exist.
If a matrix with n columns has n pivots, it is said to be full column rank. The only null space is the zero vector (i.e. [0 ...]). Ax = b either has one solution, or b is not in the column space of A (i.e., no solution exists). Incidentally, the reduced row echelon form (R) looks like the identity matrix (I) with zero rows interspersed.
If a matrix with m rows has m pivots, it is said to be full row rank. This means that Ax = b can be solved for any b.
If a square matrix has full rank, it meets both of those criteria and inherits all of those properties:
- The only null space is the zero vector.
Ax = b can be solved for any b.
Ax = b either has one solution or is not solvable, except property #2 revealed that Ax = b can be solved for any b, so the only logical conclusion is that there is exactly one solution for any given b.
The reduced row echelon form (R) looks like the identity matrix (I) with zero rows interspersed, except there are no dependent rows, so R is exactly the same as I.
In any other case, Ax = b either can be solved for any b, or b is not in the column space of A (i.e., no solution exists).
Lastly, rank provides a simple method to determine if b is in the column space of A (i.e., a solution exists): compose the augmented matrix [A | b]. If rank(A) = rank([A | b]), then b must be in the column space.
