Ques: What is the rank of the matrix A?
# Creating Matrix A
A <-matrix(c(1,2,3,4,-1,0,1,3,0,1,-2,1,5,4,-2,-3), nrow=4,byrow=TRUE)
#displaying the Matrix
A
## [,1] [,2] [,3] [,4]
## [1,] 1 2 3 4
## [2,] -1 0 1 3
## [3,] 0 1 -2 1
## [4,] 5 4 -2 -3
#Determining the rank of A
qr(A)$rank
## [1] 4
Ans: Therefore the Rank of Matrix A is 4
Ques: Given an mxn matrix where m > n, what can be the maximum rank? The minimum rank, assuming that the matrix is non-zero?
Ans: Given a mxn matrix with m>n the min rank is 1 and the maximum rank is n assuming that this is a non zero matrix.
Ques: What is the rank of matrix B?
# Creating Matrix B
B <- matrix(c(1,2,1,3,6,3,2,4,2), nrow=3, byrow=TRUE)
#displaying the Matrix
B
## [,1] [,2] [,3]
## [1,] 1 2 1
## [2,] 3 6 3
## [3,] 2 4 2
#Determining the rank of A
qr(B)$rank
## [1] 1
Ans: Therefore the Rank of Matrix B is 1
Ques: 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.
Ans: Solving for eigen values and Characteristic polynomial by hand
Testing the answers through R
#Matrix A
A <- matrix(c(1,2,3,0,4,5,0,0,6), nrow=3, byrow=TRUE)
#Displaying Matrix A
A
## [,1] [,2] [,3]
## [1,] 1 2 3
## [2,] 0 4 5
## [3,] 0 0 6
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
library(pracma)
# Characteristic Polynomial
charpoly(A)
## [1] 1 -11 34 -24