** DATA_605_Discussion_3__C10_p388_Thonn **
** Problem C10 pg388 - manual method **
1-1). Find characterisic polynomial
\(A = \left[\begin{array}{rrrr} 1 & 2 \\ 3 & 4 \\ \end{array} \right]\)
\(det (A - \lambda I) = 0\)
$[ \[\begin{array}{rrrr} 1 & 2 \\ 3 & 4 \\ \end{array}\] ] - [ \[\begin{array}{rrrr} -\lambda +1 & 2 \\ 3 & -\lambda +1 \\ \end{array}\]] $
\((-\lambda + 1)(-\lambda +4) - (2 * 3) = 0\)
\(\lambda^2 -5\lambda - 2 = 0\)
** Problem C10 pg 388 in R **
Note: the syntax for polyroot is polyroot(c(C, B, A)) gives the roots of Ax^2 + Bx + C.
#install.packages("pracma")
library(pracma)
## Warning: package 'pracma' was built under R version 3.3.3
# Roots - R
a = round(polyroot(c(-2,-5,1)),2)
a
## [1] -0.37+0i 5.37+0i
A <- matrix (c (1,2,3,4), nrow = 2, ncol=2 , byrow = TRUE)
A
## [,1] [,2]
## [1,] 1 2
## [2,] 3 4
#characteristic polynomial - R
charpoly(A, info=FALSE)
## [1] 1 -5 -2
# [1] 1 -5 -2
END