ch7-exercise14_황훌

333 days ago by kyunganoh

x=vector([1,2,3,4,5]) a=vector([9,9,9,9,10]) x1=(x.inner_product(a))/(a.inner_product(a))*a x2=x-x1 print x1 print print x2 print print x2.inner_product(x1) print print x==x1+x2 #checking if x=x1+x2 
       
(315/106, 315/106, 315/106, 315/106, 175/53)

(-209/106, -103/106, 3/106, 109/106, 90/53)

0

True
(315/106, 315/106, 315/106, 315/106, 175/53)

(-209/106, -103/106, 3/106, 109/106, 90/53)

0

True