Help with understanding the Gram-Schmidt Process

gram-schmidtlinear algebraorthogonalitysolution-verification

Let $U=\langle x_1,x_2,x_3\rangle \subseteq \mathbb{R^4},$ where $$x_1=\begin {pmatrix} 3\\4 \\0\\0
\end {pmatrix}, \ x_2=\begin {pmatrix} 1\\3 \\1\\1 \end {pmatrix},\ x_3=\begin {pmatrix} 0\\5 \\5\\7 \end {pmatrix}.$$

Use the Gram-Schmidt Process to determine an orthogonal basis of $U$ with respect to the bilinear form given by the identity $I_4\in \mathbb{R^{4\times4}}$.

I think I understand the process at hand ok enough but I'm unsure of my work and need someone to check it. First I look at the Gram Matrix which is just the $4\times4 $ identity matrix. Then based on the definition of the Gram matrix I turn it into $ \mathfrak{b}(v_i,y_i)= v_1y_1+v_2y_2+v_3y_3+v_4y_4.$ Then I start looking at the actual process:
$$B'=\langle w_1,w_2,w_3\rangle \text{ where } w_1= \begin {pmatrix} 3\\4\\0\\0 \end {pmatrix} $$
$$w_2=x_2-\frac{\mathfrak{b}(x_2,w_1)}{\mathfrak{b}(w_1,w_1)}w_1 \implies w_2= \begin {pmatrix} 1\\3\\1\\1 \end {pmatrix} – \frac{(1 \times3)+(3\times4)+(1\times0)+(1\times0)}{(3\times3)+(4\times4)+(0\times0)+(0\times0)}\begin {pmatrix} 3\\4\\0\\0 \end {pmatrix}.$$
$$w_2= \begin {pmatrix} -4/5\\3/5\\1\\1 \end {pmatrix} $$
$$
w_3= \begin {pmatrix} 0\\5\\5\\7 \end {pmatrix} – \frac{(5\times4)}{25}\begin {pmatrix} 3\\4\\0\\0 \end {pmatrix}- \frac{(0)+(3)+(5)+(7)}{(16/25)+(9/25)+1+1} \begin {pmatrix} -4/5\\3/5\\1\\1 \end {pmatrix}$$

$$w_3= \begin {pmatrix} 8/5\\-6/5\\0\\2 \end {pmatrix},\ B'= \langle w_1,w_2,w_3\rangle.$$
What I'm most particularly unsure about is whether or not I had to turn the Gram matrix into a bilinear form and also I'm just generally unsure about what I've turned it into as well. I suspect I should actually be doing vector-matrix multiplication or something but I don't really know.

Best Answer

Ah, well, the way that I would explain the Gram-Schmidt process, or at the very least, the way that I've always thought about it is, that when you're in your standard basis (for instance, in $\mathbb{R}^3$ with basis vectors $\vec{x}, \vec{y}, \vec{z}$) with your "ordinary" scalar product (in $\mathbb{R}^3$, $\langle \vec{x} , \vec{x} \rangle = \langle \vec{y} , \vec{y} \rangle = \langle \vec{z} , \vec{z} \rangle = 1$ and $\langle \vec{x} , \vec{y} \rangle = \langle \vec{x} , \vec{z} \rangle = \langle \vec{y} , \vec{z} \rangle = 0$, etc.) everything is nice and dandy. It's clean, at least. Very easy and systematic to work with. It's orthonormal.

But let's say that you're handed a new scalar product, $\langle \cdot , \cdot \rangle_{\text{New}}$, for which $\langle \vec{x} , \vec{y} \rangle_{\text{New}} \neq 0$ and $\langle \vec{x} , \vec{x} \rangle_{\text{New}} \neq 1$ (for example), how do you go about finding a new basis of your vector space so that in this new basis (in $\mathbb{R}^3$, call them $\vec{a}, \vec{b}, \vec{c}$) the new scalar product becomes the "ordinary" scalar product? (In $\mathbb{R}^3$, such that $\langle \vec{a} , \vec{a} \rangle_{\text{New}} = \langle \vec{b} , \vec{b} \rangle_{\text{New}} = \langle \vec{c} , \vec{c} \rangle_{\text{New}} = 1$ and $\langle \vec{a} , \vec{b} \rangle_{\text{New}} = \langle \vec{a} , \vec{c} \rangle_{\text{New}} = \langle \vec{b} , \vec{c} \rangle_{\text{New}} = 0$, etc.)

Well, this is where the Gram-Schmidt process comes in handy!

To illustrate, consider the example of real three-dimensional space as above.

The vectors in your original base are $\vec{x} , \vec{y}, \vec{z}$. We now wish to construct a new base with respect to the scalar product $\langle \cdot , \cdot \rangle_{\text{New}}$. How to go about?

Well, first off, what's wrong with $\vec{x}$? Why couldn't that be a vector in our basis? It isn't the nilvector, after all. Only problem is that it is not necessarily normalized with respect to our new scalar product! That is to say, we do not necessarily have that $$\langle \vec{x} , \vec{x} \rangle_{\text{New}} = 1.$$ But, no need to be alarmed! All we need to do is to normalize it! If we put $$\vec{a} = \frac{1}{\sqrt{\langle \vec{x} , \vec{x} \rangle_{\text{New}}}} \vec{x},$$ then clearly, $$\langle \vec{a} , \vec{a} \rangle_{\text{New}} = \langle \frac{1}{\sqrt{\langle \vec{x} , \vec{x} \rangle_{\text{New}}}} \vec{x} , \frac{1}{\sqrt{\langle \vec{x} , \vec{x} \rangle_{\text{New}}}} \vec{x} \rangle_{\text{New}} = \frac{1}{ \langle \vec{x} , \vec{x} \rangle } \langle \vec{x} , \vec{x} \rangle = 1,$$ and so we have our first basis vector in our new basis in $\vec{a}$. But, we're in three-dimensional space, so we need two more!

What's wrong with $\vec{y}$?

Well, we actually have two problems here! First of all, it is far from guaranteed that $\langle \vec{a} , \vec{y} \rangle_{\text{New}} = 0$. However, we do know now that $\langle \vec{a} , \vec{a} \rangle_{\text{New}} = 1$. Since scalar products respects addition and subtraction and scalar multiplication, it follows that if we put $$\vec{\beta} = \vec{y} - \langle \vec{a} , \vec{y} \rangle_{\text{New}} \vec{a},$$ then, $$\langle \vec{a} , \vec{\beta} \rangle_{\text{New}} = \langle \vec{a} , \vec{y} - \langle \vec{a} , \vec{y} \rangle_{\text{New}} \vec{a} \rangle_{\text{New}} = \langle \vec{a} , \vec{y} \rangle_{\text{New}} - \langle \vec{a} , \vec{y} \rangle_{\text{New}} \langle \vec{a} , \vec{a} \rangle_{\text{New}} = \langle \vec{a} , \vec{y} \rangle_{\text{New}} - \langle \vec{a} , \vec{y} \rangle_{\text{New}} = 0 ,$$ so now at least we can say that $\vec{a}$ and $\vec{\beta}$ are orthogonal. But we need our basis to be orthonormal. That is to say, we need to normalize $\vec{\beta}$ with respect to our new scalar product.

But that's easy! It's the same procedure as for constructing $\vec{a}$ out of $\vec{x}$. Just put $$\vec{b} = \frac{1}{\sqrt{\langle \vec{\beta} , \vec{\beta} \rangle_{\text{New}}}} \vec{\beta},$$ and it follows that $$\langle \vec{b} , \vec{b} \rangle_{\text{New}} = 1 .$$ Since $\vec{\beta}$ was orthogonal to $\vec{a}$, it follows that $\vec{b}$ also is! So now we have two orthonormal basis vectors!

But this is three-dimensional space, so we need another!

Well, you might ask, what's wrong with $\vec{z}$? Well, again, as with $\vec{y}$, we have two problems: orthogonality and normality.

We don't necessarily have that $\langle \vec{z} , \vec{a} \rangle_{\text{New}} = \langle \vec{z} , \vec{b} \rangle_{\text{New}} = 0$. But there's no problem here, we just need to apply the same approach as before, only now with respect to two vectors, $\vec{a}$ and $\vec{b}$! We know that $\langle \vec{a} , \vec{a} \rangle_{\text{New}} = \langle \vec{b} , \vec{b} \rangle_{\text{New}} = 1$ and $\langle \vec{a} , \vec{b} \rangle_{\text{New}} = 0$, so if we put $$\vec{\gamma} = \vec{z} - \langle \vec{a} , \vec{z} \rangle_{\text{New}} \vec{a} - \langle \vec{b} , \vec{z} \rangle_{\text{New}} \vec{b} ,$$ then it follows that $$\langle \vec{a}, \vec{\gamma} \rangle_{\text{New}} = \langle \vec{a} , \vec{z} \rangle_{\text{New}} - \langle \vec{a}, \vec{z} \rangle_{\text{New}} \langle \vec{a} , \vec{a} \rangle_{\text{New}} - \langle \vec{b} , \vec{z} \rangle_{\text{New}} \langle \vec{a} , \vec{b} \rangle_{\text{New}} = \langle \vec{a},\vec{z} \rangle_{\text{New}} - \langle \vec{a},\vec{z} \rangle_{\text{New}} - 0 = 0,$$ and $$\langle \vec{b}, \vec{\gamma} \rangle_{\text{New}} = \langle \vec{b} , \vec{z} \rangle_{\text{New}} - \langle \vec{a}, \vec{z} \rangle_{\text{New}} \langle \vec{b} , \vec{a} \rangle_{\text{New}} - \langle \vec{b} , \vec{z} \rangle_{\text{New}} \langle \vec{b} , \vec{b} \rangle_{\text{New}} = \langle \vec{b},\vec{z} \rangle_{\text{New}} - 0 - \langle \vec{b},\vec{z} \rangle_{\text{New}}= 0,$$ and now all you have to do is to normalize! Put $$\vec{c} = \frac{1}{\sqrt{\langle \vec{\gamma} , \vec{\gamma} \rangle_{\text{New}}}} \vec{\gamma},$$ and in $\vec{a}, \vec{b}, \vec{c}$, you now have your desired orthonormal basis with respect to your new scalar product!

(Now, here I started with the standard basis $\vec{x}, \vec{y}, \vec{z}$, of course, but you could start with basically any set of three linearly independent vectors in $\mathbb{R}^3$ that you want. The process is one of, starting with a basis, to obtain a new basis which is orthonormal with respect to a certain scalar product.)

It should be easy for you from this information to extend and generalize the Gram-Schmidt method to all sorts of vector spaces, regardless what fields they are over, or how many dimensions they have!

But what about your specific example then?

Well, you're looking at a three-dimensional subspace of $\mathbb{R}^4$ spanned by the three vectors $\vec{x}_1, \vec{x}_2, \vec{x}_3$, and the text says that the scalar product is given in terms of the bilinear form given by the identity matrix $I_4 \in \mathbb{R}^{4 \times 4}$, so it looks like this: $$\langle \begin{pmatrix} x \\ y \\ z \\ w \end{pmatrix} , \begin{pmatrix} a \\ b \\ c \\ d \end{pmatrix} \rangle_{\text{New}} = \begin{pmatrix} x & y & z & w \end{pmatrix} \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} a \\ b \\ c \\ d \end{pmatrix} = xa + yb + zc + wd,$$ so, in terms of your vectors, we have $$\langle \vec{x}_1 , \vec{x}_2 \rangle_{\text{New}} = 3+12+0+0=15,$$ and $$\langle \vec{x}_1 , \vec{x}_3 \rangle_{\text{New}} = 0+20+0+0=20,$$ and $$\langle \vec{x}_2 , \vec{x}_3 \rangle_{\text{New}} = 0+15+5+7=27,$$ and from hereon, I have no doubt that you should know perfectly well how to continue!

I wish you the best of luck!

Related Question