Transcript

okay this is the lecture on linear Transformations actually linear algebra courses used to begin with this lecture so so you could say I'm beginning this course Again by talking about linear Transformations those so so in in in a lot of courses those come first before matrices the idea of a linear transformation makes sense without a matrix and physicists and other some people like it better that way they don't like coordinates they don't want those numbers they want to see what's going on with the whole space but for most of us in the end if we're going to compute anything we introduce coordinates and then every linear transformation will lead us to a matrix so really that's and then to all the all the things that we've done about null space and row space and determinant and igen values all will come from The Matrix but behind it in other words behind this is the idea of a linear transformation let me give an example of a linear transformation so example example one a projection I want to I can describe a projection without telling you any Matrix anything about any Matrix I can describe a projection say this will be a linear trans information that takes say all of R2 every Vector in the plane into a vector in the plane and this is the way people describe uh a mapping it takes every vector and and so by what rule so what's the rule is uh I take a so here's the plane this is going to be my line my line through a my line and I'm going to project every Vector onto that line so if I take a vector like b or let me call the vector v for the moment the projection the the the linear transformation is going to produce this Vector as T of V so T it's like a function exactly like a function you give me an input the transformation produces the output so transformation sometimes the word map or mapping is used a map between inputs and outputs so this is one particular map this is one example a projection that takes every Vector here let me do another vector v or let me do this Vector W what is T of w you see there are no coordinates here I I've drawn those axes but I'm sorry I drew them I'm going to remove them that's the whole point is that we don't need axes we just need so let's get it out of there I'm I always I'm not a physicist so I draw those axes so the the input is W the output of the projection is project on that line T of w okay now I could think of a lot of transformation T but in this linear algebra course I want it to be a linear transformation so here are the rules for a linear transformation that if I you see exactly the two operations that we can do on vectors adding and multiplying by scalars the transformation does something special with respect to those operations so for example uh the projection is a linear transformation because if I for example if I wanted to check that one if I took V to be twice as long the projection would be twice as long if I took V to V minus if I change from V to minus V the projection would change to a minus So Cal to 2 Cal minus1 any c is okay so you see that actually those combin I can combine those in in one statement the T that the what the transformation does to any linear combination it must produce the same combination of T of v and T of w let's think about some I mean it's like not hard to decide is a transformation linear or is it not let me give you an example where so you can tell me the answer suppose I suppose my transformation is here's another example two example two uh shift the whole plane shift the whole plane so here are all my vectors my plane and every vector v in the plane I shift it over by let's say three by by some vector v KN shift whole plane by V KN so every Vector in the plane this was V T of V will be V plus v KN there's T of V here's V KN there's the typical V and there's T of V you see what the you see what this transformation does takes this vector and adds to it adds a fixed Vector to it well that seems like a pretty reasonable simple transformation but is it linear the answer is no it's not linear which which law does it is broken maybe both laws are broken let's see uh um if I double the length of V does the transformation produce something double do I double T of v no if I double the length of v in this transformation I'm just adding on the same one same V KN not two V kns but only one V KN for every Vector so I don't get two times the transfer do you see see what what I'm saying that if I if I double this then the transformation starts there and only goes one VN out and doesn't Double T of v in fact a linear transformation what what is T of zero that's just like special case but really worth noticing the zero Vector in a linear transformation must get transformed to zero it can't move because take any vector v here uh well so you you can see why T of0 is zero take take V to be the zero Vector take C to be three then we'd have t of zero Vector equaling 3 T of zero Vector the T of Z had has to be zero okay so this example is really a non example Shifting the whole plane is not a linear transformation or if I cooked up some formula that involved squaring or the transformation that also non-example um how about the transformation that uh takes any vector and produces its length so there's a transformation that takes any Vector say any Vector in R3 let me just I'll just get a chance to use this notation again suppose I think of the transformation that takes any Vector in R3 and produces this number so that I could say is a is a is a member of R1 for example if I want it or just real numbers that's certainly not linear it's true that the zero Vector goes to zero but if I double a vector it does double the length that's true but suppose I multiply a vector by minus to what happens to its length it just doubles it doesn't get multiplied by minus two so when C is minus two in my in my requirement I'm I'm uh not satisfying that requirement so T of minus V is not minus the minus the the length it's just the the length Okay so that's another non-example projection was an example let me give you another example I can stay here and have a this will be a an example that is a linear transformation a rotation Rotation by what shall we say by 45° okay so again let me choose this this will be a mapping from any from all from the whole plane of vectors into the whole plane of vectors and it just every here's the input vector v and the output Vector from this 45 Dee rotation is just rotate that thing by 45° T of V so every Vector got rotated you see that I don't need I can describe this without any coordinates and see that it's linear if I multiplied if I doubled V I would the rotation would just be be twice as far out if I had V plus W they would and and if I rotated each of them and added the the answer is the same as if I add and then rotate that's what the linear transformation is okay so those are two examples two examples projection and rotation and I could invent more uh that um our linear Transformations where I haven't told you a matrix yet actually uh the book has a picture of the action of linear Transformations um in this actually the cover of the book has it so and and in this section 7.1 we can think of a actually here let let's let's take this linear transformation rotation suppose I have as the cover of the book has uh a house in R2 so let me take instead of this let me take a a small house in R2 so that's a whole lot of points the idea is with this linear transformation that I can see what it does to everything at once I don't have to just take one vector at a time and see see what t is I can take all the vectors on the on the outline of the house and see where they all go in fact that'll that'll show me where the whole house goes so what will happen with this with this um particular linear transformation the whole house will rotate so the the result will be if I can draw it will be the house will be sitting there okay and uh but suppose I give some other examples oh let me give some examples that involve a matrix example three and this is important coming from a matrix that we always call a so the transformation will be multiply by a there is a linear transformation and a whole family of them because every Matrix produces a a transformation by this simple rule just multiply every vector by that Matrix and it's linear right linear I have to check that a of v a * V + W equal AV V + a w which is fine and I have to check that a * CV b equal c a check those are fine so there is a linear transformation and if I take my favorite Matrix a and I apply it to all vectors in the plane it'll produce a bunch of outputs see the the idea is now we're thinking of like the big picture the whole plane is transformed by matrix multiplication every Vector in the plane gets multiplied by a let's take an example uh and and see what happens to the vectors of the house so it's this is still a transformation from plane to plane and let me take a particular V Matrix a well if I cooked up a rotation Matrix this would be the right picture if I cooked up a projection Matrix the projection would be the picture let me just take some other Matrix let me take the Matrix 1 0 0us one what happens to the house to all vectors and in particular we can sort of visualize it if we look at the house so the house is not rotated anymore what do I get what happens to all the vectors if I do this transformation I multiply by this Matrix well of course it's an easy matrix it's diagonal the X component stays the same the Y component reverses sign so that any like the roof of that house the point of the tip of the roof is has an X component which stays the same but his y component reverses and it's down here and of course what we get is the house is like upside down now I have to put where does the door go I guess the door goes upside down there right so that's the the here's the input here's the input house and this is the output okay this idea of a linear transformation is like kind of the abstract description of matrix multiplication and what's our goal here our goal is to understand linear Transformations and the way to understand them is to find the Matrix that lies behind them that's really the idea find the Matrix that lies behind them um and to do that we have to bring in coordinates we have to choose a basis so let me point out what what's the story if we have a linear transformation so start with start take a l suppose we have a linear transformation let me from now on let t stand for linear Transformations I won't be interested in the nonlinear ones only linear Transformations I'm interested in okay I start with a linear transformation T let's suppose it it it uh its inputs are vectors in R3 okay and suppose its outputs are vectors in R2 for example okay what's an example of such a transformation just before I go any further any Matrix of the right size will do this so what would be the right shape of a matrix so for example so all in fact examples I I'm wanting to give you an example just because here I'm taking I'm thinking of Transformations that take three-dimensional space to two-dimensional space and I want them to be linear and those easy way to invent them is a matrix multiplication so example T of V should be any any AV that's that's those Transformations are linear that's what 1806 is about and a should be what size what shape of Matrix should that be I want V to be to have three components because this is what the inputs have so here's the input in R3 and here's the output in R2 so what shape of Matrix so this is a this should be I guess a 2 by 3 Matrix right a 2x3 Matrix a 2x3 Matrix well multiply a vector in R3 you see I'm I'm moving to coordinates so quickly I'm not a true physicist here it a 2x3 Matrix will multiply a vector in R3 and produce an output in R2 and it will be a linear transformation and okay so there's a there's a whole lot of examples every 2x3 Matrix gives me an example and basically I want to show you that there are no other examples every linear transformation is associated with a matrix now let me come back to the idea of linear transformation how many suppose I want to tell you you know I've I've got this linear transformation in my mind and I want to tell tell you what it is suppose I tell you what the transformation does to one vector okay you know one thing then all right so so this is like the what I'm what I'm speaking about now is how much information information needed to know the transformation by knowing t i to know to know T of V for all V all inputs how much information do I have to give you so that you know what the transformation does to every Vector okay I could tell you what the transformation so I could tell I could take a vector V1 one particular Vector tell you what the transformation does to it fine but now you only know what the transformation does to one vector so I say you say okay that's not enough tell me what it does to another Vector so I say okay give me a vector you give me a vector V2 and I we see what is the transformation due to V2 now you only know or do you only know what the transformation does to two vectors have I got to ask you answer you about every Vector in the whole input space or can you knowing what it does to V1 and V2 how much do you now know about the transformation you know what the transformation does to a larger bunch of vectors than just these two because you know what it does to every linear combination you know what it does now to the whole plane of vectors with bases V1 and V2 I'm assuming V1 and V2 were independent if they were if they were dependent if V2 was 6 * V1 then I didn't give you any new information in t of V2 you already knew it would be 6 * T of V1 but so you can see what I'm headed for if I know what the transformation does to every Vector in basis then I know everything so the information needed to know t ofv for all inputs is T of V1 T of V2 up to T of v m let's say or VN for a ba for a b any basis any a for for a basis V1 up to VN this is a base for any I can I call it an input basis it's a basis for the space of inputs the the things that t is acting on you you see this point that if I if I have a basis for the input space and I tell you what the transformation does to every one of those basis vectors that is all I'm allowed to tell you and it's enough to know T of V for all V's because why because every V is some combination of these basis vectors C1 V1 plus plus c n VN that's what a basis is right it spans the space and if I know what T does to this and what T does to V2 and what T does to VN then I know then I know what T of T does to V by this linearity it has to be C1 T of V1 plus so on plus CN T of VN that's uh there's no choice so um the that so the point of this comment is that if I know what T does to a basis to to each Vector in a basis then I know the linear transformation the property of linearity tells me all the other vectors all the other outputs okay so now we got so that like we now see what do we really need in a linear transformation and we ready to go to a matrix okay what's the step now that takes us from a linear trans from a linear transformation that's free of coordinates to a matrix that's been created with respect to coordinates The Matrix is going to come from the coordinate system these are the coordinates coordinates mean a basis is decided once you decide on a basis this is where coordinates come from you decide on a basis then every Vector these are the coordinates in that basis there is one and only one way to express v as a combination of the basis vectors and the numbers you need in that combination are the coordinates let me write that down so what are coordinates coordinates come from a basis coordinates come from a basis the coordinates of V the coordinates of V are in this are these numbers that that uh tell you how much of each basis Vector is in V if I change the basis I change the coordinates right now we have always been assuming that we were working with a standard basis right the basis we we hardly don't we we don't even think about this stuff because if I give you the vector v equals 3 2 4 you have been assuming completely and probably rightly that I had in mind the standard basis that this that this Vector was 3 * the first coordinate vector and 2 * the second and 4 * the 3 but you're not entitled I I might have had some other basis in mind this is like the a standard basis and then the the coordinates are sitting right there in the vector but I could have chosen a different basis like I might have had igen vectors of a matrix and I might have said okay that's a great basis yeah I'll use the igen vectors of this of this Matrix as my basis vectors not which not necessarily these three but some other bases so that every so this was that was an example this is the real thing the coordinates are these numbers I'll Circle them again the amounts of each basis okay so if I want to create a matrix that describes a linear transformation now I'm ready to do that okay okay so now now what I plan to do is construct The Matrix a that represents or tells me about a linear transformation linear transformation T okay so I I really start with the transformation whether it's a projection or a rotation or some strange movement of this house in the plane or some some transformation from n dimensional space to M or M dimensional space to n dimensional space n to M I guess usually we'll have t will somehow transform n dimensional space to M dimensional space and the whole point is that if I have a basis for n-dimensional space I guess I need two bases really I need an input basis to describe the inputs and I need an output basis to give me coordinates to give me some numbers for the output so I've got to choose two bases choose a basis V1 up to VN for the inputs the inputs in they came from RN so this is the transformation is taking every n dimensional Vector into some M dimensional vector and I have to choose a basis and I'll call them W1 up to WM for the outputs those are guys in RM once I've chosen the basis that settles The Matrix that's I now I'm working with coordinates every Vector in RN every input Vector has some coordinates so I here's what I do here's what I do can I say it in words I take a a vector v i express it in its basis in the in the basis so I get its coordinates then I'm going to multiply those coordinates by the right Matrix a and that will give me the coordinates of the output in the output basis I better write that down that was a a mouthful what I want I want I want a matrix a I want a matrix a that does what the linear transformation does and it does it with respect respecting the spes so I want the Matrix to be well let's suppose look let me take an example let me take the projection example the projection example suppose I take because we we we've got that we got that projection in mind I can fit it in here here's the projection example so the projection example I'm thinking of N and M as two the transformation takes the plane takes every Vector in the plane and let me draw the plane just so we remember it's a plane and there's the thing that I'm projecting onto that's the line I'm projecting onto so the transformation takes every Vector in the plane and projects it onto that line so this is projection so so I'm going to do projection okay but I'm going to choose a basis that I like better than the standard basis my basis in fact I'll choose the same basis for inputs and for outputs and the basis will be my first basis Vector will be right on the line there's my first basis Vector say a unit Vector on the line and my second basis Vector will be a unit Vector perpendicular to that line and I'm going to use that as the output basis also and I'm going to ask you what's the Matrix what's the Matrix what's the how do I describe this transformation of projection with respect to this basis okay so what's the rule I take any vector v it's some combination of the first base bis vector and the second basis Vector now what is T of V suppose the input is well suppose the input is V1 what's the output V1 right the projection leaves this one alone so we know what the projection does to this first basis Vector this guy it leaves it what does the projection do to the second basis Vector it kills it sends it to zero so what does the projection do do to a combination it kills this part and this part it leaves alone now all I want to do is find the Matrix I now want to find the Matrix that takes a I want to find the Matrix that takes an input C1 C2 the coordinates and gives me the output C10 you see that in this basis the coordinates of the input were C1 C2 and the coordinates of the output are C1 0 and of course not hard to find a matrix that'll do that the Matrix that will do that is the Matrix 1 0 0 0 because if I multiply input by that Matrix a this is a * input coordinates and I'm hoping to get the output coordinates and what do I get from that multiplication I get the right answer C1 and z so what's the point so the first point is there's a matrix that does the job if there's a linear transformation out there coordinate free no coordinates and then I choose a basis for the inputs and I choose a basis for the outputs then there's a matrix that does the job and what's the job it takes it multiplies the coord the input coordinates and produces the output coordinates now in this example let me repeat I chose the input basis was the same as the output basis the input bases and output bases were both along the line and perpendicular to the line they're actually the ion vectors of the projection and as a result The Matrix came out diagonal in fact it came out to be Lambda this is like the good basis so the the good B the igen vector basis is the good basis it leads to the Matrix the diagonal matrix of ion values Lambda and just as in this example the I vectors and IG values of this of this linear transformation were along the line and perpendicular the I values were one and zero and that's the Matrix that we got okay so that's like the great choice of Matrix that's the choice a physicist would do when he had to finally he or she had to finally bring coordinates in unwillingly the coordinates to be chosen the good coordinates are the igen vectors because if I did this projection in the the standard basis which I could do right I could do the whole thing in the standard basis let me let me I better try if I can do that what what are we calling the the that so I I have to tell you now which line we're projecting on say the 45 degree line so so say we're projecting onto 45 Dee line and we use not the igen vector basis but the standard basis the standard bases V1 is one Z and V2 is 01 and again I'll use the same basis for the outputs then I have to do this the M I can find a matrix it'll be the Matrix that we would always think of it'll be the projection Matrix it'll be actually it's the Matrix that we learned about in uh chapter 4 it's what I call the The Matrix The Matrix is do you remember P was a a transpose over a transpose a and I think in this example it'll come out 1/2 1/2 122 I believe that's the Matrix that comes from our formula and that's the Matrix that'll do the job if I give you the input if I give you this input one zero what's the output the output is 1/2 one2 and that should be the right projection and if I give you the input 01 the output is again 1/2 1/2 again the projection so that's the Matrix but not diagonal of course because we didn't choose a great bases we just chose the handiest basis well so the whole course has practically been about the handiest basis and just dealing with the Matrix that we got and we it's not that bad a matrix it has it's symmetric and it has this p^2 equal p property all those things are good but in the in the best basis it's easy to see that p^2 equals p and it's symmetric and it's diagonal so that's the the idea then is do you see now how I'm associating a matrix to the transformation I better write the rule down I better write the rule down the the rule to find to find the Matrix a all right First Column so rule to find a we're given the bases of course we don't there's no way we could construct The Matrix until we're told what the bases are so we're given the input bases and the output bases V1 to VN W1 to WM those are given now in the First Column of a how do I find that column the First Column of the Matrix so that should tell me what happens to the first basis Vector so the rule is apply the linear transformation to V one to the first basis vector and then I'll write it so that's the output right the input is V1 what's the output the output is in the output space it's some combination of these guys and it's that combination that goes into the First Column so let me I'll put this word right we so I'll say it in words again how to find this Matrix take the first basis Vector apply the transformation then it's in the output space t of V1 so it's some combination of these outputs this output basis so that combination the coefficients in that combination will be the first column so A1 a row two column 1 W2 a M1 WM there are the numbers in the First Column of the Matrix second let me make the point by doing the second column second column of a what's the idea now I take the second basis Vector I apply the transformation to it that's in now I got an output so it's some combination in the output basis and that combination is the bunch of numbers that should go in the second column of the Matrix okay and so forth so I get a matrix and the Matrix I get does the right job now the Matrix constructed that way and following the rules of matrix multiplication the result will be that if I give you the input coordinates and I multiply by The Matrix so the the the the outcome of all this is a times the input coordinates correctly reproduces the output coordinates why is this right let me just check the First Column suppose the input input coordinates are one and all zeros what does that mean what's the input if the input coordinates are one and other and the rest zeros then the input is V1 right that's the vector that has coordinates one and all zeros okay when I multiply a by the one and all zeros I'll get the First Column of a I'll get these numbers and sure enough those are the output coordinates for T of V1 so we made it right on the First Column we made it right on the second column we made it right on all the basis vectors and then it has to be right on every Vector okay so there there is a picture of the Matrix for a linear trans transformation finally let me give you uh another a different linear transformation the linear transformation that takes the derivative that's a linear transformation suppose the input space is all combinations C1 + C2 x + C3 x^2 so the basis is the these simple functions then what's the output is the derivative the output is the derivative so the output is C2 + 2 c3x and let's take as output basis the vectors 1 and X so we're going from a 3 dimensional space of inputs to a two-dimensional space of outputs by this by the derivative and I don't know if you ever thought that the derivative is linear but if it weren't linear taking derivatives would take forever right the the we are able to compute derivatives of functions exactly because we know it's a linear transformation so that if we if we learn the derivatives of a few functions like sinx and cos x and e to the X and another little short list then we can take all their combinations and we can do all the derivatives Okay now what's the Matrix what's the Matrix so I want the Matrix to multiply these input vectors input coordinates and give these output coordinates so I just think okay what's the Matrix that does it I can follow my rule of construction or I can see what the Matrix is it should be a 2x3 Matrix right and the Matrix if it if when it so I'm just figuring out what do I want let me write it here what do I want for my Matrix what should that Matrix do well I want to get C2 in the first output so 0 one Z will do it I want to get two C3 so 0 02 will do it that's the Matrix for the for this linear transformation with those bases and those coordinates you see it just clicks and the whole point is that the inverse Matrix gives the inverse of the linear transformation that the product of two matrices gives the the right Matrix for the product of two Transformations matrix multiplication really came from linear Transformations I better pick up on that theme uh Monday after Thanksgiving and I hope you have a great holiday hope Indian summer keeps going okay see you on Monday