Ch-4-Prob-14-New-김준하

1899 days ago by matrix

A = matrix(QQ, 2, 2, [3, 0, 1, -2]) print "character polynomial of A =" print A.charpoly() 
       
character polynomial of A =
x^2 - x - 6
character polynomial of A =
x^2 - x - 6
solve(x^2 - x - 6==0,x) 
       
[x == 3, x == -2]
[x == 3, x == -2]
A = matrix(QQ, 2, 2, [3, 0, 1, -2]) x1=3 x2=-2 print (x1*identity_matrix(2)-A).echelon_form() print (x2*identity_matrix(2)-A).echelon_form() 
       
[ 1 -5]
[ 0  0]
[1 0]
[0 0]
[ 1 -5]
[ 0  0]
[1 0]
[0 0]
A = matrix(QQ, 2, 2, [3, 0, 1, -2]) print A.eigenvectors_right() 
       
[(3, [
(1, 1/5)
], 1), (-2, [
(0, 1)
], 1)]
[(3, [
(1, 1/5)
], 1), (-2, [
(0, 1)
], 1)]
A = matrix(QQ, 4, 4, [-3, 0, -2, 8, 0, 1, 4, -2, -4, 10, -1 ,-2, 6, -4, -2, 3]) print "character polynomial of A =" print A.charpoly() 
       
character polynomial of A =
x^4 - 118*x^2 - 168*x + 1485
character polynomial of A =
x^4 - 118*x^2 - 168*x + 1485
solve(x^4 - 118*x^2 - 168*x + 1485==0,x) 
       
[x == 11, x == -9, x == -5, x == 3]
[x == 11, x == -9, x == -5, x == 3]
A = matrix(QQ, 4, 4, [-3, 0, -2, 8, 0, 1, 4, -2, -4, 10, -1 ,-2, 6, -4, -2, 3]) x1=11 x2=-9 x3=-5 x4=3 print (x1*identity_matrix(4)-A).echelon_form() print (x2*identity_matrix(4)-A).echelon_form() print (x3*identity_matrix(4)-A).echelon_form() print (x4*identity_matrix(4)-A).echelon_form() 
       
[    1     0     0 -9/13]
[    0     1     0  7/13]
[    0     0     1 11/13]
[    0     0     0     0]
[ 1  0  0  2]
[ 0  1  0 -1]
[ 0  0  1  2]
[ 0  0  0  0]
[    1     0     0   7/5]
[    0     1     0   7/5]
[    0     0     1 -13/5]
[    0     0     0     0]
[ 1  0  0 -1]
[ 0  1  0 -1]
[ 0  0  1 -1]
[ 0  0  0  0]
[    1     0     0 -9/13]
[    0     1     0  7/13]
[    0     0     1 11/13]
[    0     0     0     0]
[ 1  0  0  2]
[ 0  1  0 -1]
[ 0  0  1  2]
[ 0  0  0  0]
[    1     0     0   7/5]
[    0     1     0   7/5]
[    0     0     1 -13/5]
[    0     0     0     0]
[ 1  0  0 -1]
[ 0  1  0 -1]
[ 0  0  1 -1]
[ 0  0  0  0]
A = matrix(QQ, 4, 4, [-3, 0, -2, 8, 0, 1, 4, -2, -4, 10, -1 ,-2, 6, -4, -2, 3]) print A.eigenvectors_right() 
       
[(11, [
(1, -7/9, -11/9, 13/9)
], 1), (3, [
(1, 1, 1, 1)
], 1), (-5, [
(1, 1, -13/7, -5/7)
], 1), (-9, [
(1, -1/2, 1, -1/2)
], 1)]
[(11, [
(1, -7/9, -11/9, 13/9)
], 1), (3, [
(1, 1, 1, 1)
], 1), (-5, [
(1, 1, -13/7, -5/7)
], 1), (-9, [
(1, -1/2, 1, -1/2)
], 1)]