WEBVTT mathematics/pre-calculus/selhorst-jones
00:00:00.000 --> 00:00:02.000
Hi--welcome back to Educator.com.
00:00:02.000 --> 00:00:04.100
Today, we are going to talk about matrices.
00:00:04.100 --> 00:00:07.100
In some way, matrices are a natural extension of vectors.
00:00:07.100 --> 00:00:14.000
Consider that we can express a vector as a horizontal array of numbers, where an array is just a bunch of different spaces to put numbers.
00:00:14.000 --> 00:00:18.000
So, each component from a vector would be an entry in that array of numbers.
00:00:18.000 --> 00:00:26.200
So, if we had some vector, (5,47,-8), we could also put that as 5, and then a little bit of space, and then 47, and then a little bit of space, and then -8.
00:00:26.200 --> 00:00:31.500
We have this array that is three different locations for numbers to go, this rectangular array.
00:00:31.500 --> 00:00:33.800
A matrix takes this idea and expands on it.
00:00:33.800 --> 00:00:39.800
The vector was just a single line--it was just a single row going on.
00:00:39.800 --> 00:00:44.400
Instead of just having columns of numbers (we had that single row with three different columns),
00:00:44.400 --> 00:00:50.000
we can take that, and we can have rows and columns.
00:00:50.000 --> 00:00:52.700
This allows us to show lots of information in a single array.
00:00:52.700 --> 00:00:59.900
Just like a vector allowed us to show more information than a single number, a matrix will allow us to show even more information than a single vector.
00:00:59.900 --> 00:01:04.100
So, it is a way to compact lots of information in this single, really useful thing.
00:01:04.100 --> 00:01:06.900
And we will end up seeing how they are useful later on.
00:01:06.900 --> 00:01:13.400
Matrices have a huge number of uses, both in math and other fields--they are really, really useful things
00:01:13.400 --> 00:01:19.100
for science, computer science, engineering, business, economics...so many things.
00:01:19.100 --> 00:01:22.400
But it is going to take a couple of lessons before we can see how useful they are,
00:01:22.400 --> 00:01:27.200
because we have to just get the basics of how they work learned before we can really see an application.
00:01:27.200 --> 00:01:33.100
But in two lessons, we will see how ridiculously easy they make it to solve linear systems.
00:01:33.100 --> 00:01:41.500
So, once we have matrices learned, and have a good understanding of them, we will be able to solve linear systems easily, which is really cool.
00:01:41.500 --> 00:01:51.100
Also, I want to mention: this lesson right here is going to be on how matrices work, what a matrix is, and how they interact in various different ways.
00:01:51.100 --> 00:01:56.100
But many teachers and textbooks don't start with matrices as how a matrix works;
00:01:56.100 --> 00:02:00.200
they start with it as specifically using it to solve linear equations
00:02:00.200 --> 00:02:05.600
through augmented matrices, row operations, and Gauss-Jordan elimination.
00:02:05.600 --> 00:02:10.100
If that is what you are looking for, you have a math class and you are trying to get more understanding of those things,
00:02:10.100 --> 00:02:14.700
you are going to want to take a look at the lesson Using Matrices to Solve Systems of Linear Equations.
00:02:14.700 --> 00:02:20.700
The first half of that lesson will go over augmented matrices, row operations, Gauss-Jordan elimination...
00:02:20.700 --> 00:02:23.400
And there will be some examples about how that stuff works there.
00:02:23.400 --> 00:02:27.600
So, if that is what you are looking for right now, you might want to go check that out, as opposed to this lesson.
00:02:27.600 --> 00:02:31.500
However, that said, you are going to end up coming back to everything that is in this lesson.
00:02:31.500 --> 00:02:37.000
It is just a question of if you introduce the idea of matrices through that stuff first, and then go on to talk about how they work;
00:02:37.000 --> 00:02:39.900
or if you talk about how matrices work, and then you get to that stuff later.
00:02:39.900 --> 00:02:45.800
I prefer talking about matrices first, and then getting to the applications; but it depends, from teacher to teacher and textbook to textbook.
00:02:45.800 --> 00:02:48.500
So, in your case, you might be interested in watching that lesson first.
00:02:48.500 --> 00:02:51.000
But you are going to end up coming back to this lesson and watching it anyway.
00:02:51.000 --> 00:02:54.600
And some of the stuff in that lesson will make more sense if you watch this one first.
00:02:54.600 --> 00:02:58.400
So, you might even find it worthwhile to watch this lesson before you get around to watching that, if you have time.
00:02:58.400 --> 00:03:08.800
All right, let's get into this: a single object is a matrix, but if we are talking about multiple of them, in the plural, it is matrices.
00:03:08.800 --> 00:03:11.500
It is a rectangular array where each entry is a number.
00:03:11.500 --> 00:03:18.400
So, an array is just...imagine a bunch of boxes stacked together to make a rectangle of boxes.
00:03:18.400 --> 00:03:23.900
And inside of each box, you can put in numbers; so you can put a number here, a number here, a number here, a number here, a number here...
00:03:23.900 --> 00:03:28.600
And we call each of those places where you could put a number an entry.
00:03:28.600 --> 00:03:34.100
We have some a = some number here, some number here, going all the way down to some number here,
00:03:34.100 --> 00:03:37.000
some number here, some number here, going all the way down to some number here;
00:03:37.000 --> 00:03:42.000
and the same thing going right as well...and then there are a bunch of numbers in the middle.
00:03:42.000 --> 00:03:48.400
So, it is just a rectangular array--a bunch of places to put numbers in this nice rectangular thing.
00:03:48.400 --> 00:03:56.700
It is like looking at a piece of grid paper and boxing off some part of it, and then writing a number inside of each of the grids.
00:03:56.700 --> 00:04:14.800
All right, for a matrix with m rows and n columns (notice that it has m rows and n columns), we say it has an order of m by n.
00:04:14.800 --> 00:04:19.000
We can put these two things together to talk about the order of the matrix.
00:04:19.000 --> 00:04:24.500
This property is also sometimes called size or dimension; those are sometimes used as synonyms for order.
00:04:24.500 --> 00:04:28.200
For the most part, we will just use "order" in this course, but I might say "size" occasionally.
00:04:28.200 --> 00:04:34.500
We can also write order as A<font size="-6">m x n</font>: we write a little part underneath it, m x n.
00:04:34.500 --> 00:04:38.800
So, if we mainly want to talk about some specific matrix, A for example, we can talk about A.
00:04:38.800 --> 00:04:46.300
But if we want to mention its order as we are talking about A, we can write its order down to the side as a subscript, m x n.
00:04:46.300 --> 00:04:51.000
If a matrix has equal numbers of rows and columns, if they are the same number of rows and columns,
00:04:51.000 --> 00:04:56.200
m = n, we call it a square matrix, because we have a square object.
00:04:56.200 --> 00:05:02.800
Matrices are usually denoted by capital letters, like A, but you might see other ones, as well.
00:05:02.800 --> 00:05:10.300
Two matrices, A and B, are equal if they have the same order (they are the same size), and all of their entries are equal.
00:05:10.300 --> 00:05:17.100
They have the same size, and then, if we go to any given one of the locations over here, it is the same as the same location over here.
00:05:17.100 --> 00:05:19.800
We go to some location here; it is the same as the location over here.
00:05:19.800 --> 00:05:23.000
You choose one location here; it is the same thing as this location here.
00:05:23.000 --> 00:05:27.100
So, they have to look exactly the same for them to be equal to each other.
00:05:27.100 --> 00:05:38.100
I also really want to drive home this fact that it is an m x n matrix with rows by columns.
00:05:38.100 --> 00:05:44.200
It is always rows by columns; I found this a little bit confusing at first, but I would recommend:
00:05:44.200 --> 00:05:52.700
the way to think about this, as a row, is something that goes left-right; a column is something that goes up-down.
00:05:52.700 --> 00:05:57.900
So, whenever we are talking about stuff in math, we normally talk left-right, then up-down,
00:05:57.900 --> 00:06:01.600
(x,y) when we are talking about rectangular coordinates.
00:06:01.600 --> 00:06:06.900
So, when we are on the plane, we talk about the horizontal stuff, and then the vertical stuff,
00:06:06.900 --> 00:06:11.500
which is why we talk about the rows, which horizontal thing we are talking about,
00:06:11.500 --> 00:06:14.200
and then the columns, which vertical thing we are talking about.
00:06:14.200 --> 00:06:16.500
It might get a little bit confusing as you work through it.
00:06:16.500 --> 00:06:22.800
But just always remember: it is rows then columns; this order of rows, then columns, ends up being very important
00:06:22.800 --> 00:06:25.200
for a lot of stuff--the way we talk about specific entries.
00:06:25.200 --> 00:06:29.200
So, it is just really important to remember this "rows by columns."
00:06:29.200 --> 00:06:35.800
The best mnemonic I can offer you is thinking in terms of the fact that rows are left-right; columns are up-down;
00:06:35.800 --> 00:06:41.400
and we go left-right, then up-down, so it is rows, then columns, rows by columns.
00:06:41.400 --> 00:06:43.900
But it is something that you just have to remember.
00:06:43.900 --> 00:06:53.300
All right, with this idea in mind, that it is rows by columns, let's look at a couple of examples.
00:06:53.300 --> 00:07:01.200
If we have a 3x3 matrix, then that means we have 3 rows, and we have 3 columns.
00:07:01.200 --> 00:07:08.000
If we have a 2x3 matrix, then we have 2 rows, and we have 3 columns.
00:07:08.000 --> 00:07:16.500
If we have a 5x1 matrix, then we have 5 rows, and we have 1 column--the same thing for all of them.
00:07:16.500 --> 00:07:18.500
Also, I want to point out some of the numbers here.
00:07:18.500 --> 00:07:25.100
We can have just whole numbers, like 17; but it is also perfectly fine to have decimal numbers, like 4.2.
00:07:25.100 --> 00:07:31.700
We can have negative numbers, like -19; we can also have irrational numbers, like ā2 or Ļ.
00:07:31.700 --> 00:07:39.600
We can have fractions: -5/7, 1/2; anything that is a real number at all can be one of the entries in a matrix.
00:07:39.600 --> 00:07:44.000
Any number at all can be something inside of a matrix.
00:07:44.000 --> 00:07:50.700
Talking about specific entries: we can also talk about some specific entry that is in row i and column j in our matrix.
00:07:50.700 --> 00:07:55.900
And so, i and j are just standing in for numbers; we will swap them out for numbers later, when we need to.
00:07:55.900 --> 00:08:06.300
In A that is a 3x3, this matrix right here, the entry in row 2, column 3 is 8.
00:08:06.300 --> 00:08:18.100
So, we go to row 2: 1, 2; so we are on this one here; and column 3: 1, 2, the third column; so we are on this column here.
00:08:18.100 --> 00:08:30.200
They end up intersecting right here, and so, we have row 2, column 3, is 8.
00:08:30.200 --> 00:08:36.900
All right, we can expand on this idea: we use capitals to denote a matrix, like A.
00:08:36.900 --> 00:08:41.900
So, we can often use corresponding lowercase letters to denote the entries inside of it--
00:08:41.900 --> 00:08:48.500
so, A to denote the entire matrix, and a if we want to talk about some specific entry inside of it.
00:08:48.500 --> 00:08:54.700
We can talk about a specific entry by using a subscript, ij, where a subscript--here is our number, and then ij,
00:08:54.700 --> 00:09:03.300
or any subscript, is just numbers that are down and to the right of the number; that is where we have our subscripts.
00:09:03.300 --> 00:09:08.700
So, we have ij on it; so we can combine those two, and we have a<font size="-6">i,j</font>, subscript ij.
00:09:08.700 --> 00:09:12.100
And that will denote the ith row and jth column.
00:09:12.100 --> 00:09:18.000
i came first, so that is talking about the rows; j came second, so that is talking about the columns.
00:09:18.000 --> 00:09:23.200
So, a<font size="-6">i,j</font> is the ith row, jth column.
00:09:23.200 --> 00:09:30.400
So, that means we could talk about a<font size="-6">1,1</font>: that would be first row, first column, so we would get 17.
00:09:30.400 --> 00:09:36.200
We could talk about a<font size="-6">2,1</font>; that would be second row, first column; so that would be 0.
00:09:36.200 --> 00:09:45.600
Second row, second column is also 0; we could have a<font size="-6">2,3</font>, second row, third column; so that would be 8.
00:09:45.600 --> 00:09:50.400
That is exactly what we figured out at the beginning: row 2, column 3, is a<font size="-6">2,3</font>.
00:09:50.400 --> 00:09:56.700
Or we could have a<font size="-6">3,2</font>, third row, second column, which gets us 3.
00:09:56.700 --> 00:10:01.000
So, this gives us another way to talk about where a number is.
00:10:01.000 --> 00:10:07.000
We can talk about it in terms of this entry, and a subscript to say which of the entries it is.
00:10:07.000 --> 00:10:09.900
With this idea in mind, we have another way to talk about a matrix.
00:10:09.900 --> 00:10:15.600
As opposed to a matrix being the entire matrix, or a matrix just being this capital letter that represents it,
00:10:15.600 --> 00:10:20.500
we can see it as a series of entries represented by this a<font size="-6">i,j</font>.
00:10:20.500 --> 00:10:28.500
There is a first row first column, first row second column, first row third; then second row first column, second row second column, third row second column, etc.
00:10:28.500 --> 00:10:31.800
It is just a bunch of entries making up the whole thing.
00:10:31.800 --> 00:10:41.700
With this idea in mind, instead of having to write the entire matrix like this...we don't have to do the entire matrix.
00:10:41.700 --> 00:10:46.900
We don't also have to just use a single letter to denote the whole thing, like just A.
00:10:46.900 --> 00:10:53.100
We can instead refer to it by using a single representative entry to stand in for all entries, a<font size="-6">i,j</font>.
00:10:53.100 --> 00:10:59.200
So, it is like saying, "Here is some a<font size="-6">i,j</font> that is talking about all of the different things at once."
00:10:59.200 --> 00:11:03.700
So, we can see what happens to this one that is representing all of them at once.
00:11:03.700 --> 00:11:09.700
Notice: since i and j can change, a<font size="-6">i,j</font> is a placeholder for all of the entries in A.
00:11:09.700 --> 00:11:13.900
It is not just one thing; it is all of them at once.
00:11:13.900 --> 00:11:19.700
In a way, it is representing all of them at once by letting us see how something happens to one of them in there.
00:11:19.700 --> 00:11:26.600
So, i,j is ith row, jth column; so we have another way to talk about a matrix.
00:11:26.600 --> 00:11:31.800
All right, at this point we are ready to actually talk about how we can do some basic arithmetic with our matrices.
00:11:31.800 --> 00:11:39.300
Given some matrix A and a scalar (that is to say, just a real number k), we can multiply the matrix by that number.
00:11:39.300 --> 00:11:48.400
k times the matrix A becomes k times a<font size="-6">i,j</font>, that is, each of the entries of our matrix A gets multiplied by k.
00:11:48.400 --> 00:11:51.400
So, every entry of A is multiplied by k.
00:11:51.400 --> 00:11:54.400
Notice that this is just like multiplying a vector by a scalar.
00:11:54.400 --> 00:12:00.700
If we have some vector, and we multiply it by a scalar, then that scalar multiplies on each of the components of the vector.
00:12:00.700 --> 00:12:03.300
It is scaling the vector; it is multiplying each of the components.
00:12:03.300 --> 00:12:08.400
So, if we have a scalar, and we multiply a matrix, that scalar multiplies each of the entries,
00:12:08.400 --> 00:12:13.900
because a matrix doesn't have components; it has entries, because we have to talk about every row.
00:12:13.900 --> 00:12:19.500
A vector is just a single row, but a matrix is many, so we talk about multiplying all of the entries.
00:12:19.500 --> 00:12:24.000
So, other than that distinction between entries or components, it is very much the same thing.
00:12:24.000 --> 00:12:27.100
A scalar on a vector multiplies each of its numbers.
00:12:27.100 --> 00:12:32.500
A scalar on a matrix multiplies each of its numbers--it is basically the same thing.
00:12:32.500 --> 00:12:39.000
So, let's look at a quick example: if we have 3 multiplying on the matrix 1, -4, 10; -19, -7, 20;
00:12:39.000 --> 00:12:43.500
then we have that 3 multiplies on the first row, first column;
00:12:43.500 --> 00:12:48.900
and that is going to get 3 times 1, which gets us 3; so the same location is now multiplied by 3.
00:12:48.900 --> 00:12:53.400
3 times -4 gets us -12; the same location is just multiplied by 3.
00:12:53.400 --> 00:13:03.200
3 times 10 gets us 30; 3 times -19 is -57; 3 times -17 is -21; 3 times 20 is 60; great.
00:13:03.200 --> 00:13:09.100
Matrix addition: given two matrices, A and B, that have the same order (they have to have the same order;
00:13:09.100 --> 00:13:14.600
otherwise it won't work--we will see why that is in just a second), we can add the two matrices together.
00:13:14.600 --> 00:13:23.300
So, A + B: every ith row, jth column of the resultant matrix will end up being a<font size="-6">i,j</font> + b<font size="-6">i,j</font>.
00:13:23.300 --> 00:13:28.800
That is to say, we are adding together entries that come from the same location.
00:13:28.800 --> 00:13:33.600
If this one was from this place over here, and this one was from this place over here, these two different numbers,
00:13:33.600 --> 00:13:38.300
we add them together, and that comes out to be that new place in our new matrix that we are creating.
00:13:38.300 --> 00:13:43.900
Note that this is very similar to adding vectors component-wise; it is very much the same thing as when we added vectors.
00:13:43.900 --> 00:13:47.900
If you add two vectors, you just take the first components, and you put them together;
00:13:47.900 --> 00:13:53.100
the second components--you put them together; the third components--you add them together, until you get through the entire vector.
00:13:53.100 --> 00:13:57.700
If we are doing it with a matrix, it is the same thing, except, instead of components, we now have to do it to each of the entries.
00:13:57.700 --> 00:14:04.800
So, first row, first column entries: you add them together; first row, second column entries--you add them together, until you get done with that row.
00:14:04.800 --> 00:14:10.000
Then second row, first column entries--you add them together; second row, second column entries--you add them together;
00:14:10.000 --> 00:14:13.700
second row, third column...etc., until you have made it through all of the rows and all of the columns.
00:14:13.700 --> 00:14:21.800
You take a given location; you put the things together from that location; that gives you the value for the same location in the new matrix.
00:14:21.800 --> 00:14:30.200
Let's look at an example: if we have the matrix 4, 8, -3, 7, and 1, 3, 3, 0, we take first row, first column in both of them,
00:14:30.200 --> 00:14:35.200
so 4 + 1; and that puts out 5 in the first row, first column of our new matrix.
00:14:35.200 --> 00:14:44.100
The same thing for first row, second column: 8 and 3 are in them, respectively: 8 + 3 becomes 11; first row, second column
00:14:44.100 --> 00:14:47.500
is the same location as what it just came from, in our new matrix.
00:14:47.500 --> 00:14:55.000
The same thing over here: -3 + 3 becomes 0; and finally, 7 + 0 becomes positive 7; great.
00:14:55.000 --> 00:15:00.600
So, we are keeping the location and adding them together, and that is what we get in our new matrix.
00:15:00.600 --> 00:15:05.300
Matrix multiplication: now, this one is going to be very different.
00:15:05.300 --> 00:15:09.200
The previous two made sense; they were a lot like what we were used to doing with vectors.
00:15:09.200 --> 00:15:14.000
You multiply everything with a scalar; you add based on location with addition.
00:15:14.000 --> 00:15:17.500
Matrix multiplication--this one is going to twist your brain a little bit.
00:15:17.500 --> 00:15:22.700
So, it is confusing at first; but the applications in a couple of lessons will hopefully make us see
00:15:22.700 --> 00:15:28.700
why we end up doing this kind of confusing thing, because there ends up being some purpose to this stuff.
00:15:28.700 --> 00:15:32.700
But for now, we are not going to really have a very good understanding of why that has to be the case.
00:15:32.700 --> 00:15:38.200
So, we just want to be careful and follow the rules precisely and pay close attention when you multiply matrices.
00:15:38.200 --> 00:15:44.200
It is really, really easy to make mistakes with multiplying matrices, especially the first couple of times you are doing it.
00:15:44.200 --> 00:15:46.500
So, you really have to be very careful and pay attention.
00:15:46.500 --> 00:15:50.000
So, just follow these rules carefully; it is going to be confusing at first, but don't worry.
00:15:50.000 --> 00:15:52.800
As we work through a bunch of examples, it will make a lot more sense.
00:15:52.800 --> 00:15:56.800
The formal definition, the first thing that we are going to see, is probably the most confusing thing of all.
00:15:56.800 --> 00:15:59.300
But as we see it in action, it will start to make a lot more sense.
00:15:59.300 --> 00:16:04.000
So, just work through it; you will end up understanding this by the time we get to the examples--no problem.
00:16:04.000 --> 00:16:11.300
All right, if we have some matrix A, and it is an m x n matrix, and B is an n x p matrix, we can multiply them together.
00:16:11.300 --> 00:16:18.700
Notice that the m here and the m here match up: there are m rows and n columns in our first matrix,
00:16:18.700 --> 00:16:23.900
and n rows, p columns in our second matrix; so the number of columns in the first matrix
00:16:23.900 --> 00:16:29.500
matches up with the number of rows in the second matrix; that is an important idea--it will come up later on.
00:16:29.500 --> 00:16:33.700
We can multiply them together, and we create a new matrix, AB.
00:16:33.700 --> 00:16:37.700
That is going to end up being m x p, the things that didn't match up.
00:16:37.700 --> 00:16:40.100
Or they could match up; but they don't have to match up.
00:16:40.100 --> 00:16:46.800
And we define AB as: AB, the ith row, jth column of AB becomes c<font size="-6">i,j</font>,
00:16:46.800 --> 00:16:53.600
where c<font size="-6">i,j</font> is equal to a<font size="-6">i,1</font>b<font size="-6">1,j</font> + a<font size="-6">i,2</font>b<font size="-6">2,j</font>,
00:16:53.600 --> 00:16:55.800
up until we get to a<font size="-6">i,n</font>b<font size="-6">n,j</font>.
00:16:55.800 --> 00:16:57.800
What does that mean? Let's look at that a little bit.
00:16:57.800 --> 00:17:08.900
a<font size="-6">i,1</font> is the ith row of A, first entry.
00:17:08.900 --> 00:17:15.300
The b<font size="-6">1,j</font> is the first entry of the jth column, because it is the first row, but in our jth column.
00:17:15.300 --> 00:17:21.800
So, it is the first entry; so it is the first entry, ith row, A; first entry, jth column, B.
00:17:21.800 --> 00:17:30.100
a<font size="-6">i,2</font> is second entry, ith row of A; and b<font size="-6">2,j</font> is second entry, jth column of B.
00:17:30.100 --> 00:17:32.500
So, we multiply those together; we add them together with the other ones.
00:17:32.500 --> 00:17:37.500
We keep doing this down the line, where it is the nth entry of ith row of A,
00:17:37.500 --> 00:17:40.700
and the nth entry of the jth column of B.
00:17:40.700 --> 00:17:45.400
Notice that the nth entry, in both of those cases, ends up being the last entry of that matrix.
00:17:45.400 --> 00:17:53.200
If A is an m x n matrix, then for our A right here, i,n, well, the ith row has to stop at the nth entry,
00:17:53.200 --> 00:17:56.000
because it only has n many columns to work its way through.
00:17:56.000 --> 00:18:00.700
The same thing with b<font size="-6">n,j</font>: the nth entry in the jth column has to stop there,
00:18:00.700 --> 00:18:04.000
because it has only n many rows to work through, to have things there.
00:18:04.000 --> 00:18:07.800
So, that ends up stopping; and they stop at the same place, which is useful.
00:18:07.800 --> 00:18:12.200
All right, so that is the entry c<font size="-6">i,j</font> of AB, the product of the two.
00:18:12.200 --> 00:18:18.800
The entry in its ith row and its jth column is the sum of the products
00:18:18.800 --> 00:18:23.600
of corresponding entries from A's ith row and B's jth column.
00:18:23.600 --> 00:18:29.300
So, we are looking at the ith row of our first one--our first matrix, A, its ith row--
00:18:29.300 --> 00:18:35.200
times the jth column of B, our second matrix.
00:18:35.200 --> 00:18:40.700
We are multiplying them together, based on first entries, second entries, third entries, fourth entries...
00:18:40.700 --> 00:18:43.800
We multiply them together, and then we add them all up together.
00:18:43.800 --> 00:18:50.300
And that ends up giving us the value for the resultant product matrix in its ith row and jth column.
00:18:50.300 --> 00:18:54.800
I know that it is confusing right now; it will make a lot more sense as soon as we start working on examples.
00:18:54.800 --> 00:19:04.600
So, we can see this visually as taking the ith row (this is the ith row of A),
00:19:04.600 --> 00:19:14.100
and then here--this would end up being the jth column of B.
00:19:14.100 --> 00:19:22.300
Our first matrix's ith row, times the second matrix's jth column: we multiply them together,
00:19:22.300 --> 00:19:27.300
where a<font size="-6">i,1</font> is multiplied times b<font size="-6">1,j</font>, plus a<font size="-6">i,2</font> times b<font size="-6">2,j</font>...
00:19:27.300 --> 00:19:32.700
The first entry here is multiplied times the first entry here; the second entry here, times the second entry here;
00:19:32.700 --> 00:19:38.600
the third entry here, times the third entry here.
00:19:38.600 --> 00:19:42.300
We multiply them all together like that; then we sum everything up.
00:19:42.300 --> 00:19:53.300
And that ends up producing c<font size="-6">i,j</font>, which is the ith row and jth column.
00:19:53.300 --> 00:19:55.200
All right, that is what we end up getting here.
00:19:55.200 --> 00:19:58.000
All right, we are ready for an example.
00:19:58.000 --> 00:20:04.200
Let's look at how we would find the entry in the first row and third column of the product from the matrices below.
00:20:04.200 --> 00:20:12.900
If we are looking for the first row, then that is going to be the first row of our first matrix, so 2, -1.
00:20:12.900 --> 00:20:23.300
Then, the third column: columns are going to come from the second matrix: so third column...1, 2, 3..the third column here: 5, 0.
00:20:23.300 --> 00:20:46.500
So, the first entries are 2 times 5; so that is 2 times 5, plus -1 times 0; that gets us 10, so 10 is what goes here in the first row and third column.
00:20:46.500 --> 00:20:49.800
That is what we end up getting; we end up getting this number 10.
00:20:49.800 --> 00:20:56.400
We are taking that first row, the third column; we are multiplying together in this strange way.
00:20:56.400 --> 00:21:03.700
We are adding up, and we are plugging that in for the entry in the matrix that we are creating.
00:21:03.700 --> 00:21:07.300
Now, notice that this bears some resemblance to dot products.
00:21:07.300 --> 00:21:11.900
We can think of this ith row as being a vector, because it just has a bunch of pieces to it.
00:21:11.900 --> 00:21:16.200
It has a bunch of components to it, since it is just one dimension in one way.
00:21:16.200 --> 00:21:19.900
It is just a vector in one way: 2 and then -1.
00:21:19.900 --> 00:21:24.900
And then, we have this jth column over here; we can think of this as also being a column vector.
00:21:24.900 --> 00:21:31.700
We have this vector here and this vector here; we are taking the dot product of them: 2, -1 dotted with 5,0.
00:21:31.700 --> 00:21:36.500
2 times 5 is 10; -1 times 0 is 0; so we get a total of 10.
00:21:36.500 --> 00:21:41.600
So, we can think of it as being the ith row, dotted with the jth column.
00:21:41.600 --> 00:21:46.800
If you think that is confusing--if you never really had a very good understanding of how dot products work in vectors--that is perfectly fine.
00:21:46.800 --> 00:21:50.800
Don't worry about that; just think of it in terms of multiplying and multiplying like this.
00:21:50.800 --> 00:21:53.900
But if the dot product stuff made a lot of sense to you in vectors,
00:21:53.900 --> 00:21:58.000
you can think of it as turning this row into a vector briefly, turning this column into a vector briefly,
00:21:58.000 --> 00:22:04.400
taking the dot product, and then moving on and doing the same thing with new vectors in a sort-of vector set.
00:22:04.400 --> 00:22:07.300
It is not exactly like vectors, because we are working inside of a matrix.
00:22:07.300 --> 00:22:15.400
But it is working very much under that same idea of multiplying based on location of entry, and then adding it all together.
00:22:15.400 --> 00:22:20.600
All right, let's work this whole thing out: we will use red to talk about everything that this first row is going to.
00:22:20.600 --> 00:22:22.300
What is the size of this going to come out to?
00:22:22.300 --> 00:22:27.400
First, let's figure that out, so we can draw in bars for where we are going to multiply.
00:22:27.400 --> 00:22:34.400
This is a 1, 2, 3...so it is a 3 x 2 matrix, because it has 2 columns.
00:22:34.400 --> 00:22:41.900
And this has 2 rows and 3 columns, so it is a 2 x 3 matrix; so the 2 and the 2 match up here,
00:22:41.900 --> 00:22:46.400
so it is going to end up coming out over here; our size is a 3 x 3 matrix.
00:22:46.400 --> 00:22:52.500
And that also makes sense, because in our first matrix, we have three rows; and in our second matrix, we have three columns.
00:22:52.500 --> 00:22:57.500
So, each of the things that will come out in our product is a way of putting a row and a column together.
00:22:57.500 --> 00:23:03.000
Three rows; three columns; they end up stacking into a 3 x 3 product matrix.
00:23:03.000 --> 00:23:08.200
All right, with that in mind, we know that what is going to have to come out of this is a 3 x 3 matrix.
00:23:08.200 --> 00:23:13.800
So, I will leave enough room, approximately, to put in a 3 x 3 matrix inside of there.
00:23:13.800 --> 00:23:22.100
The first one: the first row, first column, will give us the location that is the first row, first column in our product matrix.
00:23:22.100 --> 00:23:34.200
2 times 2 and -1 times -3, then added together: 2 times 2 is 4; -1 times -3 is positive 3; so 4 + 3 is 7.
00:23:34.200 --> 00:23:43.900
2, -1 on 1, 3 (first row on second column): 2 times 1 is 2; -1 times 3 is -3; add those together, and you get -1.
00:23:43.900 --> 00:23:50.200
2, -1 on 5, 0: 2 times 5 is 10; -1 times 0 is 0; so we get 10.
00:23:50.200 --> 00:23:55.000
So, there is our first row, after we have worked through all three columns.
00:23:55.000 --> 00:24:06.700
The next one; let's use a new color here: 3, 4 on 2, -3; 3 times 2 gets us 6; 4 times -3 gets us -12; so it comes out to -6.
00:24:06.700 --> 00:24:13.700
3, 4 on 1, 3; 3 times 1 is 3; 4 times 3 is 12; so that gets us 15 when we add them together.
00:24:13.700 --> 00:24:19.700
3, 4 on 5, 0; 3 times 5 is 15; 4 times 0 is still 0; so that totals to 15.
00:24:19.700 --> 00:24:34.500
The last one, the final color: 0, 5 on 2, -3; 0 times 2 is 0; 5 times -3 is -15; 0 times 1 is 0; 5 times 3 is +15;
00:24:34.500 --> 00:24:41.100
and 0 times 5 is 0; 5 times 0 is 0; 0; and that is our final result.
00:24:41.100 --> 00:24:50.800
So, we are working through, taking a row in our first matrix, then multiplying it against a column in our second matrix.
00:24:50.800 --> 00:24:57.200
And we are doing location of entry: first entries, second entries, third entries, fourth entries, as many as we have entries.
00:24:57.200 --> 00:25:01.300
We multiply the location of entries (first entries together, second entries together, third entries together...)--
00:25:01.300 --> 00:25:06.300
multiply based on that, and then sum up the whole thing; and that is what gets us what comes out
00:25:06.300 --> 00:25:09.800
as our product for that row number and that column number.
00:25:09.800 --> 00:25:14.800
It makes a lot more sense after you just end up working with it, after you end up getting some practice in.
00:25:14.800 --> 00:25:20.100
As soon as you start working on examples like this yourself, as soon as you do some practice homework, it will make a lot more sense.
00:25:20.100 --> 00:25:23.900
But we will also get the chance to work on another example a little bit later.
00:25:23.900 --> 00:25:30.100
All right, matrix multiplication and order: to multiply two matrices together, we have to first be sure that their orders are compatible.
00:25:30.100 --> 00:25:32.000
We have talked about this a little bit so far.
00:25:32.000 --> 00:25:38.000
The numbers of columns in the first matrix must equal the number of rows in the second matrix.
00:25:38.000 --> 00:25:43.800
The number of columns in the first matrix must be the same as the number of rows in the second matrix.
00:25:43.800 --> 00:25:49.600
And then, what comes out of it is this m x p; so AB<font size="-6">m x p</font>.
00:25:49.600 --> 00:25:58.500
So, we have n columns in our first matrix, times n rows in our second matrix.
00:25:58.500 --> 00:26:02.900
Why is this the case? We can just believe this rule, but let's also get a sense for why it is the case.
00:26:02.900 --> 00:26:21.900
Well, consider this: if I have, say, a 3 x 2 matrix (let's use red, so we can see how it matches here),
00:26:21.900 --> 00:26:28.700
and then we have something here, something here, something here, something here, something here, something here;
00:26:28.700 --> 00:26:34.500
notice that if you look at the length of any row, the length of any row is 2.
00:26:34.500 --> 00:26:38.700
The length of a row is based on how many columns you have, because each column is an entry.
00:26:38.700 --> 00:26:42.800
If we look at a row, then it is going to span all of those columns; so it is going to be a question
00:26:42.800 --> 00:26:46.600
of how many times it has something to go inside of the row.
00:26:46.600 --> 00:26:50.300
Well, that is going to be a question of how many columns are going through that row.
00:26:50.300 --> 00:26:55.500
So, the number of entries in a row is going to be based on the number of columns.
00:26:55.500 --> 00:27:04.200
Similarly, if we have a 2 x 3 matrix, then it is going to be 2 rows, 3 columns.
00:27:04.200 --> 00:27:08.600
If we grab some column, how many entries are going to be in the column?
00:27:08.600 --> 00:27:11.000
Well, it is how many rows it goes deep.
00:27:11.000 --> 00:27:17.600
So, the number of rows is going to tell us how many entries are in a given column.
00:27:17.600 --> 00:27:24.400
Now, the way matrix multiplication works is: it is this thing, the row, times this thing, the column.
00:27:24.400 --> 00:27:30.500
It is the row times the column; well, this whole thing has to be first entries against first entries,
00:27:30.500 --> 00:27:33.000
second entries against second entries, third entries against third entries...
00:27:33.000 --> 00:27:36.500
So, we have to have the number of entries match up.
00:27:36.500 --> 00:27:43.800
If we have a different length in the row than the column--they are different lengths, row versus column--we are not going to have them match up.
00:27:43.800 --> 00:27:49.700
This thing doesn't really make sense; so we are required...the idea of this is for the length here to match up to the length here.
00:27:49.700 --> 00:27:54.800
And that is why we have this requirement: because the length of a row is based on how many columns it has.
00:27:54.800 --> 00:27:57.900
The length of a column is based on how many rows it has.
00:27:57.900 --> 00:28:02.200
So, that is why we have to have these matching here.
00:28:02.200 --> 00:28:07.400
Otherwise, it won't make sense for the way we have this thing defined, because we will have something longer than the other thing;
00:28:07.400 --> 00:28:11.700
and what do you multiply by then?--because you don't have the same number of entries; it doesn't make any sense.
00:28:11.700 --> 00:28:16.300
When you take dot products with vectors, they have to have the same number of components for you to be able to take a dot product.
00:28:16.300 --> 00:28:19.400
It is sort of the same thing going on here.
00:28:19.400 --> 00:28:24.100
Matrix multiplication is not commutative; this is absolutely mind-blowing,
00:28:24.100 --> 00:28:28.800
because it is not something that we have seen anywhere else in math at this point, I am pretty sure.
00:28:28.800 --> 00:28:32.700
So, at this point, we probably want to know what it means to be commutative,
00:28:32.700 --> 00:28:36.000
before we try to understand matrices not being commutative.
00:28:36.000 --> 00:28:42.000
Let's look at that: commutative means that x times y is the same thing as y times x--
00:28:42.000 --> 00:28:46.000
that this operation from the left is the same thing as the operation from the right.
00:28:46.000 --> 00:28:53.200
x on the left of y is the same thing as x on the right of y; x times y equals y times x.
00:28:53.200 --> 00:28:58.500
It doesn't matter which direction that x multiplies from; you get the same thing out of it, at least in the real numbers.
00:28:58.500 --> 00:29:05.700
5 times 7 is the same thing as 7 times 5; 8 times -3 is the exact same thing as -3 times 8.
00:29:05.700 --> 00:29:08.800
So, that is something we are pretty used to that makes a lot of sense to us.
00:29:08.800 --> 00:29:11.500
It doesn't matter which direction you multiply from; it comes out to be the same thing.
00:29:11.500 --> 00:29:13.200
So, we have never had to worry about it.
00:29:13.200 --> 00:29:18.400
Well, it is time to start worrying about it: matrices are not commutative, in general.
00:29:18.400 --> 00:29:24.000
That is, for most matrices A and B, AB is not equal to BA.
00:29:24.000 --> 00:29:30.500
It is totally different if A multiplies on the left side, or if A multiplies on the right side; you will get totally different things.
00:29:30.500 --> 00:29:38.300
Now, there are some cases when AB will be equal to BA; it is not an absolute, hard-and-fast rule that AB can never equal BA.
00:29:38.300 --> 00:29:42.600
It is just like 99% of the time that AB will not be equal to BA.
00:29:42.600 --> 00:29:50.000
Given two random matrices, chances are that they are not going to end up being the same, depending on the order of multiplication.
00:29:50.000 --> 00:29:53.200
So, you have to pay attention to who is multiplying from which side.
00:29:53.200 --> 00:29:56.900
You will have totally different things, depending on changing the order of multiplication, usually.
00:29:56.900 --> 00:30:00.800
There are some cases where it won't be, but for the most part, they are totally different things.
00:30:00.800 --> 00:30:07.100
So, you can't rely on having x times y equal to y times x, because all of a sudden, it is not equal to the same thing.
00:30:07.100 --> 00:30:10.900
You are going to have to pay attention to the order that things are multiplying.
00:30:10.900 --> 00:30:12.900
Let's look at an example to really make this clear.
00:30:12.900 --> 00:30:22.400
If we have this first matrix, 4, 2, -3, 1, and 3, 0, -5, 2; then we know we are going to get a 2 x 2 matrix out of this, because they are both 2 x 2.
00:30:22.400 --> 00:30:28.800
So, 4, 2, 3, -5....4 times 3 gets us 12; 2 times -5 gets us -10; so that comes out to 2.
00:30:28.800 --> 00:30:46.200
4, 2 on 0, 2: 4 times 0 is 0; 2 times 2 is 4; -3 on 1...let's use a new color here; -3, 1 on 3, -5; -3 times 3 gets us -9; 1 times -5 gets us -5; so -14 total.
00:30:46.200 --> 00:30:53.900
-3, 1 on 0, 2; -3 times 0 is 0; 1 times 2 is 2; OK, so that is what that first matrix came out to be.
00:30:53.900 --> 00:30:57.400
What about this one here, where we flipped the order of multiplying them?
00:30:57.400 --> 00:31:04.900
We have 3, 0 on 4, -3 now; once again, it is going to come out as a 2 x 2 matrix: 3, 0 on 4, -3:
00:31:04.900 --> 00:31:09.500
3 times 4 is 12; 0 times -3 is 0; so we have 12.
00:31:09.500 --> 00:31:14.700
At this point, we already see that we are not the same; on the first one we did, that first multiplication,
00:31:14.700 --> 00:31:21.400
our first row, first column was 2; in the second one, our first row, first column, was 12.
00:31:21.400 --> 00:31:26.400
2 versus 12 is totally different; we know that these matrices cannot be the same anymore,
00:31:26.400 --> 00:31:30.000
because one of their entries is different, and that is enough to say that they are not equal.
00:31:30.000 --> 00:31:34.400
However, let's get a sense for just how different they are; let's look at the rest of this thing.
00:31:34.400 --> 00:31:42.100
3, 0...the first row, on the second column now...on 2, 1: 3 times 2 gets us 6; 0 times 1 gets us 0; so 6.
00:31:42.100 --> 00:31:50.700
-5, 2 on 4, -3; -5 times 4 is -20; 2 times -3 is -6; so -26.
00:31:50.700 --> 00:31:56.400
-5, 2 on 2, 1: -10 + 2 gets us -8.
00:31:56.400 --> 00:32:00.700
So, notice: these things are totally and utterly different.
00:32:00.700 --> 00:32:08.800
2, 4, -14, 2 is completely different than 12, 6, -26, -8.
00:32:08.800 --> 00:32:14.600
This is a case that really helps us see how different these things are.
00:32:14.600 --> 00:32:19.900
AB is not equal to BA in a single one of its entries; we get totally different things.
00:32:19.900 --> 00:32:25.300
So, the order of multiplication, if you are multiplying from the left or you are multiplying from the right--that really, really matters.
00:32:25.300 --> 00:32:29.400
And that is going to affect how we pay attention to doing matrix algebra in the next two lessons.
00:32:29.400 --> 00:32:31.000
That is something to think about later on.
00:32:31.000 --> 00:32:35.500
But for right now, you just have to be aware that AB and BA are totally different.
00:32:35.500 --> 00:32:38.000
Swapping the order of matrix multiplication means you have to do it again,
00:32:38.000 --> 00:32:41.700
because you have no idea what is going to come out of it until you actually work through it.
00:32:41.700 --> 00:32:45.800
All right, finally, we have two special matrices to talk about.
00:32:45.800 --> 00:32:53.000
First, the zero matrix: the zero matrix is a matrix that has--no big surprise--0 for all of its entries.
00:32:53.000 --> 00:32:55.500
A zero matrix can be made with any order at all.
00:32:55.500 --> 00:33:01.800
It is denoted by a 0 as bold; however, if you are writing it by hand, normally you can just tell by writing a zero;
00:33:01.800 --> 00:33:07.200
and people will know, from context, that that 0 is supposed to be a zero matrix, depending on how the problem is working.
00:33:07.200 --> 00:33:11.500
But if you really want to denote it, you could probably put some underlines underneath it, or something,
00:33:11.500 --> 00:33:16.700
to show that it is really important--whatever you want to be able to see that it is definitely a matrix.
00:33:16.700 --> 00:33:21.700
But for the most part, just writing a 0, if it is next to other matrices...people will know what you are talking about.
00:33:21.700 --> 00:33:30.000
If you need to show its order, you can write it with a subscript of m x n; that tells us that that zero matrix will have m rows, n columns.
00:33:30.000 --> 00:33:36.700
So, for example, if we had 3 x 3, then we have 3 rows and 3 columns of nothing but zeroes.
00:33:36.700 --> 00:33:42.800
If we have 5 x 2, then we have 5 rows and 2 columns of nothing but zeroes.
00:33:42.800 --> 00:33:49.400
For any matrix A, A - A comes out to be the zero matrix, because each of its entries will be subtracted
00:33:49.400 --> 00:33:53.500
by it entries again, so each entry will turn into a 0; we get the zero matrix.
00:33:53.500 --> 00:33:59.600
And also, the zero matrix, times A, equals the zero matrix, which is equal to A times the zero matrix.
00:33:59.600 --> 00:34:04.900
So, the zero matrix, multiplying on some other matrix, by the left or the right, turns it into the zero matrix.
00:34:04.900 --> 00:34:09.800
The zero matrix, through multiplication, crushes other matrices into the zero matrix.
00:34:09.800 --> 00:34:16.200
All right, finally: the identity matrix: the **identity matrix** is a square matrix
00:34:16.200 --> 00:34:24.600
(it is always going to be a square) that has 1 for all of its entries on the main diagonal, and 0 for other entries.
00:34:24.600 --> 00:34:27.400
It can be any order, as long as it is a square.
00:34:27.400 --> 00:34:33.300
It is denoted with the symbol I; so you just write that out like a normal capital I.
00:34:33.300 --> 00:34:37.100
If you need to show what its order is (and remember, its order is going to have to be n x n,
00:34:37.100 --> 00:34:40.300
because it has to have the same number of rows and columns; we can't have different numbers there),
00:34:40.300 --> 00:34:44.600
we can use just I with a subscript of n, because we don't have to say n x n,
00:34:44.600 --> 00:34:48.600
because it has to be square, so we just use one number, one letter.
00:34:48.600 --> 00:34:58.700
So, if we want to talk about Iā, then that would be a 2 x 2 matrix with 1's on the diagonal, and 0's everywhere else.
00:34:58.700 --> 00:35:03.900
If we want to talk about Iā
, the identity matrix as a 5 x 5, then that is 1's on this main diagonal,
00:35:03.900 --> 00:35:16.500
from the top left down to the bottom right; and it is going to be 0's everywhere else on the thing.
00:35:16.500 --> 00:35:23.600
Why is this identity matrix useful? For any matrix A, any matrix at all, as long as they match in orders appropriately,
00:35:23.600 --> 00:35:28.600
and there is always going to be some identity matrix that will match up appropriately with any given matrix,
00:35:28.600 --> 00:35:33.800
identity matrix A is equal to A, and A times the identity matrix is equal to A.
00:35:33.800 --> 00:35:40.100
The identity matrix, multiplied from the left, or the identity matrix, multiplied from the right, comes out to be
00:35:40.100 --> 00:35:43.100
just whatever matrix we had started with that wasn't the identity matrix.
00:35:43.100 --> 00:35:48.100
The identity matrix effectively works the same as multiplying a real number by 1.
00:35:48.100 --> 00:35:53.500
5 times 1 just comes out to be 5; -20 billion times 1 just comes out to be -20 billion.
00:35:53.500 --> 00:36:01.000
The identity matrix works the same way: I times A just comes out to be A; I times C just comes out to be C.
00:36:01.000 --> 00:36:05.900
So, whatever matrix we have, we multiply by the identity matrix; it is the multiplicative identity.
00:36:05.900 --> 00:36:12.200
It just leaves it as it normally was; it leaves its identity alone--it leaves it the same.
00:36:12.200 --> 00:36:14.100
All right, we are ready for some examples.
00:36:14.100 --> 00:36:20.200
First, a little bit of scalar multiplication: let's do the scalar multiplication, and then we will do the subtraction or addition.
00:36:20.200 --> 00:36:29.100
2 times 5, -7, 2, 11, 3, 4; its order stays the same, so 2 times 5 is 10; 2 times -7 is -14;
00:36:29.100 --> 00:36:36.100
2 times 2 is 4; 2 times 11 is 22; 2 times 3 is 6; and 2 times -4 is -8.
00:36:36.100 --> 00:36:41.700
So, at this point, I am going to change this into a plus, and I am going to say that we had -3 here.
00:36:41.700 --> 00:36:45.500
+ -3 times something is the same thing as -3 times something.
00:36:45.500 --> 00:36:48.800
We can pull that negative out and put it on the scalar instead.
00:36:48.800 --> 00:37:03.800
We do that here: -3 times 3 gets us -9; -3 times -2 gets us +6; -3 times 2 gets us -6; -3 times 6 gets us -18; -3 times 0 gets us 0; -3 times -5 gets us +15.
00:37:03.800 --> 00:37:08.800
At this point, we are ready to combine them: we combine the two things together.
00:37:08.800 --> 00:37:15.100
We do it based on location: so 10 and -9 will go in the first row, first column, because they came from the first row and first column.
00:37:15.100 --> 00:37:19.200
10 and -9 gets us 1; it is going to have the same order here.
00:37:19.200 --> 00:37:41.800
-14 and 6 gets us -8; -6 and 4 gets us -2; 22 and -18 gets us +4; 6 and 0 gets us +6; -8 and 15; and we have 7; and there is our matrix.
00:37:41.800 --> 00:37:45.400
All right, now we could have done this a different way.
00:37:45.400 --> 00:37:52.200
At this point up here, we chose to do plus onto a negative scale, but we could have left it with subtraction.
00:37:52.200 --> 00:37:59.000
If we had chosen to leave it as subtraction, our first matrix would have remained the same: 10, -14...
00:37:59.000 --> 00:38:03.200
still the same scalar, so nothing is going to change here from that first matrix.
00:38:03.200 --> 00:38:08.600
And now, it is going to be minus...we could multiply that scalar by it instead.
00:38:08.600 --> 00:38:16.800
So, we are going to leave it as a subtraction, but we are just going to multiply that +3 as if it wasn't changed over.
00:38:16.800 --> 00:38:28.000
So, 3 times 3 gets us 9; 3 times -2 gets us -6; 3 times 2 gets us +5; 3 times 6 gets us +18; 0; and -15.
00:38:28.000 --> 00:38:35.300
All right, notice: the only difference between these two matrices is this negative sign having hit everything.
00:38:35.300 --> 00:38:43.500
At this point, we can subtract, and we would end up having 10 - 9; 10 - 9 comes out to be 1.
00:38:43.500 --> 00:39:03.100
-14 - -6; well, - -6 becomes + 6; -14 + 6 becomes -8; 4 - 6 is -2; 22 - 18 is 4; 6 - 0 is 6; -8 - -15 becomes + 15; -8 + 15 becomes +7.
00:39:03.100 --> 00:39:05.600
So, we end up getting the exact same thing.
00:39:05.600 --> 00:39:09.700
Whichever way we do it ends up coming out to be the same thing, which is what we had hoped.
00:39:09.700 --> 00:39:19.500
I would, for the most part, recommend doing this method that I did here, where you make it addition, and you put the negative on the scalar.
00:39:19.500 --> 00:39:23.700
You swap it from being subtraction to addition, and then you put the negative on the scalar.
00:39:23.700 --> 00:39:27.000
And then, you multiply that through, because it gives you one less thing to have to keep track of,
00:39:27.000 --> 00:39:31.200
as opposed to having to remember the entire time, "I am subtracting; I am subtracting; I am subtracting,"
00:39:31.200 --> 00:39:35.300
because then, if you forget to subtract just once, your answer is gone; you now have the wrong answer.
00:39:35.300 --> 00:39:39.800
But if you put the negative on it there, then you remember to multiply by the negative the whole time through.
00:39:39.800 --> 00:39:41.700
And then, from there, it is just addition.
00:39:41.700 --> 00:39:45.900
I think it is easier that way; but if you think it would be easier by doing subtraction, go ahead and do that.
00:39:45.900 --> 00:39:48.500
Whatever works best for you is what you want to use.
00:39:48.500 --> 00:39:53.800
But I personally would recommend multiplying by the negative, and then doing addition, as opposed to keeping around subtraction.
00:39:53.800 --> 00:39:56.600
But they will both work just fine.
00:39:56.600 --> 00:40:02.500
The next example: A is this matrix; B is this matrix; C is this matrix; if the matrix multiplication below is possible,
00:40:02.500 --> 00:40:05.700
give the order, the size, of the matrix that it would result in.
00:40:05.700 --> 00:40:14.500
So, we have AB times B...OK, to do that, the first thing we are going to have to do is talk about what each one of these sizes are.
00:40:14.500 --> 00:40:20.600
If we have 3 rows, 2 columns, that is a 3 x 2 matrix for A.
00:40:20.600 --> 00:40:26.500
B is 2 columns, 3 rows, so that is a 2 x 3 matrix for B.
00:40:26.500 --> 00:40:32.700
And C is 3 rows, 3 columns; it is square, so we have a 3 x 2 matrix here.
00:40:32.700 --> 00:40:36.600
Great; so at this point, it is a question of comparing--do these things match up?
00:40:36.600 --> 00:40:50.300
AB is going to be 3 x 2, multiplying against a matrix that is 2 x 3.
00:40:50.300 --> 00:40:55.000
To do this, we have to have...the first one's number of columns has to match the second one's number of rows.
00:40:55.000 --> 00:40:58.500
But an easier way to do this is to just think in terms of the inner numbers.
00:40:58.500 --> 00:41:04.500
Are the inner numbers the same? Well, the inner numbers are both 2; so now, what is going to result is the outer numbers.
00:41:04.500 --> 00:41:10.100
We get those outer numbers as the resultant size of the matrix; so we will get a 3 x 3 matrix in the end.
00:41:10.100 --> 00:41:17.100
If we reversed this and looked at B times A, then we would have a 2 x 3 matrix times a 3 x 2 matrix.
00:41:17.100 --> 00:41:23.500
We check: are the inner numbers the same? 3 and 3 are the same, so it becomes the outer numbers; those will be our resultant.
00:41:23.500 --> 00:41:27.600
So, we will get a 2 x 2; so notice, AB and BA are very different in the end.
00:41:27.600 --> 00:41:30.200
And we can see that, just based on the fact that they have totally different orders.
00:41:30.200 --> 00:41:33.300
So, you can end up getting different sizes, as well, based on it.
00:41:33.300 --> 00:41:42.800
Not only are they not commutative (we can't rely on AB being the same thing as BA); we can't even rely on the size remaining the same.
00:41:42.800 --> 00:41:54.900
Next, let's look at C on B: that is a 3 x 3 times a 2 x 3; so in this case, do they match up?
00:41:54.900 --> 00:41:57.200
Does 2 match up with 3--are they the same number?
00:41:57.200 --> 00:42:00.500
No, they don't match up; so we have no solution here.
00:42:00.500 --> 00:42:13.700
A on C: a 3 x 2 matrix multiplied with a (sorry, I need to switch to green) 3 x 3 matrix--do they match up?
00:42:13.700 --> 00:42:19.500
3 and 2 don't match up; so we don't have anything that comes out of that, as a result.
00:42:19.500 --> 00:42:23.500
And finally, CAB: well, can we multiply multiple matrices together?
00:42:23.500 --> 00:42:27.800
Sure--we do one matrix multiplication; that comes out as another matrix; and then just multiply the resultant thing.
00:42:27.800 --> 00:42:40.300
So, let's see if we can work through this: CAB is a 3 x 3, multiplied by a 3 x 2, multiplied by a 2 x 3.
00:42:40.300 --> 00:42:43.500
So, our first question that we want to do...let's work from the left to the right.
00:42:43.500 --> 00:42:47.200
So, we will look at what CA became, and then we will multiply by B.
00:42:47.200 --> 00:42:56.100
So, CA...we have a 3 here; we have a 3 here; so that is going to result in a 3 x 2 (that is what CA would come out as),
00:42:56.100 --> 00:43:02.100
times B still (we have to do B), 2 x 3; so now we ask--do they match on the inside?
00:43:02.100 --> 00:43:07.800
They match on the inside, so what is going to result is a 3 x 3; there is our answer.
00:43:07.800 --> 00:43:11.500
Let's also look at it if we had gone from another direction--if instead of going from the left, we came from the right.
00:43:11.500 --> 00:43:16.300
We would hope that that would work out, because if it didn't, then there are some issues with how we have this stuff set up.
00:43:16.300 --> 00:43:25.100
So, let's look at CAB, if we had done CAB from the right side to the left.
00:43:25.100 --> 00:43:33.400
We have the same thing: a 3 x 3 is C; A is 3 x 2; and B is a 2 x 3.
00:43:33.400 --> 00:43:36.700
So now, we are working from the right side; so what does AB come out to be?
00:43:36.700 --> 00:43:39.400
Well, that is a 2 here and a 2 here, so that comes out to be 3.
00:43:39.400 --> 00:43:42.300
And look, we already did this--we already figured out what AB is.
00:43:42.300 --> 00:43:47.800
We know that that should come out to be a 3 x 3; so from there, we have a 3 x 3 matrix.
00:43:47.800 --> 00:43:58.500
And then, what came out of a AB is a 3 x 3 matrix; the 3's match up, so what we get in the end is a 3 x 3 matrix.
00:43:58.500 --> 00:44:01.600
So, that checks out; either way we did it, it is the same.
00:44:01.600 --> 00:44:13.900
One last thing to point out here: look, if we had a 3 x 3, if we had CAB one more time...a 3 x 2, and then a 2 x 3...
00:44:13.900 --> 00:44:18.100
well, what we can do is say, "Do the inner parts match?"
00:44:18.100 --> 00:44:20.800
The inner part here matches, and the inner parts here match.
00:44:20.800 --> 00:44:25.400
Ultimately, what is going to happen is that all of the inner parts are required to match for multiplication to happen.
00:44:25.400 --> 00:44:33.800
But they all disappear; the only thing that ends up making it out in the end is things on the far edges, the 3 and 3 on both sides.
00:44:33.800 --> 00:44:37.300
So, what is going to come out in the end is a 3 x 3.
00:44:37.300 --> 00:44:43.500
So, if you have multiple matrices multiplying against each other, you can just check and make sure that all of the inner numbers match up against each other.
00:44:43.500 --> 00:44:51.400
And then, the size of the resulting thing will end up just being the far edge numbers, which were, in this case, 3 and 3.
00:44:51.400 --> 00:44:55.500
All right, the next example is a big, big one of matrix multiplication.
00:44:55.500 --> 00:45:00.000
We are going to work to simplify this, so first, let's see what size our product is going to come out to be.
00:45:00.000 --> 00:45:05.300
So, we have a 3 x 3 and a 3 x 3; it is possible--no surprise there, since it was given to us as a problem.
00:45:05.300 --> 00:45:08.800
That is going to come out as a 3 x 3 matrix.
00:45:08.800 --> 00:45:16.500
At this point, let's work it out; since we are working with a 3 x 3 matrix, we will leave a nice, big chunk of space for us to work inside of.
00:45:16.500 --> 00:45:26.500
So, we are going to work this out: the first row times the first column will get the number that is going to go
00:45:26.500 --> 00:45:29.900
in our first row, first column of our resultant product matrix.
00:45:29.900 --> 00:45:39.500
So, 6 (the first entry of the first row), times the first entry of the first column, -2, added to 2
00:45:39.500 --> 00:45:49.000
(the second entry of the first row), times the second entry of our first column, plus 3 times the final entry,
00:45:49.000 --> 00:45:54.600
the third entry, of our first row, times the final of entry, the third entry, of our first column:
00:45:54.600 --> 00:46:05.200
we work that out; we get -12 + 8 - 3; we get -15 + 8, so we get -7.
00:46:05.200 --> 00:46:09.500
We have -7 for the entry--that first row, first column entry.
00:46:09.500 --> 00:46:11.900
That is what is going on behind the scenes.
00:46:11.900 --> 00:46:17.700
We are taking that row; we are taking that column; we are multiplying them based on how the entries multiply together,
00:46:17.700 --> 00:46:21.600
matching the entries, multiplying matching entries, and then summing up the whole thing.
00:46:21.600 --> 00:46:24.800
We can see that as I just wrote it out there.
00:46:24.800 --> 00:46:31.000
So, clearly, this takes a lot of arithmetic: we are doing three multiplications and three additions--it is tough to do this.
00:46:31.000 --> 00:46:37.800
I would recommend, if you aren't excellent at doing mental math: really try to keep some scratch paper that you are doing on the side.
00:46:37.800 --> 00:46:43.000
Be very, very careful working with your calculator; it is so easy to make mistakes in matrix multiplication,
00:46:43.000 --> 00:46:47.300
Especially the first couple of times you are doing it--it is something you really have to be careful with the first couple of times.
00:46:47.300 --> 00:46:50.800
And it is something you always have to be careful with, because you can always easily make mistakes.
00:46:50.800 --> 00:46:54.200
Even I will very easily make mistakes with matrix multiplication.
00:46:54.200 --> 00:46:58.900
But if you just stay focused and pay attention to these rules carefully, and you work carefully,
00:46:58.900 --> 00:47:00.800
you can always make sure that you get the answer right.
00:47:00.800 --> 00:47:03.500
But just really be careful with matrix multiplication.
00:47:03.500 --> 00:47:07.000
It is an easy place to make simple mistakes where you understand what is going on,
00:47:07.000 --> 00:47:11.200
but you just made a little arithmetic error, and it makes your answer wrong; so be careful.
00:47:11.200 --> 00:47:14.700
All right, I am going to do the rest of these by just working through them in my head and talking them out,
00:47:14.700 --> 00:47:18.800
because I am pretty good at this; but be careful when you are doing it.
00:47:18.800 --> 00:47:22.900
If you are not really good at doing this sort of stuff in your head, be careful; do it on scratch paper.
00:47:22.900 --> 00:47:25.600
And the larger the matrices get, the harder it is to do in your head.
00:47:25.600 --> 00:47:33.800
So, 6, 2, 3 on 1, 2, 0; the first row on the second column: 6 times 1 is 6; 2 times 2 is 4; 6 + 4 is 10.
00:47:33.800 --> 00:47:37.500
3 times 0 is 0; so we get 10.
00:47:37.500 --> 00:47:48.300
And then the final column: 6, 2, 3 on -3, 0, 1: 6 times -3 is -18; 2 times 0 is 0, so still -18; 3 times 1 is 3; so -18 + 3 is -15.
00:47:48.300 --> 00:47:53.900
The next one (let's switch to a new color): second row: 1, 0, -8; multiply that by the first row;
00:47:53.900 --> 00:48:01.300
so, second row, first column, is going to be 1, 0, -8 on -2, 4, -1; 1 times -2 is -2; 0 times 4 is 0;
00:48:01.300 --> 00:48:10.400
so, -2 + -8 times -2 becomes +8, so -2 + +8 becomes +6.
00:48:10.400 --> 00:48:21.000
The next one: 1, 0, -8 on 1, 2, 0; 1 times 1 is 1; 0 times 2 is 0; -8 times 0 is 0; so we just get 1 out of that.
00:48:21.000 --> 00:48:30.800
1, 0, -8 on -3, 0, 1; 1 times -3 is -3; 0 on 0 is 0; -8 times 1 is -8; so -3 + -8 becomes -11.
00:48:30.800 --> 00:48:46.800
And then finally, -7, 3, 5 on -2, 4, -1: -7 times -2 becomes +14; 3 times 4 becomes +12; 14 + 12 becomes +26;
00:48:46.800 --> 00:49:01.900
5 times -1 is -5; 26 - 5 is 21; OK; -7, 3, 5 on 1, 2, 0: -7 times 1 is -7; 3 times 2 is 6; -7 + 6 is -1; and then + 5 times 0,
00:49:01.900 --> 00:49:04.200
so we just come out to be -1 here.
00:49:04.200 --> 00:49:19.800
And then the final one: -7, 3, 5, on -3, 0, 1: -7 times -3 becomes +21; 3 times 0 is 0; +21 still; plus 5 times 1 is 5; 21 + 5 is 26.
00:49:19.800 --> 00:49:26.800
OK, so hopefully, that points out just how much arithmetic you are having to do in your head here.
00:49:26.800 --> 00:49:29.800
I really want you to be careful, because this is the easiest way to make mistakes.
00:49:29.800 --> 00:49:33.300
And it is the pretty silly way to end up losing points on a test or homework,
00:49:33.300 --> 00:49:35.100
because it is not because you don't understand what is going on.
00:49:35.100 --> 00:49:39.400
It is just because you are trying to do so much arithmetic in your head; it is easy to make a mistake.
00:49:39.400 --> 00:49:43.000
If you end up having any difficulty with something particularly hard, just write it out on paper.
00:49:43.000 --> 00:49:47.300
Or if you have a really nice graphing calculator, where you can see each of the numbers you are putting into it,
00:49:47.300 --> 00:49:51.500
be careful; watch; make sure that what you have there matches up to what you have on the paper.
00:49:51.500 --> 00:49:53.900
And then, make sure that you are being careful if you are using a calculator.
00:49:53.900 --> 00:49:56.200
So, just be careful, however you are approaching it.
00:49:56.200 --> 00:50:01.700
The actual process isn't that difficult, once you get used to it; but it is always going to be a real chance of making mistakes,
00:50:01.700 --> 00:50:04.200
just because there is so much arithmetic going on.
00:50:04.200 --> 00:50:12.300
All right, the final example: Prove that for any 2 x 2 matrix A, the zero matrix times A equals 0, and the identity matrix times A equals A.
00:50:12.300 --> 00:50:18.200
So, any 2 x 2 matrix A--it says "any," so that means we can't just use some 2 x 2 matrix.
00:50:18.200 --> 00:50:23.100
We can't actually put down numbers, because we have to be able to have this true for any 2 x 2 matrix.
00:50:23.100 --> 00:50:30.700
So, if we came up with some matrix, like 3, 1, 7, 47; well, maybe it happens to be true for that matrix.
00:50:30.700 --> 00:50:33.900
So, we have to figure out a way to be able to show that it is true for every matrix.
00:50:33.900 --> 00:50:39.600
We need to write about this in a general form, so we do the same thing that we have everything set up in, where we use variables,
00:50:39.600 --> 00:50:48.700
because if we have it as a, b, c, d, then any 2 x 2 matrix...we can just swap out a, b, c, d for actual numerical values,
00:50:48.700 --> 00:50:52.500
and we will have any 2 x 2 matrix--this will be true for any 2 x 2 matrix.
00:50:52.500 --> 00:50:55.800
So, we have that as an idea; so now we can just try multiplying.
00:50:55.800 --> 00:51:02.700
If this is going to work for this A here, a, b, c, d, that is a stand-in for any 2 x 2 matrix at all.
00:51:02.700 --> 00:51:07.800
So, if we can show that the zero matrix times this comes out to be 0 anyway, then it has to be true for all of them,
00:51:07.800 --> 00:51:12.500
because they are just going to end up swapping out the variables, a, b, c, d, for actual numbers.
00:51:12.500 --> 00:51:19.400
So, let's try this: the zero matrix times A = 0: well, if we have the zero matrix, then we are going to have 0, 0, 0, 0,
00:51:19.400 --> 00:51:24.300
because it is multiplying against a 2 x 2; our A is a, b, c, d.
00:51:24.300 --> 00:51:26.800
This is actually pretty easy matrix multiplication, thankfully.
00:51:26.800 --> 00:51:31.500
0 and 0 times a and c; look, that is going to crush it down to 0.
00:51:31.500 --> 00:51:35.200
We know that we are going to have to get a 2 x 2 matrix, because we started with 2 x 2 times 2 x 2.
00:51:35.200 --> 00:51:39.700
0, 0 on b, d: well, 0 times b and 0 times d--that comes out to be 0.
00:51:39.700 --> 00:51:43.200
0, 0 on a, c: 0 times a and 0 times c--that comes out to be 0.
00:51:43.200 --> 00:51:47.700
0, 0 on b, d: 0 times b and 0 times d--no surprise there--comes out to be 0.
00:51:47.700 --> 00:51:51.100
So, we see, because it has nothing but zeroes that we are multiplying by:
00:51:51.100 --> 00:51:53.400
whatever it is going to hit is going to get turned into a 0.
00:51:53.400 --> 00:51:59.000
So, that is why the zero matrix, multiplied by any matrix at all, ends up coming out to be the zero matrix.
00:51:59.000 --> 00:52:03.400
So, this checks out: and we can see that, if we had put it as the zero matrix,
00:52:03.400 --> 00:52:06.600
multiplying from the right as opposed to the left, basically the same thing is going to happen,
00:52:06.600 --> 00:52:11.800
because we are multiplying against, it is going to hit nothing but zeroes, so it is just going to get turned to 0's automatically.
00:52:11.800 --> 00:52:16.200
So, the zero matrix, multiplied against any matrix, becomes the zero matrix.
00:52:16.200 --> 00:52:20.200
Next, the identity matrix times A: let's show that that becomes A.
00:52:20.200 --> 00:52:25.600
The identity matrix: well, A is a 2 x 2, so that means that our identity matrix will have to also be a 2 x 2.
00:52:25.600 --> 00:52:29.300
So, 1's are on the main diagonal, with 0's everywhere else.
00:52:29.300 --> 00:52:36.500
1, 0, 0, 1; the main diagonal has 1's, and then everything else will have 0's (in this case, not many 0's).
00:52:36.500 --> 00:52:40.400
a, b, c, d: this will take a little bit more thought.
00:52:40.400 --> 00:52:50.100
1, 0 on a, c: 1 times a...we are going to have to get a 2 x 2, because we started with 2 2 x 2 matrices...
00:52:50.100 --> 00:52:55.500
1 times a comes out to be a; 0 times c becomes 0; so we have a.
00:52:55.500 --> 00:53:03.200
1, 0 on b, d: well, 1 times b comes out to be b; 0 times d comes out to be 0, so we get just b.
00:53:03.200 --> 00:53:09.300
0, 1 on a, c: 0 times a comes out to be 0; 1 times c comes out to be c.
00:53:09.300 --> 00:53:14.000
0, 1 on b, d: 0 times b comes out to be 0; 1 times d comes out to be d.
00:53:14.000 --> 00:53:16.200
That checks out; it ended up being the same thing.
00:53:16.200 --> 00:53:18.900
So, it is a little bit harder to see why the identity matrix is working;
00:53:18.900 --> 00:53:23.700
but basically, what it is doing is: when you multiply some other matrix by it,
00:53:23.700 --> 00:53:29.500
since it has just a 1 in one place, it is seeing what is at the same location over here.
00:53:29.500 --> 00:53:33.300
a is at the same location; b is at the same location; so they end up popping out.
00:53:33.300 --> 00:53:38.800
For this one down here, 0 and 1, it is seeing what is at the same location: c and d are there, so they get to pop out, as well.
00:53:38.800 --> 00:53:43.400
A similar thing ends up happening if you multiply the identity matrix from the right, instead of from the left.
00:53:43.400 --> 00:53:46.300
Try it out for yourself--take a look, if you are curious about seeing it.
00:53:46.300 --> 00:53:47.800
All right, that shows everything that we have.
00:53:47.800 --> 00:53:50.500
We have a pretty good understanding of how matrices work at this point.
00:53:50.500 --> 00:53:52.700
We are ready to go and see some of the cool things that we can start doing with them.
00:53:52.700 --> 00:53:55.900
So, we will talk about some new ideas in the next section, the next lesson.
00:53:55.900 --> 00:53:59.800
And then two lessons from now, we will see just how powerful these things can be
00:53:59.800 --> 00:54:04.900
for solving problems that would seem really difficult; we are going to turn them so easy so quickly.
00:54:04.900 --> 00:54:07.000
All right, we will see you at Educator.com later--goodbye!