\[A = \begin{bmatrix}1&2&3&4\\-1&0&1&3\\0&1&-2&1\\5&4&-2&-3\\\end{bmatrix}\] The rank of an invertible matrix is equal to its dimension. So let’s check whether this matrix is invertible by calculating it’s determinant.
A<-matrix(c(1,2,3,4,-1,0,1,3,0,1,-2,1,5,4,-2,-3),nrow=4,byrow=TRUE)
det.matrixA<-det(A)
det.matrixA
## [1] -9
Since the determinant is not 0, the matrix is invertible. Therefore it’s rank is equal to it’s dimension. r=4
This can be cross-checked using a couple of R functions
library(matrixcalc)
matrix.rank(A)
## [1] 4
rank.A<- qr(A)$rank
rank.A
## [1] 4
The rank of a matrix is equal to the minimum of the number of rows and the number of columns. So in this case, the maximum rank = n. If the matrix is non-zero, it means there is at least one element that is non-zero, and there is at least one element in its column space. Therefore the minimum rank can be 1.
B<-matrix(c(1,2,1,3,6,3,2,4,2),nrow=3,byrow=TRUE)
matrix.rank(B)
## [1] 1
rank.B<- qr(B)$rank
rank.B
## [1] 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 = \begin{bmatrix}1&2&3\\0&4&5\\0&0&6\\\end{bmatrix}\] To find the eigenvalues and eigenvectors of this matrix, we set:
\[det(A-\lambda I)=0\]
\[ det\Bigg\{\begin{bmatrix}1&2&3\\0&4&5\\0&0&6\\\end{bmatrix}\ - \lambda \begin{bmatrix}1&0&0\\0&1&0\\0&0&1\\\end{bmatrix}\Bigg\}=0 \\ \\ = det\Bigg\{\begin{bmatrix}1&2&3\\0&4&5\\0&0&6\\\end{bmatrix}\ - \begin{bmatrix}\lambda&0&0\\0&\lambda&0\\0&0&\lambda\\\end{bmatrix}\Bigg\}=0 \\ \\ = det\Bigg\{\begin{bmatrix}1-\lambda&2&3\\0&4-\lambda&5\\0&0&6-\lambda\\\end{bmatrix}\Bigg\}=0 \\ \\ = \Bigg\{\big(1-\lambda) det \begin{bmatrix}4-\lambda&5\\0&6-\lambda\\\end{bmatrix}\Bigg\}=0 \\ \\ = \big(1-\lambda)[(4-\lambda)(6-\lambda) - 5.0]=0\\ \\ = \big(1-\lambda)(4-\lambda)(6-\lambda)=0\\ \\ = \lambda^{3}-11\lambda^{2} +34\lambda-24=0 \]
This is the characteristic polynomial equation, which has 3 roots which then yield 3 eigenvalues: 1,4 and 6 in ascending order
Substituting this back in the matrix one by one will gives us the eigenvectors as shown below:
\[\begin{bmatrix}1-1&2&3\\0&4-1&5\\0&0&6-1\\\end{bmatrix} \begin{bmatrix}x\\y\\z\\\end{bmatrix}=\begin{bmatrix}0\\0\\0\\\end{bmatrix}\\ \\ = \begin{bmatrix}0&2&3\\0&3&5\\0&0&5\\\end{bmatrix} \begin{bmatrix}x\\y\\z\\\end{bmatrix}=\begin{bmatrix}0\\0\\0\\\end{bmatrix}\\\]
The third row (5z = 0) gives us z = 0 which then substituting back in the second row (3y+0=0) gives us y = 0 Since x is unconstrained by the 3 rows, we get the following eigenvector corresponding to eigenvalue = 1
\[\begin{bmatrix}1\\0\\0\\\end{bmatrix}\]
Following a similar process of back-substitution for the other two eigenvalues 4 and 6 yields their correspondng eigenvectors as well. Below, we cross-check the eigenvalues using R functions, and we also extract the eigenvectors:
A<-matrix(c(1,2,3,0,4,5,0,0,6),nrow=3,byrow=TRUE)
evalues.A <- eigen(A)$values
evalues.A
## [1] 6 4 1
evectors.A <- eigen(A)$vectors
evectors.A
## [,1] [,2] [,3]
## [1,] 0.5108407 0.5547002 1
## [2,] 0.7981886 0.8320503 0
## [3,] 0.3192754 0.0000000 0