Ch-3.2-ex-4-new-허재석

1917 days ago by matrix

A=matrix(ZZ, 2, 2, [1, 0, 9, 4]) B=matrix(ZZ, 2, 2, [5, 8, 1, 7]) AB=A*B print "A=" print A print "B=" print B print "(AB)^-1=" print AB.inverse() print "(B^-1)(A^-1)=" print B.inverse()*A.inverse() 
       
A=
[1 0]
[9 4]
B=
[5 8]
[1 7]
(AB)^-1=
[  25/27   -2/27]
[-49/108   5/108]
(B^-1)(A^-1)=
[  25/27   -2/27]
[-49/108   5/108]
A=
[1 0]
[9 4]
B=
[5 8]
[1 7]
(AB)^-1=
[  25/27   -2/27]
[-49/108   5/108]
(B^-1)(A^-1)=
[  25/27   -2/27]
[-49/108   5/108]