1 00:00:01,000 --> 00:00:03,000 The following content is provided under a Creative 2 00:00:03,000 --> 00:00:05,000 Commons license. Your support will help MIT 3 00:00:05,000 --> 00:00:08,000 OpenCourseWare continue to offer high quality educational 4 00:00:08,000 --> 00:00:13,000 resources for free. To make a donation or to view 5 00:00:13,000 --> 00:00:18,000 additional materials from hundreds of MIT courses, 6 00:00:18,000 --> 00:00:23,000 visit MIT OpenCourseWare at ocw.mit.edu. 7 00:00:23,000 --> 00:00:34,000 Remember last time -- -- we learned about the cross product 8 00:00:34,000 --> 00:00:42,000 of vectors in space. Remember the definition of 9 00:00:42,000 --> 00:00:48,000 cross product is in terms of this determinant det| i hat, 10 00:00:48,000 --> 00:00:53,000 j hat, k hat, and then the components of A, 11 00:00:53,000 --> 00:00:57,000 a1, a2, a3, and then the components of B| 12 00:00:57,000 --> 00:01:02,000 This is not an actual determinant because these are 13 00:01:02,000 --> 00:01:05,000 not numbers. But it's a symbolic notation, 14 00:01:05,000 --> 00:01:08,000 to remember what the actual formula is. 15 00:01:08,000 --> 00:01:12,000 The actual formula is obtained by expanding the determinant. 16 00:01:12,000 --> 00:01:19,000 So, we actually get the determinant of a2, 17 00:01:19,000 --> 00:01:27,000 a3, b2, b3 times i hat, minus the determinant of a1, 18 00:01:27,000 --> 00:01:35,000 a3, b1, b3 times j hat plus the determinant of a1, 19 00:01:35,000 --> 00:01:42,000 a2, b1, b2, times k hat. And we also saw a more 20 00:01:42,000 --> 00:01:47,000 geometric definition of the cross product. 21 00:01:47,000 --> 00:01:56,000 We have learned that the length of the cross product is equal to 22 00:01:56,000 --> 00:02:04,000 the area of the parallelogram with sides A and B. 23 00:02:17,000 --> 00:02:26,000 We have also learned that the direction of the cross product 24 00:02:26,000 --> 00:02:37,000 is given by taking the direction that's perpendicular to A and B. 25 00:02:37,000 --> 00:02:42,000 If I draw A and B in a plane (they determine a plane), 26 00:02:42,000 --> 00:02:48,000 then the cross product should go in the direction that's 27 00:02:48,000 --> 00:02:53,000 perpendicular to that plane. Now, there's two different 28 00:02:53,000 --> 00:02:56,000 possible directions that are perpendicular to a plane. 29 00:02:56,000 --> 00:03:04,000 And, to decide which one it is, we use the right-hand rule, 30 00:03:04,000 --> 00:03:07,000 which says if you extend your right hand in the direction of 31 00:03:07,000 --> 00:03:10,000 the vector A, then curve your fingers in the 32 00:03:10,000 --> 00:03:14,000 direction of B, then your thumb will go in the 33 00:03:14,000 --> 00:03:20,000 direction of the cross product. One thing I didn't quite get to 34 00:03:20,000 --> 00:03:26,000 say last time is that there are some funny manipulation rules. 35 00:03:26,000 --> 00:03:29,000 What are we allowed to do or not do with cross products? 36 00:03:29,000 --> 00:03:35,000 So, let me tell you right away the most surprising one if 37 00:03:35,000 --> 00:03:41,000 you've never seen it before: A cross B and B cross A are not 38 00:03:41,000 --> 00:03:45,000 the same thing. Why are they not the same thing? 39 00:03:45,000 --> 00:03:49,000 Well, one way to see it is to think geometrically. 40 00:03:49,000 --> 00:03:52,000 The parallelogram still has the same area, and it's still in the 41 00:03:52,000 --> 00:03:54,000 same plane. So, the cross product is still 42 00:03:54,000 --> 00:03:58,000 perpendicular to the same plane. But, what happens is that, 43 00:03:58,000 --> 00:04:01,000 if you try to apply the right-hand rule but exchange the 44 00:04:01,000 --> 00:04:04,000 roles of A and B, then you will either injure 45 00:04:04,000 --> 00:04:06,000 yourself, or your thumb will end up 46 00:04:06,000 --> 00:04:08,000 pointing in the opposite direction. 47 00:04:08,000 --> 00:04:12,000 So, in fact, B cross A and A cross B are 48 00:04:12,000 --> 00:04:17,000 opposite of each other. And you can check that in the 49 00:04:17,000 --> 00:04:19,000 formula because, for example, 50 00:04:19,000 --> 00:04:22,000 the i component is a2 b3 minus a3 b2. 51 00:04:22,000 --> 00:04:27,000 If you swap the roles of A and B, you will also have to change 52 00:04:27,000 --> 00:04:30,000 the signs. That's a slightly surprising 53 00:04:30,000 --> 00:04:33,000 thing, but you will see one easily adjusts to it. 54 00:04:33,000 --> 00:04:36,000 It just means one must resist the temptation to write AxB 55 00:04:36,000 --> 00:04:40,000 equals BxA. Whenever you do that, 56 00:04:40,000 --> 00:04:45,000 put a minus sign. Now, in particular, 57 00:04:45,000 --> 00:04:53,000 what happens if I do A cross A? Well, I will get zero. 58 00:04:53,000 --> 00:04:54,000 And, there's many ways to see that. 59 00:04:54,000 --> 00:04:58,000 One is to use the formula. Also, you can see that the 60 00:04:58,000 --> 00:05:02,000 parallelogram formed by A and A is completely flat, 61 00:05:02,000 --> 00:05:06,000 and it has area zero. So, we get the zero vector. 62 00:05:17,000 --> 00:05:20,000 Hopefully you got practice with cross products, 63 00:05:20,000 --> 00:05:23,000 and computing them, in recitation yesterday. 64 00:05:23,000 --> 00:05:29,000 Let me just point out one important application of cross 65 00:05:29,000 --> 00:05:33,000 product that maybe you haven't seen yet. 66 00:05:33,000 --> 00:05:36,000 Let's say that I'm given three points in space, 67 00:05:36,000 --> 00:05:39,000 and I want to find the equation of the plane that contains them. 68 00:05:39,000 --> 00:05:45,000 So, say I have P1, P2, P3, three points in space. 69 00:05:45,000 --> 00:05:48,000 They determine a plane, at least if they are not 70 00:05:48,000 --> 00:05:51,000 aligned, and we would like to find the equation of the plane 71 00:05:51,000 --> 00:05:56,000 that they determine. That means, let's say that we 72 00:05:56,000 --> 00:06:01,000 have a point, P, in space with coordinates x, 73 00:06:01,000 --> 00:06:07,000 y, z. Well, to find the equation of 74 00:06:07,000 --> 00:06:14,000 the plane -- -- the plane containing P1, 75 00:06:14,000 --> 00:06:22,000 P2, and P3, we need to find a condition on 76 00:06:22,000 --> 00:06:26,000 the coordinates x, y, z, 77 00:06:26,000 --> 00:06:41,000 telling us whether P is in the plane or not. 78 00:06:41,000 --> 00:06:44,000 We have several ways of doing that. 79 00:06:44,000 --> 00:06:47,000 For example, one thing we could do. 80 00:06:47,000 --> 00:06:51,000 Let me just backtrack to determinants that we saw last 81 00:06:51,000 --> 00:06:56,000 time. One way to think about it is to 82 00:06:56,000 --> 00:07:03,000 consider these vectors, P1P2, P1P3, and P1P. 83 00:07:03,000 --> 00:07:07,000 The question of whether they are all in the same plane is the 84 00:07:07,000 --> 00:07:12,000 same as asking ourselves whether the parallelepiped that they 85 00:07:12,000 --> 00:07:15,000 form is actually completely flattened. 86 00:07:15,000 --> 00:07:18,000 So, if I try to form a parallelepiped with these three 87 00:07:18,000 --> 00:07:21,000 sides, and P is not in the plane, then it will have some 88 00:07:21,000 --> 00:07:24,000 volume. But, if P is in the plane, 89 00:07:24,000 --> 00:07:26,000 then it's actually completely squished. 90 00:07:26,000 --> 00:07:31,000 So,one possible answer, one possible way to think of 91 00:07:31,000 --> 00:07:37,000 the equation of a plane is that the determinant of these vectors 92 00:07:37,000 --> 00:07:42,000 should be zero. Take the determinant of (vector 93 00:07:42,000 --> 00:07:48,000 P1P,vector P1P2,vector P1P3) equals 0 (if you do it in a 94 00:07:48,000 --> 00:07:53,000 different order it doesn't really matter). 95 00:07:53,000 --> 00:07:58,000 One possible way to express the condition that P is in the plane 96 00:07:58,000 --> 00:08:02,000 is to say that the determinant of these three vectors has to be 97 00:08:02,000 --> 00:08:05,000 zero. And, if I am given coordinates 98 00:08:05,000 --> 00:08:07,000 for these points -- I'm not giving you numbers, 99 00:08:07,000 --> 00:08:10,000 but if I gave you numbers, then you would be able to plug 100 00:08:10,000 --> 00:08:14,000 those numbers in. So, you could compute these two 101 00:08:14,000 --> 00:08:16,000 vectors P1P2 and P1P3 explicitly. 102 00:08:16,000 --> 00:08:19,000 But, of course, P1P would depend on x, 103 00:08:19,000 --> 00:08:21,000 y, and z. So, when you compute the 104 00:08:21,000 --> 00:08:24,000 determinant, you get a formula that involves x, 105 00:08:24,000 --> 00:08:26,000 y, and z. And you'll find that this 106 00:08:26,000 --> 00:08:29,000 condition on x, y, z is the equation of a 107 00:08:29,000 --> 00:08:32,000 plane. We're going to see more about 108 00:08:32,000 --> 00:08:36,000 that pretty soon. Now, let me tell you a slightly 109 00:08:36,000 --> 00:08:40,000 faster way of doing it. Actually, it's not much faster, 110 00:08:40,000 --> 00:08:44,000 It's pretty much the same calculation, but it's maybe more 111 00:08:44,000 --> 00:08:50,000 enlightening. Let me actually show you a nice 112 00:08:50,000 --> 00:08:56,000 color picture that I prepared for this. 113 00:08:56,000 --> 00:09:00,000 One thing that's on this picture that I haven't drawn 114 00:09:00,000 --> 00:09:02,000 before is the normal vector to the plane. 115 00:09:02,000 --> 00:09:06,000 Why is that? Well, let's say that we know 116 00:09:06,000 --> 00:09:09,000 how to find a vector that's perpendicular to our plane. 117 00:09:09,000 --> 00:09:13,000 Then, what does it mean for the point, P, to be in the plane? 118 00:09:13,000 --> 00:09:19,000 It means that the direction from P1 to P has to be 119 00:09:19,000 --> 00:09:29,000 perpendicular to this vector N. So here's another solution: 120 00:09:29,000 --> 00:09:43,000 P is in the plane exactly when the vector P1P is perpendicular 121 00:09:43,000 --> 00:09:48,000 to N, where N is some vector that's 122 00:09:48,000 --> 00:10:05,000 perpendicular to the plane. N is called a normal vector. 123 00:10:05,000 --> 00:10:08,000 How do we rephrase this condition? 124 00:10:08,000 --> 00:10:13,000 Well, we've learned how to detect whether two vectors are 125 00:10:13,000 --> 00:10:18,000 perpendicular to each other using dot product (that was the 126 00:10:18,000 --> 00:10:21,000 first lecture). These two vectors are 127 00:10:21,000 --> 00:10:25,000 perpendicular exactly when their dot product is zero. 128 00:10:25,000 --> 00:10:32,000 So, concretely, if we have a point P1 given to 129 00:10:32,000 --> 00:10:34,000 us, and say we have been able to 130 00:10:34,000 --> 00:10:37,000 compute the vector N, then when we actually compute 131 00:10:37,000 --> 00:10:40,000 what happens, here we will have the 132 00:10:40,000 --> 00:10:41,000 coordinates x, y, z, of a point P, 133 00:10:41,000 --> 00:10:44,000 and we will get some condition on x, y, z. 134 00:10:44,000 --> 00:10:47,000 That will be the equation of a plane. 135 00:10:47,000 --> 00:10:50,000 Now, why are these things the same? 136 00:10:50,000 --> 00:10:54,000 Well, before I can tell you that, I should tell you how to 137 00:10:54,000 --> 00:10:57,000 find a normal vector. Maybe you are already starting 138 00:10:57,000 --> 00:11:01,000 to see what the method should be, because we know how to find 139 00:11:01,000 --> 00:11:04,000 a vector perpendicular to two given vectors. 140 00:11:04,000 --> 00:11:08,000 We know two vectors in that plane, for example, 141 00:11:08,000 --> 00:11:11,000 P1P2, and P1P3. Actually, I could have used 142 00:11:11,000 --> 00:11:14,000 another permutation of these points, but, let's use this. 143 00:11:14,000 --> 00:11:18,000 So, if I want to find a vector that's perpendicular to both 144 00:11:18,000 --> 00:11:22,000 P1P2 and P1P3 at the same time, all I have to do is take their 145 00:11:22,000 --> 00:11:27,000 cross product. So, how do we find a vector 146 00:11:27,000 --> 00:11:32,000 that's perpendicular to the plane? 147 00:11:32,000 --> 00:11:46,000 The answer is just the cross product P1P2 cross P1P3. 148 00:11:46,000 --> 00:11:49,000 Say you actually took the points in a different order, 149 00:11:49,000 --> 00:11:52,000 and you took P1P3 x P1P2. You would get, 150 00:11:52,000 --> 00:11:55,000 of course, the opposite vector. That is fine. 151 00:11:55,000 --> 00:11:58,000 Any plane actually has infinitely many normal vectors. 152 00:11:58,000 --> 00:12:03,000 You can just multiply a normal vector by any constant, 153 00:12:03,000 --> 00:12:07,000 you will still get a normal vector. 154 00:12:07,000 --> 00:12:12,000 So, that's going to be one of the main uses of dot product. 155 00:12:12,000 --> 00:12:16,000 When we know two vectors in a plane, it lets us find the 156 00:12:16,000 --> 00:12:21,000 normal vector to the plane, and that is what we need to 157 00:12:21,000 --> 00:12:26,000 find the equation. Now, why is that the same as 158 00:12:26,000 --> 00:12:33,000 our first answer over there? Well, the condition that we 159 00:12:33,000 --> 00:12:39,000 have is that P1P dot N should be 0. 160 00:12:39,000 --> 00:12:48,000 And we said N is actually P1P2 cross P1P3. 161 00:12:48,000 --> 00:12:51,000 So, this is what we want to be zero. 162 00:12:51,000 --> 00:12:56,000 Now, if you remember, a long time ago (that was 163 00:12:56,000 --> 00:13:04,000 Friday) we've introduced this thing and called it the triple 164 00:13:04,000 --> 00:13:07,000 product. And what we've seen is that the 165 00:13:07,000 --> 00:13:10,000 triple product is the same thing as the determinant. 166 00:13:10,000 --> 00:13:13,000 So, in fact, these two ways of thinking, 167 00:13:13,000 --> 00:13:17,000 one saying that the box formed by these three vectors should be 168 00:13:17,000 --> 00:13:21,000 flat and have volume zero, and the other one saying that 169 00:13:21,000 --> 00:13:25,000 we can find a normal vector and then express the condition that 170 00:13:25,000 --> 00:13:29,000 a vector is in the plane if it's perpendicular to the normal 171 00:13:29,000 --> 00:13:31,000 vector, are actually giving us the same 172 00:13:31,000 --> 00:13:32,000 formula in the end. 173 00:13:41,000 --> 00:13:46,000 OK, any quick questions before we move on? 174 00:13:46,000 --> 00:13:50,000 STUDENT QUESTION: are those two equal only when P 175 00:13:50,000 --> 00:13:53,000 is in the plane, or no matter where it is? 176 00:13:53,000 --> 00:13:57,000 So, these two quantities, P1P dot the cross product, 177 00:13:57,000 --> 00:14:02,000 or the determinant of the three vectors, are always equal to 178 00:14:02,000 --> 00:14:04,000 each other. They are always the same. 179 00:14:04,000 --> 00:14:08,000 And now, if a point is not in the plane, then their numerical 180 00:14:08,000 --> 00:14:13,000 value will be nonzero. If P is in the plane, 181 00:14:13,000 --> 00:14:26,000 it will be zero. OK, let's move on and talk a 182 00:14:26,000 --> 00:14:35,000 bit about matrices. Probably some of you have 183 00:14:35,000 --> 00:14:38,000 learnt about matrices a little bit in high school, 184 00:14:38,000 --> 00:14:42,000 but certainly not all of you. So let me just introduce you to 185 00:14:42,000 --> 00:14:46,000 a little bit about matrices -- just enough for what we will 186 00:14:46,000 --> 00:14:51,000 need later on in this class. If you want to know everything 187 00:14:51,000 --> 00:14:56,000 about the secret life of matrices, then you should take 188 00:14:56,000 --> 00:14:59,000 18.06 someday. OK, what's going to be our 189 00:14:59,000 --> 00:15:02,000 motivation for matrices? Well, in life, 190 00:15:02,000 --> 00:15:07,000 a lot of things are related by linear formulas. 191 00:15:07,000 --> 00:15:10,000 And, even if they are not, maybe sometimes you can 192 00:15:10,000 --> 00:15:12,000 approximate them by linear formulas. 193 00:15:12,000 --> 00:15:30,000 So, often, we have linear relations between variables -- 194 00:15:30,000 --> 00:15:47,000 for example, if we do a change of coordinate systems. 195 00:15:47,000 --> 00:15:52,000 For example, say that we are in space, 196 00:15:52,000 --> 00:15:58,000 and we have a point. Its coordinates might be, 197 00:15:58,000 --> 00:16:02,000 let me call them x1, x2, x3 in my initial coordinate 198 00:16:02,000 --> 00:16:04,000 system. But then, maybe I need to 199 00:16:04,000 --> 00:16:07,000 actually switch to different coordinates to better solve the 200 00:16:07,000 --> 00:16:09,000 problem because they're more adapted to other things that 201 00:16:09,000 --> 00:16:13,000 we'll do in the problem. And so I have other coordinates 202 00:16:13,000 --> 00:16:18,000 axes, and in these new coordinates, P will have 203 00:16:18,000 --> 00:16:22,000 different coordinates -- let me call them, say, 204 00:16:22,000 --> 00:16:25,000 u1, u2, u3. And then, the relation between 205 00:16:25,000 --> 00:16:29,000 the old and the new coordinates is going to be given by linear 206 00:16:29,000 --> 00:16:33,000 formulas -- at least if I choose the same origin. 207 00:16:33,000 --> 00:16:38,000 Otherwise, there might be constant terms, 208 00:16:38,000 --> 00:16:50,000 which I will not insist on. Let me just give an example. 209 00:16:50,000 --> 00:16:58,000 For example, maybe, let's say u1 could be 2 210 00:16:58,000 --> 00:17:08,000 x1 3 x2 3 x3. u2 might be 2 x1 4 x2 5 x3. 211 00:17:08,000 --> 00:17:16,000 u3 might be x1 x2 2 x3. Do not ask me where these 212 00:17:16,000 --> 00:17:18,000 numbers come from. I just made them up, 213 00:17:18,000 --> 00:17:23,000 that's just an example of what might happen. 214 00:17:23,000 --> 00:17:30,000 You can put here your favorite numbers if you want. 215 00:17:30,000 --> 00:17:35,000 Now, in order to express this kind of linear relation, 216 00:17:35,000 --> 00:17:39,000 we can use matrices. A matrix is just a table with 217 00:17:39,000 --> 00:17:45,000 numbers in it. And we can reformulate this in 218 00:17:45,000 --> 00:17:54,000 terms of matrix multiplication or matrix product. 219 00:17:54,000 --> 00:18:04,000 So, instead of writing this, I will write that the matrix 220 00:18:04,000 --> 00:18:11,000 |2,3, 3; 2,4, 5; 1,1, 2| times the vector 221 00:18:11,000 --> 00:18:16,000 ***amp***lt;x1, x2, x3> is equal to 222 00:18:16,000 --> 00:18:22,000 ***amp***lt;u1, u2, u3>. 223 00:18:22,000 --> 00:18:26,000 Hopefully you see that there is the same information content on 224 00:18:26,000 --> 00:18:29,000 both sides. I just need to explain to you 225 00:18:29,000 --> 00:18:35,000 what this way of multiplying tables of numbers means. 226 00:18:35,000 --> 00:18:40,000 Well, what it means is really that we'll have exactly these 227 00:18:40,000 --> 00:18:45,000 same quantities. Let me just say that more 228 00:18:45,000 --> 00:18:49,000 symbolically: so maybe this matrix could be 229 00:18:49,000 --> 00:18:56,000 called A, and this we could call X, and this one we could call U. 230 00:18:56,000 --> 00:19:00,000 Then we'll say A times X equals U, which is a lot shorter than 231 00:19:00,000 --> 00:19:03,000 that. Of course, I need to tell you 232 00:19:03,000 --> 00:19:07,000 what A, X, and U are in terms of their entries for you to get the 233 00:19:07,000 --> 00:19:11,000 formula. But it's a convenient notation. 234 00:19:11,000 --> 00:19:17,000 So, what does it mean to do a matrix product? 235 00:19:17,000 --> 00:19:30,000 The entries in the matrix product are obtained by taking 236 00:19:30,000 --> 00:19:37,000 dot products. Let's say we are doing the 237 00:19:37,000 --> 00:19:48,000 product AX. We do a dot products between 238 00:19:48,000 --> 00:20:00,000 the rows of A and the columns of X. 239 00:20:00,000 --> 00:20:07,000 Here, A is a 3x3 matrix -- that just means there's three rows 240 00:20:07,000 --> 00:20:14,000 and three columns. And X is a column vector, 241 00:20:14,000 --> 00:20:20,000 which we can think of as a 3x1 matrix. 242 00:20:20,000 --> 00:20:27,000 It has three rows and only one column. 243 00:20:27,000 --> 00:20:31,000 Now, what can we do? Well, I said we are going to do 244 00:20:31,000 --> 00:20:35,000 a dot product between a row of A: 2,3, 3, and a column of X: 245 00:20:35,000 --> 00:20:38,000 x1, x2, x3. That dot product will be two 246 00:20:38,000 --> 00:20:43,000 times x1 plus three times x2 plus three times x3. 247 00:20:43,000 --> 00:20:47,000 OK, it's exactly what we want to set u1 equal to. 248 00:20:47,000 --> 00:20:51,000 Let's do the second one. I take the second row of A: 249 00:20:51,000 --> 00:20:55,000 2,4, 5, and I do the dot product with x1, 250 00:20:55,000 --> 00:20:59,000 x2, x3. I will get two times x1 plus 251 00:20:59,000 --> 00:21:04,000 four times x2 plus five times x3, which is u2. 252 00:21:04,000 --> 00:21:10,000 And, same thing with the third one: one times x1 plus one times 253 00:21:10,000 --> 00:21:18,000 x2 plus two times x3. So that's matrix multiplication. 254 00:21:18,000 --> 00:21:27,000 Let me restate things more generally. 255 00:21:27,000 --> 00:21:33,000 If I want to find the entries of a product of two matrices, 256 00:21:33,000 --> 00:21:38,000 A and B -- I'm saying matrices, but of course they could be 257 00:21:38,000 --> 00:21:41,000 vectors. Vectors are now a special case 258 00:21:41,000 --> 00:21:44,000 of matrices, just by taking a matrix of width one. 259 00:21:44,000 --> 00:21:54,000 So, if I have my matrix A, and I have my matrix B, 260 00:21:54,000 --> 00:22:01,000 then I will get the product, AB. 261 00:22:01,000 --> 00:22:08,000 Let's say for example -- this works in any size -- let's say 262 00:22:08,000 --> 00:22:13,000 that A is a 3x4 matrix. So, it has three rows, 263 00:22:13,000 --> 00:22:15,000 four columns. And, here, I'm not going to 264 00:22:15,000 --> 00:22:17,000 give you all the values because I'm not going to compute 265 00:22:17,000 --> 00:22:19,000 everything. It would take the rest of the 266 00:22:19,000 --> 00:22:23,000 lecture. And let's say that B is maybe 267 00:22:23,000 --> 00:22:28,000 size 4x2. So, it has two columns and four 268 00:22:28,000 --> 00:22:30,000 rows. And, let's say, 269 00:22:30,000 --> 00:22:33,000 for example, that we have the second column: 270 00:22:33,000 --> 00:22:36,000 0,3, 0,2. So, in A times B, 271 00:22:36,000 --> 00:22:43,000 the entries should be the dot products between these rows and 272 00:22:43,000 --> 00:22:46,000 these columns. Here, we have two columns. 273 00:22:46,000 --> 00:22:49,000 Here, we have three rows. So, we should get three times 274 00:22:49,000 --> 00:22:55,000 two different possibilities. And so the answer will have 275 00:22:55,000 --> 00:22:59,000 size 3x2. We cannot compute most of them, 276 00:22:59,000 --> 00:23:02,000 because I did not give you numbers, but one of them we can 277 00:23:02,000 --> 00:23:04,000 compute. We can compute the value that 278 00:23:04,000 --> 00:23:07,000 goes here, namely, this one in the second column. 279 00:23:07,000 --> 00:23:13,000 So, I select the second column of B, and I take the first row 280 00:23:13,000 --> 00:23:16,000 of A, and I find: 1 times 0: 0. 281 00:23:16,000 --> 00:23:20,000 2 times 3: 6, plus 0, plus 8, 282 00:23:20,000 --> 00:23:28,000 should make 14. So, this entry right here is 14. 283 00:23:28,000 --> 00:23:34,000 In fact, let me tell you about another way to set it up so that 284 00:23:34,000 --> 00:23:38,000 you can remember more easily what goes where. 285 00:23:38,000 --> 00:23:43,000 One way that you can set it up is you can put A here. 286 00:23:43,000 --> 00:23:49,000 You can put B up here, and then you will get the 287 00:23:49,000 --> 00:23:53,000 answer here. And, if you want to find what 288 00:23:53,000 --> 00:23:57,000 goes in a given slot here, then you just look to its left 289 00:23:57,000 --> 00:24:01,000 and you look above it, and you do the dot product 290 00:24:01,000 --> 00:24:07,000 between these guys. That's an easy way to remember. 291 00:24:07,000 --> 00:24:09,000 First of all, it tells you what the size of 292 00:24:09,000 --> 00:24:11,000 the answer will be. The size will be what fits 293 00:24:11,000 --> 00:24:14,000 nicely in this box: it should have the same width 294 00:24:14,000 --> 00:24:18,000 as B and the same height as A. And second, it tells you which 295 00:24:18,000 --> 00:24:22,000 dot product to compute for each position. 296 00:24:22,000 --> 00:24:27,000 You just look at what's to the left, and what's above the given 297 00:24:27,000 --> 00:24:29,000 position. Now, there's a catch. 298 00:24:29,000 --> 00:24:32,000 Can we multiply anything by anything? 299 00:24:32,000 --> 00:24:35,000 Well, no. I wouldn't ask the question 300 00:24:35,000 --> 00:24:38,000 otherwise. But anyway, to be able to do 301 00:24:38,000 --> 00:24:41,000 this dot product, we need to have the same number 302 00:24:41,000 --> 00:24:45,000 of entries here and here. Otherwise, we can't say "take 303 00:24:45,000 --> 00:24:46,000 this times that, plus this times that, 304 00:24:46,000 --> 00:24:50,000 and so on" if we run out of space on one of them before the 305 00:24:50,000 --> 00:24:57,000 other. So, the condition -- and it's 306 00:24:57,000 --> 00:25:12,000 important, so let me write it in red -- is that the width of A 307 00:25:12,000 --> 00:25:22,000 must equal the height of B. (OK, it's a bit cluttered, 308 00:25:22,000 --> 00:25:28,000 but hopefully you can still see what I'm writing.) 309 00:25:28,000 --> 00:25:31,000 OK, now we know how to multiply matrices. 310 00:25:38,000 --> 00:25:41,000 So, what does it mean to multiply matrices? 311 00:25:41,000 --> 00:25:47,000 Of course, we've seen in this example that we can use a matrix 312 00:25:47,000 --> 00:25:52,000 to tell us how to transform from x's to u's. 313 00:25:52,000 --> 00:25:54,000 And, that's an example of multiplication. 314 00:25:54,000 --> 00:25:58,000 But now, let's see that we have two matrices like that telling 315 00:25:58,000 --> 00:26:01,000 us how to transform from something to something else. 316 00:26:01,000 --> 00:26:02,000 What does it mean to multiply them? 317 00:26:11,000 --> 00:26:25,000 I claim that the product AB represents doing first the 318 00:26:25,000 --> 00:26:36,000 transformation B, then transformation A. 319 00:26:36,000 --> 00:26:37,000 That's a slightly counterintuitive thing, 320 00:26:37,000 --> 00:26:40,000 because we are used to writing things from left to right. 321 00:26:40,000 --> 00:26:43,000 Unfortunately, with matrices, 322 00:26:43,000 --> 00:26:48,000 you multiply things from right to left. 323 00:26:48,000 --> 00:26:51,000 If you think about it, say you have two functions, 324 00:26:51,000 --> 00:26:55,000 f and g, and you write f(g(x)), it really means you apply first 325 00:26:55,000 --> 00:26:59,000 g then f. It works the same way as that. 326 00:26:59,000 --> 00:27:06,000 OK, so why is this? Well, if I write AB times X 327 00:27:06,000 --> 00:27:12,000 where X is some vector that I want to transform, 328 00:27:12,000 --> 00:27:16,000 it's the same as A times BX. This property is called 329 00:27:16,000 --> 00:27:19,000 associativity. And, it's a good property of 330 00:27:19,000 --> 00:27:23,000 well-behaved products -- not of cross product, 331 00:27:23,000 --> 00:27:27,000 by the way. Matrix product is associative. 332 00:27:27,000 --> 00:27:30,000 That means we can actually think of a product ABX and 333 00:27:30,000 --> 00:27:32,000 multiply them in whichever order we want. 334 00:27:32,000 --> 00:27:37,000 We can start with BX or we can start with AB. 335 00:27:37,000 --> 00:27:43,000 So, now, BX means we apply the transformation B to X. 336 00:27:43,000 --> 00:27:46,000 And then, multiplying by A means we apply the 337 00:27:46,000 --> 00:27:49,000 transformation A. So, we first apply B, 338 00:27:49,000 --> 00:27:58,000 then we apply A. That's the same as applying AB 339 00:27:58,000 --> 00:28:05,000 all at once. Another thing -- a warning: 340 00:28:05,000 --> 00:28:10,000 AB and BA are not the same thing at all. 341 00:28:10,000 --> 00:28:13,000 You can probably see that already from this 342 00:28:13,000 --> 00:28:18,000 interpretation. It's not the same thing to 343 00:28:18,000 --> 00:28:24,000 convert oranges to bananas and then to carrots, 344 00:28:24,000 --> 00:28:28,000 or vice versa. Actually, even worse: 345 00:28:28,000 --> 00:28:31,000 this thing might not even be well defined. 346 00:28:31,000 --> 00:28:38,000 If the width of A equals the height of B, we can do this 347 00:28:38,000 --> 00:28:42,000 product. But it's not clear that the 348 00:28:42,000 --> 00:28:47,000 width of B will equal the height of A, which is what we would 349 00:28:47,000 --> 00:28:50,000 need for that one. So, the size condition, 350 00:28:50,000 --> 00:28:53,000 to be able to do the product, might not make sense -- maybe 351 00:28:53,000 --> 00:28:56,000 one of the products doesn't make sense. 352 00:28:56,000 --> 00:29:01,000 Even if they both make sense, they are usually completely 353 00:29:01,000 --> 00:29:07,000 different things. The next thing I need to tell 354 00:29:07,000 --> 00:29:13,000 you about is something called the identity matrix. 355 00:29:13,000 --> 00:29:17,000 The identity matrix is the matrix that does nothing. 356 00:29:17,000 --> 00:29:19,000 What does it mean to do nothing? I don't mean the matrix is zero. 357 00:29:19,000 --> 00:29:23,000 The matrix zero would take X and would always give you back 358 00:29:23,000 --> 00:29:26,000 zero. That's not a very interesting 359 00:29:26,000 --> 00:29:29,000 transformation. What I mean is the guy that 360 00:29:29,000 --> 00:29:33,000 takes X and gives you X again. It's called I, 361 00:29:33,000 --> 00:29:38,000 and it has the property that IX equals X for all X. 362 00:29:38,000 --> 00:29:41,000 So, it's the transformation from something to itself. 363 00:29:41,000 --> 00:29:44,000 It's the obvious transformation -- called the identity 364 00:29:44,000 --> 00:29:48,000 transformation. So, how do we write that as a 365 00:29:48,000 --> 00:29:51,000 matrix? Well, actually there's an 366 00:29:51,000 --> 00:29:56,000 identity for each size because, depending on whether X has two 367 00:29:56,000 --> 00:30:01,000 entries or ten entries, the matrix I needs to have a 368 00:30:01,000 --> 00:30:05,000 different size. For example, 369 00:30:05,000 --> 00:30:10,000 the identity matrix of size 3x3 has entries one, 370 00:30:10,000 --> 00:30:15,000 one, one on the diagonal, and zero everywhere else. 371 00:30:15,000 --> 00:30:22,000 OK, let's check. If we multiply this with a 372 00:30:22,000 --> 00:30:28,000 vector -- start thinking about it. 373 00:30:28,000 --> 00:30:31,000 What happens when multiply this with the vector X? 374 00:31:00,000 --> 00:31:11,000 OK, so let's say I multiply the matrix I with a vector x1, 375 00:31:11,000 --> 00:31:15,000 x2, x3. What will the first entry be? 376 00:31:15,000 --> 00:31:19,000 It will be the dot product between ***amp***lt;1,0,0> and 377 00:31:19,000 --> 00:31:23,000 ***amp***lt;x1 x2 x3>. This vector is i hat. 378 00:31:23,000 --> 00:31:27,000 If you do the dot product with i hat, you will get the first 379 00:31:27,000 --> 00:31:32,000 component -- that will be x1. One times x1 plus zero, zero. 380 00:31:32,000 --> 00:31:35,000 Similarly here, if I do the dot product, 381 00:31:35,000 --> 00:31:40,000 I get zero plus x2 plus zero. I get x2, and here I get x3. 382 00:31:40,000 --> 00:31:44,000 OK, it works. Same thing if I put here a 383 00:31:44,000 --> 00:31:48,000 matrix: I will get back the same matrix. 384 00:31:48,000 --> 00:31:58,000 In general, the identity matrix in size n x n is an n x n matrix 385 00:31:58,000 --> 00:32:07,000 with ones on the diagonal, and zeroes everywhere else. 386 00:32:07,000 --> 00:32:11,000 You just put 1 at every diagonal position and 0 387 00:32:11,000 --> 00:32:13,000 elsewhere. And then, you can see that if 388 00:32:13,000 --> 00:32:15,000 you multiply that by a vector, you'll get the same vector 389 00:32:15,000 --> 00:32:15,000 back. 390 00:32:29,000 --> 00:32:39,000 OK, let me give you another example of a matrix. 391 00:32:39,000 --> 00:32:53,000 Let's say that in the plane we look at the transformation that 392 00:32:53,000 --> 00:33:05,000 does rotation by 90°, let's say, counterclockwise. 393 00:33:05,000 --> 00:33:11,000 I claim that this is given by the matrix: |0,1; 394 00:33:11,000 --> 00:33:19,000 - 1,0|. Let's try to see why that is 395 00:33:19,000 --> 00:33:25,000 the case. Well, if I do R times i hat -- 396 00:33:25,000 --> 00:33:29,000 if I apply that to the first vector, 397 00:33:29,000 --> 00:33:35,000 i hat: i hat will be ***amp***lt;1,0> so in this 398 00:33:35,000 --> 00:33:39,000 product, first you will get 0, 399 00:33:39,000 --> 00:33:46,000 and then you will get 1. You get j hat. 400 00:33:46,000 --> 00:33:53,000 OK, so this thing sends i hat to j hat. 401 00:33:53,000 --> 00:34:06,000 What about j hat? Well, you get negative one. 402 00:34:06,000 --> 00:34:10,000 And then you get 0. So, that's minus i hat. 403 00:34:10,000 --> 00:34:15,000 So, j is sent towards here. And, in general, 404 00:34:15,000 --> 00:34:19,000 if you apply it to a vector with components x,y, 405 00:34:19,000 --> 00:34:29,000 then you will get back -y,x, which is the formula we've seen 406 00:34:29,000 --> 00:34:39,000 for rotating a vector by 90°. So, it seems to do what we want. 407 00:34:39,000 --> 00:34:47,000 By the way, the columns in this matrix represent what happens to 408 00:34:47,000 --> 00:34:53,000 each basis vector, to the vectors i and j. 409 00:34:53,000 --> 00:34:57,000 This guy here is exactly what we get when we multiply R by i. 410 00:34:57,000 --> 00:35:05,000 And, when we multiply R by j, we get this guy here. 411 00:35:05,000 --> 00:35:08,000 So, what's interesting about this matrix? 412 00:35:08,000 --> 00:35:12,000 Well, we can do computations with matrices in ways that are 413 00:35:12,000 --> 00:35:15,000 easier than writing coordinate change formulas. 414 00:35:15,000 --> 00:35:19,000 For example, if you compute R squared, 415 00:35:19,000 --> 00:35:23,000 so if you multiply R with itself: I'll let you do it as an 416 00:35:23,000 --> 00:35:28,000 exercise, but you will find that you get 417 00:35:28,000 --> 00:35:33,000 |-1,0;0,-1|. So, that's minus the identity 418 00:35:33,000 --> 00:35:35,000 matrix. Why is that? 419 00:35:35,000 --> 00:35:39,000 Well, if I rotate something by 90° and then I rotate by 90° 420 00:35:39,000 --> 00:35:42,000 again, then I will rotate by 180�. 421 00:35:42,000 --> 00:35:46,000 That means I will actually just go to the opposite point around 422 00:35:46,000 --> 00:35:51,000 the origin. So, I will take (x,y) to 423 00:35:51,000 --> 00:35:58,000 (-x,-y). And if I applied R four times, 424 00:35:58,000 --> 00:36:06,000 R^4 would be identity. OK, questions? 425 00:36:06,000 --> 00:36:11,000 STUDENT QUESTION: when you said R equals that 426 00:36:11,000 --> 00:36:14,000 matrix, is that the definition of R? 427 00:36:14,000 --> 00:36:17,000 How did I come up with this R? Well, secretly, 428 00:36:17,000 --> 00:36:21,000 I worked pretty hard to find the entries that would tell me 429 00:36:21,000 --> 00:36:25,000 how to rotate something by 90° counterclockwise. 430 00:36:25,000 --> 00:36:32,000 So, remember: what we saw last time or in the 431 00:36:32,000 --> 00:36:39,000 first lecture is that, to rotate a vector by 90°, 432 00:36:39,000 --> 00:36:46,000 we should change (x, y) to (-y, x). 433 00:36:46,000 --> 00:36:52,000 And now I'm trying to express this transformation as a matrix. 434 00:36:52,000 --> 00:36:57,000 So, maybe you can call these guys u and v, 435 00:36:57,000 --> 00:37:02,000 and then you write that u equals 0x-1y, 436 00:37:02,000 --> 00:37:08,000 and that v equals 1x 0y. So that's how I would find it. 437 00:37:08,000 --> 00:37:13,000 Here, I just gave it to you already made, 438 00:37:13,000 --> 00:37:19,000 so you didn't really see how I found it. 439 00:37:19,000 --> 00:37:30,000 You will see more about rotations on the problem set. 440 00:37:30,000 --> 00:37:35,000 OK, next I need to tell you how to invert matrices. 441 00:37:35,000 --> 00:37:39,000 So, what's the point of matrices? 442 00:37:39,000 --> 00:37:41,000 It's that it gives us a nice way to think about changes of 443 00:37:41,000 --> 00:37:43,000 variables. And, in particular, 444 00:37:43,000 --> 00:37:48,000 if we know how to express U in terms of X, maybe we'd like to 445 00:37:48,000 --> 00:37:51,000 know how to express X in terms of U. 446 00:37:51,000 --> 00:37:54,000 Well, we can do that, because we've learned how to 447 00:37:54,000 --> 00:37:58,000 solve linear systems like this. So in principle, 448 00:37:58,000 --> 00:38:01,000 we could start working, substituting and so on, 449 00:38:01,000 --> 00:38:06,000 to find formulas for x1, x2, x3 as functions of u1, 450 00:38:06,000 --> 00:38:09,000 u2, u3. And the relation will be, 451 00:38:09,000 --> 00:38:11,000 again, a linear relation. It will, again, 452 00:38:11,000 --> 00:38:14,000 be given by a matrix. Well, what's that matrix? 453 00:38:14,000 --> 00:38:17,000 It's the inverse transformation. 454 00:38:17,000 --> 00:38:21,000 It's the inverse of the matrix A. 455 00:38:21,000 --> 00:38:24,000 So, we need to learn how to find the inverse of a matrix 456 00:38:24,000 --> 00:38:25,000 directly. 457 00:38:43,000 --> 00:38:48,000 The inverse of A, by definition, 458 00:38:48,000 --> 00:38:56,000 is a matrix M, with the property that if I 459 00:38:56,000 --> 00:39:03,000 multiply A by M, then I get identity. 460 00:39:03,000 --> 00:39:07,000 And, if I multiply M by A, I also get identity. 461 00:39:07,000 --> 00:39:10,000 The two properties are equivalent. 462 00:39:10,000 --> 00:39:13,000 That means, if I apply first the transformation A, 463 00:39:13,000 --> 00:39:16,000 then the transformation M, actually I undo the 464 00:39:16,000 --> 00:39:18,000 transformation A, and vice versa. 465 00:39:18,000 --> 00:39:24,000 These two transformations are the opposite of each other, 466 00:39:24,000 --> 00:39:28,000 or I should say the inverse of each other. 467 00:39:28,000 --> 00:39:37,000 For this to make sense, we need A to be a square 468 00:39:37,000 --> 00:39:41,000 matrix. It must have size n by n. 469 00:39:41,000 --> 00:39:45,000 It can be any size, but it must have the same 470 00:39:45,000 --> 00:39:50,000 number of rows as columns. It's a general fact that you 471 00:39:50,000 --> 00:39:55,000 will see more in detail in linear algebra if you take it. 472 00:39:55,000 --> 00:40:09,000 Let's just admit it. The matrix M will be denoted by 473 00:40:09,000 --> 00:40:13,000 A inverse. Then, what is it good for? 474 00:40:13,000 --> 00:40:18,000 Well, for example, finding the solution to a 475 00:40:18,000 --> 00:40:21,000 linear system. What's a linear system in our 476 00:40:21,000 --> 00:40:24,000 new language? It's: a matrix times some 477 00:40:24,000 --> 00:40:28,000 unknown vector, X, equals some known vector, 478 00:40:28,000 --> 00:40:32,000 B. How do we solve that? 479 00:40:32,000 --> 00:40:37,000 We just compute: X equals A inverse B. 480 00:40:37,000 --> 00:40:42,000 Why does that work? How do I get from here to here? 481 00:40:42,000 --> 00:40:43,000 Let's be careful. 482 00:40:51,000 --> 00:40:54,000 (I'm going to reuse this matrix, but I'm going to erase 483 00:40:54,000 --> 00:40:57,000 it nonetheless and I'll just rewrite it). 484 00:41:21,000 --> 00:41:30,000 If AX=B, then let's multiply both sides by A inverse. 485 00:41:30,000 --> 00:41:35,000 A inverse times AX is A inverse B. 486 00:41:35,000 --> 00:41:41,000 And then, A inverse times A is identity, so I get: 487 00:41:41,000 --> 00:41:46,000 X equals A inverse B. That's how I solved my system 488 00:41:46,000 --> 00:41:48,000 of equations. So, if you have a calculator 489 00:41:48,000 --> 00:41:51,000 that can invert matrices, then you can solve linear 490 00:41:51,000 --> 00:41:55,000 systems very quickly. Now, we should still learn how 491 00:41:55,000 --> 00:41:58,000 to compute these things. Yes? 492 00:41:58,000 --> 00:42:03,000 [Student Questions:]"How do you know that A inverse will be on 493 00:42:03,000 --> 00:42:07,000 the left of B and not after it " Well, 494 00:42:07,000 --> 00:42:10,000 it's exactly this derivation. So, if you are not sure, 495 00:42:10,000 --> 00:42:13,000 then just reproduce this calculation. 496 00:42:13,000 --> 00:42:16,000 To get from here to here, what I did is I multiplied 497 00:42:16,000 --> 00:42:20,000 things on the left by A inverse, and then this guy simplify. 498 00:42:20,000 --> 00:42:23,000 If I had put A inverse on the right, I would have AX A 499 00:42:23,000 --> 00:42:27,000 inverse, which might not make sense, and even if it makes 500 00:42:27,000 --> 00:42:31,000 sense, it doesn't simplify. So, the basic rule is that you 501 00:42:31,000 --> 00:42:35,000 have to multiply by A inverse on the left so that it cancels with 502 00:42:35,000 --> 00:42:38,000 this A that's on the left. STUDENT QUESTION: 503 00:42:38,000 --> 00:42:41,000 "And if you put it on the left on this side then it will be on 504 00:42:41,000 --> 00:42:43,000 the left with B as well?" That's correct, 505 00:42:43,000 --> 00:42:46,000 in our usual way of dealing with matrices, 506 00:42:46,000 --> 00:42:49,000 where the vectors are column vectors. 507 00:42:49,000 --> 00:42:52,000 It's just something to remember: if you have a square 508 00:42:52,000 --> 00:42:56,000 matrix times a column vector, the product that makes sense is 509 00:42:56,000 --> 00:42:58,000 with the matrix on the left, and the vector on the right. 510 00:42:58,000 --> 00:43:04,000 The other one just doesn't work. You cannot take X times A if A 511 00:43:04,000 --> 00:43:11,000 is a square matrix and X is a column vector. 512 00:43:11,000 --> 00:43:16,000 This product AX makes sense. The other one XA doesn't make 513 00:43:16,000 --> 00:43:19,000 sense. It's not the right size. 514 00:43:19,000 --> 00:43:23,000 OK. What we need to do is to learn 515 00:43:23,000 --> 00:43:29,000 how to invert a matrix. It's a useful thing to know, 516 00:43:29,000 --> 00:43:32,000 first for your general knowledge, and second because 517 00:43:32,000 --> 00:43:38,000 it's actually useful for things we'll see later in this class. 518 00:43:38,000 --> 00:43:40,000 In particular, on the exam, 519 00:43:40,000 --> 00:43:45,000 you will need to know how to invert a matrix by hand. 520 00:43:45,000 --> 00:43:50,000 This formula is actually good for small matrices, 521 00:43:50,000 --> 00:43:52,000 3x3,4x4. It's not good at all if you 522 00:43:52,000 --> 00:43:54,000 have a matrix of size 1,000x1,000. 523 00:43:54,000 --> 00:43:59,000 So, in computer software, actually for small matrices 524 00:43:59,000 --> 00:44:02,000 they do this, but for larger matrices, 525 00:44:02,000 --> 00:44:09,000 they use other algorithms. Let's just see how we do it. 526 00:44:09,000 --> 00:44:13,000 First of all I will give you the final answer. 527 00:44:13,000 --> 00:44:19,000 And of course I will need to explain what the answer means. 528 00:44:19,000 --> 00:44:22,000 We will have to compute something called the adjoint 529 00:44:22,000 --> 00:44:24,000 matrix. I will tell you how to do that. 530 00:44:24,000 --> 00:44:35,000 And then, we will divide by the determinant of A. 531 00:44:35,000 --> 00:44:38,000 How do we get to the adjoint matrix? 532 00:44:38,000 --> 00:44:46,000 Let's go through the steps on a 3x3 example -- the steps are the 533 00:44:46,000 --> 00:44:52,000 same no matter what the size is, but let's do 3x3. 534 00:44:52,000 --> 00:44:56,000 So, let's say that I'm giving you the matrix A -- let's say 535 00:44:56,000 --> 00:44:59,000 it's the same as the one that I erased earlier. 536 00:44:59,000 --> 00:45:08,000 That was the one relating our X's and our U's. 537 00:45:08,000 --> 00:45:18,000 The first thing I want to do is find something called the 538 00:45:18,000 --> 00:45:22,000 minors. What's a minor? 539 00:45:22,000 --> 00:45:24,000 It's a slightly smaller determinant. 540 00:45:24,000 --> 00:45:28,000 We've already seen them without calling them that way. 541 00:45:28,000 --> 00:45:32,000 The matrix of minors will have again the same size. 542 00:45:32,000 --> 00:45:37,000 Let's say we want this entry. Then, we just delete this row 543 00:45:37,000 --> 00:45:40,000 and this column, and we are left with a 2x2 544 00:45:40,000 --> 00:45:44,000 determinant. So, here, we'll put the 545 00:45:44,000 --> 00:45:49,000 determinant 4,5, 1,2, which is 4 times 2: 546 00:45:49,000 --> 00:45:51,000 8 -- minus 5: 3. 547 00:45:51,000 --> 00:45:53,000 Let's do the next one. So, for this entry, 548 00:45:53,000 --> 00:45:55,000 I'll delete this row and this column. 549 00:45:55,000 --> 00:46:00,000 I'm left with 2,5, 1,2. The determinant will be 2 times 550 00:46:00,000 --> 00:46:04,000 2 minus 5, which is negative 1. Then minus 2, 551 00:46:04,000 --> 00:46:09,000 then I get to the second row, so I get to this entry. 552 00:46:09,000 --> 00:46:12,000 To find the minor here, I will delete this row and this 553 00:46:12,000 --> 00:46:15,000 column. And I'm left with 3,3, 1,2. 554 00:46:15,000 --> 00:46:24,000 3 times 2 minus 3 is 3. Let me just cheat and give you 555 00:46:24,000 --> 00:46:31,000 the others -- I think I've shown you that I can do them. 556 00:46:31,000 --> 00:46:34,000 Let's just explain the last one again. 557 00:46:34,000 --> 00:46:37,000 The last one is 2. To find the minor here, 558 00:46:37,000 --> 00:46:41,000 I delete this column and this row, and I take this 559 00:46:41,000 --> 00:46:44,000 determinant: 2 times 4 minus 2 times 3. 560 00:46:44,000 --> 00:46:49,000 So it's the same kind of manipulation that we've seen 561 00:46:49,000 --> 00:46:53,000 when we've taken determinants and cross products. 562 00:46:53,000 --> 00:46:59,000 Step two: we go to another matrix that's called cofactors. 563 00:46:59,000 --> 00:47:03,000 So, the cofactors are pretty much the same thing as the 564 00:47:03,000 --> 00:47:07,000 minors except the signs are slightly different. 565 00:47:07,000 --> 00:47:16,000 What we do is that we flip signs according to a 566 00:47:16,000 --> 00:47:22,000 checkerboard diagram. You start with a plus in the 567 00:47:22,000 --> 00:47:26,000 upper left corner, and you alternate pluses and 568 00:47:26,000 --> 00:47:28,000 minuses. The rule is: 569 00:47:28,000 --> 00:47:33,000 if there is a plus somewhere, then there's a minus next to it 570 00:47:33,000 --> 00:47:36,000 and below it. And then, below a minus or to 571 00:47:36,000 --> 00:47:38,000 the right of a minus, there's a plus. 572 00:47:38,000 --> 00:47:43,000 So that's how it looks in size 3x3. 573 00:47:43,000 --> 00:47:46,000 What do I mean by that? I don't mean, 574 00:47:46,000 --> 00:47:48,000 make this positive, make this negative, 575 00:47:48,000 --> 00:47:50,000 and so on. That's not what I mean. 576 00:47:50,000 --> 00:47:53,000 What I mean is: if there's a plus, 577 00:47:53,000 --> 00:47:59,000 that means leave it alone -- we don't do anything to it. 578 00:47:59,000 --> 00:48:05,000 If there's a minus, that means we flip the sign. 579 00:48:05,000 --> 00:48:17,000 So, here, we'd get: 3, then 1, -2, 580 00:48:17,000 --> 00:48:25,000 -3,1, 1... 3,-4, and 2. 581 00:48:25,000 --> 00:48:29,000 OK, that step is pretty easy. The only hard step in terms of 582 00:48:29,000 --> 00:48:32,000 calculations is the first one because you have to compute all 583 00:48:32,000 --> 00:48:33,000 of these 2x2 determinants. 584 00:48:40,000 --> 00:48:44,000 By the way, this minus sign here is actually related to the 585 00:48:44,000 --> 00:48:47,000 way in which, when we do a cross product, 586 00:48:47,000 --> 00:48:51,000 we have a minus sign for the second entry. 587 00:48:51,000 --> 00:49:00,000 OK, we're almost done. The third step is to transpose. 588 00:49:00,000 --> 00:49:03,000 What does it mean to transpose? It means: you read the rows of 589 00:49:03,000 --> 00:49:07,000 your matrix and write them as columns, or vice versa. 590 00:49:07,000 --> 00:49:16,000 So we switch rows and columns. What do we get? 591 00:49:16,000 --> 00:49:19,000 Well, let's just read the matrix horizontally and write it 592 00:49:19,000 --> 00:49:24,000 vertically. We read 3,1, - 2: 3,1, - 2. 593 00:49:24,000 --> 00:49:29,000 Then we read -3 3,1, 1: - 3,1, 1. 594 00:49:29,000 --> 00:49:39,000 Then, 3, - 4,2: 3, - 4,2. That's pretty easy. 595 00:49:39,000 --> 00:49:44,000 We're almost done. What we get here is this is the 596 00:49:44,000 --> 00:49:52,000 adjoint matrix. So, the fourth and last step is 597 00:49:52,000 --> 00:49:58,000 to divide by the determinant of A. 598 00:49:58,000 --> 00:50:04,000 We have to compute the determinant -- the determinant 599 00:50:04,000 --> 00:50:08,000 of A, not the determinant of this guy. 600 00:50:08,000 --> 00:50:16,000 So: 2,3, 3,2, 4,5, 1,1, 2. I'll let you check my 601 00:50:16,000 --> 00:50:21,000 computation. I found that it's equal to 3. 602 00:50:21,000 --> 00:50:30,000 So the final answer is that A inverse is one third of the 603 00:50:30,000 --> 00:50:35,000 matrix we got there: |3, - 3,3, 1,1, 604 00:50:35,000 --> 00:50:39,000 - 4, - 2,1, 2|. Now, remember, 605 00:50:39,000 --> 00:50:43,000 A told us how to find the u's in terms of the x's. 606 00:50:43,000 --> 00:50:47,000 This tells us how to find x-s in terms of u-s: 607 00:50:47,000 --> 00:50:52,000 if you multiply x1,x2,x3 by this you get u1,u2,u3. 608 00:50:52,000 --> 00:50:56,000 It also tells you how to solve a linear system: 609 00:50:56,000 --> 00:51:03,000 A times X equals something.