## Question on Gram-Schmidt Process.

For the discussion of math. Duh.

Moderators: gmalivuk, Moderators General, Prelates

Hydralisk
Posts: 24
Joined: Fri Sep 12, 2008 4:25 pm UTC

### Question on Gram-Schmidt Process.

I've been given a question in a specimen paper on the Gram-Schmidt process;
Let U be the subspace of R^4 with the basis
(1; 0; 1; 0); (0; 1; 􀀀1; 0); (0; 0; 1; 1):
Use the Gram-Schmidt process to nd an orthonormal basis for U.
Note - R4 is that strange looking R with a double | at the left of it.

Right, so I know the first few steps for this question.

Take y1 = (1; 0; 1; 0); y2 = (0; 1; 􀀀1; 0); y3 = (0; 0; 1; 1):
Put x1 = y1 = (1; 0; 1; 0). Simples.

The next formula I think is something like x2 = y2-((y2*x1)/(x1*x1))*x1

But I keep getting out -1/2(1,0,1,0), and to top it off there's another formula for the next bit that I have no idea about. The lecturer has already said that the answer should be 1/2(1,0,1,0) [or 1/2x1 if you prefer.]

So, to clarify; i) How do you multiply two vectors together (eg (0,1,-1,0)*(1,0,1,0) like in the above example.) ii) What have I done wrong in the last part of the solution given? iii) What is the formula required for the next step?

Many thanks to those who can help me! This is going towards my resit paper in a few days by the way, so wish me luck.

Qoppa
Posts: 694
Joined: Sat Nov 24, 2007 9:32 pm UTC
Location: Yes.

### Re: Question on Gram-Schmidt Process.

The "multiplication" you're talking about is the dot product. The dot product is done by multiplying together the corresponding components and then adding all these components together. For example, [imath]\begin{pmatrix} 1\\2\\3\end{pmatrix} \cdot \begin{pmatrix}4\\-5\\6\end{pmatrix} = (1)(4) + (2)(-5)+(3)(6)=12[/imath]

The next step will be:
$x_3 = y_3 - \frac{y_3\cdot x_1}{x_1 \cdot x_1}x_1 - \frac{y_3\cdot x_2}{x_2 \cdot x_2}x_2$
What you're doing at each step is subtracting out the projection of your current vector onto each of the vectors that you've already orthogonalized.

Code: Select all

_=0,w=-1,(*t)(int,int);a()??<char*p="[gd\~/d~/\\b\x7F\177l*~/~djal{x}h!\005h";(++w<033)?(putchar((*t)(w??(p:>,w?_:0XD)),a()):0;%>O(x,l)??<_='['/7;{return!(x%(_-11))?x??'l:x^(1+ ++l);}??>main(){t=&O;w=a();}

Hydralisk
Posts: 24
Joined: Fri Sep 12, 2008 4:25 pm UTC

### Re: Question on Gram-Schmidt Process.

OK, thanks a lot. I knew it was something simplish but I couldn't quite put my finger on it.

So using the formula you've given me, I've calculated as such;

x3 = (0,0,1,1) - ((0,0,1,1)*(1,0,1,0)/(1,0,1,0)*(1,0,1,0))*(1,0,1,0) - ((0,0,1,1)*(1/2(1,2,-1,0))/(1/2*1/2)(1,2,-1,0)*(1,2,-1,0))*(1/2)(1,2,-1,0) Hope you're following this ok.

Which simplifies to

x3 = (0,0,1,1)-1/2(1,0,1,0)-1/6(1,2,-1,0)

Which in turn simplifies to;

x3 = 1/6(-2, 2, 2, 6)

Can anyone explain that very last step? [God how the hell am I still on this course?]

EDIT - the last bit of this question involves finding the lengths of the vectors - simple stuff (if you don't know, (square root of the sum of the bracket terms)^-1, times any constants at the front of the vector. Though you probably do know this, you smarties. :p). I'm also aware you can divide through the last line of working there by 2 and get a simpler answer, but I'll leave it as is for now.
Last edited by Hydralisk on Tue Aug 25, 2009 6:39 pm UTC, edited 1 time in total.

skeptical scientist
closed-minded spiritualist
Posts: 6142
Joined: Tue Nov 28, 2006 6:09 am UTC
Location: San Francisco

### Re: Question on Gram-Schmidt Process.

You now have an orthogonal basis for your subspace U: (1, 1, 0, 0); (1/2, 1, -1/2, 0), and (-1/3, 1/3, 1/3, 1). You can check that these are all orthogonal. The last step is to turn this into an orthonormal basis, which is a basis where each vector is orthogonal to the others, and all are unit vectors, so you have to normalize your vectors. This is the easiest part of Gram-Schmidt; you just have to find the length of each vector, and divide by the length. For instance, the length of (1, 1, 0, 0) is [imath]\sqrt{1^2+1^2+0^2+0^2}=\sqrt{2}[/imath], so the normalized vector is [imath]\frac{1}{\sqrt{2}}(1, 1, 0, 0) \approx (.707, .707, 0, 0)[/imath].

Edit: apparently you already know this, so what exactly was the "very last step" you wanted explained? You seem to be getting it all now...
I'm looking forward to the day when the SNES emulator on my computer works by emulating the elementary particles in an actual, physical box with Nintendo stamped on the side.

"With math, all things are possible." —Rebecca Watson

Hydralisk
Posts: 24
Joined: Fri Sep 12, 2008 4:25 pm UTC

### Re: Question on Gram-Schmidt Process.

Yeah, sorry about that. To clarify, I was wondering how

x3 = (0,0,1,1)-1/2(1,0,1,0)-1/6(1,2,-1,0)

Simplifies to;

x3 = 1/6(-2, 2, 2, 6).

many thanks.

achan1058
Posts: 1783
Joined: Sun Nov 30, 2008 9:50 pm UTC

### Re: Question on Gram-Schmidt Process.

It doesn't, check your work on the steps before it.

skeptical scientist
closed-minded spiritualist
Posts: 6142
Joined: Tue Nov 28, 2006 6:09 am UTC
Location: San Francisco

### Re: Question on Gram-Schmidt Process.

Hydralisk wrote:Yeah, sorry about that. To clarify, I was wondering how

x3 = (0,0,1,1)-1/2(1,0,1,0)-1/6(1,2,-1,0)

Simplifies to;

x3 = 1/6(-2, 2, 2, 6).

many thanks.

Oh, you made a sign error. Remember to keep track of your minus signs when taking dot products of vectors.
I'm looking forward to the day when the SNES emulator on my computer works by emulating the elementary particles in an actual, physical box with Nintendo stamped on the side.

"With math, all things are possible." —Rebecca Watson

bray
Posts: 67
Joined: Wed Aug 15, 2007 4:17 pm UTC

### Re: Question on Gram-Schmidt Process.

Do you not have a book? Or access to Wikipedia?

Return to “Mathematics”

### Who is online

Users browsing this forum: No registered users and 9 guests