In this video we'll talk about
matrix addition and subtraction,
as well as how to
multiply a matrix by a
number, also called Scalar Multiplication.
Let's start an example.
Given two matrices like these,
let's say I want to add them together.
How do I do that?
And so, what does addition of matrices mean?
It turns out that if you
want to add two matrices, what
you do is you just add
up the elements of these matrices one at a time.
So, my result of adding
two matrices is going to
be itself another matrix and
the first element again just by
taking one and four and
multiplying them and adding them together, so I get five.
The second element I get
by taking two and two
and adding them, so I get
four; three plus three
plus zero is three, and so on.
I'm going to stop changing colors, I guess.
And, on the right is open
five, ten and two.
And it turns out you can
add only two matrices that are of the same dimensions.
So this example is
a three by two matrix,
because this has 3
rows and 2 columns, so it's 3 by 2.
This is also a 3
by 2 matrix, and the
result of adding these two
matrices is a 3 by 2 matrix again.
So you can only add
matrices of the same
dimension, and the result
will be another matrix that's of
the same dimension as the ones you just added.
Where as in contrast, if you
were to take these two matrices, so this
one is a 3 by
2 matrix, okay, 3 rows, 2 columns.
This here is a 2 by 2 matrix.
And because these two matrices
are not of the same dimension,
you know, this is an error,
so you cannot add these
two matrices and, you know,
their sum is not well-defined.
So that's matrix addition.
Next, let's talk about multiplying matrices by a scalar number.
And the scalar is just a,
maybe a overly fancy term for,
you know, a number or a real number.
Alright, this means real number.
So let's take the number 3 and multiply it by this matrix.
And if you do that, the result is pretty much what you'll expect.
You just take your elements
of the matrix and multiply
them by 3, one at a time.
So, you know, one
times three is three.
What, two times three is
six, 3 times 3
is 9, and let's see, I'm
going to stop changing colors again.
Zero times 3 is zero.
Three times 5 is 15, and 3 times 1 is three.
And so this matrix is the
result of multiplying that matrix on the left by 3.
And you notice, again,
this is a 3 by 2
matrix and the result is
a matrix of the same dimension.
This is a 3 by
2, both of these are
3 by 2 dimensional matrices.
And by the way,
you can write multiplication, you know, either way.
So, I have three times this matrix.
I could also have written this
matrix and 0, 2, 5, 3, 1, right.
I just copied this matrix over to the right.
I can also take this matrix and multiply this by three.
So whether it's you know, 3
times the matrix or the
matrix times three is
the same thing and this thing here in the middle is the result.
You can also take a matrix and divide it by a number.
So, turns out taking
this matrix and dividing it by
four, this is actually the
same as taking the number
one quarter, and multiplying it by this matrix.
4, 0, 6, 3 and
so, you can figure
the answer, the result of
this product is, one quarter
times four is one, one quarter times zero is zero.
One quarter times six is,
what, three halves, about six over
four is three halves, and
one quarter times three is three quarters.
And so that's the results
of computing this matrix divided by four.
Vectors give you the result.
Finally, for a slightly
more complicated example, you can
also take these operations and combine them together.
So in this calculation, I
have three times a vector
plus a vector minus another vector divided by three.
So just make sure we know where these are, right.
This multiplication.
This is an example of
scalar multiplication because I am taking three and multiplying it.
And this is, you know, another
scalar multiplication.
Or more like scalar division, I guess.
It really just means one zero times this.
And so if we evaluate
these two operations first, then
what we get is this thing
is equal to, let's see,
so three times that vector is three,
twelve, six, plus
my vector in the middle which
is a 005 minus
one, zero, two-thirds, right?
And again, just to make
sure we understand what is going on here,
this plus symbol, that is
matrix addition, right?
I really, since these are
vectors, remember, vectors are special cases of matrices, right?
This, you can also call
this vector addition This
minus sign here, this is
again a matrix subtraction,
but because this is an
n by 1, really a three
by one matrix, that this
is actually a vector, so this is
also vector, this column.
We call this matrix a vector subtraction, as well.
OK?
And finally to wrap this up.
This therefore gives me a
vector, whose first element is
going to be 3+0-1,
so that's 3-1, which is 2.
The second element is 12+0-0, which is 12.
And the third element
of this is, what, 6+5-(2/3),
which is 11-(2/3), so
that's 10 and one-third
and see, you close this square bracket.
And so this gives me a
3 by 1 matrix, which is
also just called a 3
dimensional vector, which
is the outcome of this calculation over here.
So that's how you
add and subtract matrices and
vectors and multiply them by scalars or by row numbers.
So far I have only talked
about how to multiply matrices and
vectors by scalars, by row numbers.
In the next video we will
talk about a much more
interesting step, of taking
2 matrices and multiplying 2 matrices together.