Let A be an matrix. Suppose that Ax=b is an inconsistent system, we are interested in finding an x such that Ax is as close as possible to b.
Lets first look at the exercise 1. There are several ways to make your line ``close'' to given points, depending how we define ``closeness". Usual way is to add the square of d1, d2 d3 dn, then minimize the sum of squares. See figure bellow.
This method is called `` least square Approximation ".
We may also think that Ax in a vector and b is another vector. We want to minimize Ax-b. Assume that our vector space is an Inner Product Space with the usual Euclidean inner product, minimizing (ax-b) translates to minimizing the distance || Ax -b|| between the two vectors Ax and b . Note that || ax-b|| is the length of the vector Ax-b.
One thing which helps understanding the procedure of minimizing the distance between Ax and b is the fact that Ax is a vector in column space of A. (Why?)
Since Ax=b is not consistent, b is not in the column space of A. So we are looking for a vector, Ax, in the column space of A which is closest to the vector b. It can be proved ( see your text book) that such a vector is the orthogonal projection of b onto the column space of A. Now if Ax is the orthogonal projection of b onto col(A) then Ax-b is orthogonal to clo(A). ( why?) That is Ax-b is in . So
or
.
This system of linear equations is consistent ( Why?) and it is called Normal System. Moreover if the column of A are linearly independent, then is invertible and
is the unique solution of the system .
If columns of A are orthonormal then and we can easily compute , and the close st vector p in the column space of A to b is .