Skip to content

4.4-exam2-2003

Exam 2, 2003 · Section 4.4: Orthonormal Bases and Gram-Schmidt Source: exam2_1.pdf, pp. 82, 91

Problem

2 (29 pts.)

(a) Apply the Gram-Schmidt algorithm to the columns of the matrix \(A\) below. (Use the order in which they occur in the matrix!) Use this to write \(A = QR\), where \(Q\) is a matrix with orthonormal columns, and \(R\) is upper triangular.

\[ A = \begin{bmatrix} 1 & 0 \\ 0 & 1 \\ 0 & 0 \\ -1 & -1 \end{bmatrix}. \]

(b) Compute the matrix of the projection onto the column space of \(A\). What is the distance of the point \((1, 1, 1, 0)\) to this column space?

Solution 2a. \[ q_1 = a_1 = (1, 0, 0, -1). \] \[ q_2 = a_2 - \frac{a_2 \cdot q_1}{q_1 \cdot q_1} q_1 = (0, 1, 0, -1) - \left( \frac{1}{2}, 0, 0, -\frac{1}{2} \right) = \left( -\frac{1}{2}, 1, 0, -\frac{1}{2} \right). \] Normalize: \[ q_1 = \left( \frac{1}{\sqrt{2}}, 0, 0, -\frac{1}{\sqrt{2}} \right), \qquad q_2 = \left( -\frac{1}{\sqrt{6}}, \frac{2}{\sqrt{6}}, 0, -\frac{1}{\sqrt{6}} \right). \] With \(Q = [q_1, q_2]\) and \(R = Q^T A\): \[ A = QR = \begin{bmatrix} \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{6}} \\ 0 & \frac{2}{\sqrt{6}} \\ 0 & 0 \\ -\frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{6}} \end{bmatrix} \begin{bmatrix} \sqrt{2} & \frac{1}{\sqrt{2}} \\ 0 & \frac{3}{\sqrt{6}} \end{bmatrix}. \] 2b. \[ P = QQ^T = \begin{bmatrix} \frac{2}{3} & -\frac{1}{3} & 0 & -\frac{1}{3} \\ -\frac{1}{3} & \frac{2}{3} & 0 & -\frac{1}{3} \\ 0 & 0 & 0 & 0 \\ -\frac{1}{3} & -\frac{1}{3} & 0 & \frac{2}{3} \end{bmatrix}. \] If \(b = (1, 1, 1, 0)\) then its projection is \(p = Pb = \left( \frac{1}{3}, \frac{1}{3}, 0, -\frac{2}{3} \right)\). The distance is \[ d = \|b - p\| = \left\| \left( \frac{2}{3}, \frac{2}{3}, 1, \frac{2}{3} \right) \right\| = \frac{\sqrt{21}}{3}. \]

Keywords: Gram-Schmidt, QR factorization, projection matrix, distance