4.4-exam2-2014¶
Exam 2, 2014 · Section 4.4: Orthonormal Bases and Gram-Schmidt Source: exam2_2.pdf, pp. 73, 79
Problem¶
Problem 1. (a) Do Gram-Schmidt orthogonalization for the vectors \(\begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix}\), \(\begin{bmatrix} 0 \\ 1 \\ 0 \end{bmatrix}\), \(\begin{bmatrix} 1 \\ 2 \\ 3 \end{bmatrix}\). (Find an orthogonal basis. Normalization is not required.)
(b) Find the \(A = QR\) decomposition for the matrix \(A = \begin{bmatrix} 0 & -1 \\ 1 & 2 \end{bmatrix}\).
(c) Find the projection of the vector \(\begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix}\) onto the line spanned by the vector \(\begin{bmatrix} 1 \\ 1 \\ 1 \end{bmatrix}\).
(d) Find the projection of the vector \(\begin{bmatrix} 1 \\ -1 \\ 0 \end{bmatrix}\) onto the plane \(x + y + z = 0\) in \(R^3\).
(e) Find the least squares solution \(\hat{x}\) for the system \(\begin{bmatrix} 1 & -1 \\ 1 & 0 \\ 1 & 1 \\ 1 & 2 \end{bmatrix} x = \begin{bmatrix} 0 \\ 0 \\ 10 \\ 0 \end{bmatrix}\).
Solution
(a) \(a_1\) and \(a_2\) are already orthogonal, so \(b_1 = a_1\) and \(b_2 = a_2\). \[ b_3 = a_3 - \frac{a_3 \cdot b_1}{b_1 \cdot b_1} b_1 - \frac{a_3 \cdot b_2}{b_2 \cdot b_2} b_2 = a_3 - 2a_1 - 2a_2 = \begin{bmatrix} -1 \\ 0 \\ 1 \end{bmatrix}. \] (b) Gram-Schmidt orthogonalization on \(a_1 = \begin{bmatrix} 0 \\ 1 \end{bmatrix}\) and \(a_2 = \begin{bmatrix} -1 \\ 2 \end{bmatrix}\) gives \(b_1 = a_1\) and \(b_2 = \begin{bmatrix} -1 \\ 0 \end{bmatrix}\), so \(Q = \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}\). Inspection gives \(R = \begin{bmatrix} 1 & 2 \\ 0 & 1 \end{bmatrix}\). (c) \(\displaystyle \frac{\begin{bmatrix} 1 \\ 1 \\ 1 \end{bmatrix} \begin{bmatrix} 1 & 1 & 1 \end{bmatrix} \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix}}{\begin{bmatrix} 1 & 1 & 1 \end{bmatrix} \begin{bmatrix} 1 \\ 1 \\ 1 \end{bmatrix}} = \begin{bmatrix} 1 \\ 1 \\ 1 \end{bmatrix} \Big/ 3.\) (d) The vector already lies in the plane, so the projection does nothing: \((1, -1, 0)^T\). (e) We must solve \[ \begin{bmatrix} 1 & 1 & 1 & 1 \\ -1 & 0 & 1 & 2 \end{bmatrix} \begin{bmatrix} 1 & -1 \\ 1 & 0 \\ 1 & 1 \\ 1 & 2 \end{bmatrix} \hat{x} = \begin{bmatrix} 1 & 1 & 1 & 1 \\ -1 & 0 & 1 & 2 \end{bmatrix} \begin{bmatrix} 0 \\ 0 \\ 10 \\ 0 \end{bmatrix}, \] i.e. \(\begin{bmatrix} 4 & 2 \\ 2 & 6 \end{bmatrix} \hat{x} = \begin{bmatrix} 10 \\ 10 \end{bmatrix}\). So \[ \hat{x} = \begin{bmatrix} 4 & 2 \\ 2 & 6 \end{bmatrix}^{-1} \begin{bmatrix} 10 \\ 10 \end{bmatrix} = \begin{bmatrix} 2 \\ 1 \end{bmatrix}. \]Keywords: Gram-Schmidt, orthogonal basis, QR decomposition, projection, least squares