(Week 3 notes): The rank of a matrix is the number of pivots it has. Further, for rectangular matrices the rank has to be no greater than the smaller of the row or column dimension. For invertible (square) matrices, the rank is the same as the dimension of the matrix. For a matrix with a rank r, there are r independent columns and all other columns can be expressed as linear combinations of these r columns. [See Definition ROM: Rank of Matrix on Page 256]
Let’s start by putting \(A\) into reduced row-echelon form, this is as detailed as I could get;
As I couldn’t reduce this matrix down to have rows of zeroes, this matrix has a rank of 4
Let’s verify;
A <- matrix(c(1, 2, 3, 4,-1, 0, 1, 3, 0, 1, -2, 1, 5, 4, -2, -3), nrow = 4, byrow = TRUE)
# Determinant of A
det_A <- det(A)
# Rank of A
rank_A <- Matrix::rankMatrix(A)
# Check if A is nonsingular/ invertible via NME8
if (det_A != 0) {
cat("Matrix A is invertible \n")
cat("Rank of A = ", rank_A, "\n")
} else {
cat("Matrix A is singular")
}
## Matrix A is invertible
## Rank of A = 4
The matrix, let’s call it \(M\) has m rows, and n columns, and since m > n, the matrix \(M\) is rectangular with more rows than columns. The rank of \(M\) is the dimension of the column space of \(M\), r(\(M\)) = dim(\(C\)(\(M\)))
It could have a maximum rank equal to the smaller dimension, so n. The minimum rank it could have is 1, if you are able to reduce the matrix via echelon row-reduction to only have 1 row of non-zero values.
This matrix has a rank of 1, and nullability of 2.
Confirm;
B <- matrix(c(1, 2, 1, 3, 6, 3,2, 4, 2), nrow = 3, byrow = TRUE)
# Compute rank
rank_B <- Matrix::rankMatrix(B)
print(paste("Rank of B =", rank_B))
## [1] "Rank of B = 1"
Compute the eigenvalues and eigenvectors of the matrix \(A\). You’ll need to show your work. You’ll need to write out the characteristic polynomial and show your solution.
We know that (λ * \(I_n - A\)) * v = 0, where v is some non-zero vector. v is a non-trivial (non-zero) member of the \(N\)(λ * \(I_n - A\)), which is the null space. This null space is non-trivial, so 0 isn’t the only member. λ * \(I_n - A\) must have linearly dependent columns = not invertible = determinant is 0.
To get the eigenvalues, we need to solve the determinant of this
matrix -
and subtract the determinant of following matrix from it, to get 0. This matrix below is just λ * \(I_n\), where \(I_n\) is the identity matrix for a 3x3 matrix;
roots <- c(1,2,3,4,6,8,12,24)
for (n in roots){
if (((1-n) * (4-n) *(6-n)) == 0){
print(n)}
}
## [1] 1
## [1] 4
## [1] 6
# Confirm the eigenvalues
A_new <- matrix(c(1, 2, 3, 0, 4, 5, 0, 0, 6), nrow = 3, byrow = TRUE)
eigen(A_new)$values
## [1] 6 4 1
We know that \(Av- λv\) = \((A-λI)v\) = 0, which can be reduced using the eigenvalues λ = 1,4,6
First, manual calculation which we’ll verify with code below;
For λ = 1, row-reduce the matrix to:
library(pracma)
## Warning: package 'pracma' was built under R version 4.3.2
# rref: Reduced Row Echelon Form
rref(A_new - 1 * diag(3))
## [,1] [,2] [,3]
## [1,] 0 1 0
## [2,] 0 0 1
## [3,] 0 0 0
\[\begin{bmatrix}
0 & 1 & 0 \\
0 & 0 & 1 \\
0 & 0 & 0
\end{bmatrix}\]
library(pracma)
# rref: Reduced Row Echelon Form
rref(A_new - 4 * diag(3))
## [,1] [,2] [,3]
## [1,] 1 -0.6666667 0
## [2,] 0 0.0000000 1
## [3,] 0 0.0000000 0
\[\begin{bmatrix}
1 & -0.6666667 & 0 \\
0 & 0 & 1 \\
0 & 0 & 0
\end{bmatrix}\]
library(pracma)
# rref: Reduced Row Echelon Form
rref(A_new - 6 * diag(3))
## [,1] [,2] [,3]
## [1,] 1 0 -1.6
## [2,] 0 1 -2.5
## [3,] 0 0 0.0
\[\begin{bmatrix}
1 & 0 & 1.6 \\
0 & 1 & -2.5 \\
0 & 0 & 0
\end{bmatrix}\]
M = matrix(c(1,2,3,0,4,5,0,0,6), nrow=3, ncol=3)
eigen(M)
## eigen() decomposition
## $values
## [1] 6 4 1
##
## $vectors
## [,1] [,2] [,3]
## [1,] 0 0.0000000 0.83077316
## [2,] 0 0.3713907 -0.55384878
## [3,] 1 -0.9284767 0.05538488
# Gives eigenvalues are 6,4,1
# Our manual calculations match the eigenspaces derived manually above (see screenshot)