0:00:05.550,0:00:08.770 In this video we look at the[br]subjective addition and 0:00:08.770,0:00:11.668 subtraction of matrices, and we[br]also look at scalar 0:00:11.668,0:00:14.888 multiplication of matrices. To[br]do that, we're going to need 0:00:14.888,0:00:18.108 some matrices, so here are some[br]matrices that I've already 0:00:18.108,0:00:21.328 prepared, and you'll see we've[br]got four matrices here, and 0:00:21.328,0:00:25.514 they've all got different sizes.[br]So the first thing we need to do 0:00:25.514,0:00:30.022 is just remind ourselves as to[br]how we look at the size of a 0:00:30.022,0:00:34.208 matrix, so we count up the[br]number of rows and the number of 0:00:34.208,0:00:35.818 columns. So this matrix A. 0:00:35.900,0:00:41.318 We say is a two by two matrix[br]because it's got two rows and 0:00:41.318,0:00:46.684 two columns. Matrix B's got[br]three rows and two columns, so 0:00:46.684,0:00:49.360 that's a three by two matrix. 0:00:50.220,0:00:55.095 And we can clearly see that[br]matrix C is a two by three 0:00:55.095,0:00:59.595 matrix, two rows and three[br]columns, and matrix D is a three 0:00:59.595,0:01:02.970 by two matrix with three rows[br]and two columns. 0:01:03.620,0:01:06.920 Now, when it comes to adding and[br]subtracting matrices, we can 0:01:06.920,0:01:10.820 only do it when the two matrices[br]have the same size. That is, 0:01:10.820,0:01:15.020 when they got this both got the[br]same number of rows and the same 0:01:15.020,0:01:18.320 number of columns and two[br]matrices that have the same size 0:01:18.320,0:01:21.620 are said to be compatible, and[br]when they're compatible we can 0:01:21.620,0:01:23.120 add them and subtract them. 0:01:23.840,0:01:25.891 So if we return to our four 0:01:25.891,0:01:31.733 matrices. We see that of these[br]four matrices, the only two that 0:01:31.733,0:01:37.169 are compatible or matrix B and[br]matrix D. They have the same 0:01:37.169,0:01:43.511 size 3 rows and two columns. So[br]what that means is that we can 0:01:43.511,0:01:50.759 find B + D and we can find[br]B -- D and we can find D 0:01:50.759,0:01:56.648 -- B. So we can add and subtract[br]matrices, B&D because they have 0:01:56.648,0:01:58.007 the same size. 0:01:58.120,0:02:03.240 Because they're compatible, we[br]can't add A&B because they have 0:02:03.240,0:02:08.360 different sizes. We can't add[br]C&A because they have different 0:02:08.360,0:02:13.130 sizes. Might be worth noting[br]that where we define the matrix 0:02:13.130,0:02:18.594 C transpose. C transpose. That's[br]where the rows become columns 0:02:18.594,0:02:23.582 would have. Two columns, because[br]each row would turn into a 0:02:23.582,0:02:27.998 column, it would have three[br]rows, so C transpose would be a 0:02:27.998,0:02:31.678 three by two matrix. So C[br]transpose is also compatible 0:02:31.678,0:02:36.830 with B&D. So we can add C[br]transpose to be or today, but we 0:02:36.830,0:02:39.406 can't add C to be or today. 0:02:40.970,0:02:44.402 Once we found two matrices that[br]are compatible that these two 0:02:44.402,0:02:48.458 matrices that have got the same[br]size, then we need to know how 0:02:48.458,0:02:52.826 to actually add them up. So we[br]look at our matrices B&D and see 0:02:52.826,0:02:56.570 how we go through this process.[br]So here's our Matrix B and 0:02:56.570,0:03:00.314 here's our Matrix D and I've[br]written them with a plus sign 0:03:00.314,0:03:03.746 between them and underneath I've[br]written them out again with a 0:03:03.746,0:03:09.674 minus sign. So this is B + D and[br]this is B -- D. So how do we do 0:03:09.674,0:03:11.234 the addition? Well, it's quite 0:03:11.234,0:03:15.280 straightforward. All we do[br]is we were adding we add the 0:03:15.280,0:03:18.660 elements that are in the[br]same position. We call that 0:03:18.660,0:03:19.674 the corresponding position. 0:03:20.960,0:03:25.342 So because the five is in the[br]first row on the 1st column and 0:03:25.342,0:03:29.724 the two is in the first row and[br]the first column, they get added 0:03:29.724,0:03:34.732 together. So we do 5 + 2 which[br]is 7 and that gives us the entry 0:03:34.732,0:03:38.175 in the first row and the first[br]column of our answer. 0:03:39.060,0:03:44.086 We do the same with all the[br]elements, so the minus one is in 0:03:44.086,0:03:48.753 the 2nd row and the first[br]column. So we add that to the 0:03:48.753,0:03:54.138 zero in the 2nd row and the[br]first column. So we do minus 1 + 0:03:54.138,0:03:59.164 0, which gives us minus one and[br]we can continue to do that for 0:03:59.164,0:04:04.190 all six elements of the matrix.[br]So 1 + 4 because the one and 0:04:04.190,0:04:08.498 four are in corresponding[br]positions gives us 5 -- 2 + -- 0:04:08.498,0:04:13.360 2. Gives us minus four and that[br]goes up here because it's in the 0:04:13.360,0:04:17.320 first row and the second column[br]first row on the second column 0:04:17.320,0:04:21.940 for three and the one get added[br]to give us four and the nought 0:04:21.940,0:04:25.570 and the minus one get added to[br]give us minus one. 0:04:26.810,0:04:31.282 And so that's how we do matrix[br]addition. So just to recap, we 0:04:31.282,0:04:35.754 have to have two matrices that[br]have the same size and then when 0:04:35.754,0:04:40.570 we have two matrices at the same[br]size we add them by adding the 0:04:40.570,0:04:43.322 elements that are in[br]corresponding positions. And so 0:04:43.322,0:04:47.794 the answer we get is the same[br]size as the two matrices that 0:04:47.794,0:04:48.826 we've added together. 0:04:50.120,0:04:53.200 Now the principles of[br]subtraction are exactly the 0:04:53.200,0:04:57.050 same. We deal with elements that[br]are in the corresponding 0:04:57.050,0:05:00.900 positions, but obviously this[br]time we subtract rather than add 0:05:00.900,0:05:07.830 them. So we do 5 -- 2 to get[br]three, we do minus 1 -- 0 to get 0:05:07.830,0:05:14.186 minus one. We do 1 -- 4 to[br]get minus three. That's done the 0:05:14.186,0:05:18.729 elements in the first column[br]with the elements in the second 0:05:18.729,0:05:24.511 column minus 2 -- -- 2 becomes[br]minus 2 + 2, which is 0. 0:05:25.340,0:05:31.268 3 -- 1 gives us 2[br]and 0 -- -- 1 is 0 0:05:31.268,0:05:33.548 + 1 which is 1. 0:05:34.570,0:05:39.666 And there's our answer. So[br]when we do B -- D, This is the 0:05:39.666,0:05:44.034 answer. Again, a matrix of the[br]same size as B&D, so that 0:05:44.034,0:05:47.310 illustrates how we do matrix[br]addition and subtraction. We 0:05:47.310,0:05:51.314 have to have two matrices[br]which have the same size in 0:05:51.314,0:05:56.046 order to be compatible. And[br]then what we do is we add or 0:05:56.046,0:06:00.050 subtract the elements that are[br]in the same positions. We call 0:06:00.050,0:06:00.778 corresponding elements. 0:06:01.910,0:06:05.430 Now Matrix obviously has the[br]same size itself, so we can 0:06:05.430,0:06:09.590 always add a matrix to itself,[br]and we're going to do that now 0:06:09.590,0:06:13.430 with the Matrix A. So we're[br]going to add matrix A to 0:06:13.430,0:06:17.590 itself, so into a plus a. So[br]here's Matrix A and what adding 0:06:17.590,0:06:21.110 matrix a onto it. And because[br]it's the same matrix, clearly 0:06:21.110,0:06:25.270 it's not the same size that[br]both 2 by two matrices, so we 0:06:25.270,0:06:26.870 go through the standard[br]procedure. 0:06:28.690,0:06:31.910 When we add elements that are[br]in corresponding positions, so 0:06:31.910,0:06:35.774 the four gets added to the[br]four, which gives us 8, the 0:06:35.774,0:06:39.960 three gets added to the three[br]to give us 6 not getting to 0:06:39.960,0:06:43.502 nought, which gives us nought[br]and minus one gets added to 0:06:43.502,0:06:45.756 minus one. To give this minus[br]2. 0:06:47.240,0:06:53.274 So matrix a + A is this matrix[br]here with entries 860 and minus 0:06:53.274,0:06:59.739 two and we used to writing A[br]plus a in a shorthand form as a 0:06:59.739,0:07:01.894 + A = 2 A. 0:07:02.720,0:07:06.260 One lot of a there's another lot[br]of a gives us two lots of a. 0:07:06.960,0:07:11.302 So this matrix that we found[br]here, we can refer to as 2A. 0:07:12.110,0:07:16.816 And if we look at the entries in[br]this matrix and compare them 0:07:16.816,0:07:21.884 with the entries of a, we see[br]that each of the entries is just 0:07:21.884,0:07:28.038 twice the entries of a 2 * 4 is[br]eight 2 * 3 or 6 two times 0:07:28.038,0:07:32.744 naughties nought 2 * -- 1 is[br]minus two, and so this process 0:07:32.744,0:07:36.726 illustrates how we do we call[br]scalar multiplication. We take a 0:07:36.726,0:07:41.432 matrix and we multiply it by a[br]number. All that happens is that 0:07:41.432,0:07:43.242 every element inside the matrix. 0:07:43.360,0:07:47.596 Gets multiplied by the number,[br]so in this case the number was 0:07:47.596,0:07:51.832 two and we'll do some examples[br]now, but we use a different 0:07:51.832,0:07:56.120 number. So we've seen how we can[br]do scalar multiplication by 0:07:56.120,0:07:59.320 simply multiplying every element[br]inside our matrix by the number. 0:07:59.320,0:08:03.160 The scalar that we're trying to[br]multiply by. So we'll do a 0:08:03.160,0:08:06.680 couple more examples now, so[br]we're going to workout is going 0:08:06.680,0:08:11.160 to five times the matrix B and[br]I'm going to do 1/2 times the 0:08:11.160,0:08:16.830 matrix D. So all I've done is[br]I've written down what matrix B 0:08:16.830,0:08:21.270 is. I'm going to do five times[br]this matrix. So remember the 0:08:21.270,0:08:24.970 rule for scalar multiplication[br]is the scalar, the number that 0:08:24.970,0:08:28.300 we're trying to multiply by[br]multiplies every entry inside 0:08:28.300,0:08:35.662 the matrix. So we get 5[br]* 5 is 20 five 5 * -- 0:08:35.662,0:08:39.470 1 is minus five. 5 * 1 is 0:08:39.470,0:08:47.156 5. 5 * -- 2 is minus[br]ten. 5 * 3 is 15 and 5 0:08:47.156,0:08:49.052 * 0 is 0. 0:08:50.080,0:08:54.448 So this is our answer. This is[br]the matrix 5B or scalar five 0:08:54.448,0:08:58.816 times matrix B. Notice that the[br]matrix we get to that answer has 0:08:58.816,0:09:03.184 the same size, the same order as[br]the matrix we started from, and 0:09:03.184,0:09:07.552 that's fairly obvious. That must[br]be the case because all we do is 0:09:07.552,0:09:10.912 we multiply every element inside[br]the matrix by the scalar 0:09:10.912,0:09:14.944 outside. So we are not creating[br]any new entries in the Matrix 0:09:14.944,0:09:19.648 and we're not losing any. So the[br]matrix that we get must have the 0:09:19.648,0:09:22.020 same size. So when we[br]started with. 0:09:23.540,0:09:27.049 Here's another example. We don't[br]have to just multiply by whole 0:09:27.049,0:09:31.196 numbers or two previous[br]examples. We did 2 * A and 5 * 0:09:31.196,0:09:35.343 B, but we can multiply by any[br]number, and in this case I'm 0:09:35.343,0:09:38.533 choosing to multiply the[br]fraction or half. So I'm going 0:09:38.533,0:09:40.447 to do half times matrix D. 0:09:41.130,0:09:45.771 So here it is written out.[br]Here's matrix D. We do 1/2 times 0:09:45.771,0:09:50.412 that number. All we have to do[br]is do 1/2 times every element 0:09:50.412,0:09:51.483 inside the matrix. 0:09:52.550,0:09:59.206 So we do 1/2 * 2, which gives us[br]one 1/2 * 0, which gives us 0:09:59.206,0:10:04.690 nought 1/2. Times 4, which gives[br]us two. That's not the first 0:10:04.690,0:10:12.002 column and 1/2 * -- 2, giving us[br]minus 1/2 * 1, giving us a half 0:10:12.002,0:10:15.658 and 1/2 * -- 1, giving us minus 0:10:15.658,0:10:20.510 1/2. And so here's our product[br]matrix and not surprisingly, it 0:10:20.510,0:10:23.768 ended up with some fractions.[br]Then, because we were 0:10:23.768,0:10:26.664 multiplying by a fraction to[br]start off with. 0:10:27.830,0:10:32.501 That concludes the video on[br]addition and subtraction of 0:10:32.501,0:10:35.096 matrices and on scalar[br]multiplication.