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:14

Video transcript

we came up with a process for generating an orthonormal basis in the last video and it wasn't a new discovery it's called the gram-schmidt process but let's apply that now to some real examples and hopefully we'll see that it's a lot more concrete than it might have looked in the last video let's say I have the plane x1 plus x2 plus x3 plus x3 is equal to 0 this is a plane in r3 so let me just say that lets say that subspace V V is equal to the plane defined by this guy right here x1 plus x2 plus x3 is equal to zero all of the vectors in the Subspace if you take their entries and you add them up you're going to get 0 so first we use just any basis for V so if we could come up with that so if we subtract X 2 and X 3 from both sides its equation we know that x1 is going to be equal to minus x2 minus x3 or we could say that our subspace V is equal to the set of all of the vectors in r3 x1 x2 and x3 that satisfy the equation was that satisfy the equation let's say - instead of let me write it this way let's say that X 2 X 2 is equal to C 1 and X 3 is equal to C 2 then this equation would be X 1 is equal to minus C 1 minus C 2 so if we write it that way then the subspace V is the set of all of the vectors in r3 such that C 1 times some vector we write it this way C 1 times let's see X 1 is let me write it this way plus C 2 times some other vector where C 1 and C 2 are any real numbers so C 1 and C 2 are a member of the reals and so what is X 1 X 1 is equal to minus C 1 minus C 2 so X 1 is equal to minus 1 C 1 minus 1 C 2 X 2 is just equal to C 1 so X 2 is equal to 1 times C 1 plus 0 Oh times C 2 and then X 3 is equal to C 2 or 0 times C 1 plus 1 times C 2 so V is essentially the span of these two vectors all of the linear combinations of these two vectors that would represent that plane so let me write it like this V is equal to the span is equal to the span of the vectors minus 1 1 0 and the vector minus 1 0 1 and you can see that these are linearly independent right here you can obviously there's no linear combination of this guy that can give you a 1 over here there's no linear combination of this guy that'll give you a 1 right there so this is what V is but what we want the whole reason why we even why I'm making this video is to find an orthonormal basis for V this is just a basis this these guys right here are just a basis for V let's find an orthonormal basis let's call this vector up here let's call that V 1 and let's call this vector right here V 2 so if we wanted to find a if we wanted to find an orthonormal basis for the span of v1 let me write this down let me define some subspace V 1 is equal to the span of just my vector V 1 well we saw in the last video if we just divide V 1 by its length then we'll have and the span of that vector is going it's going to be a unit vector and it's going to be the same thing as this subspace V 1 is this line in r3 so let's do that what is the length of V 1 the length of V 1 is equal to the square root the square root of minus 1 squared which is 1 plus 1 squared which is 1 plus 0 squared which is 0 so it's equal to the square root of 2 so let's define some vector u1 is equal to 1 divided by the length of V 1 so 1 over the square root of 2 times V 1 times minus 1 1 0 then the span of v1 is just the same thing as the span as the span of you one and so this would be an orthonormal basis just this vector right here would be an orthonormal basis for just the span of v1 but we don't want just to span a v1 we want the span of v1 and v2 so let me just let me draw it so right now we have a basis if I just do u 1 I'm not going to actually draw what this looks like but it looks something like this and its span is this entire line in r3 so its span is this entire line the span of just one vector in RN is just going to be all the scalar multiples of it or a line in RN so this right here is the subspace v1 now we have a v2 here which is linearly independent from this guy which means it's linearly independent from this guy because he's just a scaled version of this guy so v2 is going to look like maybe look like that that is v2 right there this of course was our u1 what we want to do is we want to define a sub subspace V what's going to call it v2 for now it's going to be v2 is equal to the span the span of v1 and v2 which is the same thing as the span anything that's spanned by V 1 is also spanned by u1 as the span of u1 and v2 so we want to see all all everything that can be generated by linear combinations of u 1 and V 2 and obviously this thing right here is our plane that we're talking about the span of these two guys the span of these two guys that is the whole subspace that we're talking about in this problem so that is equal to V so once we find this if we find an orthonormal version for this span we're done so how can we do that well if I can find a vector that's orthogonal to all of the linear combinations of this that if I add up some linear combination of this to that vector I can get V 2 I can replace V 2 with that vector so we could call that vector right there why - all right if I can determine Y 2 this Y 2 is clearly orthogonal to everything over here and I can take some vector in V 1 in this line and add it to Y 2 and I can get 2 V 2 so a combinations of these guys are just as good as V 2 so this is going to be equal to the span of u1 and why and why to now what is y2 equal to well we saw in the last video this is just the projection of V to this vector right here is the projection of v2 onto the subspace v1 and how do we figure out with that and then what would Y to be Y to be v2 minus that so y2 is equal to v2 minus the projection of v2 onto v1 or if we were to actually write it out what is that going to be equal to so it's going to be equal to v2 is this vector right here so it's minus 1 0 1 that is v2 v2 minus the projection of v2 onto v1 well the projection of the vector v2 onto the subspace v1 is just V 2 is just v2 minus 1 0 1 dotted with the orthonormal basis for v1 the orthonormal basis for v1 is just u 1 and we solve for u 1 up here so that's going to be that dotted with 1 over the square root of 2 times let me do that in yellow actually just so you can see that this is U 1 so dotting it with you one so it's dotting with 1 over the square root of 2 times minus 1 1 0 I like leaving the 1 over the square root of 2 out of there just to keep things simple all of that divided by actually not divided by anything because if we were you know if we were doing a prediction align it would be dot you know divided by the dot product of the orthonormal basis with itself but its length is 1 so we don't have that and we saw that before so actually let me let me write this a little bit let me write it a little bit I'll just move it down let's see if I can move it so it's just equal to that guy all right V let me make the numbers clear this is V 2 V 2 minus the projection of v2 onto the subspace 1 so that's just V 2 V 2 dotted with my orthonormal basis for V 1 my first vector in my orthonormal basis there's only one so I'm going to have one term here and then all of that time's my orthonormal basis vector for v1 so 1 over the square root of 2 times the vector minus 1 1 0 now this looks this looks really fancy this right here is our orthonormal basis for the subspace v1 but what does this simplify to so this is going to be equal to remember this right here this piece right there that's the projection onto V 1 of V 2 that's what that was right there so this is going to be equal to the vector minus 1 0 1 minus now if I I can take the 1 over square root of 2 on the outside actually I can take both of these on the outside so 1 over the square root of 2 times 1 over the square root of 2 it's just going to be 1 over 2 right so there's going to be minus 1/2 times these guys dotted with each other so what is let me just write it this way so what is these guys dotted with each other it's going to be so it's going to be a number minus 1 times minus 1 is 1 plus 0 times 1 so plus 0 plus 1 times 0 so plus 0 all of that times well we already used this part of it so we just have this part left over times minus 1 1 and 0 this was the dot product and well we took and we took the 2 scaling factors out when you multiply them you got a 1/2 so this is just going to be a 1 which simplifies things so this is going to be equal to the vector minus 1 0 1 minus 1/2 times this or we could just write so 1/2 times minus 1 is minus 1/2 we have 1/2 and then we have 0 and so this is going to be equal to minus 1 minus minus 1/2 that's plus 1/2 so that's going to be just minus 1/2 0 minus 1/2 is minus 1/2 and then 1 minus 0 is just 1 so this right here is our vector y 2 is our vector Y 2 and if you combine u 1 right here and why - we are spanning our subspace V but we don't have an orthonormal basis if these guys are orthogonal with respect to each other but this guy does not have length one yet so to make it equal to length one let's replace him let's define another vector let's define another vector u - that's equal to 1 over the length of Y - 1 over the length of Y 2 times y 2 so what is the length of Y 2 the length of Y 2 is equal to the square root mine of minus 1/2 squared is 1/4 plus minus 1/2 squared is 1/4 plus 1 squared so it's the square root of what is this 1 and a half or 3 halves so it's equal to the square root of 3 halves right yeah 1 let me this is 1/2 plus 1 is 1 and 1/2 which is 3 halves so it's equal to the square root of 3 halves so if I define u 2 u 2 is equal to 1 over the square root of 3 halves or that's the same thing as the square root of 2/3 times y 2 which is this guy right here minus 1/2 minus 1/2 + 1 and I already had defined u1 up here u1 was right up here I can let me copy and paste let me X I can just I think I can just move it down let me just move it down so I found you one right here we now have two vectors we now have two vectors that are orthogonal with respect to each other so if I have the set of u1 and u2 these guys both have length 1 they're orthogonal with respect to each other and they span V so this is an orthonormal orthonormal basis for the plane that we started this video out with for V and we're done we have done the gram-schmidt process this is our new our new these are our new orthonormal basis vectors