1 00:00:00,735 --> 00:00:01,806 Voiceover:In the last video we saw 2 00:00:01,806 --> 00:00:03,561 that we could take a system of two equations 3 00:00:03,561 --> 00:00:05,786 with two unknowns and represent it 4 00:00:05,786 --> 00:00:09,119 as a matrix equation where the matrix A's 5 00:00:09,119 --> 00:00:11,792 are the coefficients here on the left-hand side. 6 00:00:11,792 --> 00:00:13,669 The column vector X has our two 7 00:00:13,669 --> 00:00:16,610 unknown variables, S and T. 8 00:00:16,610 --> 00:00:17,845 Then the column vector B is essentially 9 00:00:17,845 --> 00:00:20,529 representing the right-hand side over here. 10 00:00:20,529 --> 00:00:21,646 What was interesting about it, 11 00:00:21,646 --> 00:00:23,386 then that would be the equation A, 12 00:00:23,386 --> 00:00:25,230 the matrix A times the column vector X 13 00:00:25,230 --> 00:00:27,605 being equal to the column vector B. 14 00:00:27,605 --> 00:00:29,900 What was interesting about that is we saw 15 00:00:29,900 --> 00:00:30,640 well, look, if A is invertible, 16 00:00:30,640 --> 00:00:34,331 we can multiply both the left and the right-hand sides 17 00:00:34,331 --> 00:00:35,540 of the equation, 18 00:00:35,540 --> 00:00:37,410 and we have to multiply them on the left-hand sides 19 00:00:37,410 --> 00:00:39,440 of their respective sides by A inverse 20 00:00:39,440 --> 00:00:40,878 because remember matrix, 21 00:00:40,878 --> 00:00:43,123 when matrix multiplication order matters, 22 00:00:43,123 --> 00:00:44,911 we're multiplying the left-hand side 23 00:00:44,911 --> 00:00:46,666 of both sides of the equation. 24 00:00:46,666 --> 00:00:49,197 If we do that then we can get to essentially 25 00:00:49,197 --> 00:00:52,680 solving for the unknown column vector. 26 00:00:52,680 --> 00:00:53,549 If we know what column vector X is, 27 00:00:53,549 --> 00:00:55,980 then we know what S and T are. 28 00:00:55,980 --> 00:00:57,300 Then we've essentially solved 29 00:00:57,300 --> 00:00:59,379 this system of equations. 30 00:00:59,379 --> 00:01:00,913 Now let's actually do that. 31 00:01:00,913 --> 00:01:03,531 Let's actually figure out what A inverse is 32 00:01:03,531 --> 00:01:05,533 and multiply that times the column vector B 33 00:01:05,533 --> 00:01:07,980 to figure out what the column vector X is, 34 00:01:07,980 --> 00:01:10,119 and what S and T are. 35 00:01:10,119 --> 00:01:15,501 A inverse, A inverse is equal to 36 00:01:15,501 --> 00:01:17,847 one over the determinant of A, 37 00:01:17,847 --> 00:01:21,771 the determinant of A for a two-by-two here 38 00:01:21,771 --> 00:01:26,780 is going to be two times four minus negative 39 00:01:26,780 --> 00:01:28,416 two times negative five. 40 00:01:28,416 --> 00:01:32,559 It's going to be eight minus positive 10, 41 00:01:32,559 --> 00:01:34,381 eight minus positive 10, 42 00:01:34,381 --> 00:01:36,031 which would be negative two. 43 00:01:36,031 --> 00:01:39,290 This would become negative two right over here. 44 00:01:39,343 --> 00:01:42,114 Once again, two times four is eight minus 45 00:01:42,114 --> 00:01:44,700 negative two times negative five 46 00:01:44,700 --> 00:01:48,960 so minus positive 10 which gets us negative two. 47 00:01:48,960 --> 00:01:50,117 You multiply one over the determinant 48 00:01:50,117 --> 00:01:54,871 times what is sometimes called the adjoint of A 49 00:01:54,871 --> 00:01:57,905 which is essentially swapping the top left 50 00:01:57,905 --> 00:02:00,847 and bottom right or at least for a two-by-two matrix. 51 00:02:00,847 --> 00:02:03,641 This would be a four. 52 00:02:03,641 --> 00:02:05,639 This would be a two. 53 00:02:05,639 --> 00:02:06,920 Notice I just swapped these, 54 00:02:06,920 --> 00:02:08,291 and making these two negative, 55 00:02:08,291 --> 00:02:10,443 the negative of what they already are. 56 00:02:10,443 --> 00:02:11,919 This is from a negative two this is 57 00:02:11,919 --> 00:02:13,501 going to become a positive two, 58 00:02:13,501 --> 00:02:14,627 and this right over here is going to become 59 00:02:14,627 --> 00:02:16,237 a positive five. 60 00:02:16,237 --> 00:02:18,963 If all of this looks completely unfamiliar to you, 61 00:02:18,963 --> 00:02:21,530 you might want to review the tutorial 62 00:02:21,530 --> 00:02:22,693 on inverting matrices 63 00:02:22,693 --> 00:02:25,240 because that's all I'm doing here. 64 00:02:25,240 --> 00:02:28,551 So A inverse is going to be equal to, 65 00:02:28,551 --> 00:02:31,920 A inverse is going to be equal to, 66 00:02:31,920 --> 00:02:35,720 let's see, this is negative 1/2 times four 67 00:02:35,720 --> 00:02:36,773 is negative two. 68 00:02:36,773 --> 00:02:42,705 Negative 1/2, negative 1/2 times five 69 00:02:42,705 --> 00:02:48,309 is negative 2.5, negative 2.5. 70 00:02:48,309 --> 00:02:52,810 And negative 1/2 times two is negative one. 71 00:02:52,810 --> 00:02:55,180 Negative 1/2 times two is negative one. 72 00:02:55,180 --> 00:02:56,986 So that's A inverse right over here. 73 00:02:56,986 --> 00:02:59,371 Now let's multiply A inverse times 74 00:02:59,371 --> 00:03:01,720 our column vector, seven, negative six. 75 00:03:01,720 --> 00:03:03,710 Let's do that. 76 00:03:03,710 --> 00:03:05,175 This is A inverse. I'll rewrite it. 77 00:03:05,175 --> 00:03:09,433 Negative two, negative 2.5, negative one, 78 00:03:09,433 --> 00:03:15,157 negative one times seven and negative six. 79 00:03:15,157 --> 00:03:17,963 Times, I'll just write them all in white here now. 80 00:03:17,963 --> 00:03:19,680 Seven, negative six. 81 00:03:19,680 --> 00:03:23,861 We've had a lot of practice multiplying matrices. 82 00:03:23,861 --> 00:03:26,395 So what is this going to be equal to? 83 00:03:26,395 --> 00:03:28,120 The first entry is going to be negative two 84 00:03:28,120 --> 00:03:33,520 times seven which is negative 14 plus 85 00:03:33,520 --> 00:03:38,548 negative 2.5 times negative six. 86 00:03:38,548 --> 00:03:40,780 Let's see. That's going to be positive. 87 00:03:40,780 --> 00:03:43,751 That's going to be 12 plus another 3. 88 00:03:43,751 --> 00:03:45,666 That's going to be plus 15. 89 00:03:45,666 --> 00:03:47,703 Plus 15. 90 00:03:47,703 --> 00:03:49,887 Negative 2.5 times negative six 91 00:03:49,887 --> 00:03:52,131 is positive 15. 92 00:03:52,131 --> 00:03:54,143 Then we're going to have negative one 93 00:03:54,143 --> 00:03:57,686 times seven which is negative seven plus 94 00:03:57,686 --> 00:04:00,130 negative one times negative six. 95 00:04:00,130 --> 00:04:02,697 Well, that is positive six. 96 00:04:02,697 --> 00:04:06,530 So the product A inverse B 97 00:04:06,530 --> 00:04:08,812 which is the same things as a column vector X 98 00:04:08,812 --> 00:04:09,999 is equal to, 99 00:04:09,999 --> 00:04:11,840 we deserve a little bit of a drum roll now, 100 00:04:11,840 --> 00:04:15,716 the column vector one, negative one. 101 00:04:15,716 --> 00:04:18,914 We have just shown that this is equal to 102 00:04:18,914 --> 00:04:22,249 one, negative one or that X is equal to 103 00:04:22,249 --> 00:04:23,852 one, negative one, 104 00:04:23,852 --> 00:04:27,891 or we could even say that the column vector, 105 00:04:27,891 --> 00:04:32,720 the column vector ST, 106 00:04:32,720 --> 00:04:36,772 column vector with the entries S and T is equal to, 107 00:04:36,772 --> 00:04:43,306 is equal to one, negative one, 108 00:04:43,306 --> 00:04:46,596 is equal to one, negative one 109 00:04:46,596 --> 00:04:47,593 which is another way of saying 110 00:04:47,593 --> 00:04:49,250 that S is equal to one 111 00:04:49,250 --> 00:04:51,411 and T is equal to negative one. 112 00:04:51,411 --> 00:04:52,470 I know what you're saying. 113 00:04:52,470 --> 00:04:53,539 I said this in the last video 114 00:04:53,539 --> 00:04:54,808 and I'll say it again in this video. 115 00:04:54,808 --> 00:04:56,172 You're like, "Well, you know, it was so much easier 116 00:04:56,172 --> 00:04:58,115 "to just solve this system directly 117 00:04:58,115 --> 00:05:01,127 "just with using elimination or using substitution." 118 00:05:01,127 --> 00:05:05,910 I agree with you, but this is a useful technique 119 00:05:05,910 --> 00:05:07,664 because when you are doing problems 120 00:05:07,664 --> 00:05:10,125 in computation there may be situations 121 00:05:10,125 --> 00:05:12,111 where you have the left-hand side 122 00:05:12,111 --> 00:05:14,800 of this system stays the same, 123 00:05:14,800 --> 00:05:16,362 but there's many, many, many different values 124 00:05:16,362 --> 00:05:18,274 for the right-hand side of the system. 125 00:05:18,274 --> 00:05:20,426 So it might be easier to just compute 126 00:05:20,426 --> 00:05:23,907 the inverse once and just keep multiplying, 127 00:05:23,907 --> 00:05:26,266 keep multiplying this inverse times 128 00:05:26,266 --> 00:05:29,885 the different what we have on the right-hand side. 129 00:05:29,885 --> 00:05:32,132 You probably are familiar with some types, 130 00:05:32,132 --> 00:05:33,869 you have graphics processors, 131 00:05:33,869 --> 00:05:35,600 and graphics cards on computers 132 00:05:35,600 --> 00:05:37,780 and they talk about special graphic processors. 133 00:05:37,780 --> 00:05:39,397 What these are really all about 134 00:05:39,397 --> 00:05:41,875 are the hardware that is special-purposed 135 00:05:41,875 --> 00:05:45,480 for really fast matrix multiplication 136 00:05:45,480 --> 00:05:47,553 because when you're doing graphics processing 137 00:05:47,553 --> 00:05:48,864 when you're thinking about modeling things 138 00:05:48,864 --> 00:05:49,879 in three dimensions, 139 00:05:49,879 --> 00:05:51,387 and you're doing all these transformations, 140 00:05:51,387 --> 00:05:52,841 you're really just doing a lot of 141 00:05:52,841 --> 00:05:55,285 matrix multiplications really, really, really fast 142 00:05:55,285 --> 00:05:57,693 in real time so that to the user playing the game 143 00:05:57,693 --> 00:05:59,480 or whatever they're doing, 144 00:05:59,480 --> 00:06:00,836 it feels like they're in some type 145 00:06:00,836 --> 00:06:03,866 of a 3D, real-time reality. 146 00:06:03,866 --> 00:06:05,761 Anyway, I just want to point that out. 147 00:06:05,761 --> 00:06:09,979 This wouldn't be, if I saw this just randomly 148 00:06:09,979 --> 00:06:13,297 my instincts would be to solve this with elimination, 149 00:06:13,297 --> 00:06:16,930 but this ability to think of this 150 00:06:16,930 --> 00:06:21,642 as a matrix equation is a very, very useful concept, 151 00:06:21,642 --> 00:06:23,240 one actually not just in computation, 152 00:06:23,240 --> 00:06:26,560 but also as you go into higher level sciences 153 00:06:26,560 --> 00:06:28,878 especially physics, you will see a lot of 154 00:06:28,878 --> 00:06:31,826 matrix vector equations like this 155 00:06:31,826 --> 00:06:33,356 that kind of speak in generalities. 156 00:06:33,356 --> 00:06:34,571 It's really important to think about 157 00:06:34,571 --> 00:06:36,508 what these actually represent 158 00:06:36,508 --> 00:06:39,270 and how they can actually be solved.