Ch-7-problem-15-New-황영준

1837 days ago by matrix

A=matrix(5,5,[1,3,-2,1,2,0,1,0,-3,4,2,3,-1,1,2,3,-2,5,1,0,0,1,3,-1,2]) b=matrix(5,1,[1,0,3,2,0]) C=A.transpose()*A print "rank(A)=",; print A.rank() print "x=" print C.inverse()*A.transpose()*b 
       
rank(A)= 5
x=
[   35/18]
[   34/27]
[    1/18]
[  -43/27]
[-163/108]
rank(A)= 5
x=
[   35/18]
[   34/27]
[    1/18]
[  -43/27]
[-163/108]
A=matrix(5,5,[2,3,3,1,5,1,1,1,1,2,0,2,2,3,2,3,0,0,2,3,2,-2,-2,0,0]) b=matrix(5,1,[2,1,0,0,3]) C=A.transpose()*A print "rank(A)=",; print A.rank() 
       
rank(A)= 3
rank(A)= 3