Download CBrayMath216-1-2-a.mp4 CLARK BRAY: OK, up to now, we`ve used

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Cartesian tensor wikipedia , lookup

Capelli's identity wikipedia , lookup

Jordan normal form wikipedia , lookup

Eigenvalues and eigenvectors wikipedia , lookup

Linear algebra wikipedia , lookup

System of linear equations wikipedia , lookup

Determinant wikipedia , lookup

Symmetry in quantum mechanics wikipedia , lookup

Singular-value decomposition wikipedia , lookup

Four-vector wikipedia , lookup

Bra–ket notation wikipedia , lookup

Matrix (mathematics) wikipedia , lookup

Perron–Frobenius theorem wikipedia , lookup

Non-negative matrix factorization wikipedia , lookup

Matrix calculus wikipedia , lookup

Cayley–Hamilton theorem wikipedia , lookup

Matrix multiplication wikipedia , lookup

Transcript
CBrayMath216-1-2-a.mp4
CLARK BRAY: OK, up to now, we've used matrices as a shorthand for systems of equations. We've done a lot with this.
Solving systems of equations is going to be a valuable tool for us. It turns out, though, that we can use matrices for other
things. There are several other really important things that we can use matrices for. At the moment, I can't tell you what
these other things are. Those will come later. But rest assured that there are these other things that we can use matrices
for.
So what I want to do is I want to develop some algebra of matrices. The algebra that we're about to develop is going to
be extremely useful for these other applications of matrices. And that algebra-- for the moment, we're just going to
think of matrices as being completely independent things, independent of an application. They're just algebraic
structures that we're going to define algebraic operations with. OK.
All right, so we'll start with matrix addition. Now, the good news is that the formula for matrix addition is very easy to
write down, and it's very easy to work with. The bad news is that the motivation for this formula that I'm about to show
you is based on how we can think of matrices as being used for these other things that I have yet to tell you about. So
I'm not going to be able to currently give you a motivation for this formula for matrix addition. I'm just going to show
you the formula.
So here it is, if you want to add two matrices, specifically, matrices for which you know the individual elements. So this is
the notation we're going to use. By the way, this notation says that, in the ij entry of a matrix, this a sub i comma j is the
entry in that position in the matrix. Again, that means ith row, jth column in the matrix. OK, so if you know the entries in
the matrix A, and if you know the entries in the matrix B, then the way you add them, the sum, matrix C, has the feature
that its entries-- you want to know what its entries are-- they're computed by that formula.
All together what this says is you just add entries with one component at a time. The ij entry in the sum is the ij entry
from the first matrix plus the ij from the second matrix. So even more explicitly, if you want to know what this is, well,
it's the sum of the corresponding entries in the two matrices that you're adding. If you want to know what that is, it's
the sum of the corresponding entries in the matrices that you're adding, et cetera.
OK, so very convenient what you're going to want to call a natural formula. But I emphasize that we can't really choose
to view this as natural yet, because algebraic convenience is not natural is about. We're going to interpret this as natural
after we see how this relates to interpreting matrices as representing these other things. That will make this formula
seem natural. OK.
Similar story for scalar matrix multiplication. There's an easy formula for how to multiply a matrix times a scalar, and the
formula is that you just-- in order to get any entry of the product matrix, you take the corresponding entry of the original
matrix and multiply it by that scalar. Said differently, that scalar multiplied by all of the entries of the given matrix to get
the corresponding entries of the product. Very simple little formula. So you see here, this 5 is multiplying by all of these
entries to give me that. So again, very convenient formula. Easy to compute with. Not immediately obvious why this is
natural, but it will be seen to be natural once we see these other interpretations of matrices.
OK, now here's where it gets a little bit tricky and seemingly unnatural. That's actually still natural. But it's going to look
weird. So this is a matrix multiplication. So an odd little formula. I suspect many students in this class have already seen
this formula for how to multiply two matrices, so I hope this will look familiar. If it doesn't, no problem. I do want to
warn you, though, that the presentations that students have usually seen prior to this class on the nature of matrix
multiplication is usually pretty light and not sufficient for our purposes here in Math 216. And I'll say more about that as
we go along.
OK, so matrix multiplication. First, a little bit of bad news. There are certain requirements. You can't just multiply any
two matrices. So we need for the number of columns in the left matrix to equal to the number of rows of the right
matrix. That's just a requirement. If this isn't satisfied, you can't multiply these matrices. Again, I claim this is very
natural. We'll see that later on in the course.
All right, now another way to phrase the same thing is that the number of elements in a row of the matrix has to equal
to the number of elements in a column of the matrix. Now, these look like different statements, but these are actually
the same statement, because these are really the same thing. The number of columns in a matrix is, in fact, the same as
the number of entries in a row of the matrix. And you just look at this example and see that, well, in fact, for every row,
each entry in that row corresponds to a column. So the number of columns is the number of entries in a row. OK, nice
fact.
And then, likewise, for the number of rows of B versus the number of entries in a column of B. And again, those are oneto-one correspondence between these. For every column, each entry corresponds to a row. OK, so we do need these
numbers to be same.
Now, again, you can view this in either context. You can view it as the number of columns of A got to equal to the
number of rows of B. So you can view it as these numbers have to be equal, or you can view it as the number of
elements in a row equals the number of elements in a column. They're equivalent. They're equivalent statements, but
they just look a little bit different. OK, so this requirement has to be satisfied.
And with that requirement satisfied, here's how you compute. If you want to compute an entry in the product matrix-here's product matrix C, the product for A times B-- the way you compute that entry is with this formula. It's a dot
product. So think back to Math 212, by the way. A dot product means you take the entries in this row-- this is the
notation we're using for the ith row, let me remind you, up here. This notation here. You need to take one of the rows of
the matrix. And then we're going to do a dot product with the corresponding column of the right matrix. Notice this
notation, the lowercase with a subscript indicates that we're talking about one of the columns of the right matrix.
So for example, if I want to compute this entry of this product matrix. Now, first of all, let's check, can I actually multiply
these matrices? Am I allowed? Well, the number of entries in a row of the left matrix does, sure enough, equal to the
number of entries in a column of the right matrix. Said differently, the number of columns of the left matrix equals the
number of rows of the right matrix. Same statement, different point of view.
And I compute that entry by taking a dot product of that row-- that's the corresponding row that the entry is that I'm
interested in-- with that column. And notice, the first column corresponding to the fact that the entry I'm interested in is
in the first column. OK, and that dot product-- a little bit of arithmetic, you can persuade yourself-- is 21. OK.
Similarly, if you want to compute that entry, it's in the first row. So we look at the first row. It's in the second column. So
we look at the second column. And again, do the arithmetic on the dot product, and you get that value.
OK, so I think this formula is the formula that students have primarily seen in high school presentations. It is
computationally convenient, computationally efficient. In fact, if you're reasonably decent with arithmetic, that means
that you can pretty much write down all of the entries in this product matrix, at least if the matrices are reasonably
sized, without even writing down any work. So that's highly appealing from an arithmetic computational point of view.
Important point to realize, though. That is not our primary interest. And our primary interest in this class is not to learn
how to compute stuff. Our primary interest in this class is to understand how objects of interest relate to other objects
of interest. Now, certainly there is some of that in here, seeing how entries of the product relate to rows and columns of
the other matrices. This is useful information, and we will make useful gains from that point of view. But there other
really more valuable points of view on how this matrix multiplication works. Equivalent points of view that have greater
upshots. So let me show you the first one of these.
So instead of looking at the product matrix and thinking of how to compute it one entry at a time, we're going to think of
how to do it one column at a time. So here is the idea. A column of the product matrix turns out to be a linear
combination of the columns of the left matrix. That's an interesting fact, right? This is a relationship between objects of
interest in this calculation that maybe you hadn't seen before. This column is a linear combination of those columns.
What linear combination? Well, it's a very specific, particular linear combination. It's a linear combination where I use
the corresponding column of B now by corresponding-- notice, this is the first column, so the corresponding column of B
is that first column-- those are the numbers that I use as coefficients. So as I have written over here, the explicit linear
combination that we use-- the linear combination is that this column of the right matrix is a linear combination of these
columns of the left matrix, and you see that I'm using the corresponding column of the right matrix to give me my
coefficients.
All right, and you can, again, do this arithmetic-- the arithmetic in this linear combination. Not hard to work that out and
persuade yourself that, sure enough, you get that 19 and 43. And if you want to check and make sure that this has
worked correctly, of course you can just compute this one entry at a time. So you know that dot that and confirm that it
gives you 19. And likewise, this is that dot that. And again, that's just arithmetic.
Now, I'd like to persuade you that it's not a coincidence that these two seemingly very different formulas give us the
same thing. In fact, the dot product point of view can be viewed as a consequence of this linear combination point of
view. Now, we agreed that this is a linear combination of those, and so let's ask now, what does that have to do with this
first entry in that column? How would I find, not the whole column, but how would I find just that first entry?
Well, if the column is a linear combination of these columns, the first entry would be the same linear combination of
these first entries. So that's a linear combination of these, and that is the same linear combination of those. Well, a
linear combination, of course, with these coefficients. So that 19-- this-- is a linear combination of those using those
coefficients, and that's a dot product. A linear combination of numbers using certain coefficients is just a dot product,
and you can see it right there.
So not too hard to see why it is that this works. This linear combination point of view just sort of combines all of the
various dot products, or many of the various dot products, together into this larger linear combination computation,
instead of individual dot product computation. OK.
Again, this is an interesting point of view, because it relates objects of interest, namely columns of the matrix. Columns
of the left matrix over here and corresponding columns of the right matrix. OK, nice fact. Here's another alternative
point of view.
There is a similar fact about rows. Again, a bit unexpected. So instead of computing one entry at a time, here we will
compute the product one row at a time. Well, the rows of the product are linear combinations of the rows of the right
matrix. Which linear combination? Well, a linear combination using the corresponding row of the left matrix.
Corresponding because, well, I'm computing the second row of the product. The coefficients, then, are the second row
of the left matrix.
So let's see, what does that linear combination look like? Well, this is the linear combination particular that we're
looking at. These rows that we're taking linear combinations of, here they are. Notice I'm writing them as rows. The
coefficients that we're using, those numbers, 3 and 4. And multiply that out, and do the arithmetic, and note that, sure
enough, we do get that correct product.
OK, so interestingly, not only can I think of matrix multiplication as a statement about linear combinations of rows, I can
also think about it as a statement about linear combinations of columns. Now, you do have to be careful. The rows and
columns play different roles. When you're taking the column point of view, you're taking linear combinations of the
columns of the left matrix. When you're taking a row point of view, it's linear combination of the rows of the right
matrix. Likewise, when you're taking a column point of view, it's the columns of the right matrix that give you the
coefficients. When you're taking a row point of view, it's the rows of the left matrix that give you the coefficients. So it
looks a little bit backwards. You have to make ultra sure to make sure you remember which way it goes. If you get it
backwards, you will get a wrong answer. It is not flexible on which way this goes.
OK, last point of view I want to show you on matrix multiplication. It's really just notation, but the sigma notation can be
very useful. It has the nice feature that it's extremely explicit. So this is a sigma notation perspective on how to multiply
matrices. Now, you'll notice that the matrices that we're starting with, again, will have a matrix A with certain known
elements. B, certain known elements. C is the product of those two matrices, and I want to talk about the elements in
that matrix C. And notice we have here an explicit formula for how to compute those elements.
So we call this sigma notation because we're making use of the sigma summation idea. This is the same summation
that's used for Riemann sums, and I know students have seen this in single variable calculus classes. It's used, of course,
for series calculations, so students should be very comfortable with this notation.
And now let me just walk you through why this as a sum and-- well, let's say it differently, why this, in fact, does matrix
multiplication for you. OK, so let's write out some matrices here. Well, gosh, I ran out of space. Let's try that again. OK.
So if you're multiplying some matrices, notice we are interested in computing the ij entry. So being, as we are, in the ith
row-- say we're in the ith row here-- that means we're going to be looking in ith row of the left matrix. And now we're
also, you'll notice, looking in the jth column. I'm interested in the entry in the jth column here. So being in the jth
column, I will look correspondingly at the jth column of the right matrix.
So what I'm going to be doing is I'm going to be taking entries from that ith row and multiplying them by entries from
this jth column, and multiplying and adding. And of course, you see here we are multiplying and adding. All right, so let's
talk about these subscripts here, and how do those subscripts do what we want them to do. Well, let me clear out those
dots.
These entries here in this ith row, one thing you'll notice is that, because we are exclusively in the ith row, note that the
first subscript is always i, because we are staying in the ith row. And it's just that, as we move along, as we move across,
the column number, which column we're in, is going to be changing as I go through the terms in this summation. So the
column number is what goes from 1 to n. k going from 1 to n, k being the column number in these subscripts, is what
has me, then, going across that ith row. And likewise, analogously, this is what has me going down the jth column.
So you'll notice that the b references is always the jth column. The second subscript of b is always j, indicating I'm in that
jth column. So how do I move down that jth column? Well, I move down that jth column by making reference to
different row numbers. So these different row numbers going from 1 to n takes me down that jth column. So all we have
here, then, is, in fact, that I'm going along the ith row of the left matrix, along the jth column of the right matrix, and I'm
multiplying and adding. That's all that expression is.
So this sigma notation, again, has the nice benefit that it's extremely explicit. All right, nothing left to the imagination
about exactly, precisely which numbers are we talking about. The disadvantage, it is a little bit hard to read, and so you
might sometimes be able to find ways to avoid using sigma notation, and that might be considered desirable. But
certainly, sometimes you can't avoid it. Certainly, sometimes you will be faced with it. In other words, the notation that
you'll be looking at will-- whatever it is that you're looking at will be given to you in sigma notation, so it's important to
understand what this notation means, and how to make sense out of it.