Main content

### Course: Linear algebra > Unit 3

Lesson 3: Change of basis- Coordinates with respect to a basis
- Change of basis matrix
- Invertible change of basis matrix
- Transformation matrix with respect to a basis
- Alternate basis transformation matrix example
- Alternate basis transformation matrix example part 2
- Changing coordinate systems to help find a transformation matrix

© 2024 Khan AcademyTerms of usePrivacy PolicyCookie Notice

# Alternate basis transformation matrix example part 2

Showing that the transformation matrix with respect to basis B actually works. Brief point on why someone would want to operate in a different basis to begin with. Created by Sal Khan.

## Want to join the conversation?

- I am new to linear algebra. Sal says several times that it is useful in computer science especially in handling graphics representing 3 dimensions on a 2 dimension screen. But isn't this what Renaissance painters did when they used perspective . linear algebra was developed in the 19th Century. My question is were Renaissance painters using a primitive or proto form of linear algebra which is simpler that full blown LA?(12 votes)
- Renaissance painters learned about and portrayed perspective by carefully observing the world around them and replication what they saw when they stood in rooms or looked at buildings. Computers don't have this observational power, nor do they have senses with which to process the world, so they need mathematical algorithms to function. Linear algebra lends numerical rigor to principles that Renaissance painters first began to understand. The concepts are very similar, it's just that painters speak in the language of shading and color whereas computers speak in the language of numbers and matrices. So while the concept of representing 3 dimensions on a 2 dimensional screen is hundreds of years old, the method of doing it using matrices is fairly young.(16 votes)

- At12:25Sal says "you want to pick the right basis". I wonder how to identify the right basis in order to get the optimization he refers to with computational processing. Can you provide some examples, please?(3 votes)
- As Sal says, "Linear Algebra is the art of choosing the right basis"; as with any form of art, the only way to become proficient is with practice.

Having said that, usually a good basis to work with a transformation is one where you can represent the transformation as a diagonal matrix. In the videos about eigenvalues and eigenvectors you will see some methods to achieve this: https://www.khanacademy.org/math/linear-algebra/alternate_bases/eigen_everything/v/linear-algebra-introduction-to-eigenvalues-and-eigenvectors(9 votes)

- I am not sure if this was asked before or if it is executed in another video but how does this logic apply to when you are dealing with two non standard bases?(5 votes)
- The logic is exactly the same, but you must be very careful to identify on which basis you are working on. For example, let's suppose you have two non standard basis:
`𝗮 = { a⃗₁ , a⃗₂ , ⋯ , a⃗ᵤ }`

𝗲 = { e⃗₁ , e⃗₂ , ⋯ , e⃗ᵤ }

If you want to create the change of basis matrix that goes from basis`𝗮`

into basis`𝗲`

, you would need to construct a matrix whose columns are the vectors of the basis`𝗮`

, expressed in the basis`𝗲`

:`𝗗ₐ₋ₑ = [ [a⃗₁]ₑ [a⃗₂]ₑ ⋯ [a⃗ᵤ]ₑ ]`

(Of course, in order to get to this, you would first need to create the change of base matrices between the standard basis and each of your basis, in order to be able to express the vectors in each of them).(4 votes)

- Thank Sal for a very clear tutorial. I have one question here. What is the difference between transformation matrix and change of basis matrix? To me they look similar.(3 votes)
- the change of basis matrix is a kind of transformation matrix. Specifically it transforms the vector into an orthonormal basis. Does that make sense?(2 votes)

- If D maps vector x (which is wrt some basis) on to a co-domain and with an image which is also wrt some basis. Can some transformation matrix map directly from x (standard basis) to x in co-domain ( with respect to B)?(2 votes)
- Yes. You can map directly from x to T([x]b) using the matrix given by multiplying C^(-1)D or AC^(-1). You can also map directly from [x]b to T(x) with the matrix given by DC or the matrix given by CA. This also means that DC = CA and C^(-1)D = AC^(-1).(2 votes)

- Does any of this relate to Tensors?(2 votes)
- Loosely. Tensors are a more general mathematical object than vectors. Vectors are the simplest kind of tensor.(2 votes)

- An extra note: it may seem that we can even use a shortcut to go from x in standard form straight to [T(x)]B, by multiplying x first with the inverse of C, then with D. So [T(x)]B = DC^-1 x (of course, provided that we know D, too).(2 votes)
- what if instead of vector it's given a line and we are ask to find the standard matrix?(2 votes)
- So D is the transform matrix with respect to B?

D = [A]_B?(2 votes) - why A is equal to C^(traspose)*D*C ?(0 votes)
- Just follow the box flowchart Sal drew and the formula writes itself, though it would've made more sense if he did the last step by multiplying the altered basis coords by C to basically create a closed loop rather than the other way around.(3 votes)

## Video transcript

We've see 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 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 in
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 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. Let me paste it up here, put all
of our takeaways from the last video up here and
paste it right here. For the last video we
said, OK, this is my basis right there. And then we said-- 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. OK, copy, And then I'm
going to paste it. Edit, paste. 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. Then we want to write what our
transformation matrix is with respect to the standard basis. And I wrote that write
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. Edit, paste. So I'll paste that. And then the whole point of the
last video is we figured out what the transformation
matrix is 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 so now we have all of our
takeaways in one place. Edit, paste. What I want to do in this
video is verify that D actually works, that I could
start with some vector x-- let me write it up here. Let's take some example
vector. So this transformation, it's
entire domain is R2, so let's start with some vector x. Let's say that x is equal
to 1 minus 1. Now, we could just apply the
transformation in the traditional way and get the
transformation of x. 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 this vector x
represented in coordinates, or I guess you could say, this
alternate basis coordinates? So what is that vector x
represented in coordinates with respect to this
basis right here? Well, you saw it before. I wrote them out here. Maybe it'll be useful
to do it right here. I'll copy this. Actually, 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 x in an alternate basis or the
alternate coordinate representations of x, you
essentially multiply x times C inverse, so 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, then paste
it right there. So 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 I'l get this version of x. So let's do that. 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, so 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 equal to minus 1 and then 1, just like that,
which is actually interesting for this example. It just kind of swapped
the first entry and the second entry. Now, let's see what happens
when we apply D to x. So if we apply D to x, D should
be our transformation matrix if we're dealing
in the B coordinates. So let's see what happens. If we apply D to x-- let me
scroll over a little bit, just so we get a little bit
more real estate. So if we apply D to
x, what do we get? And so 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? You 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. Now, for everything to work
together and assuming I haven't made any careless
mistakes, this thing, this is 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. When you go in that direction,
you just multiply this guy times C inverse. And I'm just using this
formula right here. If I'm in the standard basis and
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. So I'm going to multiply
the vector 5, 4. I'm going to multiply
that by C inverse. 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-- Ill just write the minus 1/3 out front. We have 1 times 5, which is
5, plus minus 2 times 4, so 5 minus 8. And then we have minus 2 times
5, which is minus 10. And then we have
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 it, all the negatives cancel out, and you get 1 and
2, which is exactly what we needed to get. When you take this guy and you
change it's 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 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 and we applied that matrix
that we found, the transformation matrix with
respect to the B coordinates, and you multiply it times
this guy right here. We got the same answer. So it didn't matter whether we
went this way around the little cycle or we
went this way. We got the same answer. This isn't a 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 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? And someone actually wrote a
comment on the last video, which I think kind of captures
the art of why you do it. I'm not looking at the comment
right now, but if I remember correctly, they said their
linear algebra teacher said that linear algebra is the art
of choosing the right basis. Let me write that down. Or you could imagine, the
right coordinate system. And why is there a right
coordinate system? Maybe I'll put little quotes
inside the quotation. What does it mean to have the
right coordinate system? Well, if you look at your
original transformation matrix with respect to the standard
basis, it's fine. It's got this 2 by 2. But if you performed matrix
operations with this, you've go 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 is what it is. But when you transfer your
bases, when you go to 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 its
scaling factors of the first and second terms. When you
multiply this guy times some vector-- we did it here. When you multiplied this guy
times this vector, you literally just scaled the first
term times minus 1 and you scaled the second
term by 2. So it's a much simpler
operation. And you might say, hey, but we
had to do all of that work of multiplying by C inverse to get
there, and then once you get this answer, you're going
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 if you had to apply D
times D times D times D to x. Let me say it this way. Imagine if you had to apply A
times A times A or you have to apply A 100 times to some vector
up here, then applying A 100 times to some vector
would be much more computationally intensive than
applying D 100 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 some other
applications you might be doing, you want to pick
the right basis. The computations for many
problems get a lot simpler if you pick the right coordinate
system.