The Gram-Schmidt process is a method for transforming a set of [[Linearly Independent Vectors]] into a set of [[Orthogonal Matrix|orthonormal]] vectors. This is particularly useful for creating an orthonormal [[Basis Vectors|Basis]] for a vector space.
**Key Idea:**
Given a set of linearly independent vectors $v = \{ v_1, v_2, v_3 \}$, the goal is to construct a new set of orthonormal basis vectors $e = \{ e_1, e_2, e_3 \}$ such that:
1. Each vector $e_i$ is orthogonal to all previously constructed vectors $e_1, \dots, e_{i-1}$.
2. Each vector $e_i$ has unit [[Vector Length|length]] $\vert e_i \vert = 1$.
The process proceeds iteratively by adjusting each vector to ensure orthogonality and normalizing it to ensure unit length.
## Step-by-Step Procedure
*Step 1: Normalize the First Vector*
The first orthonormal vector $e_1$ is obtained by normalizing $v_1$:
$ e_1 = \frac{v_1}{\lvert v_1 \rvert} $
*Step 2: Orthogonalize the Second Vector*
The construct $e_2$, first identify the component of $v_2$ that points along $e_1$. This is found by the [[Vector Projection]] of $v_2$ onto $e_1$.
$ \text {Projection of }v_2 \text{ onto }e_1=(v_2 \cdot e_1)\,e_1 $
To create a vector that is orthogonal to $e_1$, we need to remove the part of $v_2$ that points along $e_i$ (i.e. the vector projection). Therefore we subtract the vector projection from $v_2$ to get an orthogonal vector $w_2$.
$ w_2 = v_2-(v_2 \cdot e_i)*e_i$
Normalize $w_2$ to get the second orthonormal vector $e_2$.
$ e_2 = \frac{w_2}{\vert \vert w_2 \vert \vert}$
*Step 3: Orthogonalize the Third Vector*
The construct $e_3$, first identify the components of $v_3$ that points along $e_1$ and $e_2$. This involves vector projections of $v_3$ onto $e_1$ and $v_3$ onto $e_2$.
$
\begin{align}
\text {Projection of }v_3 \text{ onto }e_1=(v_3 \cdot e_1) *e_1 \\
\text {Projection of }v_3 \text{ onto }e_2=(v_3 \cdot e_2) *e_2
\end{align}
$
Subtract these projections from $v_3$ to obtain $w_3$, a vector orthogonal to both $e_1$ and $e_2$:
$ w_3 = v_3 -(v_3 \cdot e_1) \, e_1-(v_3 \cdot e_2) \,e_2$
Normalize $w_2$ to get the second orthonormal vector $e_2$.
$ e_3 = \frac{w_3}{\vert \vert w_3 \vert \vert}$
## General Procedure
For a general set of $n$ linearly independent vectors $\{v_1, \dots v_n\}$, the orthonormal vectors $\{e_1, \dots e_n\}$ are constructed as follows:
For $k=1$:
$e_1= \frac{v_1}{\vert \vert v_1 \vert \vert}$
For $k>1$:
1. Compute the orthogonalized vector $w_k$ by subtracting the projections of $v_k$ onto all previously constructed $e_i$ vectors:
$ w_k = v_k - \sum_{i=1}^{k-1} (v_k \cdot e_i)\, e_i $
2. Normalize $w_k$ to obtain $e_k$:
$ e_k = \frac{w_k}{\vert \vert w_k \vert \vert}$