If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content
Current time:0:00Total duration:13:57

Video transcript

let's do one more gram-schmidt example so let's say I have the subspace B that is spanned spanned by the vectors let's say we're dealing in r4 so the vectors the first vector is 0 0 1 1 the second vector is 0 1 1 0 and then its third vector so it's a three dimensional subspace of R for its 1 1 0 0 just like that three dimensional subspace of our form but we want to do we want to find an orthonormal basis or V so we want to we want to find we want to substitute these guys three other vectors that are orthogonal with respect to each other and have length 1 so we do the same drill we've done before we can say let's call this guy V 1 this guy is V 2 it's called the sky V 3 so the first thing we want to do is replace V 1 you know and I'm just picking this guy at random just because he was the first guy on the left hand side I want to replace V 1 with an orthogonal version of V 1 so let me call u 1 is equal to well let me just tell find out the length of V 1 I don't think I have to explain too much of the theory at this point I just want to show another example so the length of V 1 is equal to the square root of 0 squared plus 0 squared plus 1 squared plus 1 squared which equals the square root of 2 so let me define my new vector u 1 to be equal to 1 over the length of V 1 1 over the square root of 2 times V 1 x times 0 0 1 1 and just like that the span of v1 v2 v3 is the same thing as a span of u1 v2 and v3 so now so this is my first thing that I've normalized so I can say that V is now equal to the span of the vectors u1 v2 and v3 because I can replace v1 with this guy because this guy I can this guy is just a scaled-up version of this guy so I can definitely represent him with him so I can represent any linear combination of these guys with any linear combination of those guys right there now we just did our first vector we've just normalized this one we need to replace these other vectors with guys that are with vectors that are orthogonal to this guy right here so let's do v2 first so let's replace we could say let's call y2 is equal to v2 minus the projection of v2 of v2 onto the space spanned by u1 or onto you know I could call it C times u1 or in the past videos we call that subspace and v1 the space spanned by u1 and that's just going to be equal to y2 is equal to v2 which is 0 1 1 0 minus v2 projected onto that space is just the dot product of a v2 it's just the dot product of V 2 0 1 1 0 with the spanning vector of that space and there's only one of them so we're only going to have one term like this with you one so dotted with 1 over the square root of 2 times 0 0 1 1 and then all of that times u1 so 1 over the square root of 2 times the vector 0 0 1 1 and so this is going to be equal to v2 which is 0 1 1 0 the square root of 2 is let's factor the mouth so then you just get or just take them and reassociate them out so then you get this is 1 over square root 2 times 1 over square root of 2 is minus 1/2 u times what's the dot product of these two guys you get 0 times 0 plus 1 times 0 which is still 0 plus 1 times 1 plus 0 times 0 so just going to have times 1 times this out here 0 0 1 1 right that a little bit neater getting careless 1 1 so this is just going to be equal to 0 1 1 0 minus minus 1/2 times 0 is 0 1/2 times 0 and 0 then I have 2 halves here so Y 2 y 2 is equal to let's see 0 minus 0 is is 0 1 minus 0 is 1 1 minus 1/2 is 1/2 and then 0 minus 1/2 is minus 1/2 so now the span of V the V we can now write is the span of u1 y 2 and V 3 and this is progress u 1 is orthogonal Y 2 y sorry you want is normalized it has length 1 y 2 is orthogonal to it or they're orthogonal with respect to each other but why 2 still has not been normalized so let me replace Y 2 with a normalized version of it the length of Y 2 the length of Y 2 is equal to the square root of 0 plus 1 squared which is 1 plus 1/2 squared which is 1/4 plus minus 1/2 squared which is also 1/4 so plus 1/4 so this is 1 and 1/2 so it's equal to the square root the square root of 3 halves so let me define another vector here u2 which is equal to 1 over the square root of 3 halves or we could say it's the square root of 2/3 I'm just inverting it it's 1 over the length of Y 2 so I'll just find the reciprocal so it's the square root of 2 over 3 times y 2 times this guy right here times 0 1 1/2 and minus 1/2 and so this span is going to be the same thing as the span of u1 u2 and v3 and there's our second basis vector we're making a lot of progress these guys are orthogonal with respect to each other they both have length one we just have to do something about v3 and we do it the same way let's find a vector that is orthogonal to these guys and if I sum that vector to some linear combination of these guys I'm going to get v3 and I'm going to call that vector Y 3 y 3 is equal to it's going to be equal to V 3 minus the projection of v3 onto onto the subspace spanned by u1 and u2 so I can call that subspace let me just write it here the span the span of u1 and u2 just for notation I'm going to call it V 2 so it's V 3 and actually don't even have to write that minus the projection of v3 onto that what's that going to be that's going to be V 3 dot u 1 times u 1 times the vector u 1 and actually let me just well under plus V 3 dot u 2 times the vector u 2 since this is an orthonormal basis the projection onto it you just take the dot product of V through with each of their the orthonormal basis vectors and multiply them times the orthonormal basis vectors we saw that several videos ago that's one of the neat things about orthonormal basis so what is this going to be equal to a little bit more computation here y3 is equal to v3 which was up here so that's V 3 V 3 looks like this it's 1 1 0 0 minus v3 dot u 1 so this is minus v3 1 1 0 0 dot u 1 so it's dot 1 over the square root of 2 times x 0 0 1 1 that's u 1 so that's this part right here times u 1 so times 1 over the square root of 2 times 0 0 1 1 this piece right there is this piece right there and then we can distribute this minus sign so it's going to be plus you know you have a plus button is minus over here so it's going to minus v3 let me switch colors minus v3 which is 1 1 0 0 dotted with you 2 dotted with the square root of 2/3 times 0 1 1/2 minus 1/2 times you 2 times the vector u 2 times the square root of 2 over 3 times the vector 0 1 1/2 minus 1/2 and what do we get let's calculate this so we could take the so this is going to be equal to this is going to be equal to the vector 1 1 0 0 minus so the 1 over square root 2 1 over squared 2 multiply them you're going to get a 1/2 1/2 and then when you take the dot product of these 2 1 times 0 let's see this is actually all going to be if you take the dot product of all of these and there's actually I'll get 2 0 right so this guy v3 was actually already orthogonal to u 1 they're already orthogonal to u 1 so this will just go straight to 0 which is nice we don't have to have a term right there and I took the dot / 1 times 0 plus 1 times 0 plus 0 times 1 plus 0 times 1 I'll get to 0 so this whole term drops out we can ignore it which makes our computation simpler and then over here we have minus square root of 2/3 times square root of 2/3 is just 2/3 times the dot product of these two guys so that's 1 times 0 which is 0 plus 1 times 1 which is 1 plus 0 times 1/2 which is 0 plus 0 times minus 1/2 which is 0 so we just get a 1 there times this vector times the vector 0 1 1/2 minus 1/2 and then what do we get we get this is the homestretch 1 1 0 0 - - two thirds times all of these guys so 2/3 times 0 is 0 2/3 times 1 is 2/3 2/3 times 1/2 2/3 times 1/2 is 1 third and then 2/3 times minus 1/2 is minus 1/3 so then this is going to be equal to 1 minus 0 is 1 1 minus 2/3 is 1/3 0 minus 1/3 is minus 1/3 and then 0 minus minus 1/3 is positive 1/3 so this vector y3 is orthogonal to these two other vectors which is nice but it still hasn't been normalized so we finally have to normalize this guy then we're done then we have an orthonormal basis we'll have u1 u2 and now we'll find you 3 so the length the length of my vector Y actually let's do something even better it'll simplify things a little bit instead of writing y this way I could scale up Y right all I want is a vector that's orthogonal to the other two that still spans the same space so I can scale this guy up so I could say I don't know let me just call it y3 you know I know let me call it y3 prime now I'm just doing this to ease the computation I could just scale this guy up multiplying by 3 so what do I get I probably should've done with some of the other ones 3 1 minus 1 and 1 and so I could replace y3 with this guy and then I can just normalize this guy it'll be a little bit easier so the length of y 3 prime that I just defined is equal to the square root of 3 squared which is 9 plus 1 squared plus minus 1 squared plus 1 squared which is equal to the square root of 12 which is what that's 2 square roots of 3 is equal to 2 square roots of 3 right 4 square root of 4 times square root of 3 which is 2 square roots of 3 so now I can define u 3 is equal to Y 3 times 1 over the length of Y 3 so it's equal to 1 over 2 square roots of 3 time's the vector 3 1 -1 and 1 and then we're done if we have a basis an orthonormal basis would be this guy let me take the other ones down here and these guys all of these form bring it all the way down if I have a collection of these 3 vectors I now have an orthonormal basis for V these 3 right here they form that set is an orthonormal basis for my original subspace V that I started off with