Find the eigenvalues, eigenspaces, algebraic and geometric multiplicities for
\[ A = \begin{bmatrix} 1 & -1 & 1 \\ -1 & 1 & -1 \\ 1 & -1 & 1 \end{bmatrix} \]
A <- matrix(c(1,-1,1,-1,1,-1,1,-1,1), nrow=3, byrow=TRUE)
A
## [,1] [,2] [,3]
## [1,] 1 -1 1
## [2,] -1 1 -1
## [3,] 1 -1 1
# Calculate characteristic polynomial using pracma library
library(pracma)
charpoly(A)
## [1] 1 -3 0 0
\(p_A(x) = x^3-3x^2+0x+0 = x^2(x-3)\)
\(p_A(\lambda) = 0\), so eigenvalues are \(\lambda = 0\) and \(\lambda = 3\).
\(\alpha_A(0) = 2\) and \(\alpha_A(3) = 1\)
If \(\lambda=0\), then \(A - 0I_3 = A\) and it is row-reduced to
rref(A)
## [,1] [,2] [,3]
## [1,] 1 -1 1
## [2,] 0 0 0
## [3,] 0 0 0
Then eigenspace is
\[
\Bigg\langle \Bigg\{
\begin{bmatrix}
1\\
1\\
0
\end{bmatrix}
,
\begin{bmatrix}
-1\\
0\\
1
\end{bmatrix}
\Bigg\} \Bigg \rangle
\]
If \(\lambda=3\), then \(A - 3I_3\) is row-reduced to
rref(A - 3 * diag(3))
## [,1] [,2] [,3]
## [1,] 1 0 -1
## [2,] 0 1 1
## [3,] 0 0 0
Then eigenspace is
\[
\Bigg\langle \Bigg\{
\begin{bmatrix}
1\\
-1\\
1
\end{bmatrix}
\Bigg\} \Bigg \rangle
\]
\(\gamma_A(0) = 2\) and \(\gamma_A(3) = 1\)
eigen function again returns a very small, near-zero value instead of \(0\).
eigen(A)$values
## [1] 3.000000e+00 8.881784e-16 0.000000e+00
Additionally, per theorem DMFE since \(\alpha_A(\lambda) = \gamma_A(\lambda)\) for all \(\lambda\), then \(A\) should be diagonalizable and eigenvalues should be on the diagonal. Consider \(S\) consisting of eigenvectors.
S <- matrix(c(1,-1,1,1,0,-1,0,1,1), nrow=3, byrow=TRUE)
S
## [,1] [,2] [,3]
## [1,] 1 -1 1
## [2,] 1 0 -1
## [3,] 0 1 1
Compute \(S^{-1}AS\)
inv(S) %*% A %*% S
## [,1] [,2] [,3]
## [1,] 0 0 -1.665335e-16
## [2,] 0 0 -3.330669e-16
## [3,] 0 0 3.000000e+00
Not considering near-zero values, everything checks out.