Problem C11
knitr::include_graphics('3.png')
# Loading the library
library(pracma)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
# Create matrix to feed data into R
A <- matrix(c(3,0,1,2,1,2,1,1,0), nrow=3)
A
## [,1] [,2] [,3]
## [1,] 3 2 1
## [2,] 0 1 1
## [3,] 1 2 0
# Now let's find out the characteristic polynomial of the defined matrix
A %>% charpoly()
## [1] 1 -4 0 5
The characteristic polynomial of above matrix is 1, -4, 0 and 5.