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

Video transcript

let's say I've got some subspace V which tends to be our favorite letter for subspaces and it's equal to the span of two vectors in r4 let's say that the first vector is 1 0 0 1 and the second vector is 0 1 0 1 that is my subspace V and you can see that these are going to be a basis that these are linearly independent right two vectors that are linear or any a set of vectors that are linearly independent and that span a subspace our basis for that subspace you can see they're linearly independent this guy has a 1 here there's no way you can take some combination of this guy to somehow get a 1 there and then this guy has a 1 here there's no way you can get some linear combination of these zeros here to get a 1 there so they're linearly independent so you could also call this you could also call this a basis a basis for V now given that let's see if we can find out the transformation matrix for the projection of any arbitrary vector onto this subspace so let's say that X we're dealing in r4 here right so let's say that X let's say that X is a member of our four and I want to figure out what the projection I want to figure out a transformation matrix for the projection projection onto V of X now in the last video we came up with a general a general way to figure this out we said if a is a transformation matrix sorry if a is a matrix whose columns whose columns are the basis for the subspace so let's say a is equal to 1 0 0 1 0 1 0 1 so a is a matrix whose columns are the basis for subspace then the projection of X onto V would be equal to and this is kind of hard that's the first time you look at it gives you a headache but there's a certain pattern T or a symmetry or a way of you could say it's a x you have something in the middle and then you have a trans Bo's x y or vector X Y or vector X and the way I remember it is in the middle you have these two guys switched around so then you have a transpose a and you take the inverse of it so you know I will probably be using this in your everyday life five or ten years from now so it's okay if you don't memorize it but temporarily put this in your medium term memory because it's a good thing to know if you know for doing these projection problems so if we want to find the general linear the general matrix for this transformation we just have to determine what this matrix is equal to and that's just a bunch of matrix operations so that's a what is a transpose a transpose is going to be a transpose is going to be equal to just all the rows turn to columns so the first column becomes the first row so it becomes one zero zero one second column becomes the second row zero one zero one that's what a transpose is now what's a transpose a to figure out that I want to figure out what a transpose times a is so let me multiply a transpose times a so I'll rewrite a right here 1 0 0 1 0 1 0 1 this is give us some good practice on matrix matrix products this is going to be equal to what well first of all we have this is a 2 by 4 matrix and I'm multiplying it by a 4 by 2 matrix so it's going to be a 2 by 2 matrix so the first entry is essentially the dot product of that row with that column so it's 1 times 1 plus 0 times 0 plus 0 times 0 plus 1 times 1 so it's just going to be 2 for that first entry right there and then you take the dot product of this guy with this guy right here so it's 1 times 0 which is 0 plus 0 times 1 which is 0 plus 0 times 0 which is 0 plus 1 times 1 which is 1 now we do this guy this guy dotted with this column right there 0 times 1 is 0 plus 1 times 0 is 0 plus 0 times 0 is 0 plus 1 times 1 is 1 is 1 and then finally this row dotted with this second column second row it's second column 0 times 0 is 0 1 times 1 is 1 0 times 0 is 0 1 times 1 is 1 so we have 1 times 1 plus 1 times 1 so it's going to be 2 it's going to be equal to 2 so this right here that right there is a transpose a but that's not good enough we need to figure out what the inverse of a transpose a is this is a transpose a but we need to figure out a transpose a inverse so what's the inverse of this so let me write it here the inverse a transpose a inverse is going to be equal to what it's 1 over the determinant of this guy and what's the determinant here going to be 1 over the determinant of this the determinant is 2 times 2 which is 4 minus 1 times 1 so it's 4 minus 1 which is 3 so 1 over the determinant times this guy times this guy where if I swap these two so I swap the ones sorry I swap the twos so this 2 goes here and then this orange 2 goes over here and then I make these ones negative so this becomes a minus 1 and this becomes a minus 1 we learned that this is a general solution for the inverse of a 2x2 matrix I think it was 10 or 11 videos ago but and then you probably learned this in your algebra 2 class frankly but there you go we have a transpose a inverse so we have this guy we have this whole guy here is just this matrix I could multiply the 1/3 into it but I don't have to do that just yet but let's figure out the whole matrix now the whole a times this guy a transpose a inverse times a transpose so let me write it this way so the projection the projection onto the subspace V of X is going to be equal to a is going to be equal to a 1 0 0 1 0 let me do a little bit let me write it a little bit bigger it's like this so 1 0 0 1 0 1 0 1 times a transpose a inverse write a times a transpose a inverse which is this guy right here and let's just put the 1/3 out front just because that's just a scalar so I'll put the 1/3 out front times this guy is a transpose a inverse is 1/3 times 2 minus 1 minus 1/2 and then I'm going to multiply it times a transpose times a transpose and then all of that times our vector X so a transpose is right there a transpose is right there it is 1 0 0 1 0 1 0 1 and then all of that's going to be times your vector X so we still have some nice matrix-matrix products ahead of us let's see if we can if we can do these so the first one let's just multiply these two guys let's multiply those two guys I don't think there's any simple way to do it so we have this is a 2 by 2 matrix and this is a 2 by 4 matrix so when I multiply them I'm going to end up with a I'm going to end up with a 2 by a 2 by 4 matrix so let me write that 2 by 4 matrix right here and then I can write this guy right here 1 0 0 1 0 1 0 1 and then I have the 1/3 that was from a transpose a inverse but I put the scaling factor out there and all this is equal to the projection of X onto V so let's do this product so this first entry is going to be 2 times 1 plus minus 1 times 0 so that is just 2 you're going to have to times zero plus minus 1 times 1 well that's minus 1 then you have 2 times 0 plus minus 1 times 0 well that's just 0 and then you're going to have 2 times 1 2 times 1 plus minus 1 times 1 that's 2 minus 1 that's just 1 right 2 times 1 plus minus 1 times 1 fair enough now let's do the second row minus 1 times 1 plus 2 times 0 so that's just minus 1 minus 1 times 0 plus 2 times 1 well that's just 2 minus 1 times 0 plus 2 times 0 that's just 0 minus 1 times 1 plus 2 times 1 well that's minus 1 minus 1 plus 2 so that is 1 almost there and of course we have to multiply it times X at the end that's what the that's what the transformation is but this right here is our transformation matrix one more left to do let's hope I haven't made any careless mistakes and that I won't make any when I'm doing this product because there's going to be a little more complicated because this is a 4 by 2 times a 2 by 4 I'm going to end up with a 4 by 4 matrix so let me give myself some breathing room here because I'm going to be I'm going to generate a 4 by 4 matrix right there and so what am I going to get so this first entry is going to be 1 times 2 plus 0 times minus 1 so it's just going to be equal to 2 the next entry 1 times you know this column times website this row times any column here is just going to be the first entry in the column right and get zeroed out so 1 times 2 plus 0 times minus 1 is just 2 1 times minus 1 plus 0 times 2 is just minus 1 1 times 0 plus 0 times 0 is 0 1 times 1 plus 0 times 1 is just 1 right when you take this row and you multiply it times these columns you literally just got your first row there now let's do this let's do this row times these columns now you get a 0 here so you're going to have a 0 times the first entry of all of these and 1 times the second one so 0 times 2 plus 1 times minus 1 is 1 0 times minus 1 plus 1 times 2 is 2 you're just going to get the second row here 2 0 1 and that actually makes sense because if you just look at this part of the matrix it's the 2 by 2 identity matrix so anyway that's that's a little hint why this looks very much like that but we're just going to go through this matrix product now you multiply this let me do it in a different color you multiply this guy times each of these columns that guy dotted with that is just going to be 0 because this guy's essentially the 0 row vector so you're just going to get a bunch of zeros and then finally this last row it's 1 times the first entry plus 1 times the second entry so this guy is going to be 2 plus minus 1 which is 1 minus 1 plus 2 which is 1 0 plus 0 which is 0 and then 1 plus 1 which is 2 and all of that times X and there you have it this is exciting the projection the projection onto V of X is equal to this whole matrix times X so this thing right here this thing right here I could multiply the 1/3 into it but we don't have to do that that will just make it a little bit more messy this thing right here is the transformation matrix the transformation matrix and it's a as you can see since we're transforming remember this projection the projection onto V this is a linear transformation from r4 to r4 you give me some member of our 4 and I'll give you another member of our 4 that's in my subspace that is the projection so this is going to be a 4 by 4 matrix you can see it right there anyway hopefully you found that useful to actually see a tangible result our 4 is very abstract so this would even be beyond our three-dimensional programming example this would be we're dealing with a more abstract data set where we're interested in finding a projection