pascal matrix test 2

1514 days 전, admin 작성

# Generating Pascal matrix (n=87) def pascal_matrix(n): A=matrix(n,n,0) for i in range(1, n): A[i,0]=1 A[i,i-1]=1 for j in range(1,i-1): A[i,j]=((A[i-1,j-1] % 2) + (A[i-1,j] % 2)) % 2 A=A+A.transpose() return A A=pascal_matrix(43) # size of matrices without zero eigenvalues list=[3, 7, 11, 23, 43] m=len(list) for i in range(2,m): n=list[i-2] s=list[i]-n print "n= ", n B=A.submatrix(0,0,s,s) D=A.submatrix(s,s,n,n) alp=A.submatrix(s,0,n,s) T=B-alp.transpose()*D.inverse()*alp show(T) print "det(T)=", T.det() print 
       
n=  3

det(T)= 1

n=  7

det(T)= 1

n=  11

det(T)= 1
n=  3

det(T)= 1

n=  7

det(T)= 1

n=  11

det(T)= 1