Ch-3.2-exam-4-Final-허재석

1912 days ago by matrix

A=matrix(QQ, 3, 3, [1, 0, 0, 1, 3, 5, 8, 1, 2]) B=matrix(QQ, 3, 3, [0, 1, 2, 8, 0, 7, 9, 0, 8]) AB=A*B I=identity_matrix(3) Aug1=A.augment(I).rref() Aug2=B.augment(I).rref() Aug3=AB.augment(I).rref() print "[I:A^(-1)]=" print Aug1 print "[I:B^(-1)]=" print Aug2 print "[I:(AB)^(-1)=" print Aug3 print AB.inverse()==B.inverse()*A.inverse() 
       
[I:A^(-1)]=
[  1   0   0   1   0   0]
[  0   1   0  38   2  -5]
[  0   0   1 -23  -1   3]
[I:B^(-1)]=
[  1   0   0   0   8  -7]
[  0   1   0   1  18 -16]
[  0   0   1   0  -9   8]
[I:(AB)^(-1)=
[   1    0    0  465   23  -61]
[   0    1    0 1053   52 -138]
[   0    0    1 -526  -26   69]
True
[I:A^(-1)]=
[  1   0   0   1   0   0]
[  0   1   0  38   2  -5]
[  0   0   1 -23  -1   3]
[I:B^(-1)]=
[  1   0   0   0   8  -7]
[  0   1   0   1  18 -16]
[  0   0   1   0  -9   8]
[I:(AB)^(-1)=
[   1    0    0  465   23  -61]
[   0    1    0 1053   52 -138]
[   0    0    1 -526  -26   69]
True