1. Problem set 1

1) What is the rank of matrix \(A\)?
\[\begin{bmatrix} 1 & 2 & 3 & 4 \\ -1 & 0 & 1 & 3 \\ 0 & 1 & -2 & 1 \\ 5 & 4 & -2 & -3 \end{bmatrix}\]
  • (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

2) Given an m x n matrix where m > n, what can be the maximum rank? The minimum rank, assuming that the matrix is non-zero?
  • 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.


3) What is the rank of matrix \(B\)?
\[\begin{bmatrix} 1 & 2 & 1 \\ 3 & 6 & 3 \\ 2 & 4 & 2 \end{bmatrix}\]

  • 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"

2. Problem set 2

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.

\[\begin{bmatrix} λ & 0 & 0 \\ 0 & λ & 0 \\ 0 & 0 & λ \end{bmatrix}\] \[\begin{bmatrix} 1-λ & -2 & -3 \\ 0 & 4-λ & -5 \\ 0 & 0 & 6-λ \end{bmatrix}\]

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

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)