Since the columns of
\(A\) are linearly independent, we know by
TheoremΒ 6.56 there is a unique least-squares solution to
\(A\vec x = \vec b\text{.}\) Note that the columns of
\(A\) are already orthogonal. Therefore, this problem wouldnβt be so bad to use our original method to finding a least-squares solution like in
ExampleΒ 6.52. We will instead use the normal equations which is usually the fastest way, especially when the columns of
\(A\) are
not orthogonal.
Note that
\begin{equation*}
A^TA = \begin{bmatrix} 1 \amp 1 \amp 1 \amp 1 \\ -6 \amp -2 \amp 1 \amp 7 \end{bmatrix}\begin{bmatrix} 1 \amp -6 \\ 1 \amp -2 \\ 1 \amp 1 \\ 1 \amp 7 \end{bmatrix} = \begin{bmatrix} 4 \amp 0 \\ 0 \amp 90 \end{bmatrix}
\end{equation*}
and
\begin{equation*}
A^T\vec b = \begin{bmatrix} 1 \amp 1 \amp 1 \amp 1 \\ -6 \amp -2 \amp 1 \amp 7 \end{bmatrix}\begin{bmatrix}-1 \\ 2 \\ 1 \\ 6 \end{bmatrix} = \begin{bmatrix} 8 \\ 45 \end{bmatrix}\text{.}
\end{equation*}
(The reason \(A^TA\) is diagonal is because the columns of \(A\) are orthogonal.) It follows that
\begin{equation*}
\begin{bmatrix} 4 \amp 0 \amp \rvert \amp 8 \\ 0 \amp 90 \amp \rvert \amp 45 \end{bmatrix} \sim \begin{bmatrix} 1 \amp 0 \amp \rvert \amp 2 \\ 0 \amp 1 \amp \rvert \amp \frac{1}{2}\end{bmatrix}\text{,}
\end{equation*}
so the least square solution is
\begin{equation*}
\widehat x = \begin{bmatrix} 2 \\ \frac{1}{2}\end{bmatrix}\text{.}
\end{equation*}