John Suh
September 15, 2019
Problem Set 1
requires pracma and Matrix packages
library(matrixcalc)
library(pracma)
x<-matrix(c(1, 2, 3, 4, 1, 0, 1, 3, 0, 1, 2, 1, 5, 4, 2, 3),4,4,byrow=TRUE)
x
## [,1] [,2] [,3] [,4]
## [1,] 1 2 3 4
## [2,] 1 0 1 3
## [3,] 0 1 2 1
## [4,] 5 4 2 3
r<-matrix.rank(x)
r
## [1] 4
The maximum rank for a mxn matrix where m>n would be n.
The minimum rank for a mxn matrix where m>n would be 1
x<-matrix(c(1,3,2,2,6,4,1,3,2),3,3,byrow=TRUE)
x
## [,1] [,2] [,3]
## [1,] 1 3 2
## [2,] 2 6 4
## [3,] 1 3 2
mrank<-matrix.rank(x)
mrank
## [1] 1
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.
x<-matrix(c(1,2,3,0,4,5,0,0,6),3,3,byrow=TRUE)
x
## [,1] [,2] [,3]
## [1,] 1 2 3
## [2,] 0 4 5
## [3,] 0 0 6
eg<-eigen(x)
eg
## 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
From the Khan Academy Videos on EigenValues and Eigen Vectors.
We would need to solve for det(A - λI) = 0
The A Matrix would be the 3 by 3 given to us for this problem set and then the identity matrix would have lambda set across diagonally with zeros. The A matrix would be subtracting from the identity Matrix.
First row as an example would be 1-λ,2,3. That would be done across for all 3 rows.
Once thats done the Khan Video uses the rule of Saurus which will find the determinant.
(1−λ)((4−λ)(6−λ))+2(0−0)+3(0−0) (1−λ)(4−λ)(6−λ)−0+0 (1−λ)(24−4λ−6λ+λ2) (1−λ)(24−10λ+λ2) 24−10λ+λ2−24λ+10λ2−λ3
characteristic polynomial:
−λ3+11λ2−34λ+24
c<-charpoly(x)
c
## [1] 1 -11 34 -24
Factor:
(-x+1)(x-6)(x-4)
Eigen Values: 1,4,6
Then to find the eigenvectors, we plug the eigen values for each of the lamda equations. This I have not computed to compare with the eigenvector output from the eigen function.
eg
## 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