I have the Gram-Schmidt algorithm memorized, so that I can always compute an orthonormal basis, when I need it (on pen and paper, I don't studying mathematical / scientific computing ... yet).
Could I think of the Gram-Schmidt algorithm geometrically (algebraically, I am fine with the proof, but I have no geoemtric insight from it) in the two / three-dimensional cases? How does...subtracting a bunch of inner products that scale vectors turn a linearly independent set into an orthogonal set?
Another orthogonality question I have is: I know the formula to compute the orthogonal projection of a vector $\vec v$ onto some subspace $W$ is given by:
$$P_W(\vec v) = \sum \langle \vec v, u_i\rangle u_i$$
where $u_i$ is an orthonormal basis for the subspace $W$.
But, there is another orthogonal projection that I know of:
If I look at the operator given by this matrix multiplication
$$UU^t$$
where U has orthonormal columns (is an orthogonal matrix, if it is nxn square)
then we know that $UU^t$ represents orthogonal projection of vectors onto the column space of $U$.
Are these two orthogonal projections related? Can they be used...interchangeably?
Thanks,
The geometric interpretation of Gram Schmidt is as follows. Given a subspace $S\subseteq \Bbb R^n$, you can always decompose a vector $v\in \Bbb R^n$ as the sum of a vector parallel to $S$ and orthogonal to $S$: $$v=v_\| + v_\bot$$
NOTE: This is the best picture I can find -- sorry that it's not great. Hopefully you can see that the dark blue vector is being decomposed into the sum of the green vector parallel to the plane and the light blue vector orthogonal to the plane.
We can call these two vectors the projection of $v$ onto $S$ and the rejection of $v$ from $S$. Gram-Schmidt is just the process of removing the projections of each vector onto the $1$d subspaces formed by the span of each of the previous vectors.
Let's see how it works for a $3$d subspace. We're given a basis $\mathcal B=\{b_1, b_2, b_3\}$ of a $3$d subspace $S$ and we want to find an orthonormal basis $\mathcal E=\{e_1, e_2, e_3\}$ for $S$.
First we start by just setting $e_1 = \frac{1}{\|b_1\|}b_1$ -- that is we just take $e_1$ to be the unit vector in the direction of $b_1$.
Then for $e_2$, we first decompose $b_2$ into it's projection and rejection from $b_1$: $$b_2 = {b_2}_\| + {b_2}_\bot$$ Then we see that the part of $b_2$ that's orthogonal to $b_1$ is given by ${b_2}_\bot = b_2-{b_2}_\| = b_2 - \operatorname{proj}_{b_1}b_2$. This gets rid of the part of $b_2$ that's parallel to $b_1$, leaving only the part that's orthogonal to it. Then we set $e_2 = \frac{1}{\|{b_2}_\bot\|}{b_2}_\bot$.
Then for $e_3$, we follow the same procedure. We decompose $b_3$ into its parts parallel to and orthogonal to $\operatorname{span}(b_1, b_2)$: $$b_3 = {b_3}_\| + {b_3}_\bot = (\operatorname{proj}_{b_1}b_3 + \operatorname{proj}_{b_2}b_3) + {b_3}_\bot$$
Solving for ${b_3}_\bot$, we get $${b_3}_\bot = b_3 - \operatorname{proj}_{b_1}b_3 - \operatorname{proj}_{b_2}b_3$$ Then we just set $e_3=\frac{1}{\|{b_3}_\bot\|}{b_3}_\bot$.