Problem 1

(1) What is the rank of the matrix A?

A <- matrix(c(1,2,3,4,
              -1,0,1,3,
              0,1,-2,1,
              5,4,-2,-3), 4, byrow=T)
qr(A)$rank
## [1] 4

The rank is the same as the dimension.

(2) Given an mxn matrix where m > n, what can be the maximum rank? The minimum rank, assuming that the matrix is non-zero?

Given an m > n, the maximum rank is n with a non-zero element, the minimum rank is 1.

(3) What is the rank of matrix B?

B <- matrix(c(1,2,1,
              3,6,3,
              2,4,2), 3, byrow=T)
qr(B)$rank
## [1] 1

The rank is 1.

Problem 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.

Eigenvalues

A <- matrix(c(1,2,3,
              0,4,5,
              0,0,6), 3, byrow=T)
eigen(A)
## eigen() decomposition
## $values
## [1] 6 4 1
## 
## $vectors
##           [,1]      [,2] [,3]
## [1,] 0.5108407 0.5547002    1
## [2,] 0.7981886 0.8320503    0
## [3,] 0.3192754 0.0000000    0
# Using function to create vectors
vect <- function(x) {
    x / sqrt(sum(x^2))
}

Eigenvectors

l1 <- vect(c(16/25, 1, 2/5))
l2 <- vect(c(2/3, 1, 0))
l3 <- vect(c(1, 0, 0))
eigenvectors <- cbind(l1, l2, l3)
eigenvectors
##             l1        l2 l3
## [1,] 0.5108407 0.5547002  1
## [2,] 0.7981886 0.8320503  0
## [3,] 0.3192754 0.0000000  0