Ch-1-hw-New-허재석

1910 days ago by matrix

A=vector([-2, 4, 3, 17, -6]) B=vector([7, -1, 0, 9, -12]) AA=A.inner_product(A) AB=A.inner_product(B) p=(AA/AB)*A w=B-p print "p=", p, "w=", w 
       
p= (-236/69, 472/69, 118/23, 2006/69, -236/23) w= (719/69, -541/69,
-118/23, -1385/69, -40/23)
p= (-236/69, 472/69, 118/23, 2006/69, -236/23) w= (719/69, -541/69, -118/23, -1385/69, -40/23)