Matrix A
matA <- matrix(c(18, -4, -9, 5, -15, 8, 9, -6, 33, -6, -16, 9, -15, 6, 9, -4), nrow = 4)
matA
## [,1] [,2] [,3] [,4]
## [1,] 18 -15 33 -15
## [2,] -4 8 -6 6
## [3,] -9 9 -16 9
## [4,] 5 -6 9 -4
\(det(\lambda I-A)=0\)
\(\lambda I - A\) = \[ \left| \begin{array}{cccc} \lambda -18 & 15 & -33 & 15 \\ 4 & \lambda -8 & 6 & -6 \\ 9 & -9 & \lambda +16 & -9 \\ 5 & 6 & -9 & \lambda +4 \end{array} \right|\] Finding the characteristic polynomial:
char_poly <- charpoly(matA, info = TRUE)
## Error term: 24
char_poly$cp
## [1] 1 -6 9 4 -12
The characteristic polynomial is \(\lambda ^4-6\lambda ^3 + 9\lambda ^2 + 4\lambda -12\)
Solving the characteristic polynomial:
roots(char_poly$cp)
## [1] 3 2 2 -1
Eigenvalues are \(\lambda = 3, \lambda = 2, and \lambda = -1\)
By using an online calculator to simply the polynomial we get: \((\lambda-3)(\lambda-2)^2(\lambda+1) = 0.\) We see that \((\lambda-2)^2\) is a repeated root so it has an algrebraic multiplicity of 2. \(\lambda =3 and \lambda =1\) have an algebraic multiplicity of 1. Theorem ME states the eigenvalues of 3 and -1 will both have an geometric multiplicity of 1.
Substituting \(\lambda = 3\): \(E_3\) = \[ \left| \begin{array}{cccc} -15 & 15 & -33 & 15 \\ 4 & -5 & 6 & -6 \\ 9 & -9 & 19 & -9 \\ 5 & 6 & -9 & 7 \end{array} \right|\]
Substituting \(\lambda = 2\): \(E_2\) = \[ \left| \begin{array}{cccc} -16 & 15 & -33 & 15 \\ 4 & -6 & 6 & -6 \\ 9 & -9 & 18 & -9 \\ 5 & 6 & -9 & 6 \end{array} \right|\]
Substituting \(\lambda = -1\): \(E_{-1}\) = \[ \left| \begin{array}{cccc} -19 & 15 & -33 & 15 \\ 4 & -9 & 6 & -6 \\ 9 & -9 & 15 & -9 \\ 5 & 6 & -9 & 3 \end{array} \right|\]
eigenVectors <- round(eigen(matA)$vectors[,1], digits = 1)
eigenVectors
## [1] 0.4+0i 0.8+0i 0.0+0i -0.4+0i
Using the eigen() method gave me the right eigen values but the eigen vectors were off. The first column was scaled by -2. The rest of the columns looked wrong. I used a calculator to row reduce the matrix after substituting the eigenvalue and finding the rest of the eigen vectors.
\(V_{1} = (-1,-2,0,1)\)
\(V_{2} = (0,-1,0,1)\)
\(V_{3} = (-3,-1,1,0)\)
\(V_{4} = (6,0,-3,1)\)
Since we have 4 eigen vectors, Theorem DMFE says that since the sum of the of algrebraic multiplicity (\(\alpha_{A} (3)=1, \alpha_{A} (2)=2, \alpha_{A} (-1)=1\) total = 4) equals the sum of the geometric multiplicity (\(\gamma_{A} (3)=1, \gamma_{A} (2)=2, \gamma_{A} (-1)=1\) total = 4) then Matrix A can be diagonalized. I’m assuming this means that the number of vectors has to equal the number of dimensions.
Putting the eigen vectors in a matrix, if the determinant is nonzero, it is a nonsingular matrix and we can use it to find a diagonal matrix of Matrix A.
eigenV <- matrix(c(-1,-2,0,1,0,-1,0,1,-3,-1,1,0,6,0,-3,1), nrow = 4)
det(eigenV)
## [1] 1
Determinant is 1
To find a diagonal matrix \(D\), we use the nonsingular matrix \(S\) in the formula \(S^{-1}AS = D\)
Find the inverse of \(S\)
inv_eigenV <- solve(eigenV)
inv_eigenV
## [,1] [,2] [,3] [,4]
## [1,] 2 -3 3 -3
## [2,] -1 2 -1 3
## [3,] -3 3 -5 3
## [4,] -1 1 -2 1
Multiply \(S^{-1}AS\) to find \(D\)
matD <- inv_eigenV %*% matA %*% eigenV
matD
## [,1] [,2] [,3] [,4]
## [1,] 3 0 0 0
## [2,] 0 2 0 0
## [3,] 0 0 2 0
## [4,] 0 0 0 -1
Diagonal Matrix \(D\) = \[ \left| \begin{array}{cccc} 3 & 0 & 0 & 0 \\ 0 & 2 & 0 & 0 \\ 0 & 0 & 2 & 0 \\ 0 & 0 & 0 & -1 \end{array} \right|\]