1 00:00:01,300 --> 00:00:06,800 Let's learn about matrices. So, what is a, well, what I do I mean when I say matrices? 2 00:00:06,800 --> 00:00:10,400 Well, matrices is just the plural for matrix. 3 00:00:10,400 --> 00:00:15,700 Which is probably a word you're familiar with more because of Hollywood than because of mathematics. 4 00:00:15,700 --> 00:00:20,900 So, what is a matrix? Well, it's actually a pretty simple idea. 5 00:00:20,900 --> 00:00:24,500 It's just a table of numbers. That's all a matrix is. 6 00:00:24,500 --> 00:00:27,800 So, let me draw a matrix for you. 7 00:00:27,800 --> 00:00:30,300 I don't like that toothpaste colored blue, so, let me use another color. 8 00:00:30,300 --> 00:00:37,600 This is an example of a matrix. If I said, I don't know I'm going to pick some random numbers; 9 00:00:37,600 --> 00:00:46,000 Five, one, two, three, zero, minus five. That is a matrix. 10 00:00:46,000 --> 00:00:51,500 And all it is is a table of numbers and, oftentimes if you want to have a variable for a matrix, you 11 00:00:51,500 --> 00:00:54,600 use a capital letter. So, you could use a capital 'A'. 12 00:00:54,600 --> 00:01:00,100 Sometimes in some books they make it extra bold. So it could be a bold 'A', would be a matrix. 13 00:01:00,100 --> 00:01:04,500 And, just a little bit of notation, So, they would call this matrix. Or, we would call 14 00:01:04,500 --> 00:01:10,100 this matrix, just by convention, you would call this a two by three matrix. 15 00:01:10,100 --> 00:01:16,500 And, sometimes they actually write it '2 by 3' below the bold letter they use to represent the matrix 16 00:01:16,500 --> 00:01:18,400 What is two? And, what is three? 17 00:01:18,400 --> 00:01:23,200 Well, two is the number of rows. We have one row, two row. This is a row, this is a row. 18 00:01:23,200 --> 00:01:26,300 We have three columns; one, two , three. 19 00:01:26,300 --> 00:01:28,500 So, that's why it's called a two by three matrix. 20 00:01:28,500 --> 00:01:34,200 When you say, you know, if I said, if I said that B, I'll put it extra bold. 21 00:01:34,200 --> 00:01:42,677 If B is a five by two matrix, that means that B would have, I can, let me do one 22 00:01:42,677 --> 00:01:46,892 I'll just type in numbers; zero, minus five, ten. 23 00:01:49,300 --> 00:01:52,600 So, it has five rows, it has two columns. 24 00:01:52,600 --> 00:01:56,000 We'll have another column here. So, let's see; minus ten, three, 25 00:01:56,000 --> 00:02:04,100 I'm justing putting in random numbers here. Seven, two, pi. 26 00:02:04,100 --> 00:02:07,000 That is a five by two matrix. 27 00:02:07,000 --> 00:02:11,700 So, I think you'd now have a kind of a convention that all a matrix is is a 28 00:02:11,700 --> 00:02:15,000 table of numbers. You can represent it when you're doing it in variable form 29 00:02:15,000 --> 00:02:19,100 you represent it as bold face capital letter. Sometimes you'd write two by three there. 30 00:02:19,100 --> 00:02:22,700 And, you can actually reference the terms of the matrix. 31 00:02:22,700 --> 00:02:26,300 In this example, the top example, where we have matrix A. 32 00:02:26,300 --> 00:02:32,600 If someone wanted to reference, let's say, this, this element of the matrix. 33 00:02:32,600 --> 00:02:37,400 So, what is that? That is in the second row. It's in row two. 34 00:02:37,400 --> 00:02:39,100 And, it's in column two. Right? 35 00:02:39,100 --> 00:02:42,500 This is column one, this is column two. Row one, row two. 36 00:02:42,500 --> 00:02:45,100 So, it's in the second row, second column. 37 00:02:45,100 --> 00:02:51,900 So, sometimes people will write that A, then they'll write, you know 38 00:02:51,900 --> 00:02:58,500 two comma two is equal to zero. 39 00:02:58,500 --> 00:03:02,100 Or, they might write, sometimes they'll write a lowercase a, 40 00:03:02,100 --> 00:03:07,100 two comma two is equal to zero. 41 00:03:07,100 --> 00:03:11,700 Well, what is A? These are just the same thing. 42 00:03:11,700 --> 00:03:14,200 I'm just doing this to expose you to the notation, because 43 00:03:14,200 --> 00:03:16,100 a lot of this really is just notation. 44 00:03:16,100 --> 00:03:21,800 So, what is a, one comma three? 45 00:03:21,800 --> 00:03:24,600 Well, that means we're in the first row and the third column. 46 00:03:24,600 --> 00:03:27,600 First row; one, two, three. It's this value right here. 47 00:03:27,600 --> 00:03:29,200 So, that equals two. 48 00:03:29,200 --> 00:03:32,100 So, this is just all notation of what a matrix is; 49 00:03:32,100 --> 00:03:34,100 it's a table of numbers, it can be represented this way. 50 00:03:34,100 --> 00:03:37,000 We can represent its different elements that way. 51 00:03:37,000 --> 00:03:38,300 So, you might be asking 52 00:03:38,300 --> 00:03:41,600 "Sal, well, that's nice, a table of numbers with fancy 53 00:03:41,600 --> 00:03:44,200 words and fancy notations. But, what is it good for?" 54 00:03:44,212 --> 00:03:46,100 And that's the interesting point. 55 00:03:46,100 --> 00:03:51,600 A matrix is just a data representation. It's just a way of writing down data. 56 00:03:51,600 --> 00:03:53,600 That's all it is. It's a table of numbers. 57 00:03:53,600 --> 00:03:57,800 But, it can be used to represent a whole set of phenomenon. 58 00:03:57,800 --> 00:04:01,500 And if you're doing this in you Algebra 1 or your Algebra 2 class 59 00:04:01,500 --> 00:04:03,600 you're probably using it to represent linear equations. 60 00:04:03,600 --> 00:04:07,854 But, we will learn, later, that it, and I'll do a whole set of videos 61 00:04:07,869 --> 00:04:10,600 on applying matrices to a whole bunch of different things. 62 00:04:10,600 --> 00:04:14,500 But, it can represent, it's very powerful and if you're doing 63 00:04:14,500 --> 00:04:19,100 computer graphics, that matrixes...The elements can represent pixels on your screen, 64 00:04:19,100 --> 00:04:21,400 they can represent points in coordinate space, 65 00:04:21,400 --> 00:04:23,000 they can represent...Who knows! 66 00:04:23,000 --> 00:04:24,900 There's tonnes of things that they can represent. 67 00:04:24,900 --> 00:04:27,600 But, the important thing to realize is that a matrix 68 00:04:27,600 --> 00:04:30,500 isn't, it's not a natural phenomenon. 69 00:04:30,500 --> 00:04:34,700 It's not like a lot of the mathematical concepts we've been looking at. 70 00:04:34,700 --> 00:04:37,700 It's a way to represent a mathematical concept. 71 00:04:37,700 --> 00:04:40,400 Or, a way of representing values. But you kinda have to 72 00:04:40,400 --> 00:04:43,000 define what it's representing. 73 00:04:43,000 --> 00:04:44,700 But, lets put that on the back burner a little bit 74 00:04:44,700 --> 00:04:48,300 in terms of what it actually represents. 75 00:04:48,300 --> 00:04:52,200 And the, oh, my wife is here. She's looking for our filing cabinet. 76 00:04:52,200 --> 00:04:54,500 But anyway, back to what I was doing. 77 00:04:54,500 --> 00:04:57,100 So, so, lets put on the back burner what a matrix is 78 00:04:57,100 --> 00:04:59,400 actually representing. Let's learn the conventions. 79 00:04:59,400 --> 00:05:02,200 Because, I think, uhm, at least initially, that tends to be 80 00:05:02,200 --> 00:05:04,015 the hardest part, How do you add matrices? 81 00:05:04,015 --> 00:05:06,408 How do you multiple matrices? How do you invert a matrices? 82 00:05:06,408 --> 00:05:09,069 How do you find the determinant of a matrix? 83 00:05:09,069 --> 00:05:11,400 I know all of those words might sound unfamiliar. Unless, 84 00:05:11,400 --> 00:05:13,700 you've already been confused by then in your algebra class. 85 00:05:13,700 --> 00:05:15,900 So. I'm gonna teach you all of those things first. 86 00:05:15,900 --> 00:05:18,400 Which are all really human-defined conventions. 87 00:05:18,400 --> 00:05:22,700 And then, later on, I'll make a whole bunch of videos on the intuition behind them, 88 00:05:22,700 --> 00:05:26,700 and what they actually represent. So, let's get started. 89 00:05:26,700 --> 00:05:29,700 So, lets say I wanted to add these two matrices. 90 00:05:29,700 --> 00:05:33,600 Let's say, the first one, let me switch colors. Let's say, 91 00:05:33,600 --> 00:05:37,700 I'll do relatively small ones, just, not to waste space. 92 00:05:37,700 --> 00:05:42,500 So, you have the matrix; three, negative one, I don't know, 93 00:05:42,500 --> 00:05:49,100 two, zero. I don't know, let's call that A, capital A. 94 00:05:49,100 --> 00:05:54,400 And let's say matrix B, and I'm just making up numbers. 95 00:05:54,400 --> 00:06:06,300 Matrix B is equal to; minus seven, two, three, five. 96 00:06:06,300 --> 00:06:14,000 So, my question to you is: What is A, 97 00:06:14,000 --> 00:06:16,300 so I'm doing it bold like they do in the text books, plus 98 00:06:16,300 --> 00:06:21,700 matrix B? So, I'm adding two matrices. And, once again 99 00:06:21,700 --> 00:06:25,700 this is just human convention. Someone defined how matrices add. 100 00:06:25,700 --> 00:06:27,500 They could've defined it some other way. But, they said; 101 00:06:27,500 --> 00:06:29,846 we're gonna make matrices add the way I'm 102 00:06:29,846 --> 00:06:32,500 about to show you because it's useful for a whole set of phenomenon. 103 00:06:32,500 --> 00:06:35,000 So, when you add two matrices you essentially just add 104 00:06:35,000 --> 00:06:40,000 the corresponding elements. So, how does that work? 105 00:06:40,000 --> 00:06:43,000 Well, you add the element that's in row one column one with 106 00:06:43,000 --> 00:06:46,100 the element that's in row one column one. Alright, so, it's 107 00:06:46,100 --> 00:06:50,500 three plus minus seven. So, three plus minus seven. 108 00:06:50,500 --> 00:06:55,000 That'll be the one-one element. Then, the row one column two element 109 00:06:55,000 --> 00:06:58,608 will be minus one plus two. 110 00:06:58,608 --> 00:07:01,700 Put parenthesis around them so you know that these are 111 00:07:01,700 --> 00:07:05,400 separate elements. And, you could guess how this keeps going. 112 00:07:05,400 --> 00:07:20,700 This element will be two plus three. This element, this last element will be zero plus five. 113 00:07:20,700 --> 00:07:26,700 So, that equals what? Three plus minus seven, that is minus four. 114 00:07:26,700 --> 00:07:32,000 Minus one plus two, that's one. Two plus three is five. And, 115 00:07:32,000 --> 00:07:39,800 zero plus five is five. So, there we have it, that is how we humans have defined the addition of two matrices. 116 00:07:39,800 --> 00:07:43,200 And, by this definition, you can imagine that this is going to be the same thing 117 00:07:43,200 --> 00:07:49,100 as B plus A. Right? And remember, this is something we have to think about 118 00:07:49,100 --> 00:07:53,000 because we're not adding numbers anymore. You know one plus two is the same as 119 00:07:53,000 --> 00:07:56,700 two plus one. Or, any two normal numbers, it doesn't matter what order you 120 00:07:56,700 --> 00:07:59,900 add them in. But matrices it's not completely obvious. But, when you define it in this way 121 00:07:59,900 --> 00:08:03,700 it doesn't matter if we do A plus B or B plus A. Right? 122 00:08:03,700 --> 00:08:06,600 If we did B plus A, this would just say negative seven plus three. 123 00:08:06,600 --> 00:08:10,100 This would just say two plus negative one. But, it would come out to the same values. 124 00:08:10,100 --> 00:08:11,900 That is matrix addition. 125 00:08:11,900 --> 00:08:15,300 And, you can imagine, matrix subtraction, it's essentially the same thing. 126 00:08:15,300 --> 00:08:21,592 We would...Well, actually let me show you. What would be A minus B? 127 00:08:27,038 --> 00:08:32,300 Well, you can also view that, this is capital B, it's a matrix 128 00:08:32,300 --> 00:08:34,800 that's why I'm making it extra bold. But, that's the same thing as; 129 00:08:34,800 --> 00:08:42,800 A plus minus one, times B. What's B? Well, B is; 130 00:08:42,800 --> 00:08:47,800 minus seven, two, three, five. And, when you multiply 131 00:08:47,800 --> 00:08:50,400 a scalar, when you just multiply a number times the matrix, 132 00:08:50,400 --> 00:08:52,700 you just multiply that number times every one of its elements. 133 00:08:52,700 --> 00:08:58,400 So, that equals A, matrix A, plus the matrix, we just multiply 134 00:08:58,400 --> 00:09:02,400 the negative one times every element in here. So, seven, 135 00:09:02,400 --> 00:09:08,400 minus two, minus three, five. And then we can do 136 00:09:08,400 --> 00:09:11,700 what we just did up there. We know what A is. So, 137 00:09:11,700 --> 00:09:15,800 this would equal, let's see, A is up here. So, three plus 138 00:09:15,800 --> 00:09:21,200 seven is ten, negative one, plus negative two is minus three, 139 00:09:21,200 --> 00:09:28,900 two plus minus three is minus one and zero plus five is five. 140 00:09:28,900 --> 00:09:31,600 And, you didn't have to go through this exercise right here. 141 00:09:31,600 --> 00:09:33,800 You could have, literally, just subtracted these elements from these elements 142 00:09:33,800 --> 00:09:35,200 and you would have gotten the same value. 143 00:09:35,200 --> 00:09:38,500 I did this because I wanted to show you also that multiplying 144 00:09:38,500 --> 00:09:41,300 a scalar times, or just a value or a number, times a matrix 145 00:09:41,300 --> 00:09:46,600 is just multiplying that number times all of the elements of that matrix. 146 00:09:46,600 --> 00:09:50,900 And, so what...By this definition of matrix addition what do we know? 147 00:09:50,900 --> 00:09:54,200 Well, we know that both matrices have to be the same size, 148 00:09:54,200 --> 00:09:58,700 by this definition of the way we're adding. So, for example 149 00:09:58,700 --> 00:10:01,100 you could add these two matrices, You could add, I don't know, 150 00:10:01,100 --> 00:10:08,500 one, two, three, four, five, six, seven, eight, nine to this matrix; 151 00:10:08,500 --> 00:10:14,500 to, I don't know, minus ten, minus one hundred, minus one thousand. 152 00:10:14,500 --> 00:10:20,100 I'm making up numbers. One, zero, zero, one ,zero, one. 153 00:10:20,100 --> 00:10:21,800 You can add these two matrices. Right? 154 00:10:21,800 --> 00:10:24,900 Because they have the same number of rows and the same number of columns. 155 00:10:24,900 --> 00:10:30,400 So, for example, if you were to add them. The first term up here would be one plus minus ten, 156 00:10:30,400 --> 00:10:34,400 so, it would be minus nine. Two plus minus one hundred, minus ninety-eight. 157 00:10:34,400 --> 00:10:39,500 I think you get the point. You'd have exactly nine elements and you'd have three rows of three columns. 158 00:10:39,500 --> 00:10:44,800 But, you could not add these two matrices. You could not add... 159 00:10:44,800 --> 00:10:48,600 Let me do it in a different color, just to show it is different, 160 00:10:48,600 --> 00:10:52,500 You could not add, this blue, you could not add this matrix; 161 00:10:52,500 --> 00:11:03,400 minus three, two to the matrix; I don't know, nine, seven. 162 00:11:03,400 --> 00:11:05,100 And why can you not add them? 163 00:11:05,100 --> 00:11:07,700 Well, they don't have corresponding elements to add up. 164 00:11:07,700 --> 00:11:11,600 This is a one row by two column, this is one by two 165 00:11:11,600 --> 00:11:15,800 and this is two by one. So, they don't have the same dimensions 166 00:11:15,800 --> 00:11:18,700 so we can't add or subtract these matrices. 167 00:11:18,700 --> 00:11:22,300 And, just as a side note, when a matrix has...when one of its 168 00:11:22,300 --> 00:11:26,800 dimensions is one. So, for example, here you have one row 169 00:11:26,800 --> 00:11:30,200 and multiple columns. This is actually called a row vector. 170 00:11:30,200 --> 00:11:32,500 A vector is essentially a one dimensional matrix, where one 171 00:11:32,500 --> 00:11:35,700 of the dimensions is one. So, this is a row vector and similarly, 172 00:11:35,700 --> 00:11:38,800 this is a column vector. That's just a little extra terminology 173 00:11:38,800 --> 00:11:41,400 that you should know. Uhm, if you take linear algebra and calculus 174 00:11:41,400 --> 00:11:44,200 your professor might use those terms and it's good to be 175 00:11:44,200 --> 00:11:49,015 familiar with it. Anyway, I'm pushing eleven minutes, so I will continue this in the next video. See you soon.