Let's learn about matrices.
What do I mean when I say matrices?
Well, matrices is just the plural for matrix, which is
probably a word you're familiar with more because of
Hollywood than because of mathematics.
So what is a matrix?
Well, it's actually a pretty simple idea.
It's just a table of numbers, that's all a matrix is.
So let me draw matrix for you.
I don't like that toothpaste-colored blue, so
let me use another color.
So this is an example of a matrix.
I'm going to pick some random numbers out: 5, 1,
2, 3, 0, minus 5.
That is a matrix.
And all it is is a table of numbers.
And often times if you wanted to have a variable for a
matrix, you'd use a capital letter, so you could use a
capital A, and sometimes in some books, they make it extra
bold, so like a bold A would be a matrix.
And just a little bit of notation, so we would call
this matrix, just by convention, you would call
this a 2-by-3 matrix.
And sometimes they actually write it, 2 by 3, below the
bold letter they use to represent the matrix.
And what is 2 and what is 3?
Well, 2 is the number of rows.
We have one row, two rows, right?
This is a row.
And we have three columns: one, two, three.
So that's why it's called a 2-by-3 matrix.
If I said that B-- I'll do it extra bold-- if B is a 5-by-2
matrix, that means that B would have--- I'll just type
in numbers: 0, minus 5, 10.
So it has five rows and it has two columns, so it'll have
another column here.
So let's see, minus 10, 3, I'm just putting in random numbers
here-- 7, 2, pi.
That is a 5-by-2 matrix.
So I think you now have kind of a convention that all a
matrix is is a table of numbers.
You can represent it when you're doing
it in variable form.
You represent it as a boldface capital letter.
Sometimes you'd write a 2 by 3 there.
And, you can actually reference the
terms of the matrix.
So in this example, in the top example where we have matrix
A, if someone wanted to reference this element of the
matrix, so what is that?
That is in the second row.
It's in row 2 and it's in column 2, right?
This is column 1, this is column 2.
This is row 1, row 2.
So it's in the second row, second column.
So sometimes people will write that A, and they'll write 2
comma 2 is equal to 0.
Or sometimes they'll write it as a lowercase A 2 comma 2 is
equal to 0.
These are just the same thing.
I'm just doing this to expose you to the notation, because a
lot of this really is just notation.
So what is a 1 comma 3?
Well, that means we're in the first row, the third column.
First row, one, two, three, it's this value right here.
So that equals 2.
So this is just all notation of what a matrix is.
It's a table of numbers that can be represented this way
and we can represent it as different elements that way.
So you might be asking, Sal, well, that's nice.
A table of numbers with fancy words and fancy notations, but
what is it good for?
And that's the interesting point.
A matrix is just a data representation.
It's just a way of writing down data.
That's all it is.
it's a table of numbers, but it can be used to represent a
whole set of phenomenon.
And if soon. you're doing this in your Algebra I or your
Algebra II class, you're probably using it to represent
linear equations.
But we'll learn later-- and I'll do a whole set of videos
on applying matrices to a whole bunch
of different things.
But it can represent-- it's very powerful and if you're
doing computer graphics on a matrix, the elements can
represent pixels on your screen.
They can represent points in coordinate space.
They can represent-- who knows?
There's tons of things that they can represent.
But the important thing to realize is that a matrix, it's
not a natural phenomenon.
It's not like a lot of the mathematical concepts we've
been looking at.
It's a way to represent a mathematical concept or a way
of representing values, but you kind of have to define
what it's representing.
But let's put that on the back burner a little bit in terms
of what it actually represents.
Oh, my wife is here.
She's looking for our filing cabinet.
But anyway, back to what I was doing.
So let's put on the back burner what a matrix is
actually representing and let's learn the convention.
Because I think, at least initially, that tends to be
the hardest part.
How do you add matrices?
How do you multiply matrices?
How do you invert matrices?
How do you find the determinant of matrices?
All of those words might sound unfamiliar unless you've
already been confused by them in your algebra class.
I'm going to teach you all of those things first, which are
all just really human-defined conventions, and then later
on, I'll make a whole bunch of videos on the intuition behind
them and what they actually represent.
So let's get started.
So let's say I wanted to add these two matrices.
Let's say the first one-- and let me switch colors.
I'll do relatively small ones, just so as not to waste space.
Say I have the matrix 3, negative 1, 2 0.
Let's call that A, capital A.
Let's say matrix B, and I'm just making up numbers.
Matrix B is equal to minus 7, 2, 3, 5.
So my question to you is what is A-- so I'm doing it bold
like they do in the textbooks-- plus matrix B?
So I'm adding two matrices.
And once again, this is just human convention.
Someone defined how matrices add.
They could've defined it some other way, but they said we're
going to make matrices add the way I'm about to show you,
because it's useful for a whole set of phenomena.
So when you add two matrices, you essentially just add the
corresponding elements.
So how does that work?
Well, you add the element that is in row 1, column 1 to the
elements in row 1, column 1, right?
So it's 3 plus minus 7.
That'll be the 1, 1 element.
Then the row 1, column 2 element will be
minus 1 plus 2.
Let me put parentheses around them so you know these are
separate elements.
And you can guess how this keeps going.
This element will be 2 plus 3 and this last element
will be 0 plus 5.
So that equals 3 plus minus 7.
That is minus 4.
Minus 1 plus 2, that's 1.
2 plus 3 is 5, and 0 plus 5 is 5.
So there we have it.
That is how we humans have defined the
addition of two matrices.
And by this definition, you could imagine that this is
going to be the same thing as B plus A, right?
And remember, this is something we have to think
about because we're not adding numbers anymore.
You know 1 plus 2 is the same thing you is 2 plus 1, or you
know any two normal numbers, it doesn't matter what order
you add them in.
But with matrices, it's not completely obvious.
But when you define it in this way, it doesn't matter if we
do A plus B or B plus A, right?
If we did B plus A, this would just say negative 7 plus 3.
This would say 2 plus negative 1.
But it would come out to the same values.
That is matrix addition.
And you could imagine, matrix subtraction, it's essentially
the same thing.
Well, actually let me show you.
What would be A minus B?
Well, this is capital B with the matrix, so I'm making it
extra bold.
Well, that's the same thing as A plus minus 1 times B.
And what's B?
Well, B is minus 7, 2, 3, 5.
When you multiply a scalar, when you just multiply a
number times a matrix, you just multiply the number times
every one of it's elements.
So that equals A, matrix A, plus the matrix.
We just multiply this negative 1 times every element in here.
So 7, minus 2, minus 3, and 5.
And then we can do what we did up there.
And we know what A is, so this would equal-- A is up here, so
3 plus 7 is 10.
Negative 1 plus negative 2 is minus 3, 2 plus minus 3 is
minus 1, and 0 plus 5 is 5.
Now, you didn't even have to go through this
exercise right here.
You could have literally just subtracted these elements from
these elements, and you would have gotten the same value.
I did this because I wanted to show you also that multiplying
a scalar or just a value or a number times a matrix is just
multiplying that number times all of the
elements of the matrix.
And so by this definition of matrix
addition, what do we know?
Well, we know that both matrices have to be the same
size by this definition, the way we're adding.
So, for example, you could add these two matrices.
You could add 1, 2, 3, 4, 5, 6, 7, 8, 9 to this matrix, to
minus 10, minus 100, minus 1000-- I'm making up numbers--
1, 0, 0, 1, 0, 1.
You can add these two matrices, right?
Because they have the same number of rows and same number
of columns.
So for example, if you were to add them, the first term up
here would be 1 plus minus 10, so it would be minus 9.
2 plus minus 100 is minus 98.
I think you get the point.
You would have exactly nine elements and you would have
three rows and three columns.
But you could not add these two matrices.
You could not add-- Let me do it in a different color just
so it's different.
You could not add this blue.
You could not add this matrix: minus 3, 2 to the matrix 9, 7.
And why can you not add them?
Well, they don't have corresponding
elements to add up.
This is a one row by two column, this is 1 by 2, and
this is 2 by 1.
So they don't have the same dimensions so we can't add or
subtract these matrices.
And this is a side note, when a matrix has-- when one of its
dimensions is one-- so, for example, here you have one row
and multiple columns, this is actually called a row vector.
A vector is essentially a one-dimensional matrix where
one of the dimensions is one.
So this is a row vector, and similarly,
this is a column vector.
That's just a little extra terminology you should know.
If you take linear algebra and calculus, your professor might
use those terms and it's good to be familiar with it.
But anyway, I'm pushing 11 minutes, so I will continue
this in the next video.
See