1 00:00:00,000 --> 00:00:07,810 2 00:00:07,810 --> 00:00:09,640 CHRISTINE BREINER: Welcome back to recitation. 3 00:00:09,640 --> 00:00:12,420 In this video, I really just want to practice matrix 4 00:00:12,420 --> 00:00:15,310 multiplication, which is potentially something new for 5 00:00:15,310 --> 00:00:17,860 some of you, and maybe some of you have been doing it for a 6 00:00:17,860 --> 00:00:19,070 while and are very good at it. 7 00:00:19,070 --> 00:00:21,460 But I want to make sure that everyone is feeling confident 8 00:00:21,460 --> 00:00:23,550 in their ability to multiply matrices. 9 00:00:23,550 --> 00:00:26,170 So we have three matrices here. 10 00:00:26,170 --> 00:00:31,200 We have A, B, and C. And what I want you to do is I want you 11 00:00:31,200 --> 00:00:33,370 to compute what makes sense below. 12 00:00:33,370 --> 00:00:37,140 I have four products of matrices below. 13 00:00:37,140 --> 00:00:44,980 a is A times B, b is B times A, c is B times C, and d is A 14 00:00:44,980 --> 00:00:48,870 times C. So I want you to multiply the matrices that 15 00:00:48,870 --> 00:00:52,120 make sense to multiply, and then the ones that don't, make 16 00:00:52,120 --> 00:00:53,260 sure you understand why. 17 00:00:53,260 --> 00:00:55,570 Give yourself a brief explanation of why you can't 18 00:00:55,570 --> 00:00:57,620 multiply them. 19 00:00:57,620 --> 00:01:00,470 So why don't you work on that, pause the video, and when you 20 00:01:00,470 --> 00:01:02,310 feel confident in your answers, bring the video back 21 00:01:02,310 --> 00:01:03,960 up, and you can check them against my work. 22 00:01:03,960 --> 00:01:11,780 23 00:01:11,780 --> 00:01:12,610 OK, welcome back. 24 00:01:12,610 --> 00:01:14,840 Well, we wanted to make sure we felt comfortable 25 00:01:14,840 --> 00:01:16,310 multiplying matrices. 26 00:01:16,310 --> 00:01:19,810 So what we're going to do is look at the four products I 27 00:01:19,810 --> 00:01:23,870 mentioned below, and we're going to see how they do, 28 00:01:23,870 --> 00:01:25,840 whether or not we can actually compute them. 29 00:01:25,840 --> 00:01:30,440 So let's first look at a, which was A times B. So before 30 00:01:30,440 --> 00:01:33,940 I write it down again, A times B is-- 31 00:01:33,940 --> 00:01:38,320 notice A is a 2 by 2 matrix, and B is a 2 32 00:01:38,320 --> 00:01:40,360 by 3 matrix, right? 33 00:01:40,360 --> 00:01:46,870 And so if I write letter a, we know we're taking a 2 34 00:01:46,870 --> 00:01:50,350 by 2 by a 2 by 3. 35 00:01:50,350 --> 00:01:54,570 And so the fact that the interior dimensions agree, 36 00:01:54,570 --> 00:01:57,080 that the number of columns of A is equal to the number of 37 00:01:57,080 --> 00:01:59,700 rows of B, means that I can multiply them. 38 00:01:59,700 --> 00:02:02,780 So I can multiply them, and my result I expect to get is, of 39 00:02:02,780 --> 00:02:05,460 course, the dimensions we have on the outside. 40 00:02:05,460 --> 00:02:07,940 So I expect to get a 2 by 3 matrix. 41 00:02:07,940 --> 00:02:10,990 So I'm going to rewrite A and B here, so that I don't have 42 00:02:10,990 --> 00:02:14,430 to keep walking back and forth, and then we'll do the 43 00:02:14,430 --> 00:02:15,440 multiplication. 44 00:02:15,440 --> 00:02:26,900 So I have 6, 5, 1, 2, times 2, minus 1, 3, 1, 0, 4. 45 00:02:26,900 --> 00:02:27,760 OK. 46 00:02:27,760 --> 00:02:30,880 So I want to perform this multiplication. 47 00:02:30,880 --> 00:02:34,770 Now remember that when you are looking for a value in your 48 00:02:34,770 --> 00:02:39,420 resulting matrix, which I know is 2 by 3, so I can even make 49 00:02:39,420 --> 00:02:41,780 a little space for myself. 50 00:02:41,780 --> 00:02:44,120 I know it's 2 by 3, so I know I'm going to have to fill in 51 00:02:44,120 --> 00:02:45,130 these spots. 52 00:02:45,130 --> 00:02:48,880 When I look at this position, it's row 1, column 1. 53 00:02:48,880 --> 00:02:52,290 That means I take row 1 of the first matrix, and I'm 54 00:02:52,290 --> 00:02:54,390 essentially just dotting it with column 1 55 00:02:54,390 --> 00:02:55,380 of the second matrix. 56 00:02:55,380 --> 00:02:58,740 So I'm taking row 1 times column 1 in the way it was 57 00:02:58,740 --> 00:03:02,290 described, which is I take 6 times 2, and I add 58 00:03:02,290 --> 00:03:03,910 it to 5 times 1. 59 00:03:03,910 --> 00:03:08,340 So row 1, column 1 gives me 6 times 2 is 12, plus 5 times 1 60 00:03:08,340 --> 00:03:12,380 which is 5, so I get 17. 61 00:03:12,380 --> 00:03:14,620 And then if I come in to the next spot, what is this? 62 00:03:14,620 --> 00:03:18,850 And the resulting matrix's position is row 1, column 2. 63 00:03:18,850 --> 00:03:22,050 So now I take row 1 of the first matrix and column 2 of 64 00:03:22,050 --> 00:03:26,320 the second matrix, and I get 6 times negative 1 is negative 65 00:03:26,320 --> 00:03:32,050 6, plus 0 times 5, so I get a negative 6 here. 66 00:03:32,050 --> 00:03:35,050 Negative 6 times 0. 67 00:03:35,050 --> 00:03:36,190 Maybe I should show you this way. 68 00:03:36,190 --> 00:03:38,150 Negative 6 times 0. 69 00:03:38,150 --> 00:03:39,170 OK. 70 00:03:39,170 --> 00:03:41,860 And then here I am now in the third spot of the first row, 71 00:03:41,860 --> 00:03:44,060 so I'm in a row 1, column 3. 72 00:03:44,060 --> 00:03:48,370 So that's again, row 1 of the first, column 3 of the second. 73 00:03:48,370 --> 00:03:51,680 So you see a pattern here about where we're getting our 74 00:03:51,680 --> 00:03:53,060 things from that we're multiplying. 75 00:03:53,060 --> 00:03:56,410 For row 1, column 3 of the resulting, I take row 1 of the 76 00:03:56,410 --> 00:03:58,600 first and column 3 of the second. 77 00:03:58,600 --> 00:04:02,460 So 6 times 3 is 18, plus-- 78 00:04:02,460 --> 00:04:03,940 5 times 4 is-- 79 00:04:03,940 --> 00:04:04,580 20. 80 00:04:04,580 --> 00:04:10,260 So 20 plus 18 is 38. 81 00:04:10,260 --> 00:04:11,530 OK. 82 00:04:11,530 --> 00:04:13,200 Now I have to do the same thing on the bottom. 83 00:04:13,200 --> 00:04:15,250 Right? 84 00:04:15,250 --> 00:04:16,580 So I have now here, the row, notice I'm in row 2, so I'm 85 00:04:16,580 --> 00:04:19,470 always going to use row 2 of ths first matrix. 86 00:04:19,470 --> 00:04:22,420 And then what we saw last time is I used column 1 in the 87 00:04:22,420 --> 00:04:24,710 first spot, column 2 in the second spot, column 3 in the 88 00:04:24,710 --> 00:04:25,700 third spot. 89 00:04:25,700 --> 00:04:25,930 Right? 90 00:04:25,930 --> 00:04:27,510 That's what happens over and over again. 91 00:04:27,510 --> 00:04:28,440 So what do I do? 92 00:04:28,440 --> 00:04:31,760 I take 1, 2, and I multiply it by 2, 1. 93 00:04:31,760 --> 00:04:34,570 So I take 1 times 2, plus 2 times 1. 94 00:04:34,570 --> 00:04:40,290 So I get 2 there and 2 there, so I get a 4. 95 00:04:40,290 --> 00:04:43,970 And then the next column: row 2, column 2. 96 00:04:43,970 --> 00:04:46,610 1 times negative 1 is negative 1-- 97 00:04:46,610 --> 00:04:47,990 2 times 0 is 0-- 98 00:04:47,990 --> 00:04:50,420 so I get a negative 1. 99 00:04:50,420 --> 00:04:52,010 And then the last column. 100 00:04:52,010 --> 00:04:53,620 1 times 3 is 3. 101 00:04:53,620 --> 00:04:55,200 2 times 4 is 8. 102 00:04:55,200 --> 00:04:59,230 So I get 3 plus 8, so I get 11. 103 00:04:59,230 --> 00:05:02,980 Hopefully I didn't make any stupid summing mistakes there, 104 00:05:02,980 --> 00:05:04,750 but if I did, you probably caught it. 105 00:05:04,750 --> 00:05:07,010 Because I was trying to say what I did as we went. 106 00:05:07,010 --> 00:05:09,410 So that is the answer to a. 107 00:05:09,410 --> 00:05:09,690 OK. 108 00:05:09,690 --> 00:05:12,460 So now let's think about what is b. 109 00:05:12,460 --> 00:05:18,880 b was take B times A, which is just to switch the order. 110 00:05:18,880 --> 00:05:20,690 So let's look at the dimension matchup. 111 00:05:20,690 --> 00:05:23,970 Now we have a 2 by 3 matrix, and I'm trying to multiply it 112 00:05:23,970 --> 00:05:25,730 by a 2 by 2 matrix. 113 00:05:25,730 --> 00:05:27,720 Well, I don't have to do any more work, 114 00:05:27,720 --> 00:05:28,950 because I can't do it. 115 00:05:28,950 --> 00:05:31,180 Because the dimensions of the insides here-- 116 00:05:31,180 --> 00:05:35,010 three columns for B, two rows for A-- 117 00:05:35,010 --> 00:05:37,120 means that I can't actually multiply them. 118 00:05:37,120 --> 00:05:37,420 OK? 119 00:05:37,420 --> 00:05:39,320 So this isn't even defined. 120 00:05:39,320 --> 00:05:43,910 121 00:05:43,910 --> 00:05:45,460 OK, so that was easy. 122 00:05:45,460 --> 00:05:46,470 That was b. 123 00:05:46,470 --> 00:05:47,790 All right. 124 00:05:47,790 --> 00:05:49,580 Letter c-- 125 00:05:49,580 --> 00:05:52,560 I'll give myself a lot of room to do that-- 126 00:05:52,560 --> 00:05:56,090 letter c was B times C. And so I'm going to write down the 127 00:05:56,090 --> 00:05:57,720 dimensions to see if I even need to 128 00:05:57,720 --> 00:05:59,350 write down the matrices. 129 00:05:59,350 --> 00:06:06,290 B was two rows by three columns, and C was three rows 130 00:06:06,290 --> 00:06:08,170 by two columns. 131 00:06:08,170 --> 00:06:10,710 So if I look at the dimensions, the 3 and the 3 132 00:06:10,710 --> 00:06:12,770 match up, so I am going to be able to multiply 133 00:06:12,770 --> 00:06:14,350 them, and my result-- 134 00:06:14,350 --> 00:06:16,910 as I mentioned before-- should be a 2 by 2. 135 00:06:16,910 --> 00:06:21,450 So let me write down B and C here, so we don't have to keep 136 00:06:21,450 --> 00:06:22,700 going to the side. 137 00:06:22,700 --> 00:06:30,110 138 00:06:30,110 --> 00:06:30,640 OK. 139 00:06:30,640 --> 00:06:40,370 And then C is 1, 2, negative 1, negative 1, 3, 2. 140 00:06:40,370 --> 00:06:43,380 All right, let me just make sure I didn't transcribe 141 00:06:43,380 --> 00:06:45,210 anything incorrectly. 142 00:06:45,210 --> 00:06:45,990 I think it looks good. 143 00:06:45,990 --> 00:06:47,630 OK. 144 00:06:47,630 --> 00:06:53,920 So row 1 of B. Row 2 of B. Column 1 of C. Column 2 of C. 145 00:06:53,920 --> 00:06:56,060 We're going to be dealing with those, specifically. 146 00:06:56,060 --> 00:06:57,650 So we want to multiply these. 147 00:06:57,650 --> 00:07:01,320 We said our resulting matrix is going to be 2 by 2. 148 00:07:01,320 --> 00:07:03,520 OK. 149 00:07:03,520 --> 00:07:05,380 Because I'm going to have a lot of terms, I might write 150 00:07:05,380 --> 00:07:07,720 them down on this one, and then simplify. 151 00:07:07,720 --> 00:07:11,115 Because I may make a mistake, so to be more careful, I'll 152 00:07:11,115 --> 00:07:13,320 write down all the pieces. 153 00:07:13,320 --> 00:07:16,630 So here I am in row 1, column 1 of the resulting. 154 00:07:16,630 --> 00:07:19,530 So I take row 1 of the first, column 1 of the second, and 155 00:07:19,530 --> 00:07:21,360 what do I get when I multiply? 156 00:07:21,360 --> 00:07:24,180 I get 2 times 1-- that's 2. 157 00:07:24,180 --> 00:07:27,830 Plus negative 1 times 2-- that's negative 2. 158 00:07:27,830 --> 00:07:31,480 Plus 3 times negative 1-- that's negative 3. 159 00:07:31,480 --> 00:07:31,760 Right? 160 00:07:31,760 --> 00:07:34,440 That's all we have to do for the first position. 161 00:07:34,440 --> 00:07:37,420 Then I do, for the second one, it's row 1, column 2. 162 00:07:37,420 --> 00:07:40,380 So I do row 1, column 2. 163 00:07:40,380 --> 00:07:42,080 So I'll try to keep my head out of the way. 164 00:07:42,080 --> 00:07:43,390 I realize I keep stepping in front. 165 00:07:43,390 --> 00:07:45,410 So it's 2 times negative 1. 166 00:07:45,410 --> 00:07:47,540 I get negative 2. 167 00:07:47,540 --> 00:07:51,690 Negative 1 times 3, so I get negative 3. 168 00:07:51,690 --> 00:07:55,800 And 3 times 2 gives me 6. 169 00:07:55,800 --> 00:07:56,960 OK. 170 00:07:56,960 --> 00:07:58,900 And then the bottom two. 171 00:07:58,900 --> 00:08:03,710 I get row 2, column 1 over here, and then row 2, 172 00:08:03,710 --> 00:08:06,220 column 2 over here. 173 00:08:06,220 --> 00:08:10,310 So row 2, column 1 is going to be 1 times 1. 174 00:08:10,310 --> 00:08:13,250 Plus 0 times 2. 175 00:08:13,250 --> 00:08:18,130 Plus 4 times negative 1, so I get negative 4. 176 00:08:18,130 --> 00:08:20,120 And then here. 177 00:08:20,120 --> 00:08:22,240 Row 2, column 2. 178 00:08:22,240 --> 00:08:25,400 I get 1 times negative 1, so I have negative 1. 179 00:08:25,400 --> 00:08:27,860 Plus 0 times 3-- 180 00:08:27,860 --> 00:08:29,230 plus 0. 181 00:08:29,230 --> 00:08:32,820 And then 4 times 2 is 8. 182 00:08:32,820 --> 00:08:36,570 So if I simplify these, it looks like in the first spot I 183 00:08:36,570 --> 00:08:38,830 should get a negative 3. 184 00:08:38,830 --> 00:08:42,030 And the second spot, I should get a 1. 185 00:08:42,030 --> 00:08:44,160 This is just for you to check your answer. 186 00:08:44,160 --> 00:08:47,240 And the third spot, I get a negative 3. 187 00:08:47,240 --> 00:08:50,320 And then the fourth spot, I get a 7. 188 00:08:50,320 --> 00:08:54,120 So hopefully I added correctly all throughout. 189 00:08:54,120 --> 00:08:57,490 I think I did, so I think we're good there. 190 00:08:57,490 --> 00:08:59,570 So that is the answer to C. 191 00:08:59,570 --> 00:09:03,310 And again, the reason we can multiply those, was that the 192 00:09:03,310 --> 00:09:03,840 dimensions-- 193 00:09:03,840 --> 00:09:06,630 when you wrote them down in order-- the dimensions to the 194 00:09:06,630 --> 00:09:09,640 inside agreed, and then the outside gives us the size of 195 00:09:09,640 --> 00:09:11,140 the resulting matrix. 196 00:09:11,140 --> 00:09:15,570 So there was one more problem, and that was d. 197 00:09:15,570 --> 00:09:20,960 And I wanted you to take A times C. And A was a 2 by 2. 198 00:09:20,960 --> 00:09:24,710 And C was a 3 by 2. 199 00:09:24,710 --> 00:09:28,010 And so again, we see we can't do it, because the two 200 00:09:28,010 --> 00:09:30,280 interior dimensions here-- 201 00:09:30,280 --> 00:09:31,980 when I write them in that order-- 202 00:09:31,980 --> 00:09:33,450 don't agree. 203 00:09:33,450 --> 00:09:33,740 OK. 204 00:09:33,740 --> 00:09:36,010 So d is not defined. 205 00:09:36,010 --> 00:09:39,746 206 00:09:39,746 --> 00:09:44,540 All right, so the basic idea of this whole video is just to 207 00:09:44,540 --> 00:09:47,890 make sure we felt comfortable multiplying matrices. 208 00:09:47,890 --> 00:09:49,260 We're trying to use some simple examples 209 00:09:49,260 --> 00:09:50,440 to understand that. 210 00:09:50,440 --> 00:09:53,730 Understand how we can recognize from the dimensions 211 00:09:53,730 --> 00:09:57,330 whether or not multiplication is even defined, and then what 212 00:09:57,330 --> 00:09:59,550 size the resulting matrix will be. 213 00:09:59,550 --> 00:10:01,550 I do want to point out one thing. 214 00:10:01,550 --> 00:10:04,970 And I want to point out that if we come over to our example 215 00:10:04,970 --> 00:10:08,000 back in the beginning. 216 00:10:08,000 --> 00:10:12,710 We had AB as our first example and then BA 217 00:10:12,710 --> 00:10:14,350 as our second example. 218 00:10:14,350 --> 00:10:16,770 And AB-- well, I think, I got to remember 219 00:10:16,770 --> 00:10:17,330 what they were, yeah-- 220 00:10:17,330 --> 00:10:21,250 AB you could multiply, but BA you could not. 221 00:10:21,250 --> 00:10:24,990 So I think it has been stressed before, but I think I 222 00:10:24,990 --> 00:10:27,930 should stress it again, that order matters in 223 00:10:27,930 --> 00:10:29,090 multiplication. 224 00:10:29,090 --> 00:10:29,350 OK? 225 00:10:29,350 --> 00:10:30,640 You can't commute these things. 226 00:10:30,640 --> 00:10:33,860 You can't switch the order and get the same result. 227 00:10:33,860 --> 00:10:37,000 So matrix multiplication, you have to be very careful about 228 00:10:37,000 --> 00:10:40,770 keeping things in the same order as you're multiplying. 229 00:10:40,770 --> 00:10:43,730 OK, I think that is where I will stop. 230 00:10:43,730 --> 00:10:44,778