WEBVTT 00:00:00.735 --> 00:00:01.806 Voiceover:In the last video we saw 00:00:01.806 --> 00:00:03.561 that we could take a system of two equations 00:00:03.561 --> 00:00:05.786 with two unknowns and represent it 00:00:05.786 --> 00:00:09.119 as a matrix equation where the matrix A's 00:00:09.119 --> 00:00:11.792 are the coefficients here on the left-hand side. 00:00:11.792 --> 00:00:13.669 The column vector X has our two 00:00:13.669 --> 00:00:16.610 unknown variables, S and T. 00:00:16.610 --> 00:00:17.845 Then the column vector B is essentially 00:00:17.845 --> 00:00:20.529 representing the right-hand side over here. 00:00:20.529 --> 00:00:21.646 What was interesting about it, 00:00:21.646 --> 00:00:23.386 then that would be the equation A, 00:00:23.386 --> 00:00:25.230 the matrix A times the column vector X 00:00:25.230 --> 00:00:27.605 being equal to the column vector B. 00:00:27.605 --> 00:00:29.900 What was interesting about that is we saw 00:00:29.900 --> 00:00:30.640 well, look, if A is invertible, 00:00:30.640 --> 00:00:34.331 we can multiply both the left and the right-hand sides 00:00:34.331 --> 00:00:35.540 of the equation, 00:00:35.540 --> 00:00:37.410 and we have to multiply them on the left-hand sides 00:00:37.410 --> 00:00:39.440 of their respective sides by A inverse 00:00:39.440 --> 00:00:40.878 because remember matrix, 00:00:40.878 --> 00:00:43.123 when matrix multiplication order matters, 00:00:43.123 --> 00:00:44.911 we're multiplying the left-hand side 00:00:44.911 --> 00:00:46.666 of both sides of the equation. 00:00:46.666 --> 00:00:49.197 If we do that then we can get to essentially 00:00:49.197 --> 00:00:52.680 solving for the unknown column vector. 00:00:52.680 --> 00:00:53.549 If we know what column vector X is, 00:00:53.549 --> 00:00:55.980 then we know what S and T are. 00:00:55.980 --> 00:00:57.300 Then we've essentially solved 00:00:57.300 --> 00:00:59.379 this system of equations. 00:00:59.379 --> 00:01:00.913 Now let's actually do that. 00:01:00.913 --> 00:01:03.531 Let's actually figure out what A inverse is 00:01:03.531 --> 00:01:05.533 and multiply that times the column vector B 00:01:05.533 --> 00:01:07.980 to figure out what the column vector X is, 00:01:07.980 --> 00:01:10.119 and what S and T are. 00:01:10.119 --> 00:01:15.501 A inverse, A inverse is equal to 00:01:15.501 --> 00:01:17.847 one over the determinant of A, 00:01:17.847 --> 00:01:21.771 the determinant of A for a two-by-two here 00:01:21.771 --> 00:01:26.780 is going to be two times four minus negative 00:01:26.780 --> 00:01:28.416 two times negative five. 00:01:28.416 --> 00:01:32.559 It's going to be eight minus positive 10, 00:01:32.559 --> 00:01:34.381 eight minus positive 10, 00:01:34.381 --> 00:01:36.031 which would be negative two. 00:01:36.031 --> 00:01:39.290 This would become negative two right over here. 00:01:39.343 --> 00:01:42.114 Once again, two times four is eight minus 00:01:42.114 --> 00:01:44.700 negative two times negative five 00:01:44.700 --> 00:01:48.960 so minus positive 10 which gets us negative two. 00:01:48.960 --> 00:01:50.117 You multiply one over the determinant 00:01:50.117 --> 00:01:54.871 times what is sometimes called the adjoint of A 00:01:54.871 --> 00:01:57.905 which is essentially swapping the top left 00:01:57.905 --> 00:02:00.847 and bottom right or at least for a two-by-two matrix. 00:02:00.847 --> 00:02:03.641 This would be a four. 00:02:03.641 --> 00:02:05.639 This would be a two. 00:02:05.639 --> 00:02:06.920 Notice I just swapped these, 00:02:06.920 --> 00:02:08.291 and making these two negative, 00:02:08.291 --> 00:02:10.443 the negative of what they already are. 00:02:10.443 --> 00:02:11.919 This is from a negative two this is 00:02:11.919 --> 00:02:13.501 going to become a positive two, 00:02:13.501 --> 00:02:14.627 and this right over here is going to become 00:02:14.627 --> 00:02:16.237 a positive five. 00:02:16.237 --> 00:02:18.963 If all of this looks completely unfamiliar to you, 00:02:18.963 --> 00:02:21.530 you might want to review the tutorial 00:02:21.530 --> 00:02:22.693 on inverting matrices 00:02:22.693 --> 00:02:25.240 because that's all I'm doing here. 00:02:25.240 --> 00:02:28.551 So A inverse is going to be equal to, 00:02:28.551 --> 00:02:31.920 A inverse is going to be equal to, 00:02:31.920 --> 00:02:35.720 let's see, this is negative 1/2 times four 00:02:35.720 --> 00:02:36.773 is negative two. 00:02:36.773 --> 00:02:42.705 Negative 1/2, negative 1/2 times five 00:02:42.705 --> 00:02:48.309 is negative 2.5, negative 2.5. 00:02:48.309 --> 00:02:52.810 And negative 1/2 times two is negative one. 00:02:52.810 --> 00:02:55.180 Negative 1/2 times two is negative one. 00:02:55.180 --> 00:02:56.986 So that's A inverse right over here. 00:02:56.986 --> 00:02:59.371 Now let's multiply A inverse times 00:02:59.371 --> 00:03:01.720 our column vector, seven, negative six. 00:03:01.720 --> 00:03:03.710 Let's do that. 00:03:03.710 --> 00:03:05.175 This is A inverse. I'll rewrite it. 00:03:05.175 --> 00:03:09.433 Negative two, negative 2.5, negative one, 00:03:09.433 --> 00:03:15.157 negative one times seven and negative six. 00:03:15.157 --> 00:03:17.963 Times, I'll just write them all in white here now. 00:03:17.963 --> 00:03:19.680 Seven, negative six. 00:03:19.680 --> 00:03:23.861 We've had a lot of practice multiplying matrices. 00:03:23.861 --> 00:03:26.395 So what is this going to be equal to? 00:03:26.395 --> 00:03:28.120 The first entry is going to be negative two 00:03:28.120 --> 00:03:33.520 times seven which is negative 14 plus 00:03:33.520 --> 00:03:38.548 negative 2.5 times negative six. 00:03:38.548 --> 00:03:40.780 Let's see. That's going to be positive. 00:03:40.780 --> 00:03:43.751 That's going to be 12 plus another 3. 00:03:43.751 --> 00:03:45.666 That's going to be plus 15. 00:03:45.666 --> 00:03:47.703 Plus 15. 00:03:47.703 --> 00:03:49.887 Negative 2.5 times negative six 00:03:49.887 --> 00:03:52.131 is positive 15. 00:03:52.131 --> 00:03:54.143 Then we're going to have negative one 00:03:54.143 --> 00:03:57.686 times seven which is negative seven plus 00:03:57.686 --> 00:04:00.130 negative one times negative six. 00:04:00.130 --> 00:04:02.697 Well, that is positive six. 00:04:02.697 --> 00:04:06.530 So the product A inverse B 00:04:06.530 --> 00:04:08.812 which is the same things as a column vector X 00:04:08.812 --> 00:04:09.999 is equal to, 00:04:09.999 --> 00:04:11.840 we deserve a little bit of a drum roll now, 00:04:11.840 --> 00:04:15.716 the column vector one, negative one. 00:04:15.716 --> 00:04:18.914 We have just shown that this is equal to 00:04:18.914 --> 00:04:22.249 one, negative one or that X is equal to 00:04:22.249 --> 00:04:23.852 one, negative one, 00:04:23.852 --> 00:04:27.891 or we could even say that the column vector, 00:04:27.891 --> 00:04:32.720 the column vector ST, 00:04:32.720 --> 00:04:36.772 column vector with the entries S and T is equal to, 00:04:36.772 --> 00:04:43.306 is equal to one, negative one, 00:04:43.306 --> 00:04:46.596 is equal to one, negative one 00:04:46.596 --> 00:04:47.593 which is another way of saying 00:04:47.593 --> 00:04:49.250 that S is equal to one 00:04:49.250 --> 00:04:51.411 and T is equal to negative one. 00:04:51.411 --> 00:04:52.470 I know what you're saying. 00:04:52.470 --> 00:04:53.539 I said this in the last video 00:04:53.539 --> 00:04:54.808 and I'll say it again in this video. 00:04:54.808 --> 00:04:56.172 You're like, "Well, you know, it was so much easier 00:04:56.172 --> 00:04:58.115 "to just solve this system directly 00:04:58.115 --> 00:05:01.127 "just with using elimination or using substitution." 00:05:01.127 --> 00:05:05.910 I agree with you, but this is a useful technique 00:05:05.910 --> 00:05:07.664 because when you are doing problems 00:05:07.664 --> 00:05:10.125 in computation there may be situations 00:05:10.125 --> 00:05:12.111 where you have the left-hand side 00:05:12.111 --> 00:05:14.800 of this system stays the same, 00:05:14.800 --> 00:05:16.362 but there's many, many, many different values 00:05:16.362 --> 00:05:18.274 for the right-hand side of the system. 00:05:18.274 --> 00:05:20.426 So it might be easier to just compute 00:05:20.426 --> 00:05:23.907 the inverse once and just keep multiplying, 00:05:23.907 --> 00:05:26.266 keep multiplying this inverse times 00:05:26.266 --> 00:05:29.885 the different what we have on the right-hand side. 00:05:29.885 --> 00:05:32.132 You probably are familiar with some types, 00:05:32.132 --> 00:05:33.869 you have graphics processors, 00:05:33.869 --> 00:05:35.600 and graphics cards on computers 00:05:35.600 --> 00:05:37.780 and they talk about special graphic processors. 00:05:37.780 --> 00:05:39.397 What these are really all about 00:05:39.397 --> 00:05:41.875 are the hardware that is special-purposed 00:05:41.875 --> 00:05:45.480 for really fast matrix multiplication 00:05:45.480 --> 00:05:47.553 because when you're doing graphics processing 00:05:47.553 --> 00:05:48.864 when you're thinking about modeling things 00:05:48.864 --> 00:05:49.879 in three dimensions, 00:05:49.879 --> 00:05:51.387 and you're doing all these transformations, 00:05:51.387 --> 00:05:52.841 you're really just doing a lot of 00:05:52.841 --> 00:05:55.285 matrix multiplications really, really, really fast 00:05:55.285 --> 00:05:57.693 in real time so that to the user playing the game 00:05:57.693 --> 00:05:59.480 or whatever they're doing, 00:05:59.480 --> 00:06:00.836 it feels like they're in some type 00:06:00.836 --> 00:06:03.866 of a 3D, real-time reality. 00:06:03.866 --> 00:06:05.761 Anyway, I just want to point that out. 00:06:05.761 --> 00:06:09.979 This wouldn't be, if I saw this just randomly 00:06:09.979 --> 00:06:13.297 my instincts would be to solve this with elimination, 00:06:13.297 --> 00:06:16.930 but this ability to think of this 00:06:16.930 --> 00:06:21.642 as a matrix equation is a very, very useful concept, 00:06:21.642 --> 00:06:23.240 one actually not just in computation, 00:06:23.240 --> 00:06:26.560 but also as you go into higher level sciences 00:06:26.560 --> 00:06:28.878 especially physics, you will see a lot of 00:06:28.878 --> 00:06:31.826 matrix vector equations like this 00:06:31.826 --> 00:06:33.356 that kind of speak in generalities. 00:06:33.356 --> 00:06:34.571 It's really important to think about 00:06:34.571 --> 00:06:36.508 what these actually represent 00:06:36.508 --> 00:06:39.270 and how they can actually be solved.