1 00:00:05,550 --> 00:00:08,770 In this video we look at the subjective addition and 2 00:00:08,770 --> 00:00:11,668 subtraction of matrices, and we also look at scalar 3 00:00:11,668 --> 00:00:14,888 multiplication of matrices. To do that, we're going to need 4 00:00:14,888 --> 00:00:18,108 some matrices, so here are some matrices that I've already 5 00:00:18,108 --> 00:00:21,328 prepared, and you'll see we've got four matrices here, and 6 00:00:21,328 --> 00:00:25,514 they've all got different sizes. So the first thing we need to do 7 00:00:25,514 --> 00:00:30,022 is just remind ourselves as to how we look at the size of a 8 00:00:30,022 --> 00:00:34,208 matrix, so we count up the number of rows and the number of 9 00:00:34,208 --> 00:00:35,818 columns. So this matrix A. 10 00:00:35,900 --> 00:00:41,318 We say is a two by two matrix because it's got two rows and 11 00:00:41,318 --> 00:00:46,684 two columns. Matrix B's got three rows and two columns, so 12 00:00:46,684 --> 00:00:49,360 that's a three by two matrix. 13 00:00:50,220 --> 00:00:55,095 And we can clearly see that matrix C is a two by three 14 00:00:55,095 --> 00:00:59,595 matrix, two rows and three columns, and matrix D is a three 15 00:00:59,595 --> 00:01:02,970 by two matrix with three rows and two columns. 16 00:01:03,620 --> 00:01:06,920 Now, when it comes to adding and subtracting matrices, we can 17 00:01:06,920 --> 00:01:10,820 only do it when the two matrices have the same size. That is, 18 00:01:10,820 --> 00:01:15,020 when they got this both got the same number of rows and the same 19 00:01:15,020 --> 00:01:18,320 number of columns and two matrices that have the same size 20 00:01:18,320 --> 00:01:21,620 are said to be compatible, and when they're compatible we can 21 00:01:21,620 --> 00:01:23,120 add them and subtract them. 22 00:01:23,840 --> 00:01:25,891 So if we return to our four 23 00:01:25,891 --> 00:01:31,733 matrices. We see that of these four matrices, the only two that 24 00:01:31,733 --> 00:01:37,169 are compatible or matrix B and matrix D. They have the same 25 00:01:37,169 --> 00:01:43,511 size 3 rows and two columns. So what that means is that we can 26 00:01:43,511 --> 00:01:50,759 find B + D and we can find B -- D and we can find D 27 00:01:50,759 --> 00:01:56,648 -- B. So we can add and subtract matrices, B&D because they have 28 00:01:56,648 --> 00:01:58,007 the same size. 29 00:01:58,120 --> 00:02:03,240 Because they're compatible, we can't add A&B because they have 30 00:02:03,240 --> 00:02:08,360 different sizes. We can't add C&A because they have different 31 00:02:08,360 --> 00:02:13,130 sizes. Might be worth noting that where we define the matrix 32 00:02:13,130 --> 00:02:18,594 C transpose. C transpose. That's where the rows become columns 33 00:02:18,594 --> 00:02:23,582 would have. Two columns, because each row would turn into a 34 00:02:23,582 --> 00:02:27,998 column, it would have three rows, so C transpose would be a 35 00:02:27,998 --> 00:02:31,678 three by two matrix. So C transpose is also compatible 36 00:02:31,678 --> 00:02:36,830 with B&D. So we can add C transpose to be or today, but we 37 00:02:36,830 --> 00:02:39,406 can't add C to be or today. 38 00:02:40,970 --> 00:02:44,402 Once we found two matrices that are compatible that these two 39 00:02:44,402 --> 00:02:48,458 matrices that have got the same size, then we need to know how 40 00:02:48,458 --> 00:02:52,826 to actually add them up. So we look at our matrices B&D and see 41 00:02:52,826 --> 00:02:56,570 how we go through this process. So here's our Matrix B and 42 00:02:56,570 --> 00:03:00,314 here's our Matrix D and I've written them with a plus sign 43 00:03:00,314 --> 00:03:03,746 between them and underneath I've written them out again with a 44 00:03:03,746 --> 00:03:09,674 minus sign. So this is B + D and this is B -- D. So how do we do 45 00:03:09,674 --> 00:03:11,234 the addition? Well, it's quite 46 00:03:11,234 --> 00:03:15,280 straightforward. All we do is we were adding we add the 47 00:03:15,280 --> 00:03:18,660 elements that are in the same position. We call that 48 00:03:18,660 --> 00:03:19,674 the corresponding position. 49 00:03:20,960 --> 00:03:25,342 So because the five is in the first row on the 1st column and 50 00:03:25,342 --> 00:03:29,724 the two is in the first row and the first column, they get added 51 00:03:29,724 --> 00:03:34,732 together. So we do 5 + 2 which is 7 and that gives us the entry 52 00:03:34,732 --> 00:03:38,175 in the first row and the first column of our answer. 53 00:03:39,060 --> 00:03:44,086 We do the same with all the elements, so the minus one is in 54 00:03:44,086 --> 00:03:48,753 the 2nd row and the first column. So we add that to the 55 00:03:48,753 --> 00:03:54,138 zero in the 2nd row and the first column. So we do minus 1 + 56 00:03:54,138 --> 00:03:59,164 0, which gives us minus one and we can continue to do that for 57 00:03:59,164 --> 00:04:04,190 all six elements of the matrix. So 1 + 4 because the one and 58 00:04:04,190 --> 00:04:08,498 four are in corresponding positions gives us 5 -- 2 + -- 59 00:04:08,498 --> 00:04:13,360 2. Gives us minus four and that goes up here because it's in the 60 00:04:13,360 --> 00:04:17,320 first row and the second column first row on the second column 61 00:04:17,320 --> 00:04:21,940 for three and the one get added to give us four and the nought 62 00:04:21,940 --> 00:04:25,570 and the minus one get added to give us minus one. 63 00:04:26,810 --> 00:04:31,282 And so that's how we do matrix addition. So just to recap, we 64 00:04:31,282 --> 00:04:35,754 have to have two matrices that have the same size and then when 65 00:04:35,754 --> 00:04:40,570 we have two matrices at the same size we add them by adding the 66 00:04:40,570 --> 00:04:43,322 elements that are in corresponding positions. And so 67 00:04:43,322 --> 00:04:47,794 the answer we get is the same size as the two matrices that 68 00:04:47,794 --> 00:04:48,826 we've added together. 69 00:04:50,120 --> 00:04:53,200 Now the principles of subtraction are exactly the 70 00:04:53,200 --> 00:04:57,050 same. We deal with elements that are in the corresponding 71 00:04:57,050 --> 00:05:00,900 positions, but obviously this time we subtract rather than add 72 00:05:00,900 --> 00:05:07,830 them. So we do 5 -- 2 to get three, we do minus 1 -- 0 to get 73 00:05:07,830 --> 00:05:14,186 minus one. We do 1 -- 4 to get minus three. That's done the 74 00:05:14,186 --> 00:05:18,729 elements in the first column with the elements in the second 75 00:05:18,729 --> 00:05:24,511 column minus 2 -- -- 2 becomes minus 2 + 2, which is 0. 76 00:05:25,340 --> 00:05:31,268 3 -- 1 gives us 2 and 0 -- -- 1 is 0 77 00:05:31,268 --> 00:05:33,548 + 1 which is 1. 78 00:05:34,570 --> 00:05:39,666 And there's our answer. So when we do B -- D, This is the 79 00:05:39,666 --> 00:05:44,034 answer. Again, a matrix of the same size as B&D, so that 80 00:05:44,034 --> 00:05:47,310 illustrates how we do matrix addition and subtraction. We 81 00:05:47,310 --> 00:05:51,314 have to have two matrices which have the same size in 82 00:05:51,314 --> 00:05:56,046 order to be compatible. And then what we do is we add or 83 00:05:56,046 --> 00:06:00,050 subtract the elements that are in the same positions. We call 84 00:06:00,050 --> 00:06:00,778 corresponding elements. 85 00:06:01,910 --> 00:06:05,430 Now Matrix obviously has the same size itself, so we can 86 00:06:05,430 --> 00:06:09,590 always add a matrix to itself, and we're going to do that now 87 00:06:09,590 --> 00:06:13,430 with the Matrix A. So we're going to add matrix A to 88 00:06:13,430 --> 00:06:17,590 itself, so into a plus a. So here's Matrix A and what adding 89 00:06:17,590 --> 00:06:21,110 matrix a onto it. And because it's the same matrix, clearly 90 00:06:21,110 --> 00:06:25,270 it's not the same size that both 2 by two matrices, so we 91 00:06:25,270 --> 00:06:26,870 go through the standard procedure. 92 00:06:28,690 --> 00:06:31,910 When we add elements that are in corresponding positions, so 93 00:06:31,910 --> 00:06:35,774 the four gets added to the four, which gives us 8, the 94 00:06:35,774 --> 00:06:39,960 three gets added to the three to give us 6 not getting to 95 00:06:39,960 --> 00:06:43,502 nought, which gives us nought and minus one gets added to 96 00:06:43,502 --> 00:06:45,756 minus one. To give this minus 2. 97 00:06:47,240 --> 00:06:53,274 So matrix a + A is this matrix here with entries 860 and minus 98 00:06:53,274 --> 00:06:59,739 two and we used to writing A plus a in a shorthand form as a 99 00:06:59,739 --> 00:07:01,894 + A = 2 A. 100 00:07:02,720 --> 00:07:06,260 One lot of a there's another lot of a gives us two lots of a. 101 00:07:06,960 --> 00:07:11,302 So this matrix that we found here, we can refer to as 2A. 102 00:07:12,110 --> 00:07:16,816 And if we look at the entries in this matrix and compare them 103 00:07:16,816 --> 00:07:21,884 with the entries of a, we see that each of the entries is just 104 00:07:21,884 --> 00:07:28,038 twice the entries of a 2 * 4 is eight 2 * 3 or 6 two times 105 00:07:28,038 --> 00:07:32,744 naughties nought 2 * -- 1 is minus two, and so this process 106 00:07:32,744 --> 00:07:36,726 illustrates how we do we call scalar multiplication. We take a 107 00:07:36,726 --> 00:07:41,432 matrix and we multiply it by a number. All that happens is that 108 00:07:41,432 --> 00:07:43,242 every element inside the matrix. 109 00:07:43,360 --> 00:07:47,596 Gets multiplied by the number, so in this case the number was 110 00:07:47,596 --> 00:07:51,832 two and we'll do some examples now, but we use a different 111 00:07:51,832 --> 00:07:56,120 number. So we've seen how we can do scalar multiplication by 112 00:07:56,120 --> 00:07:59,320 simply multiplying every element inside our matrix by the number. 113 00:07:59,320 --> 00:08:03,160 The scalar that we're trying to multiply by. So we'll do a 114 00:08:03,160 --> 00:08:06,680 couple more examples now, so we're going to workout is going 115 00:08:06,680 --> 00:08:11,160 to five times the matrix B and I'm going to do 1/2 times the 116 00:08:11,160 --> 00:08:16,830 matrix D. So all I've done is I've written down what matrix B 117 00:08:16,830 --> 00:08:21,270 is. I'm going to do five times this matrix. So remember the 118 00:08:21,270 --> 00:08:24,970 rule for scalar multiplication is the scalar, the number that 119 00:08:24,970 --> 00:08:28,300 we're trying to multiply by multiplies every entry inside 120 00:08:28,300 --> 00:08:35,662 the matrix. So we get 5 * 5 is 20 five 5 * -- 121 00:08:35,662 --> 00:08:39,470 1 is minus five. 5 * 1 is 122 00:08:39,470 --> 00:08:47,156 5. 5 * -- 2 is minus ten. 5 * 3 is 15 and 5 123 00:08:47,156 --> 00:08:49,052 * 0 is 0. 124 00:08:50,080 --> 00:08:54,448 So this is our answer. This is the matrix 5B or scalar five 125 00:08:54,448 --> 00:08:58,816 times matrix B. Notice that the matrix we get to that answer has 126 00:08:58,816 --> 00:09:03,184 the same size, the same order as the matrix we started from, and 127 00:09:03,184 --> 00:09:07,552 that's fairly obvious. That must be the case because all we do is 128 00:09:07,552 --> 00:09:10,912 we multiply every element inside the matrix by the scalar 129 00:09:10,912 --> 00:09:14,944 outside. So we are not creating any new entries in the Matrix 130 00:09:14,944 --> 00:09:19,648 and we're not losing any. So the matrix that we get must have the 131 00:09:19,648 --> 00:09:22,020 same size. So when we started with. 132 00:09:23,540 --> 00:09:27,049 Here's another example. We don't have to just multiply by whole 133 00:09:27,049 --> 00:09:31,196 numbers or two previous examples. We did 2 * A and 5 * 134 00:09:31,196 --> 00:09:35,343 B, but we can multiply by any number, and in this case I'm 135 00:09:35,343 --> 00:09:38,533 choosing to multiply the fraction or half. So I'm going 136 00:09:38,533 --> 00:09:40,447 to do half times matrix D. 137 00:09:41,130 --> 00:09:45,771 So here it is written out. Here's matrix D. We do 1/2 times 138 00:09:45,771 --> 00:09:50,412 that number. All we have to do is do 1/2 times every element 139 00:09:50,412 --> 00:09:51,483 inside the matrix. 140 00:09:52,550 --> 00:09:59,206 So we do 1/2 * 2, which gives us one 1/2 * 0, which gives us 141 00:09:59,206 --> 00:10:04,690 nought 1/2. Times 4, which gives us two. That's not the first 142 00:10:04,690 --> 00:10:12,002 column and 1/2 * -- 2, giving us minus 1/2 * 1, giving us a half 143 00:10:12,002 --> 00:10:15,658 and 1/2 * -- 1, giving us minus 144 00:10:15,658 --> 00:10:20,510 1/2. And so here's our product matrix and not surprisingly, it 145 00:10:20,510 --> 00:10:23,768 ended up with some fractions. Then, because we were 146 00:10:23,768 --> 00:10:26,664 multiplying by a fraction to start off with. 147 00:10:27,830 --> 00:10:32,501 That concludes the video on addition and subtraction of 148 00:10:32,501 --> 00:10:35,096 matrices and on scalar multiplication.