CoCalc Shared Filesmatrix_computations.sagewsOpen in CoCalc with one click!
Author: Narad Rampersad
Views : 103
M = matrix([[2,1,0],[0,3,1],[1,1,1]]) M
[2 1 0] [0 3 1] [1 1 1]
M.echelon_form()
[1 0 4] [0 1 2] [0 0 5]
M.rref()
[1 0 0] [0 1 0] [0 0 1]
M.det()
5
M.right_eigenvectors()
[(1, [ (1, -1, 2) ], 1), (1.381966011250106?, [(1, -0.618033988749895?, 1)], 1), (3.618033988749895?, [(1, 1.618033988749895?, 1)], 1)]
M.inverse()
[ 2/5 -1/5 1/5] [ 1/5 2/5 -2/5] [-3/5 -1/5 6/5]
P = M.charpoly() print P
x^3 - 6*x^2 + 10*x - 5
P.factor()
(x - 1) * (x^2 - 5*x + 5)