Introduction to the inverse of a function

WEBVTT
Kind: captions
Language: en

00:00:00.610 --> 00:00:04.650
Let's say we have some function,
f, and it's a

00:00:04.650 --> 00:00:09.015
mapping from the set X to Y.

00:00:09.015 --> 00:00:14.520
So if I were to draw the set X
right there, that's my set X.

00:00:14.520 --> 00:00:18.640
If I were to draw the set
Y, just like that.

00:00:18.640 --> 00:00:21.740
We know, and I've done this
several videos ago, that a

00:00:21.740 --> 00:00:26.400
function just associates any
member of our set X-- so I

00:00:26.400 --> 00:00:30.960
have some member of my set
X there-- if I apply the

00:00:30.960 --> 00:00:33.240
function to it, or if we're
dealing with vectors, we can

00:00:33.240 --> 00:00:35.620
imagine instead of using the
word function, we would use

00:00:35.620 --> 00:00:36.730
the word transformation.

00:00:36.730 --> 00:00:37.880
But it's the same thing.

00:00:37.880 --> 00:00:41.550
We would associate with this
element, or this member of X,

00:00:41.550 --> 00:00:44.040
a member of Y.

00:00:44.040 --> 00:00:47.120
So that's why we call
it a mapping.

00:00:47.120 --> 00:00:50.010
When I apply this function--
I'll do it in a different

00:00:50.010 --> 00:00:57.850
color-- this little member of
X is associated with this

00:00:57.850 --> 00:01:00.720
member of Y.

00:01:00.720 --> 00:01:02.790
If this is right here,
this is a capital X.

00:01:05.360 --> 00:01:09.370
Let's say we call this a,
and let's call that b.

00:01:09.370 --> 00:01:15.840
We would say that the function
where a is a member of X and b

00:01:15.840 --> 00:01:21.860
is a member of Y, we would say
that f of a is equal to b.

00:01:21.860 --> 00:01:24.170
This is all a review of
everything that we've learned

00:01:24.170 --> 00:01:25.870
already about functions.

00:01:25.870 --> 00:01:27.580
Now I'm going to
define a couple

00:01:27.580 --> 00:01:29.610
of interesting functions.

00:01:29.610 --> 00:01:32.650
The first one-- I guess it's
really just one function, I

00:01:32.650 --> 00:01:35.030
said it's a couple-- but I'll
call it the identity function.

00:01:42.330 --> 00:01:43.150
This is a function.

00:01:43.150 --> 00:01:45.960
I'll just call it
a big capital I.

00:01:45.960 --> 00:01:48.150
This identity function
operates on some set.

00:01:48.150 --> 00:01:51.490
So let's say this is the
identity function on set X,

00:01:51.490 --> 00:01:56.150
and it's a mapping
from X to X.

00:01:56.150 --> 00:01:58.840
What's interesting about the
identity function is that if

00:01:58.840 --> 00:02:02.286
you give it some a that is a
member of X-- so lets say you

00:02:02.286 --> 00:02:05.980
give it that a-- the identity
function applied to that

00:02:05.980 --> 00:02:10.110
member of X, the identity
function of a, is going to be

00:02:10.110 --> 00:02:12.090
equal to a.

00:02:12.090 --> 00:02:14.760
So it literally just maps
things back to itself.

00:02:14.760 --> 00:02:17.430
So the identity function, if I
were draw it on this diagram

00:02:17.430 --> 00:02:19.500
right here, would
look like this.

00:02:19.500 --> 00:02:22.440
It would look like-- we pick a
nice suitable color-- it would

00:02:22.440 --> 00:02:23.090
look like this.

00:02:23.090 --> 00:02:24.910
It would just kind
of be a circle.

00:02:24.910 --> 00:02:26.500
It just points back
at the point that

00:02:26.500 --> 00:02:27.290
you started off with.

00:02:27.290 --> 00:02:30.150
It associates all points
with themselves.

00:02:30.150 --> 00:02:35.150
That's the identity function on
X, especially as it applies

00:02:35.150 --> 00:02:35.790
to the point a.

00:02:35.790 --> 00:02:39.300
If you apply it to some other
point in X, it would just

00:02:39.300 --> 00:02:41.940
refer back to itself.

00:02:41.940 --> 00:02:43.590
That's the identity
function on X.

00:02:43.590 --> 00:02:46.590
You could also have an identity
function on Y.

00:02:46.590 --> 00:02:51.180
So let's say that b
is a member of Y.

00:02:51.180 --> 00:02:53.340
So I drew b right there.

00:02:53.340 --> 00:02:56.300
Then the Y identity function--
so this would be that identity

00:02:56.300 --> 00:03:00.600
function on Y applied
to b-- would just

00:03:00.600 --> 00:03:01.855
refer back to itself.

00:03:05.450 --> 00:03:08.850
So that would be equal to b.

00:03:08.850 --> 00:03:12.600
This is the identity
function on Y.

00:03:12.600 --> 00:03:14.150
So you might say, hey
Sal, these are

00:03:14.150 --> 00:03:15.080
kind of silly functions.

00:03:15.080 --> 00:03:15.910
But we'll use them.

00:03:15.910 --> 00:03:20.010
They're actually at least a
useful notation to use as we

00:03:20.010 --> 00:03:21.080
progress through our

00:03:21.080 --> 00:03:23.570
explorations of linear algebra.

00:03:23.570 --> 00:03:25.440
But I'm going to make
a new definition.

00:03:25.440 --> 00:03:29.150
I'm going to say that a
function-- let me pick a nice

00:03:29.150 --> 00:03:34.650
color, pink-- I'm going to say
that a function, let me say f

00:03:34.650 --> 00:03:37.800
since we already established
it right over here.

00:03:37.800 --> 00:03:45.360
I'm going to say that f is
invertible, introducing some

00:03:45.360 --> 00:03:47.270
new terminology.

00:03:47.270 --> 00:03:50.883
f is invertible if and only
if the following is true.

00:03:54.100 --> 00:03:55.950
I could either write it with
these two-way arrows like

00:03:55.950 --> 00:03:59.890
that, or I could write it
as iff with two f's.

00:03:59.890 --> 00:04:02.770
That means that if this is true,
then this is true, and

00:04:02.770 --> 00:04:04.080
only if this is true.

00:04:04.080 --> 00:04:06.560
So this implies that, and
that implies this.

00:04:06.560 --> 00:04:10.290
So f is invertible-- I'm kind
of making a definition right

00:04:10.290 --> 00:04:23.080
here-- if and only if there
exists a function, I'll call

00:04:23.080 --> 00:04:24.650
it nothing just yet.

00:04:24.650 --> 00:04:26.710
I'll call it something
in a second.

00:04:26.710 --> 00:04:29.420
I'll write it as this f
with this negative 1

00:04:29.420 --> 00:04:31.020
superscript on it.

00:04:31.020 --> 00:04:35.000
So f is invertible if and only
if there exists a function f

00:04:35.000 --> 00:04:37.430
inverse-- well I guess I just
called it something.

00:04:42.750 --> 00:04:44.000
Let me do that in purple.

00:04:50.700 --> 00:04:55.860
Remember f is just a mapping
from X to Y.

00:04:55.860 --> 00:04:58.480
So this function, f inverse,
is going to be a

00:04:58.480 --> 00:05:01.760
mapping from Y to X.

00:05:01.760 --> 00:05:04.560
So I'm saying that f is
invertible if there exists a

00:05:04.560 --> 00:05:10.870
function, f inverse, that's a
mapping from Y to X such that

00:05:10.870 --> 00:05:18.860
if I take the composition of f
inverse with f, this is equal

00:05:18.860 --> 00:05:25.080
to the identity function
over X.

00:05:25.080 --> 00:05:26.730
So let's think about
what's happening.

00:05:26.730 --> 00:05:27.720
This is just part
of it actually.

00:05:27.720 --> 00:05:29.690
Let me just complete the
whole definition.

00:05:29.690 --> 00:05:41.950
This is true, this has to be
true, and the composition of f

00:05:41.950 --> 00:05:46.400
with the inverse function has
to be equal to the identity

00:05:46.400 --> 00:05:48.300
function over Y.

00:05:48.300 --> 00:05:50.270
So let's just think about
what's this saying.

00:05:50.270 --> 00:05:54.060
There's some function-- I'll
call it right now, this called

00:05:54.060 --> 00:06:06.500
the inverse of f-- and it's
a mapping from Y to X.

00:06:06.500 --> 00:06:07.850
Let me draw it up here.

00:06:07.850 --> 00:06:09.680
So f is a mapping from X to Y.

00:06:09.680 --> 00:06:10.260
We showed that.

00:06:10.260 --> 00:06:12.570
This is the mapping
of f right there.

00:06:12.570 --> 00:06:14.020
It goes in that direction.

00:06:14.020 --> 00:06:16.650
We're saying there has be some
other function, f inverse,

00:06:16.650 --> 00:06:19.390
that's a mapping from Y to X.

00:06:19.390 --> 00:06:20.370
So let's write it here.

00:06:20.370 --> 00:06:28.150
So f inverse is a mapping from Y
to X. f inverse, if you give

00:06:28.150 --> 00:06:33.340
me some value in set
Y, I go to set X.

00:06:33.340 --> 00:06:37.660
So this guy's domain is this
guy's codomain, and this guy's

00:06:37.660 --> 00:06:39.970
codomain is this guy's domain.

00:06:39.970 --> 00:06:40.480
Fair enough.

00:06:40.480 --> 00:06:41.770
But let's see what
it's saying.

00:06:41.770 --> 00:06:45.040
It's saying that the composition
of f inverse with

00:06:45.040 --> 00:06:47.510
f, has to be equal to
the identity matrix.

00:06:47.510 --> 00:06:52.490
So essentially it's saying if I
apply f to some value in X--

00:06:52.490 --> 00:06:55.050
right, if you think about
what's this composition

00:06:55.050 --> 00:06:58.130
doing-- this guy's going
from X to Y.

00:06:58.130 --> 00:07:01.050
This guy goes from Y to X.

00:07:01.050 --> 00:07:02.690
So let's think about what's
happening here.

00:07:05.266 --> 00:07:10.340
f is going from X to Y.

00:07:10.340 --> 00:07:14.090
Then f inverse is going
from Y to X.

00:07:14.090 --> 00:07:18.770
So this composition is going to
be a mapping from X to X,

00:07:18.770 --> 00:07:23.660
which the identity function
needs to do.

00:07:23.660 --> 00:07:24.730
It needs to go from X to X.

00:07:24.730 --> 00:07:26.220
They're saying this equals
the identity function.

00:07:26.220 --> 00:07:30.670
So that means when you apply f
on some value in our domain,

00:07:30.670 --> 00:07:34.750
so you go here, and then you
apply f inverse to that point

00:07:34.750 --> 00:07:38.160
over there, you go back to
this original point.

00:07:38.160 --> 00:07:45.700
So another way of saying this
is that f-- let me do it in

00:07:45.700 --> 00:07:50.980
another color-- the composition
of f inverse with

00:07:50.980 --> 00:08:01.650
f of some member of the set
X is equal to the identity

00:08:01.650 --> 00:08:05.050
function applied on that item.

00:08:05.050 --> 00:08:07.220
These two statements
are equivalent.

00:08:07.220 --> 00:08:09.920
So by definition, this
thing is going to be

00:08:09.920 --> 00:08:11.310
your original thing.

00:08:11.310 --> 00:08:15.380
Or another way of writing this
is that f inverse applied to f

00:08:15.380 --> 00:08:19.370
of a is going to
be equal to a.

00:08:19.370 --> 00:08:22.050
That's what this first
statement tells us.

00:08:22.050 --> 00:08:24.680
If you think of it visually,
it's saying you start with an

00:08:24.680 --> 00:08:29.050
a, you apply f to it, and you
get this value right here.

00:08:29.050 --> 00:08:30.520
That is f of a.

00:08:30.520 --> 00:08:33.620
I'm saying it equals b, or I
said it equalled b earlier on.

00:08:33.620 --> 00:08:36.130
Then if you apply this f
inverse-- and it doesn't

00:08:36.130 --> 00:08:39.640
always exist-- but if you apply
that f inverse to this

00:08:39.640 --> 00:08:43.179
function, it needs to
go back to this.

00:08:43.179 --> 00:08:46.755
By definition it needs to go
back to your original a.

00:08:46.755 --> 00:08:49.650
It has to be equivalent to just
doing this little closed

00:08:49.650 --> 00:08:53.800
loop right when I introduce you
to the identity function.

00:08:53.800 --> 00:08:57.080
Now that's what this statement
is telling us right here.

00:08:57.080 --> 00:09:00.940
The second statement is saying
look, if I apply f to f

00:09:00.940 --> 00:09:03.640
inverse, I'm getting the
identity function on Y.

00:09:03.640 --> 00:09:10.140
So if I start at some point in
Y right there, and I apply f

00:09:10.140 --> 00:09:16.880
inverse first, maybe
I go right here.

00:09:16.880 --> 00:09:20.400
Let's call that lowercase y So
this would be f inverse of

00:09:20.400 --> 00:09:21.910
lowercase y.

00:09:21.910 --> 00:09:26.380
Then if I were to apply f to
that-- I know this chart is

00:09:26.380 --> 00:09:29.690
getting very confusing-- if I
apply f to this right here, I

00:09:29.690 --> 00:09:32.870
need to go right back
to my original Y.

00:09:32.870 --> 00:09:37.010
So when I apply f to f inverse
of Y this has to be equivalent

00:09:37.010 --> 00:09:41.900
of just doing the identity
function on y.

00:09:41.900 --> 00:09:44.490
So that's what the second
statement is saying.

00:09:44.490 --> 00:09:51.130
Or another way to write it is
that f of f inverse of y,

00:09:51.130 --> 00:09:55.400
where y is a member of the
set capital Y, it has

00:09:55.400 --> 00:09:58.750
to be equal to Y.

00:09:58.750 --> 00:10:01.790
You've been exposed to the idea
of an inverse before.

00:10:01.790 --> 00:10:05.150
We're just doing it a little
bit more precisely because

00:10:05.150 --> 00:10:08.200
we're going to start dealing
with these notions with

00:10:08.200 --> 00:10:11.380
transformations and matrices
in the very near future.

00:10:11.380 --> 00:10:14.670
So it's good to be exposed to it
in this more precise form.

00:10:14.670 --> 00:10:18.230
Now the first thing you might
ask is let's say that I have a

00:10:18.230 --> 00:10:25.450
function f, and there does exist
a function f inverse

00:10:25.450 --> 00:10:29.850
that satisfies these
two requirements.

00:10:29.850 --> 00:10:31.100
So f is invertible.

00:10:35.040 --> 00:10:37.300
The obvious question, or maybe
it's not an obvious question

00:10:37.300 --> 00:10:45.100
is, is f inverse unique?

00:10:45.100 --> 00:10:46.790
Actually probably the obvious
question is how do you know

00:10:46.790 --> 00:10:47.780
when something's invertible.

00:10:47.780 --> 00:10:49.600
We're going to talk a
lot about that in

00:10:49.600 --> 00:10:50.530
the very near future.

00:10:50.530 --> 00:10:52.460
But let's say we know that
f is invertible.

00:10:52.460 --> 00:10:57.080
How do we know, or do we know
whether f inverse is unique?

00:10:57.080 --> 00:11:01.960
To answer that question, let's
assume it's not unique.

00:11:01.960 --> 00:11:05.500
So if it's not unique, let's say
that there's two functions

00:11:05.500 --> 00:11:08.930
that satisfy our two constraints
that can act as

00:11:08.930 --> 00:11:10.850
inverse functions of f.

00:11:10.850 --> 00:11:13.130
Let's say that g
is one of them.

00:11:13.130 --> 00:11:15.430
So let's say g is a mapping.

00:11:15.430 --> 00:11:19.330
Remember f is a mapping
from X to Y.

00:11:19.330 --> 00:11:27.850
Let's say that g is a mapping
from Y to X such that if I

00:11:27.850 --> 00:11:36.230
apply f to something and then
apply g to it-- so this gets

00:11:36.230 --> 00:11:37.850
me from X to Y.

00:11:37.850 --> 00:11:39.980
Then when I do the composition
with g, that gets

00:11:39.980 --> 00:11:41.480
me back into X.

00:11:41.480 --> 00:11:47.560
This is equivalent to the
identity function.

00:11:47.560 --> 00:11:50.430
This was part of the definition
of what it means to

00:11:50.430 --> 00:11:51.680
be an inverse.

00:11:53.810 --> 00:12:01.000
I'm assuming that g is
an inverse of f.

00:12:01.000 --> 00:12:03.370
This assumption implies
these two things.

00:12:07.010 --> 00:12:15.370
Now let's say that h is
another inverse of f.

00:12:21.560 --> 00:12:25.160
By definition, by what I just
called an inverse, h has to

00:12:25.160 --> 00:12:26.285
satisfy two requirements.

00:12:26.285 --> 00:12:28.760
It has to be a mapping
from Y to X.

00:12:28.760 --> 00:12:34.730
Then if I take the composition
of h with f, I have to get the

00:12:34.730 --> 00:12:37.940
identity matrix on the set X.

00:12:37.940 --> 00:12:39.510
Now that wasn't just part
of the definition.

00:12:39.510 --> 00:12:42.160
It implies even more
than that.

00:12:42.160 --> 00:12:45.490
If something is an inverse, it
has to satisfy both of these.

00:12:45.490 --> 00:12:47.430
The composition of the inverse
with the function has to

00:12:47.430 --> 00:12:49.610
become the identity
matrix on x.

00:12:49.610 --> 00:12:51.610
Then the composition of the
function with the inverse has

00:12:51.610 --> 00:12:55.610
to be the identity
function on Y.

00:12:55.610 --> 00:12:57.050
Let's write that.

00:12:57.050 --> 00:12:58.240
So g is an inverse of f.

00:12:58.240 --> 00:12:59.340
It implies this.

00:12:59.340 --> 00:13:03.670
It also implies-- I'll do
it in yellow-- that the

00:13:03.670 --> 00:13:08.470
composition of f with
g is equal to the

00:13:08.470 --> 00:13:10.630
identity function on y.

00:13:10.630 --> 00:13:14.560
Then if we do it with h, the
fact that h is an inverse of f

00:13:14.560 --> 00:13:19.180
implies that the composition
of f with h is equal to the

00:13:19.180 --> 00:13:23.210
identity function
on y as well.

00:13:23.210 --> 00:13:26.490
Let me redraw what I drew in the
beginning just so we know

00:13:26.490 --> 00:13:28.070
what we're doing.

00:13:28.070 --> 00:13:31.890
So if this is a set X right
here-- let me do it in a

00:13:31.890 --> 00:13:36.780
different color-- let's say this
right here is the set Y.

00:13:36.780 --> 00:13:39.640
We know that f is a
mapping X to Y.

00:13:44.130 --> 00:13:47.390
What we're trying to determine
is is f's inverse unique.

00:13:47.390 --> 00:13:50.440
So any inverse, so we're saying
that g is a situation

00:13:50.440 --> 00:13:52.960
that if you take the composition
of g with f, you

00:13:52.960 --> 00:13:54.130
get the identity matrix.

00:13:54.130 --> 00:13:55.530
So f does that.

00:13:55.530 --> 00:13:59.750
If you could take g
you're going to go

00:13:59.750 --> 00:14:01.020
back to the same point.

00:14:01.020 --> 00:14:02.450
So it's equivalent.

00:14:02.450 --> 00:14:04.830
So taking the composition of g
with f-- that means doing f

00:14:04.830 --> 00:14:10.670
first then g-- this is the
equivalent of just taking the

00:14:10.670 --> 00:14:13.430
identity function in X, so just
taking an X and going

00:14:13.430 --> 00:14:14.360
back to an X.

00:14:14.360 --> 00:14:15.210
It's equivalent to that.

00:14:15.210 --> 00:14:18.250
So this is g right here.

00:14:18.250 --> 00:14:20.430
The same thing is true with h.

00:14:20.430 --> 00:14:21.960
h should also be.

00:14:21.960 --> 00:14:25.590
If I start with some element in
X and go into Y, and then

00:14:25.590 --> 00:14:31.660
apply h, it should also be
equivalent to the identity

00:14:31.660 --> 00:14:32.400
transformation.

00:14:32.400 --> 00:14:37.000
That's what this statement and
this statement are saying.

00:14:37.000 --> 00:14:40.580
Now this statement is saying
that if I start with some

00:14:40.580 --> 00:14:45.620
entry in Y here and I apply g,
which is the inverse of f, I'm

00:14:45.620 --> 00:14:47.210
going to go here.

00:14:47.210 --> 00:14:49.340
So g will take me there.

00:14:49.340 --> 00:14:57.700
When I apply f then to that, I'm
going to go back to that

00:14:57.700 --> 00:14:59.560
same element of Y.

00:14:59.560 --> 00:15:00.970
That's equivalent to
just doing the

00:15:00.970 --> 00:15:03.930
identity function on Y.

00:15:03.930 --> 00:15:06.520
That's the same thing as the
identity function of Y.

00:15:06.520 --> 00:15:08.140
I could do the same
thing here with h.

00:15:08.140 --> 00:15:11.410
I just take a point here, apply
h, then apply f back.

00:15:11.410 --> 00:15:13.360
I should just go back
to that point.

00:15:13.360 --> 00:15:14.980
That's all of what
this is saying.

00:15:14.980 --> 00:15:16.570
So let's go back to
the question of

00:15:16.570 --> 00:15:19.330
whether g is unique.

00:15:19.330 --> 00:15:23.680
Can we have two different
inverse functions g and h?

00:15:23.680 --> 00:15:26.660
So let's start with g.

00:15:26.660 --> 00:15:32.240
Remember g is just a mapping
from Y to X.

00:15:32.240 --> 00:15:35.130
So this is going to be equal to,
this is the same thing as

00:15:35.130 --> 00:15:38.460
the composition of the identity

00:15:38.460 --> 00:15:42.220
function over x with g.

00:15:42.220 --> 00:15:45.180
To show you why that's the case,
remember g just goes

00:15:45.180 --> 00:15:50.130
from-- these diagrams get me
confused very quickly-- so

00:15:50.130 --> 00:15:53.670
let's say this is
x and this is y.

00:15:53.670 --> 00:15:58.130
Remember g is a mapping
from y to x.

00:15:58.130 --> 00:16:00.220
So g will take us there.

00:16:00.220 --> 00:16:02.090
There's a mapping from y to x.

00:16:02.090 --> 00:16:06.060
I'm saying that this g is
equivalent to the identity

00:16:06.060 --> 00:16:07.540
mapping, or the identity
function in

00:16:07.540 --> 00:16:08.420
composition with this.

00:16:08.420 --> 00:16:11.020
Because all this is saying is
you apply g, and then you

00:16:11.020 --> 00:16:13.440
apply the identity
mapping on x.

00:16:13.440 --> 00:16:16.270
So obviously you're going to get
to the exact same mapping

00:16:16.270 --> 00:16:17.920
or the exact same point.

00:16:17.920 --> 00:16:19.390
So these are equivalent.

00:16:19.390 --> 00:16:22.020
But what is another
way of writing the

00:16:22.020 --> 00:16:23.840
identity mapping on x?

00:16:23.840 --> 00:16:26.010
What's another way
of writing that?

00:16:26.010 --> 00:16:28.310
Well by definition, if
h is another inverse

00:16:28.310 --> 00:16:30.440
of f, this is true.

00:16:30.440 --> 00:16:34.010
So I can replace this in this
expression with a composition

00:16:34.010 --> 00:16:35.500
of h with f.

00:16:35.500 --> 00:16:39.680
So this is going to be equal to
the composition of h with

00:16:39.680 --> 00:16:43.770
f, and the composition
of that with g.

00:16:43.770 --> 00:16:45.850
You might want to put
parentheses here.

00:16:45.850 --> 00:16:47.490
I'll do it very lightly.

00:16:47.490 --> 00:16:49.110
You might want to put
parentheses there.

00:16:49.110 --> 00:16:51.450
But I showed you a couple
of videos ago that the

00:16:51.450 --> 00:16:54.610
composition of functions, or
of transformations, is

00:16:54.610 --> 00:16:55.330
associative.

00:16:55.330 --> 00:16:57.430
It doesn't matter if you put
the parentheses there or if

00:16:57.430 --> 00:16:58.250
you put the parentheses there.

00:16:58.250 --> 00:16:59.070
Actually I'll do that.

00:16:59.070 --> 00:17:01.160
I'll put the parentheses there
at first just so you can

00:17:01.160 --> 00:17:03.990
understand that this
is the same thing

00:17:03.990 --> 00:17:05.190
as that right there.

00:17:05.190 --> 00:17:07.440
But we know that composition
is associative.

00:17:07.440 --> 00:17:10.849
So this is equal to the
composition of h with the

00:17:10.849 --> 00:17:13.920
composition of f and g.

00:17:13.920 --> 00:17:19.470
Now what is this equal to, the
composition of f and g?

00:17:19.470 --> 00:17:22.109
Well it's equal to, by
definition, it's equal to the

00:17:22.109 --> 00:17:24.695
identity transformation
over y.

00:17:24.695 --> 00:17:31.500
So this is equal to h composed
with, or the composition of h

00:17:31.500 --> 00:17:37.260
with, the identity function over
y with this right here.

00:17:37.260 --> 00:17:39.020
Now what is this going to be?

00:17:39.020 --> 00:17:42.010
Remember h is a mapping
from y to x.

00:17:42.010 --> 00:17:43.830
Let me redraw it.

00:17:43.830 --> 00:17:47.505
So that's my x and
that is my y.

00:17:47.505 --> 00:17:50.680
h could take some element
in y and gives me

00:17:50.680 --> 00:17:51.930
some element in x.

00:17:55.450 --> 00:17:58.400
If I take the composition of the
identity in y-- so that's

00:17:58.400 --> 00:18:02.270
essentially I take some element,
let me do it this

00:18:02.270 --> 00:18:05.410
way-- I take some element in
y, I apply the identity

00:18:05.410 --> 00:18:07.930
function, which essentially
just gives me that element

00:18:07.930 --> 00:18:10.940
again, and then I
apply h to that.

00:18:10.940 --> 00:18:14.720
That's the same thing as just
applying h to the function to

00:18:14.720 --> 00:18:17.690
begin with.

00:18:17.690 --> 00:18:20.360
So just going through this
little exercise we've shown,

00:18:20.360 --> 00:18:22.510
even though we started off
saying I have these two

00:18:22.510 --> 00:18:25.690
different inverses, we've
just shown that g

00:18:25.690 --> 00:18:27.970
must be equal to h.

00:18:27.970 --> 00:18:30.770
So any function has
a unique inverse.

00:18:30.770 --> 00:18:33.030
You can't set up two
different inverses.

00:18:33.030 --> 00:18:35.180
If you do you'll find that
they're always going to be

00:18:35.180 --> 00:18:36.170
equal to each other.

00:18:36.170 --> 00:18:39.310
So far we know what
an inverse is.

00:18:39.310 --> 00:18:42.350
We don't know what causes
someone to be able to have an

00:18:42.350 --> 00:18:45.660
inverse or not, but we know if
they have an inverse, how to

00:18:45.660 --> 00:18:46.910
think about it.

00:18:49.010 --> 00:18:52.730
We also know that that
inverse is unique.


Distributive property of matrix products

WEBVTT
Kind: captions
Language: en

00:00:00.000 --> 00:00:06.680
Let's say we have three
matrices, A, B, and C.

00:00:06.680 --> 00:00:12.850
And let's say that B and C are
both m by n matrices, and that

00:00:12.850 --> 00:00:17.280
A is a, let's call it
a k by m matrix.

00:00:17.280 --> 00:00:20.830
And what I want to do is figure
out whether matrix

00:00:20.830 --> 00:00:23.730
products exhibit the
distributive property.

00:00:23.730 --> 00:00:28.340
So let's test out A
times B plus C.

00:00:32.610 --> 00:00:34.480
And of course these
are all matrices.

00:00:34.480 --> 00:00:38.770
So B, just to make things clear,
the matrix B could be

00:00:38.770 --> 00:00:44.080
represented as just a bunch of
column vectors, B1, B2, all

00:00:44.080 --> 00:00:46.030
the way to Bn.

00:00:46.030 --> 00:00:48.630
And the matrix C can also be
represented as just a bunch of

00:00:48.630 --> 00:00:49.160
column vectors.

00:00:49.160 --> 00:00:50.860
So could the matrix A,
but I don't have to

00:00:50.860 --> 00:00:52.410
draw that just yet.

00:00:52.410 --> 00:00:54.410
So the matrix C could just be
represented as a bunch of

00:00:54.410 --> 00:00:59.090
column vectors, C1, C2,
all the way to Cn.

00:00:59.090 --> 00:01:00.270
Maybe I should've drawn
this taller.

00:01:00.270 --> 00:01:03.200
These are column vectors, so
they actually have some

00:01:03.200 --> 00:01:04.510
verticality to them.

00:01:04.510 --> 00:01:06.030
I think you've seen that
multiple times.

00:01:06.030 --> 00:01:08.830
So what is A times B plus C?

00:01:08.830 --> 00:01:10.760
Well, let's figure out
what B plus C is.

00:01:10.760 --> 00:01:15.590
This is equal to A
times B plus C.

00:01:15.590 --> 00:01:18.450
When you add B plus C, the
definition of matrix addition

00:01:18.450 --> 00:01:20.810
is, you just add the
corresponding columns.

00:01:20.810 --> 00:01:23.030
Which essentially boils
down to adding the

00:01:23.030 --> 00:01:25.040
corresponding entries.

00:01:25.040 --> 00:01:31.380
So the first column is going
to be equal to B1 plus C1.

00:01:31.380 --> 00:01:35.770
The second column is going
to be B2 plus C2.

00:01:35.770 --> 00:01:37.850
And you're going to go all the
way to the nth column.

00:01:37.850 --> 00:01:42.610
It's going to be Bn plus Cn.

00:01:42.610 --> 00:01:48.940
Now by our definition of
matrix-matrix products, this

00:01:48.940 --> 00:01:54.880
product right here is going to
be equal to the matrix, where

00:01:54.880 --> 00:01:57.980
we take the matrix A and
multiply it by each of the

00:01:57.980 --> 00:02:02.460
column vectors of this matrix
here, of B plus C.

00:02:02.460 --> 00:02:04.680
Which as you can imagine,
these are both m by n.

00:02:04.680 --> 00:02:07.250
In fact they both have to have
the same dimensions for this

00:02:07.250 --> 00:02:09.100
addition to be well defined.

00:02:09.100 --> 00:02:11.360
So this is going to be
an m by n matrix.

00:02:11.360 --> 00:02:14.170
I already you told you
that A is a k by m.

00:02:14.170 --> 00:02:16.750
And we know this is well defined
because A has the same

00:02:16.750 --> 00:02:21.190
number of columns as B
plus C has of rows.

00:02:21.190 --> 00:02:22.450
So this is well defined.

00:02:22.450 --> 00:02:26.220
And this is going to be equal
to-- let me switch colors

00:02:26.220 --> 00:02:35.720
again-- A times the column
vector B1 plus C1.

00:02:35.720 --> 00:02:39.030
The second column is going to
be A times the column vector

00:02:39.030 --> 00:02:41.580
B2 plus C2.

00:02:41.580 --> 00:02:42.790
I'm running out of space.

00:02:42.790 --> 00:02:45.740
This is going to be all the
way to A times the column

00:02:45.740 --> 00:02:49.950
vector Bn plus Cn.

00:02:49.950 --> 00:02:54.040
This is our definition of
matrix-matrix products.

00:02:54.040 --> 00:02:57.560
You just take the first matrix
and you multiply it times each

00:02:57.560 --> 00:02:59.660
of the column vectors of
the second matrix.

00:02:59.660 --> 00:03:03.150
And we can say that because
we've already defined

00:03:03.150 --> 00:03:05.420
matrix-vector products.

00:03:05.420 --> 00:03:08.015
So what is this thing on
the right equal to?

00:03:08.015 --> 00:03:11.280
I'll keep switching colors.

00:03:11.280 --> 00:03:13.850
We know that matrix-vector
products exhibit the

00:03:13.850 --> 00:03:14.850
distributive property.

00:03:14.850 --> 00:03:16.900
I don't even remember when
I did that video.

00:03:16.900 --> 00:03:18.200
But we've assumed
it for a while.

00:03:18.200 --> 00:03:20.990
It's a very trivial
thing to prove.

00:03:20.990 --> 00:03:23.650
So each of these columns is
going to be equal to, let me

00:03:23.650 --> 00:03:25.380
write this way.

00:03:25.380 --> 00:03:27.340
This guy right here
can be re-written.

00:03:27.340 --> 00:03:31.050
The first column is going to be
A times column vector B1,

00:03:31.050 --> 00:03:36.520
plus A times the column
vector C1.

00:03:36.520 --> 00:03:38.430
This term right there
is the same thing as

00:03:38.430 --> 00:03:39.320
that term right there.

00:03:39.320 --> 00:03:44.840
The next one is going to
be AB2 plus matrix A

00:03:44.840 --> 00:03:46.910
times the vector C2.

00:03:46.910 --> 00:03:49.870
And then the nth column is going
to be the matrix-- keep

00:03:49.870 --> 00:03:56.760
going-- A times the column
vector Bn, plus matrix A times

00:03:56.760 --> 00:03:58.360
the column vector C.

00:04:03.230 --> 00:04:04.550
Just like that.

00:04:04.550 --> 00:04:08.780
Now we can write this
matrix as the sum of

00:04:08.780 --> 00:04:10.190
two different matrices.

00:04:10.190 --> 00:04:12.590
So what is this going
to be equal to?

00:04:12.590 --> 00:04:17.390
This is equal to-- let me see,
I'll just write it right

00:04:17.390 --> 00:04:28.830
here-- AB1 as the first column,
AB2 as the second

00:04:28.830 --> 00:04:32.400
column, all the way to ABn
as the third column.

00:04:32.400 --> 00:04:35.370
So that's these terms
right there.

00:04:35.370 --> 00:04:41.030
And then if I were to add to
that the matrix A times vector

00:04:41.030 --> 00:04:44.620
C1, A times the column vector
C2-- these are just the

00:04:44.620 --> 00:04:47.940
different columns of this
matrix-- and we just then have

00:04:47.940 --> 00:04:51.840
the matrix A times the
column vector Cn.

00:04:51.840 --> 00:04:54.160
These represent these terms.

00:04:54.160 --> 00:04:56.870
So clearly if I add these two
matrices, I just add the

00:04:56.870 --> 00:04:58.810
corresponding column vectors
and I'll get

00:04:58.810 --> 00:05:00.500
this matrix up here.

00:05:00.500 --> 00:05:03.490
But what is this equal to?

00:05:03.490 --> 00:05:07.780
This right here, by definition,
this is the matrix

00:05:07.780 --> 00:05:10.870
A times the matrix B.

00:05:10.870 --> 00:05:14.070
The definition of matrix
products is you take the first

00:05:14.070 --> 00:05:16.550
matrix and multiply times
the column vectors

00:05:16.550 --> 00:05:18.030
of the second matrix.

00:05:18.030 --> 00:05:22.390
And by the same argument, I
guess you could say, this is

00:05:22.390 --> 00:05:25.230
equivalent to A times C.

00:05:25.230 --> 00:05:27.250
And all of this-- remember we
just had a bunch of equal

00:05:27.250 --> 00:05:30.380
signs-- is equal to
A times B plus C.

00:05:30.380 --> 00:05:34.080
So now we can say definitively
that as long as the products

00:05:34.080 --> 00:05:36.340
are well defined and the sums
are well difined, so they all

00:05:36.340 --> 00:05:41.090
have to have the correct
dimensions, that A times B

00:05:41.090 --> 00:05:49.100
plus C is equal to AB plus AC.

00:05:49.100 --> 00:05:52.910
So matrix products do exhibit
the distributive property, at

00:05:52.910 --> 00:05:54.350
least in this direction.

00:05:54.350 --> 00:05:57.550
And I say that because remember
matrix products are

00:05:57.550 --> 00:05:58.490
not commutative.

00:05:58.490 --> 00:06:04.400
So we don't know necessarily
that B plus C times A is

00:06:04.400 --> 00:06:05.060
equivalent to that.

00:06:05.060 --> 00:06:07.510
In fact, most of the time
these two things are not

00:06:07.510 --> 00:06:08.000
equivalent.

00:06:08.000 --> 00:06:11.610
So we don't know quite yet
that if we reversed this,

00:06:11.610 --> 00:06:13.090
whether it's still going
to exhibit the

00:06:13.090 --> 00:06:14.230
distributive property.

00:06:14.230 --> 00:06:16.770
So let's try to do that.

00:06:16.770 --> 00:06:18.850
And I'll do it a little bit
quicker, because I think you

00:06:18.850 --> 00:06:21.162
know the general
argument here.

00:06:21.162 --> 00:06:25.820
So let's take B plus
C times A.

00:06:25.820 --> 00:06:28.700
And I'll just write A as
its column vectors.

00:06:28.700 --> 00:06:34.540
A1, A2, all the way to-- A has
m columns if I remember

00:06:34.540 --> 00:06:38.540
correctly, right A has
m columns-- so

00:06:38.540 --> 00:06:42.550
all the way to Am.

00:06:42.550 --> 00:06:46.830
And by the definition of matrix
products, this is going

00:06:46.830 --> 00:06:51.570
to be equal to the matrix--
B plus C is

00:06:51.570 --> 00:06:52.600
just a matrix, right?

00:06:52.600 --> 00:06:54.450
We can represent it as the
sum of two matrix, but

00:06:54.450 --> 00:06:55.840
it is just a matrix.

00:06:55.840 --> 00:07:00.300
So it's B plus C times each of
the column vectors of A.

00:07:00.300 --> 00:07:09.180
So it's going to be equal to
B plus C times A1, B plus C

00:07:09.180 --> 00:07:17.440
times A2, all the way to
B plus C times An.

00:07:17.440 --> 00:07:21.560
And, once again, it was many
videos ago that I think we

00:07:21.560 --> 00:07:28.380
showed that matrix-vector
products are distributive, so

00:07:28.380 --> 00:07:29.750
we can just distribute
this vector

00:07:29.750 --> 00:07:30.730
along these two matrices.

00:07:30.730 --> 00:07:33.400
And if I haven't proven it
yet, it's actually a very

00:07:33.400 --> 00:07:34.560
straightforward prove to do.

00:07:34.560 --> 00:07:44.890
So we could say that this is
equal to BA1 plus CA2.

00:07:44.890 --> 00:07:45.900
That's the first column.

00:07:45.900 --> 00:07:52.790
The second column is B times A2,
plus C times A2, all the

00:07:52.790 --> 00:07:59.595
way to B times An,
plus C times An.

00:08:02.640 --> 00:08:06.530
And then what is
this equal to?

00:08:06.530 --> 00:08:07.720
I'll write it out.

00:08:07.720 --> 00:08:13.940
This is equivalent to B times--
this is A1, no this is

00:08:13.940 --> 00:08:21.020
an A1 right here-- A1, and then
B times A2, all the way

00:08:21.020 --> 00:08:32.210
to BAn plus the vector C times
A1, C times A2, all the way to

00:08:32.210 --> 00:08:34.320
C times An, right?

00:08:34.320 --> 00:08:37.570
This guy represents these terms
right there, and this

00:08:37.570 --> 00:08:39.320
guy represents the first
terms in each of

00:08:39.320 --> 00:08:40.640
these column vectors.

00:08:40.640 --> 00:08:43.490
And this, by the definition of
matrix products, is just

00:08:43.490 --> 00:08:49.370
equivalent to BA, and then this
is just equivalent to CA.

00:08:49.370 --> 00:08:51.940
So now we've seen that the
distributive property works

00:08:51.940 --> 00:08:55.130
both ways with matrix-vector
products.

00:08:55.130 --> 00:09:04.840
That B plus C times A is equal
to BA CA, and that A times B

00:09:04.840 --> 00:09:10.170
plus C is equal to AB plus AC.

00:09:10.170 --> 00:09:12.250
Now the one thing that you have
to be careful of is that

00:09:12.250 --> 00:09:14.470
these two things are not
equivalent [UNINTELLIGIBLE].

00:09:14.470 --> 00:09:19.420
We just figured out that this
guy is equal to BA plus CA.

00:09:19.420 --> 00:09:21.560
So the distribution works
in both ways.

00:09:21.560 --> 00:09:26.160
But when you're dealing with
matrices, it's very important

00:09:26.160 --> 00:09:27.550
to keep your order.

00:09:27.550 --> 00:09:30.240
So this is going to be you
have the A second here.

00:09:30.240 --> 00:09:31.870
So it is BA plus CA.

00:09:31.870 --> 00:09:35.640
You can't say that this is
equal to AB plus AC.

00:09:35.640 --> 00:09:37.350
You can't just switch
these up.

00:09:37.350 --> 00:09:39.520
Because we've shown multiple
times, or we've talked about

00:09:39.520 --> 00:09:43.010
it multiple times, that matrix
products are not commutative.

00:09:43.010 --> 00:09:45.860
You can't just switch the
order of the products.

00:09:45.860 --> 00:09:47.990
But we've at least shown
in this video that the

00:09:47.990 --> 00:09:50.050
distributive property
works both ways.


Matrix product associativity

WEBVTT
Kind: captions
Language: en

00:00:00.760 --> 00:00:03.430
We know that if we have some
linear transformation, that

00:00:03.430 --> 00:00:08.240
the transformation from x to y
-- and these are just sets,

00:00:08.240 --> 00:00:13.170
sets of vectors, and T is a
linear transformation from y

00:00:13.170 --> 00:00:18.850
to z-- that we can construct a
composition of s with T that

00:00:18.850 --> 00:00:23.360
is a linear transformation
from x all the way to z.

00:00:23.360 --> 00:00:25.440
We saw this several
videos ago.

00:00:25.440 --> 00:00:28.860
And the definition of our linear
transformation, or the

00:00:28.860 --> 00:00:30.930
composition of our linear
transformation.

00:00:30.930 --> 00:00:36.040
So the composition of s with t,
applied to someone vector x

00:00:36.040 --> 00:00:45.980
in our set x, our domain,
is equal to s of t of x.

00:00:45.980 --> 00:00:47.340
This was our definition.

00:00:47.340 --> 00:00:52.770
And then we went on and we said,
look, if s of x can be

00:00:52.770 --> 00:00:59.770
represented as the matrix
multiplication a x, the matrix

00:00:59.770 --> 00:01:05.280
vector product, and if T of x
can be represented -- or the

00:01:05.280 --> 00:01:07.850
transformation T can be
represented-- as the product

00:01:07.850 --> 00:01:12.690
of the matrix b with x, we saw
that this thing right here --

00:01:12.690 --> 00:01:14.820
which is of course, if we just
write this way, this is equal

00:01:14.820 --> 00:01:21.220
to a times T times x, which is
just b x -- we saw in multiple

00:01:21.220 --> 00:01:24.580
videos now that this is
equivalent to, by our

00:01:24.580 --> 00:01:30.030
definition of matrix products,
the matrix a b -- right?

00:01:30.030 --> 00:01:32.130
When you take the product of
two matrices you just get

00:01:32.130 --> 00:01:36.210
another matrix -- the
product a b times x.

00:01:36.210 --> 00:01:39.760
So you take essentially the
first linear transformation in

00:01:39.760 --> 00:01:43.200
your composition, its matrix,
which was a, and you take the

00:01:43.200 --> 00:01:44.880
product with the second one.

00:01:44.880 --> 00:01:47.230
Fair enough, all of this
is review so far.

00:01:47.230 --> 00:01:50.440
Let's take three linear
transformations.

00:01:50.440 --> 00:01:53.710
Let's say that I have the linear
transformation h, and

00:01:53.710 --> 00:01:56.900
when I apply that to a vector
x, it's equivalent to

00:01:56.900 --> 00:02:00.220
multiplying my vector
x by the matrix a.

00:02:00.220 --> 00:02:05.490
Let's say I have the linear
transformation g.

00:02:05.490 --> 00:02:08.400
When I applied that to a vector
x, it's equivalent to

00:02:08.400 --> 00:02:12.250
multiplying that vectrix -- that
vector, there should be a

00:02:12.250 --> 00:02:15.320
new concept called a vetrix --
it's equivalent to multiplying

00:02:15.320 --> 00:02:18.170
that vector times
the matrix b.

00:02:18.170 --> 00:02:23.410
And then I have a final linear
transformation f.

00:02:23.410 --> 00:02:26.380
When it's applied to some vector
x, it's equivalent to

00:02:26.380 --> 00:02:32.280
multiplying that vector
x times the matrix z.

00:02:32.280 --> 00:02:35.810
Now what I'm curious about is
what happens when I take the

00:02:35.810 --> 00:02:43.570
composition of h with g, and
then I take the composition of

00:02:43.570 --> 00:02:50.070
that with f -- these are all
linear transformations -- and

00:02:50.070 --> 00:02:52.350
then I apply that to
some vector x.

00:02:57.520 --> 00:03:01.070
Which is necessarily going to be
in the domain of this guy.

00:03:01.070 --> 00:03:03.800
I haven't actually drawn out
their domain and co-domain

00:03:03.800 --> 00:03:06.020
definitions, but I think
you get the idea.

00:03:06.020 --> 00:03:09.290
So let's explore what this
is a little bit.

00:03:09.290 --> 00:03:12.610
Well by the definition of
what a -- let's go back.

00:03:12.610 --> 00:03:15.320
By this definition right here
of what composition even

00:03:15.320 --> 00:03:19.270
means, we can just apply that
to this right here.

00:03:19.270 --> 00:03:25.240
So we could just imagine this as
being our s, and then this

00:03:25.240 --> 00:03:27.520
is our T right there.

00:03:27.520 --> 00:03:29.280
Then what is this going
to be equal to?

00:03:29.280 --> 00:03:31.640
If we just do a straight up
pattern match right there,

00:03:31.640 --> 00:03:35.530
this is going to be equal to
s, the transformation s,

00:03:35.530 --> 00:03:38.620
applied to the transformation
f, applied to x.

00:03:38.620 --> 00:03:40.830
So s is h of g.

00:03:40.830 --> 00:03:46.750
So it is h -- or I should say h
of g -- the composition of h

00:03:46.750 --> 00:03:51.180
with g, that is our s.

00:03:51.180 --> 00:03:58.300
And then I apply that
to f applied to x.

00:03:58.300 --> 00:03:59.360
f is our t.

00:03:59.360 --> 00:04:04.470
I apply that to f applied
to x, just like that.

00:04:04.470 --> 00:04:08.740
Now what is this equal to?

00:04:08.740 --> 00:04:12.225
Now we can imagine that
this is our x.

00:04:12.225 --> 00:04:14.670
If we just pattern match,
according to this definition,

00:04:14.670 --> 00:04:19.480
that this and this guy right
here, that this is our t, and

00:04:19.480 --> 00:04:23.160
that this is our s.

00:04:23.160 --> 00:04:24.790
And so if we just pattern
match here,

00:04:24.790 --> 00:04:26.040
this is equal to what?

00:04:26.040 --> 00:04:29.430
This is just straight from the
definition of a composition.

00:04:29.430 --> 00:04:35.720
So it's equal to s of -- s is
our h -- so h of t, which in

00:04:35.720 --> 00:04:39.010
this case is g, g
applied to x.

00:04:39.010 --> 00:04:42.200
But instead of an x, we have
this vector here, which was

00:04:42.200 --> 00:04:44.650
the transformation
f applied to x.

00:04:44.650 --> 00:04:47.960
So g of f of x.

00:04:47.960 --> 00:04:48.980
That's what this is equal to.

00:04:48.980 --> 00:04:52.550
The composition of h with
g, and the composition

00:04:52.550 --> 00:04:57.710
competition of f with h, the
composition of h and g, all of

00:04:57.710 --> 00:05:02.370
that applied to x is equal
to h of g of f of x.

00:05:02.370 --> 00:05:06.310
Now what is this equal to?

00:05:06.310 --> 00:05:09.700
Well this is equal to -- I'll
do it right here -- this is

00:05:09.700 --> 00:05:18.210
equal to h, the transformation
h, applied to -- what is this

00:05:18.210 --> 00:05:18.530
term right here?

00:05:18.530 --> 00:05:20.570
I'll do it in pink.

00:05:20.570 --> 00:05:22.080
What is this?

00:05:22.080 --> 00:05:25.100
That is the composition of
g and f applied to x.

00:05:25.100 --> 00:05:28.620
You can just replace s with g,
and f with T, and you'll get

00:05:28.620 --> 00:05:29.920
that right there.

00:05:29.920 --> 00:05:36.160
So this is just equal to the
composition of g with f

00:05:36.160 --> 00:05:39.110
applied to x.

00:05:39.110 --> 00:05:41.420
That's all that is.

00:05:41.420 --> 00:05:46.190
Now, what is this equal
to right there?

00:05:46.190 --> 00:05:48.280
And it's probably confusing
to see two parentheses in

00:05:48.280 --> 00:05:49.730
different colors, but
you get the idea.

00:05:49.730 --> 00:05:51.300
What is this equal to?

00:05:51.300 --> 00:05:53.270
Well, just go back to your
definition of the composition

00:05:53.270 --> 00:05:56.760
-- I just want to make it very
clear what we're doing.

00:05:56.760 --> 00:06:00.500
This is, if you imagine this
being your T and then this

00:06:00.500 --> 00:06:03.700
being your s, this is just the
composition of s with T,

00:06:03.700 --> 00:06:05.270
applied to x.

00:06:05.270 --> 00:06:08.730
So this is just equal to --
I'll write it this way.

00:06:08.730 --> 00:06:11.530
This is equal to -- I shouldn't
write s's -- this is

00:06:11.530 --> 00:06:18.820
a composition of h with the
composition of g and f.

00:06:18.820 --> 00:06:21.210
And then all of that
applied to x.

00:06:21.210 --> 00:06:23.190
Now why did I do all of this?

00:06:23.190 --> 00:06:26.330
Well one, to show you that the
composition is associative.

00:06:26.330 --> 00:06:28.710
I went all the way here and then
I went all the way back.

00:06:28.710 --> 00:06:30.880
And essentially it doesn't
matter where you put the

00:06:30.880 --> 00:06:31.490
parentheses.

00:06:31.490 --> 00:06:37.130
The composition of h with g with
f, is equivalent to the

00:06:37.130 --> 00:06:40.050
composition of h with the
composition of g and f.

00:06:40.050 --> 00:06:43.020
That these two things are
equivalent, and essentially

00:06:43.020 --> 00:06:45.800
these two things, you can
just re-write them.

00:06:45.800 --> 00:06:49.210
The parentheses are essentially
unnecessary.

00:06:49.210 --> 00:06:53.020
You can write this as a
composition of h with g with

00:06:53.020 --> 00:06:57.070
f, all of that applied to x.

00:06:57.070 --> 00:07:02.400
Now, I took the time to say
that each of these linear

00:07:02.400 --> 00:07:04.520
transformations I can
represent as matrix

00:07:04.520 --> 00:07:05.250
multiplications.

00:07:05.250 --> 00:07:06.930
Why did I do that?

00:07:06.930 --> 00:07:09.860
Well we saw before, that any
composition, when you take the

00:07:09.860 --> 00:07:14.220
composition of s with T, the
matrix version of this

00:07:14.220 --> 00:07:17.900
transformation of this
composition is going to be

00:07:17.900 --> 00:07:21.520
equal to the product -- by our
definition of matrix matrix

00:07:21.520 --> 00:07:26.480
products -- the product of the
s's transformation matrix and

00:07:26.480 --> 00:07:28.690
T's transformation matrix.

00:07:28.690 --> 00:07:32.010
So what are these going
to be equal to?

00:07:32.010 --> 00:07:34.810
So this one right here --
if you think of this

00:07:34.810 --> 00:07:38.260
transformation right here, this
statement right here, its

00:07:38.260 --> 00:07:40.540
matrix version of it--
so let me write that.

00:07:40.540 --> 00:07:49.930
A matrix version of the
composition of h with g, and

00:07:49.930 --> 00:07:57.300
then the composition of that
with f, applied to x, is going

00:07:57.300 --> 00:08:03.930
to be equal to -- and we've
seen this before -- the

00:08:03.930 --> 00:08:05.510
product of these matrices.

00:08:05.510 --> 00:08:10.500
So this composition, its matrix
is going to be a b.

00:08:10.500 --> 00:08:12.620
h and g, their matrices
are a and b.

00:08:12.620 --> 00:08:19.220
So it's going to be a b -- and
I'll do it in parentheses.

00:08:19.220 --> 00:08:22.380
And then you take that matrix,
and you take the product -- so

00:08:22.380 --> 00:08:26.420
this guy's matrix representation
is a b, right?

00:08:26.420 --> 00:08:28.840
And this guy's matrix
representation is c.

00:08:28.840 --> 00:08:31.690
So the matrix representation
of this whole thing is this

00:08:31.690 --> 00:08:34.480
guy, taking the product of a b,
and then taking the product

00:08:34.480 --> 00:08:36.380
of that with c.

00:08:36.380 --> 00:08:37.640
So a b.

00:08:37.640 --> 00:08:38.929
and then c.

00:08:38.929 --> 00:08:42.179
And then if you look at this
guy right here -- and of

00:08:42.179 --> 00:08:46.110
course all of that times a
vector x, all of that time

00:08:46.110 --> 00:08:48.430
some vector x, right there.

00:08:48.430 --> 00:08:49.860
That's the vector x.

00:08:49.860 --> 00:08:52.730
Now let's look at this
one right here.

00:08:52.730 --> 00:08:59.220
If we take the composition of
h with the composition of g

00:08:59.220 --> 00:09:04.550
and f, and apply all of that to
some vector x, what is that

00:09:04.550 --> 00:09:05.750
equivalent to?

00:09:05.750 --> 00:09:10.180
Well this composition right
here, the matrix version of

00:09:10.180 --> 00:09:13.170
it, I guess we can say, is going
to be the product b c.

00:09:13.170 --> 00:09:15.012
And we're going to
apply that to x.

00:09:15.012 --> 00:09:18.340
So we're going to have
the product b c.

00:09:18.340 --> 00:09:20.770
And then we're going to take the
product of that with this

00:09:20.770 --> 00:09:24.980
guy's matrix representation,
which is a.

00:09:24.980 --> 00:09:26.530
And we've shown this before.

00:09:26.530 --> 00:09:30.020
We never showed it with
three, but it extends.

00:09:30.020 --> 00:09:32.430
I kind of showed it extends, so
you can just keep applying

00:09:32.430 --> 00:09:33.420
the definition.

00:09:33.420 --> 00:09:36.290
You can keep applying this
property right here, and so

00:09:36.290 --> 00:09:37.900
it'll just naturally extend.

00:09:37.900 --> 00:09:39.160
Because every time, we're
just taking the

00:09:39.160 --> 00:09:40.630
composition of two things.

00:09:40.630 --> 00:09:42.030
Even though it looks like we're
taking the composition

00:09:42.030 --> 00:09:44.160
of three, we're taking the
composition of two things

00:09:44.160 --> 00:09:45.150
first here.

00:09:45.150 --> 00:09:47.640
And then we get its matrix
representation.

00:09:47.640 --> 00:09:49.310
And then we take the composition
of that with this

00:09:49.310 --> 00:09:50.240
other thing.

00:09:50.240 --> 00:09:53.850
So the matrix representation of
the entire composition is

00:09:53.850 --> 00:09:57.640
going to be this matrix
times this matrix.

00:09:57.640 --> 00:09:58.820
Which I did here.

00:09:58.820 --> 00:10:04.240
Similarly, here we take first
the composition of these two

00:10:04.240 --> 00:10:07.430
linear transformations, and
their matrix representation

00:10:07.430 --> 00:10:08.900
will be that right there.

00:10:08.900 --> 00:10:12.550
And then we take the composition
of that with that.

00:10:12.550 --> 00:10:16.120
So its entire matrix
representation is going to be

00:10:16.120 --> 00:10:18.390
guy's matrix times this
guy's matrix.

00:10:18.390 --> 00:10:20.220
So a times b c.

00:10:20.220 --> 00:10:23.530
And of course, all of that
applied to the vector x.

00:10:23.530 --> 00:10:26.990
Now, in this video I've showed
you that these two things are

00:10:26.990 --> 00:10:27.840
equivalent.

00:10:27.840 --> 00:10:31.800
If anything, the parentheses
are completely unnecessary.

00:10:31.800 --> 00:10:32.920
And I showed you that there.

00:10:32.920 --> 00:10:37.420
They both essentially boil
down to h of g of f of x.

00:10:37.420 --> 00:10:39.410
So these two things
are equivalent.

00:10:39.410 --> 00:10:42.620
So we could say, essentially,
that these two things over

00:10:42.620 --> 00:10:44.520
here are equivalent.

00:10:44.520 --> 00:10:49.390
Or that a b, the product a b,
and then taking the product of

00:10:49.390 --> 00:10:53.290
that matrix with the matrix c,
is equivalent to taking the

00:10:53.290 --> 00:10:58.040
product a with the matrix b c.

00:10:58.040 --> 00:11:00.290
Which is just another
product matrix.

00:11:00.290 --> 00:11:02.590
Or another way of saying it is
that these parentheses don't

00:11:02.590 --> 00:11:07.030
matter, that all of these
is just equal to a b c.

00:11:07.030 --> 00:11:11.430
Or -- I mean, this is just a
statement that matrix products

00:11:11.430 --> 00:11:13.315
exhibit the associative
property.

00:11:18.350 --> 00:11:21.040
It doesn't matter where you
put the parentheses.

00:11:21.040 --> 00:11:23.080
And you know, sometimes it's
confusing me, the word

00:11:23.080 --> 00:11:23.680
associative.

00:11:23.680 --> 00:11:25.840
It just means it doesn't matter
where you put the

00:11:25.840 --> 00:11:26.780
parentheses.

00:11:26.780 --> 00:11:30.040
Matrix products do not exhibit
the commutative property.

00:11:30.040 --> 00:11:32.140
We saw that in the last video.

00:11:32.140 --> 00:11:37.050
In general, we cannot make
the statement that a b

00:11:37.050 --> 00:11:39.280
is equal to b a.

00:11:39.280 --> 00:11:41.020
We cannot do that.

00:11:41.020 --> 00:11:43.550
And in fact in the last video
-- I think it was the last

00:11:43.550 --> 00:11:46.720
video -- I showed you that if a
b is defined, sometimes b a

00:11:46.720 --> 00:11:47.660
is not even defined.

00:11:47.660 --> 00:11:50.030
Or if b a is defined, sometimes
a b isn't defined.

00:11:50.030 --> 00:11:51.820
So it's not commutative.

00:11:51.820 --> 00:11:53.630
It is associative, though.

00:11:53.630 --> 00:11:57.050
In the next video, I'll see if
matrix products are actually

00:11:57.050 --> 00:11:58.300
distributive.


Matrix product examples

WEBVTT
Kind: captions
Language: en

00:00:00.680 --> 00:00:03.140
In the last video we learned
what it meant to take the

00:00:03.140 --> 00:00:04.900
product of two matrices.

00:00:04.900 --> 00:00:10.330
So if we have one matrix A, and
it's an m by n matrix, and

00:00:10.330 --> 00:00:14.120
then we have some other
matrix B, let's say

00:00:14.120 --> 00:00:17.270
that's an n by k matrix.

00:00:17.270 --> 00:00:26.040
And we've defined the product
of A and B to be equal to--

00:00:26.040 --> 00:00:29.080
And actually before I define the
product, let me just write

00:00:29.080 --> 00:00:31.610
B out as just a collection
of column vectors.

00:00:31.610 --> 00:00:36.460
So we know that B can be written
as a column vector b1,

00:00:36.460 --> 00:00:39.050
another column vector b2, and
all the way it's going to have

00:00:39.050 --> 00:00:44.230
k of them because it has exactly
k columns, so bk.

00:00:44.230 --> 00:00:48.540
So the last video we defined the
product of A and B , and

00:00:48.540 --> 00:00:52.390
they have to have the columns
of A have to be the same as

00:00:52.390 --> 00:00:56.120
the rows of B in order for
this to be well-defined.

00:00:56.120 --> 00:01:00.960
But we define this product to
be equal to A times each of

00:01:00.960 --> 00:01:02.310
the column vectors of B.

00:01:02.310 --> 00:01:05.640
So it's equal to-- let me switch
back to that color--

00:01:05.640 --> 00:01:10.160
it's equal to A times-- do it in
the color that I did it-- A

00:01:10.160 --> 00:01:15.830
times b1, and then the second
column of our product is going

00:01:15.830 --> 00:01:19.590
to be A times b2.

00:01:23.160 --> 00:01:30.840
Our third product is going to be
A times b3, all the way to

00:01:30.840 --> 00:01:32.120
A times bk.

00:01:41.630 --> 00:01:42.930
Right there.

00:01:42.930 --> 00:01:45.280
And the whole motivation for
this, you've probably you've

00:01:45.280 --> 00:01:48.110
seen this before, maybe in your
Algebra II class-- it

00:01:48.110 --> 00:01:50.330
might have not been defined
exactly this way, but this is

00:01:50.330 --> 00:01:52.315
the equivalent to what you
probably saw in your Algebra

00:01:52.315 --> 00:01:55.040
II class-- but the neat thing
about this definition is that

00:01:55.040 --> 00:01:59.480
the motivation came from the
composition of two linear

00:01:59.480 --> 00:02:02.390
transformations whose
transformation matrices were

00:02:02.390 --> 00:02:03.670
the matrices A and B.

00:02:03.670 --> 00:02:05.600
And I showed you that
in the last video.

00:02:05.600 --> 00:02:08.975
With that said, let's actually
compute some matrix-matrix

00:02:08.975 --> 00:02:11.510
products just so you
get the hang of it.

00:02:11.510 --> 00:02:15.310
So let's say that I
have the matrix A.

00:02:15.310 --> 00:02:25.490
Let's say that A is equal to the
matrix 1, minus 1, 2, 0,

00:02:25.490 --> 00:02:28.050
minus 2, and 1.

00:02:28.050 --> 00:02:30.900
I keep the numbers low to keep
our arithmetic fairly

00:02:30.900 --> 00:02:32.100
straightforward.

00:02:32.100 --> 00:02:38.900
And let's say that I have the
matrix B, and let's say that

00:02:38.900 --> 00:02:49.520
it is equal to 1, 0, 1, 1,
2, 0, 1, minus 1, and

00:02:49.520 --> 00:02:56.200
then 3, 1, 0, 2.

00:02:56.200 --> 00:03:03.220
So A is a 2 by 3 matrix,
2 rows, 3 columns.

00:03:03.220 --> 00:03:06.530
And B is a 3 by 4 matrix.

00:03:06.530 --> 00:03:10.140
So by our definition, what
is the product AB

00:03:10.140 --> 00:03:11.380
going to be equal to?

00:03:11.380 --> 00:03:12.980
Well, we know it's well-defined
because the

00:03:12.980 --> 00:03:15.590
number of columns here is equal
to the number of rows,

00:03:15.590 --> 00:03:17.900
so we can actually take these
matrix vector products--

00:03:17.900 --> 00:03:27.280
you'll see that in a second-- so
AB is equal to the matrix A

00:03:27.280 --> 00:03:31.970
times the column vector,
1, 2, 3.

00:03:31.970 --> 00:03:35.720
That's going to be the first
column in our product matrix.

00:03:35.720 --> 00:03:38.160
And the second one is going to
be the matrix A times the

00:03:38.160 --> 00:03:42.910
column 0, 0, 1.

00:03:42.910 --> 00:03:46.190
The third column is going to
be the matrix A times the

00:03:46.190 --> 00:03:50.260
column vector 1, 1, 0.

00:03:50.260 --> 00:03:53.190
And then the fourth column in
our product vector is going to

00:03:53.190 --> 00:04:00.680
be the matrix A times the column
vector 1, minus 1, 2.

00:04:00.680 --> 00:04:03.770
And this, when we write it like
this, it should be clear

00:04:03.770 --> 00:04:07.620
why this has to be, why the
number of columns in A have to

00:04:07.620 --> 00:04:12.460
be the number of rows in B,
because the column vectors in

00:04:12.460 --> 00:04:15.500
B are going to have the same
number of components as the

00:04:15.500 --> 00:04:19.470
number of rows in B, so all of
the column vectors in B-- so

00:04:19.470 --> 00:04:24.540
if we call this B1, B2, B3, B4,
all of my bi's-- let me

00:04:24.540 --> 00:04:29.020
write it this way-- all of my
bi's where this i could be 1,

00:04:29.020 --> 00:04:33.470
2, or 3, or 4, are all
members of R3.

00:04:33.470 --> 00:04:38.530
So we only have matrix vector
products well-defined when the

00:04:38.530 --> 00:04:42.270
number of columns in your
matrix are equivalent to

00:04:42.270 --> 00:04:44.690
essentially the dimensionality
of your vectors.

00:04:44.690 --> 00:04:46.810
That's why that number
and that number

00:04:46.810 --> 00:04:48.150
has to be the same.

00:04:48.150 --> 00:04:52.280
Well, now we've reduced our
matrix-matrix product problem

00:04:52.280 --> 00:04:56.200
to just four different matrix
vector product problems, so we

00:04:56.200 --> 00:04:57.550
can just multiply these.

00:04:57.550 --> 00:05:00.690
This is nothing new to
us, so let's do it.

00:05:03.740 --> 00:05:05.060
And so what is this equal to?

00:05:05.060 --> 00:05:10.140
So AB,-- let me rewrite it--
AB, my product vector, is

00:05:10.140 --> 00:05:14.320
going to be equal to-- so this
first column is the matrix A

00:05:14.320 --> 00:05:17.030
times the column
vector 1, 2, 3.

00:05:17.030 --> 00:05:18.250
And how did we define that?

00:05:18.250 --> 00:05:20.550
Remember, one way to think about
it is that this is equal

00:05:20.550 --> 00:05:24.760
to the-- you can kind of think
of it as the-- each of the

00:05:24.760 --> 00:05:30.890
rows of A dotted with the column
here of B, or even

00:05:30.890 --> 00:05:34.420
better, this is the transpose
of some matrix, right?

00:05:34.420 --> 00:05:36.330
Let me write this this way.

00:05:36.330 --> 00:05:42.650
If a is equal to-- sorry-- the
transpose of some vector,

00:05:42.650 --> 00:05:47.110
let's say that a is equal to the
column vector 0, minus 1,

00:05:47.110 --> 00:05:50.710
2, then a transpose-- and
I haven't talked about

00:05:50.710 --> 00:05:53.630
transposes a lot yet, but I
think you get the idea.

00:05:53.630 --> 00:05:56.240
You just changed all of the
columns into rows-- so a

00:05:56.240 --> 00:06:00.550
transpose will just be equal
to 0, minus 1, 2.

00:06:00.550 --> 00:06:03.760
You just go from a column
vector to a row vector.

00:06:03.760 --> 00:06:08.270
So if we called this thing here,
a transpose, then when

00:06:08.270 --> 00:06:13.810
we take the product of our
matrix A times this vector, we

00:06:13.810 --> 00:06:18.960
essentially are just taking A
and dotting with this guy for

00:06:18.960 --> 00:06:21.420
our first row and our
first column.

00:06:21.420 --> 00:06:23.450
So let me do it that
way, so let me

00:06:23.450 --> 00:06:24.650
write it in that notation.

00:06:24.650 --> 00:06:29.610
So this is going to be the
matrix-- or sorry-- the vector

00:06:29.610 --> 00:06:32.880
1, minus 1, 2.

00:06:32.880 --> 00:06:35.090
That's essentially, that row
right there represented as a

00:06:35.090 --> 00:06:39.650
column dotted with 1, 2, 3.

00:06:39.650 --> 00:06:43.420
Actually, let me do it in that
color just so I can later

00:06:43.420 --> 00:06:46.040
switch to one color to make
things simple-- but dotted

00:06:46.040 --> 00:06:48.020
with 1, 2, 3.

00:06:48.020 --> 00:06:50.520
So we just took that row, or, I
guess the column equivalent

00:06:50.520 --> 00:06:52.280
of that row, and dotted
with this.

00:06:52.280 --> 00:06:55.620
And I wrote it like this because
we've only defined dot

00:06:55.620 --> 00:06:56.800
products for column vectors.

00:06:56.800 --> 00:06:59.410
I could do it maybe for row
vectors, but we don't need to

00:06:59.410 --> 00:07:02.330
make a new definition.

00:07:02.330 --> 00:07:06.530
So that's going to be the first
entry in this matrix

00:07:06.530 --> 00:07:07.210
vector product.

00:07:07.210 --> 00:07:11.370
The second entry is going to
be the second row of A

00:07:11.370 --> 00:07:14.810
essentially dotted with this
vector right there, so it's

00:07:14.810 --> 00:07:23.270
going to be equal to 0, minus 2,
and 1, dotted with 1, 2, 3.

00:07:27.820 --> 00:07:30.230
And we just keep doing that--
and I'll just switch maybe to

00:07:30.230 --> 00:07:34.430
one neutral color now-- so
that A times 0, 0, 1.

00:07:34.430 --> 00:07:37.510
That's going to be the first row
of A expressed as a column

00:07:37.510 --> 00:07:41.420
vector, so we can write
it like this, 1, minus

00:07:41.420 --> 00:07:46.890
1, 2 dot 0, 0, 1.

00:07:46.890 --> 00:07:49.640
And then, actually, and then
we have our and then the

00:07:49.640 --> 00:07:54.770
second row of A dotted with this
column vector, so we have

00:07:54.770 --> 00:08:01.830
0, minus 2, 1, dotted
with 0, 0, 1.

00:08:01.830 --> 00:08:02.800
Two more rows left.

00:08:02.800 --> 00:08:06.090
This can get a little tedious
and it's inevitable that I'll

00:08:06.090 --> 00:08:08.390
probably make a careless
mistake, but as long as you

00:08:08.390 --> 00:08:11.560
understand the process, that's
the important thing.

00:08:11.560 --> 00:08:15.900
So the next one, this row of A
expressed as a column vector,

00:08:15.900 --> 00:08:19.990
1, minus 1, 2, and we're going
to dot it with this vector

00:08:19.990 --> 00:08:23.630
right there, 1, 1, 0.

00:08:23.630 --> 00:08:27.830
And then this row of A-- I can
just look over here as well--

00:08:27.830 --> 00:08:33.730
0, minus 2, 1, dotted
with 1, 1, 0.

00:08:33.730 --> 00:08:37.380
And then finally the last two
entries are going to be the

00:08:37.380 --> 00:08:42.690
top row of A, 1, minus 1, 2,
dotted with this column

00:08:42.690 --> 00:08:47.840
vector, 1, minus 1, 2-- a little
dot there, remember

00:08:47.840 --> 00:08:50.630
we're taking the dot product--
and then finally this second

00:08:50.630 --> 00:08:57.460
row of A, so 0, minus 2, 1,
dotted with this column

00:08:57.460 --> 00:09:02.100
vector, 1, minus 1, 2.

00:09:02.100 --> 00:09:05.250
And that is going to be our
product matrix-- and this

00:09:05.250 --> 00:09:07.190
looks very complicated right
now but now we just have to

00:09:07.190 --> 00:09:10.270
compute it, and dot products
tend to simplify things a good

00:09:10.270 --> 00:09:13.320
bit-- so what is our matrix--
our product-- going to

00:09:13.320 --> 00:09:14.690
simplify to?

00:09:14.690 --> 00:09:16.750
I'll do it in pink.

00:09:16.750 --> 00:09:21.370
AB is equal to-- draw the
matrix right there.

00:09:21.370 --> 00:09:23.190
So what is the dot product
of these two things?

00:09:23.190 --> 00:09:24.140
It's 1 times 1.

00:09:24.140 --> 00:09:24.820
I'll just write it out.

00:09:24.820 --> 00:09:31.040
It's 1 times 1, I'll just write,
1 times 1 is 1, plus

00:09:31.040 --> 00:09:38.270
minus 1 times 2, so minus 2,
plus 2 times 3, plus 6.

00:09:38.270 --> 00:09:42.470
Now we'll do this term right
here, 0 times 1 is 0, plus

00:09:42.470 --> 00:09:46.290
minus 2 times 2, so that's
minus 4, plus 1

00:09:46.290 --> 00:09:48.730
times 3, plus 3.

00:09:48.730 --> 00:09:52.490
Now we're on to this term, 1
times 0 is 0, plus minus 1

00:09:52.490 --> 00:09:57.400
times 0, plus 0, plus 2 times
1 is equal to plus 2.

00:09:57.400 --> 00:10:01.980
This term, 0 times 0 is 0, plus
minus 2 times 0-- let me

00:10:01.980 --> 00:10:06.530
write it 0 plus minus 2 times
0 is 0, plus 1 times 1.

00:10:06.530 --> 00:10:11.340
So plus 1, and here you have 1
times 1 is 1, plus minus 1

00:10:11.340 --> 00:10:15.360
times 1 is minus 1, plus
2 times 0, so plus 0.

00:10:15.360 --> 00:10:22.880
Here 0 times 1 is 0, 2 minus 2
times 1 is minus 2, and then 1

00:10:22.880 --> 00:10:25.680
times 0 is plus 0.

00:10:25.680 --> 00:10:26.400
Almost done.

00:10:26.400 --> 00:10:33.880
1 times 1 is 1; minus 1 times
minus 1 is 1; 2 times 2 is 4.

00:10:33.880 --> 00:10:40.740
Finally, 0 times 1 is 0; minus
2 times minus 1 is 2.

00:10:40.740 --> 00:10:43.870
1 times 2 is also 2.

00:10:43.870 --> 00:10:46.210
And we're in the home stretch,
so now we just have to add up

00:10:46.210 --> 00:10:47.360
these values.

00:10:47.360 --> 00:10:52.570
So our dot product of the two
matrices is equal to the 2 by

00:10:52.570 --> 00:10:58.190
4 matrix, 1 minus 2 plus 6.

00:10:58.190 --> 00:11:00.200
That's equal to 5.

00:11:00.200 --> 00:11:02.960
Minus 4 plus 3 is minus 1.

00:11:02.960 --> 00:11:04.700
This is just 2.

00:11:04.700 --> 00:11:06.450
This is just 1.

00:11:06.450 --> 00:11:11.090
Then we have 1 minus 1 plus 0
is just 0, minus 2, right?

00:11:11.090 --> 00:11:15.110
We just have a minus 2 there, 1
plus 1 plus 4 is 6, and then

00:11:15.110 --> 00:11:17.680
2 plus 2 is 4.

00:11:17.680 --> 00:11:19.580
And we are done.

00:11:19.580 --> 00:11:22.210
The product of A B is equal
to this matrix right here.

00:11:22.210 --> 00:11:24.290
Let me get my A and B back.

00:11:24.290 --> 00:11:26.525
We can talk a little bit more
about what this product

00:11:26.525 --> 00:11:28.386
actually represented.

00:11:28.386 --> 00:11:30.650
So let me copy and paste this.

00:11:35.950 --> 00:11:38.160
Let me scroll down
a little bit.

00:11:38.160 --> 00:11:41.870
Go down here, paste.

00:11:41.870 --> 00:11:43.120
There you go.

00:11:43.120 --> 00:11:45.190
So this was our A and our B.

00:11:45.190 --> 00:11:48.150
And when we took the product
we got this matrix here.

00:11:48.150 --> 00:11:49.990
Now there is another couple of
interesting things to notice.

00:11:49.990 --> 00:11:53.900
Remember, I only said that
this product is only

00:11:53.900 --> 00:11:57.500
well-defined when the number
of columns in A is equal to

00:11:57.500 --> 00:11:59.350
the number of rows in B.

00:11:59.350 --> 00:12:01.480
So that was the case
in this situation.

00:12:01.480 --> 00:12:05.610
And then notice, we got a 2 by
4 matrix, which is the number

00:12:05.610 --> 00:12:11.300
of rows in A times the number
of columns in B.

00:12:11.300 --> 00:12:13.470
So we got a 2 by 4 matrix.

00:12:13.470 --> 00:12:16.890
So another natural question is,
could we have found, or is

00:12:16.890 --> 00:12:21.760
it even equal, if we were
to take the product BA?

00:12:21.760 --> 00:12:24.250
If we were to even take
the product BA.

00:12:24.250 --> 00:12:27.320
So if we tried to apply our
definition there, what would

00:12:27.320 --> 00:12:28.195
it be equal to?

00:12:28.195 --> 00:12:33.610
It would be equal to the matrix
B times the column 1,

00:12:33.610 --> 00:12:39.090
0, then the matrix B times the
column minus 1, minus 2.

00:12:39.090 --> 00:12:41.150
And then it would be
the matrix B times

00:12:41.150 --> 00:12:43.740
the column 2, 1.

00:12:43.740 --> 00:12:47.070
Now, can we take this matrix
vector product?

00:12:47.070 --> 00:12:52.350
We have a 3 by 4-- this right
here is a 3 by 4 matrix, and

00:12:52.350 --> 00:12:55.390
this guy right here
is a member of R2.

00:12:55.390 --> 00:12:56.440
So this is not well-defined.

00:12:56.440 --> 00:12:59.910
We have more columns here than
entries here, so we have never

00:12:59.910 --> 00:13:02.950
defined a matrix vector
product like this.

00:13:02.950 --> 00:13:05.680
So not only is this
not equal to this,

00:13:05.680 --> 00:13:07.920
it's not even defined.

00:13:07.920 --> 00:13:16.520
So it's not defined when you
take a 3 by 4 matrix, and you

00:13:16.520 --> 00:13:19.130
take the product of that
with a 2 by 4 matrix.

00:13:19.130 --> 00:13:21.740
It's not defined because
that number and that

00:13:21.740 --> 00:13:23.410
number is not equal.

00:13:23.410 --> 00:13:26.030
And so obviously since this
is defined and this isn't

00:13:26.030 --> 00:13:29.600
defined, you know that AB is
not always equal to BA.

00:13:29.600 --> 00:13:32.240
In fact, it's not usually equal
to BA, and sometimes

00:13:32.240 --> 00:13:34.160
it's not even defined.

00:13:34.160 --> 00:13:37.610
And the last point I want to
make is, you probably learned

00:13:37.610 --> 00:13:41.550
to do matrix-matrix products in
Algebra II, but you didn't

00:13:41.550 --> 00:13:44.150
have any motivation for what you
were doing, but now we do

00:13:44.150 --> 00:13:45.450
have a motivation.

00:13:45.450 --> 00:13:48.690
Because when you're taking the
product of A and B, we learned

00:13:48.690 --> 00:13:54.710
in the last video that if we
have two transformations,

00:13:54.710 --> 00:14:00.390
let's say we have the
transformation, S is a

00:14:00.390 --> 00:14:12.590
transformation from R3 to R2,
and that S is represented by

00:14:12.590 --> 00:14:13.710
the matrix.

00:14:13.710 --> 00:14:18.700
So S, given some matrix in
R3, if you'd apply the

00:14:18.700 --> 00:14:22.340
transformation S to it, it's
equivalent to multiplying

00:14:22.340 --> 00:14:26.000
that, or given any vector
in R3, applying the

00:14:26.000 --> 00:14:28.350
transformation S is equivalent
to multiplying that

00:14:28.350 --> 00:14:30.320
vector times A.

00:14:30.320 --> 00:14:31.460
We can say that.

00:14:31.460 --> 00:14:35.380
And I used R3 and R2 because the
number of columns in A is

00:14:35.380 --> 00:14:38.580
3, so it can apply to a
three-dimensional vector.

00:14:38.580 --> 00:14:41.890
And similarly, we can imagine
B as being the matrix

00:14:41.890 --> 00:14:45.450
transformation of some
transformation, T, that is a

00:14:45.450 --> 00:14:58.660
mapping from R4 to R3, where if
you give it some vector x

00:14:58.660 --> 00:15:03.190
in R4, it will produce-- you
take the product of that with

00:15:03.190 --> 00:15:07.420
B, and you're going to get
some vector in R3.

00:15:07.420 --> 00:15:11.140
Now, if we think of the
composition of the two-- so

00:15:11.140 --> 00:15:14.570
let's think about it a little
bit-- if we have R4 here-- let

00:15:14.570 --> 00:15:25.560
me switch colors-- we have R4
here, we have R3 here, and

00:15:25.560 --> 00:15:32.020
then we have R2 here.

00:15:32.020 --> 00:15:35.360
T is a transformation
from R4 to R3.

00:15:35.360 --> 00:15:37.390
So T would look like that.

00:15:37.390 --> 00:15:41.150
T is a transformation
and it's B times x.

00:15:41.150 --> 00:15:44.740
That's what T is equal to, so
T is this transformation.

00:15:44.740 --> 00:15:48.710
And then S is a transformation
from R3 to R2.

00:15:48.710 --> 00:15:50.650
So S looks like that.

00:15:50.650 --> 00:15:54.480
And S is equivalent to
A times any vector in

00:15:54.480 --> 00:15:56.660
R3, so that is S.

00:15:56.660 --> 00:16:01.420
So now we know how to visualize,
or how to think

00:16:01.420 --> 00:16:05.140
about, what the product
of A and B are.

00:16:05.140 --> 00:16:09.480
The product of A and B is
essentially, you apply the

00:16:09.480 --> 00:16:13.770
transformation B first-- so
let me think of it-- the

00:16:13.770 --> 00:16:19.870
composition of S-- let me write
it this way-- so what is

00:16:19.870 --> 00:16:23.270
the composition of S with T?

00:16:23.270 --> 00:16:31.830
This is equal to-- of x-- this
is equal to S of T of x.

00:16:31.830 --> 00:16:35.300
So you take a transformation
from R4 to R3, and then you

00:16:35.300 --> 00:16:40.780
take the S transformation from
R3 to R2, so this is S of T.

00:16:40.780 --> 00:16:47.150
S of T is a transformation from
R4 all the way to R2.

00:16:47.150 --> 00:16:49.340
And then the neat thing about
this, if you were to just

00:16:49.340 --> 00:16:51.710
write this out in its matrix
representations-- we did this

00:16:51.710 --> 00:16:56.150
in the last video-- this would
be equal to the S matrix A

00:16:56.150 --> 00:17:03.200
times this vector right
here, which is Bx.

00:17:03.200 --> 00:17:06.390
But now we know that the
matrix-- by our definition of

00:17:06.390 --> 00:17:10.700
matrix vector products-- that
this guy right here is going

00:17:10.700 --> 00:17:11.972
to have a transformation.

00:17:11.972 --> 00:17:17.930
It's going to be equal to-- So
the composition S of T of x is

00:17:17.930 --> 00:17:23.180
going to be equal to the
matrix AB, based on our

00:17:23.180 --> 00:17:26.050
definition, so the
transformation AB

00:17:26.050 --> 00:17:28.190
times some vector x.

00:17:28.190 --> 00:17:29.960
So the reason why I'm going all
this is because we just

00:17:29.960 --> 00:17:32.820
did a matrix-matrix
product up here.

00:17:32.820 --> 00:17:35.680
We took the pain of multiplying
the matrix A times

00:17:35.680 --> 00:17:38.060
the matrix B and we got this
value here-- and hopefully I

00:17:38.060 --> 00:17:39.880
didn't make any careless
mistakes.

00:17:39.880 --> 00:17:43.150
But the big idea here, the idea
that you probably weren't

00:17:43.150 --> 00:17:45.910
exposed to in your Algebra II
class, is that this is the

00:17:45.910 --> 00:17:51.650
matrix of the composition of the
transformations S and T.

00:17:51.650 --> 00:17:55.780
So right here, it's the matrix
of the composition of S and T.

00:17:55.780 --> 00:17:58.970
So you're not just blindly doing
some-- matrix-matrix

00:17:58.970 --> 00:18:01.260
products can be pretty tedious,
but now you know what

00:18:01.260 --> 00:18:01.900
they're for.

00:18:01.900 --> 00:18:04.240
They're actually for the
composition of two

00:18:04.240 --> 00:18:07.940
transformations where each of A
and B are the transformation

00:18:07.940 --> 00:18:10.440
matrices for each of the
individual linear

00:18:10.440 --> 00:18:11.490
transformations.

00:18:11.490 --> 00:18:13.920
Anyway, hopefully you
found that useful.


Compositions of linear transformations 2

WEBVTT
Kind: captions
Language: en

00:00:00.530 --> 00:00:04.180
In the last video, we started
with a linear transformation

00:00:04.180 --> 00:00:08.520
S, that was a mapping between
the set x, that was a subset

00:00:08.520 --> 00:00:10.510
of Rn to the set y.

00:00:10.510 --> 00:00:12.390
And then we had another
transformation that was a

00:00:12.390 --> 00:00:15.540
mapping from the set
y to the set z.

00:00:15.540 --> 00:00:18.060
And we asked ourselves,
given these two linear

00:00:18.060 --> 00:00:20.900
transformations, could
we construct a linear

00:00:20.900 --> 00:00:26.320
transformation that goes all
the way from x to z?

00:00:26.320 --> 00:00:27.780
What we did was we made
a definition.

00:00:27.780 --> 00:00:30.820
We said let's create something
called the

00:00:30.820 --> 00:00:33.290
composition of T with S.

00:00:33.290 --> 00:00:37.180
What that is, is first you apply
S to some vector in X to

00:00:37.180 --> 00:00:38.535
get some vector in Y.

00:00:38.535 --> 00:00:40.990
And that's your vector
right there.

00:00:40.990 --> 00:00:44.090
And then you apply T to
that, to get to z.

00:00:44.090 --> 00:00:45.720
And so we defined it that way.

00:00:45.720 --> 00:00:48.420
And our next question was, was
that a linear transformation?

00:00:48.420 --> 00:00:49.890
We show that it was.

00:00:49.890 --> 00:00:52.010
It met the two requirements
for them.

00:00:52.010 --> 00:00:54.620
And because it is a linear
transformation, I left off in

00:00:54.620 --> 00:00:57.440
the last video saying that
it should be able to be

00:00:57.440 --> 00:01:00.870
represented by some matrix
vector product.

00:01:00.870 --> 00:01:03.440
Where this will have to
be an l by n matrix.

00:01:03.440 --> 00:01:06.690
Because it's a mapping from an n
dimensional space, which was

00:01:06.690 --> 00:01:12.300
x-- it was a subset of Rn--
to an l dimensional space.

00:01:12.300 --> 00:01:16.860
Because z is a subset of Rl Now
in this video, let's try

00:01:16.860 --> 00:01:20.340
to actually construct
this matrix.

00:01:20.340 --> 00:01:24.130
So at the beginning of the last
video, I told you that T

00:01:24.130 --> 00:01:28.050
of x could be written as some
matrix product, B times x.

00:01:28.050 --> 00:01:32.170
Let me write that and rewrite
it down here.

00:01:32.170 --> 00:01:36.090
So I told you that the linear
transformation T applied to

00:01:36.090 --> 00:01:39.900
some vector x, could be written
as the matrix vector

00:01:39.900 --> 00:01:43.410
product, B times a vector x.

00:01:43.410 --> 00:01:49.540
And since it was a mapping from
an m dimensional space to

00:01:49.540 --> 00:01:53.170
an l dimensional space, we know
this is going to be in l

00:01:53.170 --> 00:01:58.800
by m matrix.

00:01:58.800 --> 00:02:04.000
Now similarly, I told you that
the transformation S can also

00:02:04.000 --> 00:02:06.780
be written as a matrix
vector product.

00:02:06.780 --> 00:02:09.729
Where we can say A is its
matrix representation

00:02:09.729 --> 00:02:11.160
times a vector x.

00:02:11.160 --> 00:02:18.060
And since S was a mapping from
an n dimensional space to an m

00:02:18.060 --> 00:02:21.950
dimensional space, this will
be an m by n matrix.

00:02:25.780 --> 00:02:32.600
Now by definition, what was the
composition of T with S?

00:02:32.600 --> 00:02:33.460
What is this?

00:02:33.460 --> 00:02:36.680
By definition, we said that this
is equal to-- you first

00:02:36.680 --> 00:02:40.590
apply the linear transformation
S to x.

00:02:40.590 --> 00:02:42.890
And I'll arbitrarily
switch colors.

00:02:42.890 --> 00:02:46.000
So you first apply the
transformation S to x.

00:02:46.000 --> 00:02:50.400
And that essentially gets you
a vector right there.

00:02:50.400 --> 00:02:52.560
This is just a vector in Rm.

00:02:52.560 --> 00:02:56.360
Or it's really a vector in y,
which is a subset of Rm.

00:02:56.360 --> 00:02:58.600
And then you apply the
transformation T to that

00:02:58.600 --> 00:03:00.460
vector to get you into z.

00:03:07.170 --> 00:03:10.340
Given this we can use our matrix
representations to

00:03:10.340 --> 00:03:13.620
replace this kind of
transformation representation.

00:03:13.620 --> 00:03:14.830
Although they're really
the same thing.

00:03:14.830 --> 00:03:18.110
What is a transformation
of S applied to x?

00:03:18.110 --> 00:03:25.830
Well this right here is just
A times x, where this

00:03:25.830 --> 00:03:29.530
is an m by n matrix.

00:03:29.530 --> 00:03:31.800
So we can say that this is equal
to the transformation

00:03:31.800 --> 00:03:35.480
applied to A times x.

00:03:35.480 --> 00:03:40.080
Now, what is the T
transformation applied

00:03:40.080 --> 00:03:41.410
to any vector x?

00:03:41.410 --> 00:03:44.740
Well that's the matrix B
times your vector x.

00:03:44.740 --> 00:03:49.960
So this thing right here is
going to be equal to B times

00:03:49.960 --> 00:03:51.040
whatever I put in there.

00:03:51.040 --> 00:03:58.790
So the matrix B times the matrix
A times the vector x

00:03:58.790 --> 00:03:59.710
right there.

00:03:59.710 --> 00:04:04.010
This is what our composition
transformation is.

00:04:04.010 --> 00:04:08.440
The composition of T with S
applied to the vector x.

00:04:08.440 --> 00:04:12.730
Which takes us from the set x
all the way to the set z is

00:04:12.730 --> 00:04:16.140
this, if we use the matrix
forms of the two

00:04:16.140 --> 00:04:17.700
transformations.

00:04:17.700 --> 00:04:23.850
Now at the end of last video I
said I wanted to find just

00:04:23.850 --> 00:04:28.500
some matrix that if I were to
multiply times this vector,

00:04:28.500 --> 00:04:30.260
that is equivalent to
this transformation.

00:04:30.260 --> 00:04:32.800
And I know that I can
find this matrix.

00:04:32.800 --> 00:04:36.100
I know that this exists because
this is a linear

00:04:36.100 --> 00:04:37.440
transformation.

00:04:37.440 --> 00:04:38.910
So how can we do that?

00:04:38.910 --> 00:04:42.180
Well, we just do what we've
always done in the past. We

00:04:42.180 --> 00:04:45.040
start with the identity matrix,
and we apply the

00:04:45.040 --> 00:04:48.370
transformation to every column
of the identity matrix.

00:04:48.370 --> 00:04:51.980
And then you end up with your
matrix representation of the

00:04:51.980 --> 00:04:53.530
transformation itself.

00:04:53.530 --> 00:04:55.200
So first of all, how
big is the identity

00:04:55.200 --> 00:04:56.750
matrix going to be?

00:04:56.750 --> 00:04:59.600
Well, these guys that we're
inputting into our

00:04:59.600 --> 00:05:03.500
transformation, they are subsets
of x, or they're

00:05:03.500 --> 00:05:05.960
members of x, which is
an n dimensional

00:05:05.960 --> 00:05:07.410
space, a subset of Rn.

00:05:13.920 --> 00:05:18.460
So all we do to figure out C
is we start off with the

00:05:18.460 --> 00:05:19.710
identity matrix.

00:05:21.880 --> 00:05:24.610
The n dimensional identity
matrix, because

00:05:24.610 --> 00:05:27.110
our domain is Rn.

00:05:27.110 --> 00:05:28.705
And of course we know what
that looks like.

00:05:31.340 --> 00:05:34.600
We have 1, 0 all the way down.

00:05:34.600 --> 00:05:37.880
It's going to be an n by n
matrix, and then 0, 1 all the

00:05:37.880 --> 00:05:39.540
way down 0's.

00:05:39.540 --> 00:05:42.410
These 0's right here, and then
you have 1's go all the way

00:05:42.410 --> 00:05:46.430
down the columns and everything
else is 0.

00:05:46.430 --> 00:05:48.680
We've seen this multiple times
that's what your identity

00:05:48.680 --> 00:05:51.970
matrix looks like, just 1's down
the column from the top

00:05:51.970 --> 00:05:53.700
left to the bottom right.

00:05:53.700 --> 00:05:59.340
Now to figure out C, the matrix
representation of our

00:05:59.340 --> 00:06:03.060
transformation, all we do is we
apply the transformation to

00:06:03.060 --> 00:06:04.950
each of these columns.

00:06:04.950 --> 00:06:12.580
So we can write that our matrix
C is equal to the

00:06:12.580 --> 00:06:14.900
transformation applied
to this first column.

00:06:14.900 --> 00:06:15.615
What is the transformation?

00:06:15.615 --> 00:06:23.150
It is the matrix B times the
matrix A times whatever you're

00:06:23.150 --> 00:06:24.450
taking the transformation of.

00:06:24.450 --> 00:06:26.190
In this case we're taking the
transformation of that.

00:06:26.190 --> 00:06:30.850
We're taking the transformation
of 1, 0, 0 all

00:06:30.850 --> 00:06:31.380
the way down.

00:06:31.380 --> 00:06:34.100
There's 1 followed by
a bunch of 0's.

00:06:34.100 --> 00:06:36.350
That's going to be our
first column of C.

00:06:36.350 --> 00:06:42.370
Our second column of C is going
to be B times A times

00:06:42.370 --> 00:06:45.300
the second column of our
identity matrix.

00:06:45.300 --> 00:06:47.650
And, of course, you remember
these are each the standard

00:06:47.650 --> 00:06:49.980
basis vectors for Rn.

00:06:57.220 --> 00:07:00.740
So this is going to be times
E2, which is a 0, 1,

00:07:00.740 --> 00:07:04.290
0 all the way down.

00:07:04.290 --> 00:07:06.560
And then we're going to keep
doing that until we do get to

00:07:06.560 --> 00:07:13.700
the last column, which is B
times A times a bunch of 0's

00:07:13.700 --> 00:07:15.680
all the way down
until get a 1.

00:07:15.680 --> 00:07:18.970
The nth term is just
a 1 right there.

00:07:18.970 --> 00:07:22.110
Now what is this going
to be equal to?

00:07:22.110 --> 00:07:24.540
It looks fairly complicated
right now.

00:07:24.540 --> 00:07:27.970
But all you have to do is make
the realization-- and we've

00:07:27.970 --> 00:07:29.500
seen this multiple times.

00:07:29.500 --> 00:07:33.490
If we write our vector A or we
write our matrix A as just a

00:07:33.490 --> 00:07:34.690
bunch of column vectors.

00:07:34.690 --> 00:07:40.610
So this is a column vector A1,
A2, all the way to An.

00:07:43.150 --> 00:07:45.413
We already learned that this
was and n buy m matrix.

00:07:48.690 --> 00:07:56.670
Then what is the vector A times,
for example, x1, x2 to

00:07:56.670 --> 00:07:59.140
all the way down to xn.

00:07:59.140 --> 00:08:00.800
We've seen this multiple
times.

00:08:00.800 --> 00:08:12.390
This is the equivalent to x1
times A1 plus x2 times A2, all

00:08:12.390 --> 00:08:16.210
the way to plus xn times An.

00:08:16.210 --> 00:08:17.460
We've seen this multiple
times.

00:08:17.460 --> 00:08:20.290
It's a linear combination of
these column vectors where the

00:08:20.290 --> 00:08:23.000
waiting factors are the terms
in our vector that we're

00:08:23.000 --> 00:08:24.470
taking the product of.

00:08:24.470 --> 00:08:27.620
So given that, what is this
guy going to reduce to?

00:08:27.620 --> 00:08:31.410
This is going to be A1 times
this first entry right here,

00:08:31.410 --> 00:08:36.100
times x1, plus A2 times a second
entry, plus A3 times a

00:08:36.100 --> 00:08:36.559
third entry.

00:08:36.559 --> 00:08:37.900
But all these other
entries are 0.

00:08:37.900 --> 00:08:40.189
The x2's all the way
to the xn are 0's.

00:08:40.189 --> 00:08:43.789
So you're only going to end
up with 1 times the first

00:08:43.789 --> 00:08:45.590
column here in A.

00:08:45.590 --> 00:08:48.680
So this will reduce to--
let me write this.

00:08:48.680 --> 00:08:56.820
So the first column is going
to be B times-- now A times

00:08:56.820 --> 00:09:01.780
this E1 vector, I guess we could
call it, right there is

00:09:01.780 --> 00:09:05.720
just going to be 1 times the
first column in A plus 0 times

00:09:05.720 --> 00:09:08.430
the second column in A plus
0 times the third column.

00:09:08.430 --> 00:09:11.420
So it's just 1 times the
first column in A.

00:09:11.420 --> 00:09:15.240
So it's just A1.

00:09:15.240 --> 00:09:16.300
That simple.

00:09:16.300 --> 00:09:18.610
Now what is this one going
to be equal to?

00:09:18.610 --> 00:09:23.740
It's going to be 0 times the
first column in A, plus 1

00:09:23.740 --> 00:09:27.660
times a second column in A, plus
0 times a third column in

00:09:27.660 --> 00:09:28.180
A, and the rest are
going to be 0's.

00:09:28.180 --> 00:09:31.250
So it's just going to be 1 times
the second column in A.

00:09:31.250 --> 00:09:34.410
So the second column in our
transformation matrix is just

00:09:34.410 --> 00:09:37.850
going to be B times A2.

00:09:37.850 --> 00:09:40.230
And I think you get
the idea here.

00:09:40.230 --> 00:09:42.830
The next one is going to be B
times A3 and all the way until

00:09:42.830 --> 00:09:46.660
you get B times An.

00:09:50.870 --> 00:09:52.670
So that's how you would
solve for your

00:09:52.670 --> 00:09:53.800
transformation matrix.

00:09:53.800 --> 00:09:55.050
Remember what we were
trying to do.

00:09:55.050 --> 00:09:59.100
We were trying to find some--
let me write down and

00:09:59.100 --> 00:10:02.140
summarize everything that
we've done so far.

00:10:02.140 --> 00:10:09.170
We had a mapping S, that was
a mapping from x to y.

00:10:09.170 --> 00:10:13.490
But x was a subset of Rn.

00:10:13.490 --> 00:10:17.370
Y was a subset of Rm.

00:10:17.370 --> 00:10:21.110
And so we said that this linear
transformation could be

00:10:21.110 --> 00:10:27.760
represented as some matrix A
where A is an m by n matrix

00:10:27.760 --> 00:10:29.750
times a vector x.

00:10:29.750 --> 00:10:33.700
Then I showed you another
transformation, we already

00:10:33.700 --> 00:10:39.320
called it T, which was a
mapping from y to z.

00:10:39.320 --> 00:10:40.570
z is a subset of Rl.

00:10:44.030 --> 00:10:47.490
And of course, the
transformation T applied to

00:10:47.490 --> 00:10:53.430
some vector in y, can be
represented as some matrix B

00:10:53.430 --> 00:10:57.450
times that vector.

00:10:57.450 --> 00:10:58.740
I shouldn't have drawn
parentheses there,

00:10:58.740 --> 00:10:59.430
but you get the idea.

00:10:59.430 --> 00:11:03.870
And this, since it's a mapping
from a subset of our Rm to Rl,

00:11:03.870 --> 00:11:07.850
this will be an l by m matrix.

00:11:07.850 --> 00:11:12.220
And then we said, look, if
we actually just take the

00:11:12.220 --> 00:11:20.750
composition of T with S,
of some vector in x,

00:11:20.750 --> 00:11:23.180
this reduced to B.

00:11:23.180 --> 00:11:25.790
So first we applied the
S transformation.

00:11:25.790 --> 00:11:29.060
We multiplied the matrix
A times x.

00:11:33.810 --> 00:11:36.800
And then we applied the T
transformation to this.

00:11:36.800 --> 00:11:38.910
So we just multiplied
B times that.

00:11:42.200 --> 00:11:45.100
Now we know this is a linear
transformation, which means it

00:11:45.100 --> 00:11:47.450
can be represented as a
matrix vector product.

00:11:47.450 --> 00:11:50.840
And we just figured out what the
matrix vector product is.

00:11:50.840 --> 00:12:00.210
So this thing is going to be
equal to C times x, which is

00:12:00.210 --> 00:12:03.400
equal to this thing right there,
which is equal to that

00:12:03.400 --> 00:12:04.040
thing right there.

00:12:04.040 --> 00:12:16.280
Which is equal to-- let me write
it this way-- B, A1,

00:12:16.280 --> 00:12:20.020
where A1 is the first column
vector in our matrix A.

00:12:20.020 --> 00:12:23.030
And then the second column
here is going to be B.

00:12:23.030 --> 00:12:26.990
And then we have A2, where
this is the second column

00:12:26.990 --> 00:12:27.970
vector in A.

00:12:27.970 --> 00:12:42.140
And you can keep going all the
way until you have B times An

00:12:42.140 --> 00:12:43.770
times x, of course.

00:12:51.670 --> 00:12:52.980
Now this is fair enough.

00:12:52.980 --> 00:12:56.470
We can always do this if you
give me some matrix.

00:12:56.470 --> 00:13:00.350
Remember this is an
l by m matrix.

00:13:00.350 --> 00:13:05.370
And you give me another matrix
right here that is an m by n

00:13:05.370 --> 00:13:08.650
matrix, I can always do this.

00:13:08.650 --> 00:13:11.250
And how do I know I can
I always do that?

00:13:11.250 --> 00:13:16.000
Because each of these
A's are going to

00:13:16.000 --> 00:13:17.900
have m entries, right?

00:13:17.900 --> 00:13:22.580
They're going to be Ai.

00:13:22.580 --> 00:13:25.150
All of them are going to
be members of our Rm.

00:13:25.150 --> 00:13:26.490
So this is well-defined.

00:13:26.490 --> 00:13:28.080
This has m columns.

00:13:28.080 --> 00:13:29.360
This has m entries.

00:13:29.360 --> 00:13:32.820
So each of these matrix vector
products are well-defined.

00:13:32.820 --> 00:13:36.480
Now, this is an interesting
thing, because we were able to

00:13:36.480 --> 00:13:39.620
figure out the actual matrix
representation of this

00:13:39.620 --> 00:13:42.350
composition transformation.

00:13:42.350 --> 00:13:43.970
Let's extend it a little
bit further.

00:13:43.970 --> 00:13:47.630
Wouldn't it be nice if this
were the same thing as the

00:13:47.630 --> 00:13:49.820
matrices B times A.

00:13:58.860 --> 00:14:00.740
All of that times x.

00:14:04.050 --> 00:14:06.500
Wouldn't it be nice if these
were the same thing?

00:14:06.500 --> 00:14:10.010
Because then we could say that
the composition of T with S of

00:14:10.010 --> 00:14:14.490
x is equal to the matrix
representation of B times a

00:14:14.490 --> 00:14:18.580
matrix representation of S.

00:14:18.580 --> 00:14:20.270
And you take the product
of those two.

00:14:20.270 --> 00:14:22.690
And that will create a new
matrix representation which

00:14:22.690 --> 00:14:24.135
you can call C.

00:14:24.135 --> 00:14:26.600
That you can then multiply
times x.

00:14:26.600 --> 00:14:29.480
So you won't have to do it
individually every time, or do

00:14:29.480 --> 00:14:30.360
it this way.

00:14:30.360 --> 00:14:33.870
And I guess the truth of the
matter is there is nothing to

00:14:33.870 --> 00:14:38.330
stop us from defining this
to be equal to B times A.

00:14:38.330 --> 00:14:42.080
We have not defined what a
matrix times a matrix is yet.

00:14:42.080 --> 00:14:43.290
So we might as well.

00:14:43.290 --> 00:14:45.500
This is a good enough motivation
for us to define it

00:14:45.500 --> 00:14:46.530
in this way.

00:14:46.530 --> 00:14:48.010
So let's throw in
this definition.

00:14:52.360 --> 00:14:54.510
So if we have some matrix B.

00:14:59.010 --> 00:15:04.980
B is an l by m matrix.

00:15:04.980 --> 00:15:08.630
And then we have some other
matrix A-- and I'll actually

00:15:08.630 --> 00:15:11.090
show what A looks like, where
these are its column vectors.

00:15:11.090 --> 00:15:16.600
A1, A2, all the way to An.

00:15:16.600 --> 00:15:18.500
We're going to define
the product.

00:15:18.500 --> 00:15:19.750
So this is a definition.

00:15:22.730 --> 00:15:28.880
We're going to define the
product BA as being equal to

00:15:28.880 --> 00:15:33.360
the matrix B times each of
the column vectors of A.

00:15:33.360 --> 00:15:36.080
So it's B times A1.

00:15:36.080 --> 00:15:37.410
That's going to be
its first column.

00:15:37.410 --> 00:15:40.220
This is going to
be B times A2.

00:15:40.220 --> 00:15:44.320
All the way to B times An.

00:15:44.320 --> 00:15:46.750
And you've seen this before in
algebra two, but the reason

00:15:46.750 --> 00:15:50.740
why I went through almost two
videos to get to here, is to

00:15:50.740 --> 00:15:56.480
show you the motivation for
why matrix products are

00:15:56.480 --> 00:15:57.670
defined this way.

00:15:57.670 --> 00:16:00.270
Because it makes the notion
of compositions of

00:16:00.270 --> 00:16:01.900
transformations kind
of natural.

00:16:01.900 --> 00:16:05.740
If you take the composition of
one linear transformation with

00:16:05.740 --> 00:16:10.050
another, the resulting
transformation matrix is just

00:16:10.050 --> 00:16:14.000
the product, as we've just
defined it, of their two

00:16:14.000 --> 00:16:16.250
transformation matrices.

00:16:16.250 --> 00:16:19.850
For those of you who might not
have a lot of experience

00:16:19.850 --> 00:16:22.590
taking products of matrices, and
who think this is fairly

00:16:22.590 --> 00:16:25.240
abstract to look at, in the next
video I'll actually do a

00:16:25.240 --> 00:16:27.270
bunch of examples and show you
that this definition is

00:16:27.270 --> 00:16:29.560
actually fairly straightforward.