Skip to content

4.3-final-2010-strang

Final Exam, 2010 (strang) · Section 4.3: Least Squares Approximations Source: finalexam_2.pdf, p. 27

Problem

2 (11 points) This problem finds the curve \(y = C + D 2^t\) which gives the best least squares fit to the points \((t, y) = (0, 6), (1, 4), (2, 0)\).

(a) Write down the 3 equations that would be satisfied if the curve went through all 3 points.

(b) Find the coefficients \(C\) and \(D\) of the best curve \(y = C + D 2^t\).

(c) What values should \(y\) have at times \(t = 0, 1, 2\) so that the best curve is \(y = 0\)?

Solution (a) The 3 equations are \[ \begin{aligned} C + D &= 6 \\ C + 2D &= 4 \\ C + 4D &= 0. \end{aligned} \] (b) The normal equations use \[ A^T A = \begin{bmatrix} 1 & 1 & 1 \\ 1 & 2 & 4 \end{bmatrix} \begin{bmatrix} 1 & 1 \\ 1 & 2 \\ 1 & 4 \end{bmatrix} = \begin{bmatrix} 3 & 7 \\ 7 & 21 \end{bmatrix}, \qquad A^T b = \begin{bmatrix} 1 & 1 & 1 \\ 1 & 2 & 4 \end{bmatrix} \begin{bmatrix} 6 \\ 4 \\ 0 \end{bmatrix} = \begin{bmatrix} 10 \\ 14 \end{bmatrix}. \] Solve \(A^T A \hat{x} = A^T b\): \[ \begin{bmatrix} 3 & 7 \\ 7 & 21 \end{bmatrix} \begin{bmatrix} C \\ D \end{bmatrix} = \begin{bmatrix} 10 \\ 14 \end{bmatrix} \quad \text{gives} \quad \begin{bmatrix} C \\ D \end{bmatrix} = \frac{1}{14} \begin{bmatrix} 21 & -7 \\ -7 & 3 \end{bmatrix} \begin{bmatrix} 10 \\ 14 \end{bmatrix} = \begin{bmatrix} 8 \\ -2 \end{bmatrix}. \] (c) The best curve is \(y = 0\) when the projection is \(p = (0, 0, 0)\), which happens exactly when \(A^T b = 0\). In that case the values of \(y\) are \(b = c(2, -3, 1)\).

Keywords: least squares, normal equations, projection, best fit curve