LA+Chapter+8+EX+5+solved+by+Leenaeul

2039 days ago by math2013

A=matrix(QQ,3,3,[1,0,-1,0,1,2,2,1,2]) print "λ= "+str(A.eigenvalues()) ev=A.eigenvalues() temp=0 i=0 for sol in ev: if(sol != temp): i=ev.count(sol) print str(sol) + " have " + str(i) + " algebraic multiplicity." temp=sol 
       
λ= [2, 1, 1]
2 have 1 algebraic multiplicity.
1 have 2 algebraic multiplicity.
λ= [2, 1, 1]
2 have 1 algebraic multiplicity.
1 have 2 algebraic multiplicity.