pascal matrix test

1532 days 전, jhlee2chn 작성

# 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(87) # size of matrices without zero eigenvalues list=[3, 7, 11, 23, 43, 87] m=len(list) for i in range(m-1): n=list[i] s=list[i+1]-list[i] print "n= ", n B=A.submatrix(0,0,n,n) D=A.submatrix(n,n,s,s) alp=A.submatrix(n,0,s,n) show(D-alp*B.inverse()*alp.transpose()) 
       
n=  3

n=  7

n=  11

n=  23

n=  43
n=  3

n=  7

n=  11

n=  23

n=  43