Lecture 40 - The Gram-Schmidt Process

Learning Objective

Orthogonal vs. Orthonormal

This lecture focuses on a step-by-step process to construct an orthogonal or orthonormal basis for a subspace of \( \mathbb R^n \). Recall that an orthonormal set is just an orthogonal set where every vector in the set is a unit vector. So, if we have an orthogonal basis for a subspace, we can turn it into an orthonormal set by normalizing each vector in the set. Because of this, we will focus our efforts on finding an orthogonal basis for a subspace.

The Gram-Schmidt Process

Let \( H \) be a subspace of \( \mathbb R^n \) with basis \( \{ \bbm x_1, \bbm x_2, \ldots, \bbm x_p \} \). Construct new vectors \( \bbm v_1, \bbm v_2, \ldots, \bbm v_p \) as follows:

Theorem (Gram-Schmidt). Given a subspace \( H \) of \( \mathbb R^n \) with basis \( \{ \bbm x_1, \bbm x_2, \ldots, \bbm x_p \} \), the Gram-Schmidt Process results in an orthogonal basis for \( H \).

Proof. By solving each equation in the process for \( \bbm x_i \), we can rewrite any linear combination of the \( \bbm x_i \) in terms of the \( \bbm v_i \). Thus, the \( \bbm v_i \) span \( H \). Now we work to show that the set \( \{ \bbm v_1, \ldots, \bbm v_p \} \) is orthogonal.

We argue by induction. The set \( \{ \bbm v_1 \} \) is trivially orthogonal. Now suppose that \( 1 \lt n \le p \) and that we have shown that \( \{ \bbm v_1, \ldots, \bbm v_{n-1} \} \) is orthogonal. Let \( 1 \le i \lt n \) and consider \( \bbm v_i \cdot \bbm v_n \): \[ \bbm v_i \cdot \bbm v_n = \bbm v_i \cdot \left( \bbm x_n - \frac{\bbm x_n\cdot \bbm v_1}{\bbm v_1\cdot \bbm v_1} \bbm v_1 - \frac{\bbm x_n\cdot \bbm v_2}{\bbm v_2\cdot \bbm v_2} \bbm v_2 - \cdots - \frac{\bbm x_n\cdot \bbm v_{n-1}}{\bbm v_{n-1}\cdot \bbm v_{n-1}} \bbm v_{n-1} \right) = \bbm v_i \cdot \bbm x_n - \sum_{j=1}^{n-1} \frac{\bbm x_n \cdot \bbm v_j}{\bbm v_j \cdot \bbm v_j} (\bbm v_i \cdot \bbm v_j) \]

Since the set \( \{ \bbm v_1, \ldots, \bbm v_{n-1} \} \) is orthogonal, each dot product \( \bbm v_i \cdot \bbm v_j \) is zero except for \( \bbm v_i \cdot \bbm v_i \). Thus, \[ \bbm v_i \cdot \bbm v_n = \bbm v_i \cdot \bbm x_n - \sum_{j=1}^{n-1} \frac{\bbm x_n \cdot \bbm v_j}{\bbm v_j \cdot \bbm v_j} (\bbm v_i \cdot \bbm v_j) = \bbm v_i \cdot \bbm x_n - \frac{\bbm x_n \cdot \bbm v_i}{\bbm v_i \cdot \bbm v_i} (\bbm v_i \cdot \bbm v_i) = 0. \]

Since Orthogonal Sets Are Linearly Independent, this shows that \( \{ \bbm v_1, \ldots, \bbm v_n \} \) is a linearly independent and orthogonal set that spans \( H \). \( \Box \)

Examples

Example 1. Let \( \bbm x_1 = \vecthree 123 \) and \( x_2 = \vecthree 10{-1} \), and let \( H = {\rm Span}\{ \bbm x_1, \bbm x_2 \} \). Find an orthonormal basis for \( H \).

First, we use the Gram-Schmidt Process to find an orthogonal basis for \( H \). We have \[ \bbm v_1 = \bbm x_1 = \vecthree 123 \quad \mbox{and} \quad \bbm v_2 = \bbm x_2 - \frac{\bbm x_2\cdot \bbm v_1}{\bbm v_1\cdot \bbm v_1} \bbm v_1 = \vecthree 10{-1} - \frac{-2}{14} \vecthree 123 = \vecthree {8/7} {2/7} {-4/7}. \]

Now, we normalize \( \bbm v_1 \) and \( \bbm v_2 \) to obtain an orthonormal basis for \( H \): \[ \bbm u_1 = \frac{1}{\| \bbm v_1 \|} \bbm v_1 = \frac{1}{\sqrt{14}} \vecthree 123 = \vecthree{1/\sqrt{14}}{2/\sqrt{14}}{3/\sqrt{14}} \quad \mbox{and} \quad \bbm u_2 = \frac{1}{\| \bbm v_2 \|} \bbm v_2 = \frac{1}{2\sqrt{21}/7} \vecthree {8/7} {2/7} {-4/7} = \vecthree{4/\sqrt{21}}{1/\sqrt{21}}{-2/\sqrt{21}}. \ \Box \]

Example 2. Let \( H = {\rm Span}\{ \bbm x_1, \bbm x_2, \bbm x_3 \} \), where \( \bbm x_1 = \vecfour 102{-1} \), \(\bbm x_2 = \vecfour {-1}101 \), and \( \bbm x_3 = \vecfour 200{-2} \). Find an orthonormal basis for \( H \).

We first apply Gram-Schmidt to find an orthogonal basis: \[ \bbm v_1 = \bbm x_1 = \vecfour 102{-1} \] \[ \bbm v_2 = \bbm x_2 - \frac{\bbm x_2\cdot \bbm v_1}{\bbm v_1\cdot \bbm v_1} \bbm v_1 = \vecfour {-1}101 - \left( \frac{-2}{6} \right) \vecfour 102{-1} = \vecfour {-2/3}{1}{2/3}{2/3} \] \[ \bbm v_3 = \bbm x_3 - \frac{\bbm x_3\cdot \bbm v_1}{\bbm v_1\cdot \bbm v_1} \bbm v_1 - \frac{\bbm x_3\cdot \bbm v_2}{\bbm v_2\cdot \bbm v_2} \bbm v_2 = \vecfour 200{-2} - \left( \frac 4 6 \right) \vecfour 102{-1} - \left( \frac{-8/3}{7/3} \right) \vecfour {-2/3}{1}{2/3}{2/3} = \vecfour {4/7}{8/7}{-4/7}{-4/7}. \]

Now we normalize these vectors to obtain the desired orthonormal basis for \( H \): \[ \bbm u_1 = \frac{1}{\| \bbm v_1 \|} \bbm v_1 = \frac{1}{\sqrt 6} \vecfour 102{-1} = \vecfour {1/\sqrt 6} 0 {2/\sqrt{6}} {-1/\sqrt{6}} \] \[ \bbm u_2 = \frac{1}{\| \bbm v_2 \|} \bbm v_2 = \frac{1}{\sqrt{21}/3} \vecfour {-2/3}{1}{2/3}{2/3} = \vecfour {-2/\sqrt{21}}{3/\sqrt{21}}{2/\sqrt{21}}{2/\sqrt{21}} \] \[ \bbm u_3 = \frac{1}{\| \bbm v_3 \|} \bbm v_3 = \frac{1}{4\sqrt{7}/7} \vecfour {4/7}{8/7}{-4/7}{-4/7} = \vecfour {1/\sqrt{7}}{2/\sqrt{7}}{-1/\sqrt{7}}{-1/\sqrt{7}}.\ \Box \]

« Lecture 39 Back to Top Lecture 41 »