LA Chpt.4 Ex.4 published by 박시현

2076 days ago by darkextra

import random n = random.randrange(2,20) A=random_matrix(QQ,n,n) print n print A print "det(adj A)= ",A.adjoint().det() print "(det A)^(n-1)",A.det()^(n-1) 
       
6
[   0   -1   -1    0   -2  1/2]
[  -2   -1   -1    2    0    0]
[  -1    0    0    0    0    0]
[  -2    0 -1/2    2    0    0]
[   0    0    1   -1   -1   -1]
[   1    0    1    1   -2   -1]
det(adj A)=  -161051/1024
(det A)^(n-1) -161051/1024
6
[   0   -1   -1    0   -2  1/2]
[  -2   -1   -1    2    0    0]
[  -1    0    0    0    0    0]
[  -2    0 -1/2    2    0    0]
[   0    0    1   -1   -1   -1]
[   1    0    1    1   -2   -1]
det(adj A)=  -161051/1024
(det A)^(n-1) -161051/1024