HW 1 laudari sudip

1924 days ago by bigdata2016

A = matrix(QQ, [[1, 2, 1, 2, 1, 2, 4],[0, 1, 1, 0, 0, 1, 0],[2, 0, 0, 1, 1, 2, 0],[1, 0, 1, 2, 4, 0, 0],[1, 1, 2, 0, 0, 1, 1],[1, 1, 6, 3, 0, 1, 0],[1, 1, 3, -1, 1, 1, 0]]) show(A) 
       
P, L, U = A.LU() show(P) show(L) show(U) 
       


x=U^(-1)*L^(-1)*P^(-1)*b x 
       
[  24/5]
[ 77/15]
[     0]
[ -4/15]
[ -1/15]
[-47/15]
[  -9/5]
[  24/5]
[ 77/15]
[     0]
[ -4/15]
[ -1/15]
[-47/15]
[  -9/5]
b=matrix(QQ, [[1,2,3,4,5,6,7]]) b=transpose(b) 
       
A*x==b 
       
True
True