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

# Alternate basis transformation matrix example part 2

## Video transcript

we've seen now that we can apply linear transformations in different coordinate systems the transformations that we've been performing before have all been with respect to the standard basis so in the last video I said look in standard coordinates if you have some vector X in your domain and you apply some transformation then let's say that a is the transformation matrix with respect to the standard domain or with respect to the standard basis then you're just going to have this mapping you take X you multiply it by a you're going to get the transformation of X now in the last video and a couple of videos before that or actually the one right before that we said well look you can do the same mapping but just in an alternate coordinate system you could do it with respect to some coordinate system or in in some coordinate system with respect to some basis B and that should be the same thing it should just be a different transformation matrix and in the last video we actually figured out what that different transformation matrix is we had a change of basis so let's say we had this basis right here let me actually copy and paste everything so that we understand what we did so this was the example let me copy it paste it up here put all of our takeaways from the last video up here let me paste it right here so in the last video we said okay this is my basis right there and then we said let me copy and paste let me copy and paste that was my alternate basis and then I have my change of basis matrix and it's inverse those will be useful to deal with so let me copy and paste that okay copy and then I'm going to paste it edit paste maybe it'll maybe I'll just write it over there not maybe the best order maybe I should have written that first but I think we get the idea and then we want to figure out we want to write what our transformation matrix is with respect to the standard basis and I wrote that I wrote that right over here this was all from the last problem if you're wondering where I got all this stuff let me copy and then paste that and it paste so I'll paste that and then invoke the whole point of the last video is we figured out what the transformation matrix is with respect to this basis with respect to this basis right here so D which was the big takeaway from the last video was equal to this right here let me copy and paste that copy and paste and though now we have all of our takeaways in one place edit paste and what I want to do in this video is verify is to verify that D actually works that D actually works that I could start with some vector X that I can let me write it up here let's say we let's take some example vector so we can this transformation its entire domain is r2 so let's start with some vector X let's say that X is equal to I don't know let's say it's equal to 1 minus 1 now we could just apply the transformation in the traditional way and get the transformation of X so let's just do that the transformation of X is just this matrix times X and so what is that going to equal let me see maybe I can just do it right here in this corner to save space so it's going to be this matrix times X so this first term right here is going to be 3 times 1 plus minus 2 times minus 1 or plus 2 right minus 2 times minus 1 is just 2 so it's going to be 3 plus 2 so it's going to be equal to 5 and then the second term right here is going to be 2 times 1 plus minus 2 times minus 1 well that's just positive 2 so it's going to be 2 plus 2 so that is 4 so that's just the transformation of X now what is what is this vector X what is this vector X represented represented in coordinates or I guess you could say to this alternate basis coordinates so what is that vector X represented in coordinates with respect to this basis right here well you saw before I wrote them out here maybe it'll be useful to do it right here the cord and I'll copy this let me copy both of these these will both be useful edit copy as you can see if you want to go from X to the to the X in an alternate basis or the alternate coordinate representations of X you essentially multiply X times C inverse but that's that's why I'm copying and pasting it let me copy and then let me put it up here so that we can apply these so then paste it right there so if we want to go if we want to go from if we want to go from X to the B coordinates of X I take my X and I multiply it times C inverse C inverse is this thing right here so if I take X and I multiply it times C inverse and I multiply it times T inverse I'll get this version of X so let's do that let me be I could it so this times that let me just put the minus 1/3 out front it's going to be equal to minus 1/3 times let's see if we can do this one in our head as well so it's going to be 1 times 1 plus minus 2 times minus 1 which is just positive 2 so it's going to be 1 plus 2 so it's going to be equal to 3 and then it's minus 2 times 1 which is minus 2 plus 1 times minus 1 which is just minus 1 so it's minus 2 minus 1 it's minus 3 so if we have minus 1/3 times this the B coordinate representation of our vector X is going to be is going to be equal to it's going to be equal to minus 1 and then 1 just like that which is actually interesting for this example it just kind of swapped the the first entry in the second entry now let's see what happens when we apply D to X so if we apply D to X right D should be our transformation matrix if we're dealing in the B coordinates so let's see what happens so if we apply D to X let me scroll over a little bit let me scroll over a little bit just so that we get a little bit more real estate so if we apply D to X what do we get and so this what this is going to be this is going to be the transformation or this should be the transformation of X in B coordinates so what is this going to be equal to what is this going to be equal to we have to multiply this times D so it's going to be minus 1 times minus 1 which is 1 plus 0 times 1 so it's just minus 1 times minus 1 which is 1 and then we're going to get 0 times minus 1 plus 2 times 1 so 2 times 1 is just 2 2 times 1 is just 2 now if for everything to work together and assuming I haven't made any careless mistakes this thing this vector right here should be the same as this vector if I change my basis so if I go from the standard basis to the basis B and when you go in that direction you just multiply this guy times C inverse so you I'm just using this formula right here if I'm in the standard basis I multiply by C inverse I'm going to get the B basis so let's see what I get so this guy I'm going to multiply him times C inverse let me do it up here just to get some extra space do it right here so I'm going to multiply the vector 5 4 I'm going to multiply that by C inverse so we're going to have minus 1/3 times 1 minus 2 minus 2 1 just like that so this is going to be equal to L 2 5 the minus 1/3 out front and we have 1 times 5 which is 5 let me just write this right 5 plus minus 2 times 4 so 5 minus 8 5 minus 8 and then we have minus 2 times 5 which is minus 10 - 10 and then we have 1 plus 1 times 4 minus 2 times 5 which is minus 10 plus 1 times 4 plus 4 so this is equal to minus 1 3 times minus 3 and this is what this is minus 6 if you multiply the minus 1/3 times at all the negatives cancel out and you get 1 + 2 which is exactly what we needed to get when you will take this guy and you change its basis to basis B or you change its coordinate system to the coordinate system with respect to B you multiply it by C inverse you get that right there so this is this literally is the B coordinate representation of the transformation of X we just did it by multiplying it by C inverse which is exactly what we got when we took the B coordinate version of X the B coordinate version of X and we applied that matrix that we found that the the transformation matrix with respect to the B coordinates when you multiply it times this guy right here we got the same answer so didn't matter whether we went this way around this little cycle or we went this way we got the same answer this isn't the proof but it shows us that what we did in the last video at least works for this case and I literally did pick a random X here and you can verify it if you like for other things now you should hopefully be reasonably convinced that we can do this that you know you can change your basis and find a transformation matrix we've shown how to do it but the obvious question is why do you do it why why do you do it and someone actually wrote a comment on the last video which i think is actually it kind of captures the art of why you do it someone if I I'm not looking at the comment right now but if I remember correctly it said some they said their linear algebra teacher said that linear algebra is the art of choosing the right basis let me write that down the art of choosing choosing the right basis or you could imagine the right coordinate system and why is there a right coordinate system maybe up to little quotes inside the quotation what what does it mean to have the right coordinate system well if you look at the original transformation matrix with respect to the standard basis it's fine it's got this two by two but if you performed matrix operations with this it's you know you got to do some you got to do some math and if you had to perform it over and over if you have to perform it on a bunch of vectors it might get a little bit you know it is what it is but when you transfer your bases when you go into a new basis when you went to this basis right here all of a sudden you find that the transformation matrix is much simpler it's a diagonal matrix when you multiply a diagonal matrix times something you're literally just taking a scaling factors of the first and second terms when you multiply this guy times some vector we did it here when you multiplied this time this guy when you multiply this guy times this vector you literally just scaled the first term times minus one and you scaled the second term by two so it's a much simpler operation and you might say hey but we have to do all of that work of multiplying by C inverse to get there and then once you get this answer you have to multiply by C to go back into standard coordinates you know that's a lot more work than just what you save here but imagine if you had to apply D multiple times imagine v to apply D times D times D times D to XOR and or you know let me say it this way imagine if you apply a times a times a look you have to apply a a hundred times to sum to some vector up here then applying a 100 times to some vector it would be much more computationally intensive than applying D a hundred times to this vector even though you had a little bit of overhead from converting in this direction and then converting back so in a lot of problems especially in computer science frankly or you know some other applications you might be doing you want to pick the right basis that problems or at least the computation for many problems get a lot simpler if you pick the right of the right the right coordinate system