8.6 prob.4

562 days ago by donkey103

A = matrix(ZZ, 4, 3, [1,0,0,1,1,1,1,2,4,1,3,9]) b = column_matrix([1,3,4,4]) at=A.transpose() ata=at * A daggerA=ata.inverse() * at print daggerA print x=daggerA*b print x 
       
[ 19/20   3/20  -3/20   1/20]
[-21/20  13/20  17/20  -9/20]
[   1/4   -1/4   -1/4    1/4]

[   1]
[ 5/2]
[-1/2]
[ 19/20   3/20  -3/20   1/20]
[-21/20  13/20  17/20  -9/20]
[   1/4   -1/4   -1/4    1/4]

[   1]
[ 5/2]
[-1/2]
var('x, y') p1=plot(1 + 5/2*x -1/2*x^2, x, -1,4, color='blue'); p2 = text("$1 + 5/2 x -1/2 x^2$", (2,2), fontsize=20, color='blue') show(p1+p2, ymax=5, ymin=-1)