rank = 0
A <- matrix(c(1, -1, 0, 5, 2, 0, 1, 4, 3,1 -2, -2,4,3,1,-3), nrow=4, ncol=4)
## Warning in matrix(c(1, -1, 0, 5, 2, 0, 1, 4, 3, 1 - 2, -2, 4, 3, 1, -3), :
## data length [15] is not a sub-multiple or multiple of the number of rows
## [4]
A
## [,1] [,2] [,3] [,4]
## [1,] 1 2 3 3
## [2,] -1 0 -1 1
## [3,] 0 1 -2 -3
## [4,] 5 4 4 1
Rank of the matrix using qr function:
rank <- qr(A)$rank
rank
## [1] 4
The rank is 4
The Matrix can have a maximum rank of rank(A)=n and mininum rank of 1
B<-matrix(c(1,2,1,3,6,3,2,4,2), byrow =TRUE,nrow = 3,ncol = 3)
qr(B)$rank
## [1] 1
The rank is 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.
A <- matrix(c(1, 0, 0, 2, 4, 0, 3, 5, 6), nrow=3, ncol=3)
E_Vals <- eigen(A)
E_Vals
## 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
The manual work is placed at the below location on Github and will be attached also.
Link for manual work: https://github.com/Riteshlohiya/Data605_HW3/blob/master/RLohiya_Assignment3_PS2.pdf