Ch-3.5-ex1-New-김강섭

1914 days ago by matrix

A=matrix(4, 4, [1, 2, 3, 4, 3, 5, 4, 4, 7, 8, 0, 0, 9, 2, 0, 5 ]) # coefficient matrix b=vector([1, -2, 5, 1]) Ai=A.inverse() # inverse matrix calculation print "x=", Ai*b print print "x=", A.solve_right(b) # solve directly. print print Ai*b==A.solve_right(b) 
       
x= (-53/17, 57/17, -116/17, 76/17)

x= (-53/17, 57/17, -116/17, 76/17)

True
x= (-53/17, 57/17, -116/17, 76/17)

x= (-53/17, 57/17, -116/17, 76/17)

True