Vector triangle inequality

WEBVTT
Kind: captions
Language: en

00:00:00.570 --> 00:00:04.490
In the last video, we showed
you the Cauchy-Schwarz

00:00:04.490 --> 00:00:05.740
Inequality.

00:00:12.690 --> 00:00:15.395
I think it's worth rewriting
because this is something

00:00:15.395 --> 00:00:16.530
that's going to show up a lot.

00:00:16.530 --> 00:00:18.570
It's a very useful tool.

00:00:18.570 --> 00:00:24.220
And that just told us if I have
two vectors, x and y,

00:00:24.220 --> 00:00:27.120
they're both members of Rn.

00:00:27.120 --> 00:00:31.390
And they're both nonzero
vectors.

00:00:31.390 --> 00:00:33.650
And that was an assumption we
had to make when we did the

00:00:33.650 --> 00:00:36.970
proof, otherwise there was a
potential of dividing by one

00:00:36.970 --> 00:00:37.530
of their magnitudes.

00:00:37.530 --> 00:00:39.500
So that would've been
a big no-no.

00:00:39.500 --> 00:00:42.830
But if we assume that they're
both nonzero, then we can say

00:00:42.830 --> 00:00:48.990
that the absolute value of their
dot products is going to

00:00:48.990 --> 00:00:51.970
be less than or equal
to the products of

00:00:51.970 --> 00:00:53.740
their individual lengths.

00:00:53.740 --> 00:00:56.760
So that's the length of vector x
and we defined that a couple

00:00:56.760 --> 00:00:57.730
of videos ago.

00:00:57.730 --> 00:01:00.890
And then this is the
length of vector y.

00:01:00.890 --> 00:01:02.870
And of course, this is just a
regular number and then each

00:01:02.870 --> 00:01:04.209
of these are just
regular numbers.

00:01:04.209 --> 00:01:06.190
They're not vectors once
you take a length.

00:01:06.190 --> 00:01:08.780
The length of a 50 dimensional
vector could just

00:01:08.780 --> 00:01:09.940
be the number 3.

00:01:09.940 --> 00:01:11.340
It's just a scalar value.

00:01:11.340 --> 00:01:14.190
So this is just scalar
multiplication here.

00:01:14.190 --> 00:01:17.710
And we also learned that the
only time that this inequality

00:01:17.710 --> 00:01:25.310
turns into an equality is the
situation where x is equal to

00:01:25.310 --> 00:01:28.040
some scalar multiple of y.

00:01:28.040 --> 00:01:30.040
And so in some textbooks you'll
say-- and this has to

00:01:30.040 --> 00:01:32.240
be a nonzero scalar multiple.

00:01:32.240 --> 00:01:33.190
But that's a bit obvious.

00:01:33.190 --> 00:01:35.800
I told you that x and
y are nonzero.

00:01:35.800 --> 00:01:39.910
So if this was 0 then
x would be 0.

00:01:39.910 --> 00:01:41.800
And we already said
that x is not 0.

00:01:41.800 --> 00:01:44.180
But if you want to say there you
could say that you know c

00:01:44.180 --> 00:01:45.440
also is going to be nonzero.

00:01:48.170 --> 00:01:50.040
But that essentially
just falls out of

00:01:50.040 --> 00:01:51.050
this information there.

00:01:51.050 --> 00:01:55.770
But if this is the case and if
and only if this is the case,

00:01:55.770 --> 00:01:59.550
then we can say that the
absolute value of the dot

00:01:59.550 --> 00:02:03.490
product of the two vectors
is equal to the

00:02:03.490 --> 00:02:07.110
product of their lengths.

00:02:07.110 --> 00:02:09.220
Now, this is all just
a review of what I

00:02:09.220 --> 00:02:10.729
did in the last video.

00:02:10.729 --> 00:02:12.850
Now what else can we do
that's useful with it?

00:02:12.850 --> 00:02:16.030
So let's just play around
a little bit.

00:02:16.030 --> 00:02:17.890
I can't claim to be
experimenting, I know where

00:02:17.890 --> 00:02:19.560
this is going to go.

00:02:19.560 --> 00:02:22.710
Let's see what happens
if I were to take the

00:02:22.710 --> 00:02:29.690
length of x plus y.

00:02:29.690 --> 00:02:32.240
So I'm going to add the two
vectors and then take the

00:02:32.240 --> 00:02:34.910
length of that vector squared.

00:02:34.910 --> 00:02:37.420
Well we know from a couple of
videos ago that the length

00:02:37.420 --> 00:02:41.650
squared can also be rewritten as
the dot product of a vector

00:02:41.650 --> 00:02:43.140
with itself.

00:02:43.140 --> 00:02:44.880
This right here, x
plus y, I know it

00:02:44.880 --> 00:02:45.860
looks like two vectors.

00:02:45.860 --> 00:02:47.820
But it's two vectors added
to each other.

00:02:47.820 --> 00:02:50.700
So it's really a vector. x
plus y is a real vector.

00:02:50.700 --> 00:02:52.560
I could graph x plus y.

00:02:52.560 --> 00:02:55.980
So the length of x plus y
squared, I can rewrite it as

00:02:55.980 --> 00:02:59.010
the dot product of that
vector with itself.

00:02:59.010 --> 00:03:04.870
So x plus y dot x plus y.

00:03:04.870 --> 00:03:05.940
And all of these are vectors.

00:03:05.940 --> 00:03:07.240
These aren't just numbers.

00:03:07.240 --> 00:03:08.320
And this is the dot product.

00:03:08.320 --> 00:03:10.220
It's just not normal
multiplication.

00:03:10.220 --> 00:03:14.320
But we saw two videos ago that
the dot product has the

00:03:14.320 --> 00:03:15.920
distributive and the
associative and the

00:03:15.920 --> 00:03:18.210
commutative properties just
like regular scalar

00:03:18.210 --> 00:03:19.280
multiplication.

00:03:19.280 --> 00:03:23.930
So you can kind of FOIL this out
if that's how you remember

00:03:23.930 --> 00:03:24.940
multiplying your binomials.

00:03:24.940 --> 00:03:27.150
Or I will think of it more as
just doing the distributive

00:03:27.150 --> 00:03:28.370
property twice.

00:03:28.370 --> 00:03:34.230
So this can be rewritten
as x dot x.

00:03:34.230 --> 00:03:36.160
Actually, let me write it as
the distributive property

00:03:36.160 --> 00:03:38.690
because that's sometimes not
obvious to a lot of people.

00:03:38.690 --> 00:03:43.640
So let me write this x as a
yellow x and let me write this

00:03:43.640 --> 00:03:45.790
whole term as x plus y.

00:03:45.790 --> 00:03:53.550
So this right here can be
rewritten as x dot-- so this x

00:03:53.550 --> 00:03:57.620
dot this x plus y.

00:03:57.620 --> 00:04:02.270
And then it would be plus
this y dot-- I want

00:04:02.270 --> 00:04:04.470
to just switch colors.

00:04:04.470 --> 00:04:11.440
Plus this y dot x plus y.

00:04:11.440 --> 00:04:13.100
It's good to see that when
you're multiplying these,

00:04:13.100 --> 00:04:15.650
you're just applying the
distributive property.

00:04:15.650 --> 00:04:19.630
All I did is I distributed this
term along each of these

00:04:19.630 --> 00:04:21.430
terms into sum right here.

00:04:21.430 --> 00:04:22.780
So then I got this.

00:04:22.780 --> 00:04:25.240
And then I can distribute each
of these into the sum.

00:04:25.240 --> 00:04:29.990
So then this becomes-- I'll be
careful with the colors-- x

00:04:29.990 --> 00:04:38.580
dot x plus x dot y.

00:04:38.580 --> 00:04:41.070
Maybe this was a little bit
overkill, but I think it's

00:04:41.070 --> 00:04:43.030
good to see that this isn't
just some magic here.

00:04:43.030 --> 00:04:45.560
And we're just using the exact
properties that we proved with

00:04:45.560 --> 00:04:46.680
the dot product.

00:04:46.680 --> 00:04:48.190
So that's that right there.

00:04:48.190 --> 00:04:52.655
And then it's plus y dot x.

00:04:57.850 --> 00:05:06.350
Plus this yellow y
dot the yellow x.

00:05:06.350 --> 00:05:10.100
Sorry, dot the blue y.

00:05:10.100 --> 00:05:14.200
So the magnitude or the length
of our vector x plus y squared

00:05:14.200 --> 00:05:16.780
can be rewritten like this.

00:05:16.780 --> 00:05:19.390
And I'll just switch
back to one color.

00:05:19.390 --> 00:05:24.300
So this equals that and all of
that-- what does this equal?

00:05:24.300 --> 00:05:28.850
This is equal to x dot x.

00:05:28.850 --> 00:05:30.300
What's x dot x?

00:05:30.300 --> 00:05:32.216
x dot x is just the magnitude.

00:05:32.216 --> 00:05:35.490
So let me write this is just
equal to the magnitude

00:05:35.490 --> 00:05:38.740
of our vector x.

00:05:38.740 --> 00:05:40.200
I should stop using the
word magnitude.

00:05:40.200 --> 00:05:44.100
The length of our vector
x squared.

00:05:44.100 --> 00:05:46.930
And then I have two
terms here.

00:05:46.930 --> 00:05:50.100
I have an x dot y
and a y dot x.

00:05:50.100 --> 00:05:54.830
We know that x dot y and y dot
x are really the same thing.

00:05:54.830 --> 00:05:58.150
We showed that order doesn't
matter when you take the dot

00:05:58.150 --> 00:05:59.750
product, just like it doesn't
matter with regular

00:05:59.750 --> 00:06:00.830
multiplication.

00:06:00.830 --> 00:06:04.400
So these are really the same
terms. So we could write plus

00:06:04.400 --> 00:06:10.430
2 times x dot y.

00:06:10.430 --> 00:06:12.830
And then finally, we have that
last term sitting here.

00:06:12.830 --> 00:06:14.640
We have this y dot y.

00:06:14.640 --> 00:06:17.800
y dot y is the same thing
as the length of

00:06:17.800 --> 00:06:23.080
our vector y squared.

00:06:23.080 --> 00:06:27.530
Now, let's see if we can break
out our Cauchy-Schwarz

00:06:27.530 --> 00:06:29.010
Inequality.

00:06:29.010 --> 00:06:32.360
Or maybe Schwarz, I don't know
if I'm pronouncing it right.

00:06:32.360 --> 00:06:33.972
But x dot y.

00:06:33.972 --> 00:06:39.250
t We have the absolute value
of x dot y here.

00:06:39.250 --> 00:06:46.100
But we know that just x dot y is
going to be-- it has to be

00:06:46.100 --> 00:06:48.760
less than or equal to the
absolute value of x dot y.

00:06:53.620 --> 00:06:54.780
Why is that?

00:06:54.780 --> 00:06:56.370
Well this could be negative.

00:06:56.370 --> 00:06:57.910
I could show you
examples of dot

00:06:57.910 --> 00:06:59.050
products that are negative.

00:06:59.050 --> 00:07:03.620
In fact, if x has all positive
terms and y has all negative

00:07:03.620 --> 00:07:06.740
terms, you're going to have
a negative dot product.

00:07:06.740 --> 00:07:09.170
So this could be negative
or it could be positive.

00:07:09.170 --> 00:07:10.650
If it's positive the absolute
value-- their

00:07:10.650 --> 00:07:11.750
equal to each other.

00:07:11.750 --> 00:07:14.130
If this is negative, than this
absolute value is definitely

00:07:14.130 --> 00:07:16.690
going to be greater than it.

00:07:16.690 --> 00:07:19.040
We can add to the Cauchy-Schwarz
Inequality and

00:07:19.040 --> 00:07:20.300
this is a bit obvious.

00:07:20.300 --> 00:07:27.310
We could say look, we could add
a little x dot y is less

00:07:27.310 --> 00:07:29.890
than or equal to the absolute
value of x dot y.

00:07:29.890 --> 00:07:33.890
Which is less than or equal to
the length of x times the

00:07:33.890 --> 00:07:35.160
length of y.

00:07:35.160 --> 00:07:42.580
So x dot y is definite-- this,
the dot product of x with y is

00:07:42.580 --> 00:07:44.940
definitely less than it's
absolute value of that.

00:07:44.940 --> 00:07:47.740
Which is definitely less than
the lengths of those two

00:07:47.740 --> 00:07:49.900
multiplied.

00:07:49.900 --> 00:07:54.870
So if I rewrite this, this
statement right here is

00:07:54.870 --> 00:08:02.830
definitely less than or equal
to this exact statement.

00:08:02.830 --> 00:08:06.430
But if I replace these with the
lengths of the vectors.

00:08:06.430 --> 00:08:10.720
So that is definitely less than
or equal to-- I'm just

00:08:10.720 --> 00:08:16.470
rewriting this x squared and
I'll write the plus 2 there.

00:08:16.470 --> 00:08:17.200
Plus 2.

00:08:17.200 --> 00:08:20.110
But I want to make it very clear
what I'm replacing here.

00:08:20.110 --> 00:08:22.790
And then I have the
plus length of my

00:08:22.790 --> 00:08:25.280
vector y there squared.

00:08:25.280 --> 00:08:27.610
Now this I'm saying, this is
definitely less than the

00:08:27.610 --> 00:08:30.100
absolute value of x dot y.

00:08:30.100 --> 00:08:35.400
Which is definitely less, by the
Cauchy-Schwarz Inequality,

00:08:35.400 --> 00:08:40.770
definitely less than the product
of the two lengths.

00:08:40.770 --> 00:08:43.880
So I'm just replacing this
with the product

00:08:43.880 --> 00:08:46.740
of their two lengths.

00:08:46.740 --> 00:08:55.730
So I'm going to put the length
of x times the length of y.

00:08:55.730 --> 00:08:57.420
And since this is the
same as that, this

00:08:57.420 --> 00:08:58.310
is the same as that.

00:08:58.310 --> 00:09:00.740
But this is definitely
less than this.

00:09:00.740 --> 00:09:05.140
This whole term has to be less
than this whole term.

00:09:05.140 --> 00:09:07.510
Now let me just remind you
what we were doing.

00:09:07.510 --> 00:09:10.860
I said that this thing that I
wrote over here, this is the

00:09:10.860 --> 00:09:12.100
same as that.

00:09:12.100 --> 00:09:14.690
So this thing up here, which is
the same as that, which is

00:09:14.690 --> 00:09:16.050
less than that also.

00:09:16.050 --> 00:09:23.030
So we can write that the
magnitude of x plus y squared

00:09:23.030 --> 00:09:25.500
and not the magnitude, the
length of the vector x plus y

00:09:25.500 --> 00:09:28.030
squared is less than
this whole thing

00:09:28.030 --> 00:09:30.240
that I wrote out here.

00:09:30.240 --> 00:09:31.850
Or less than or equal to.

00:09:31.850 --> 00:09:33.220
Now, what is this thing?

00:09:33.220 --> 00:09:35.900
Remember, I mean this might look
all fancy with my little

00:09:35.900 --> 00:09:37.840
double lines around
everything.

00:09:37.840 --> 00:09:39.210
But these are just numbers.

00:09:39.210 --> 00:09:43.070
This length of x squared,
this is just a number.

00:09:43.070 --> 00:09:45.440
Each of these are numbers and I
can just say hey, look, this

00:09:45.440 --> 00:09:46.770
looks like a perfect
square to me.

00:09:49.680 --> 00:09:52.510
This term on the right-hand side
is the exact same thing

00:09:52.510 --> 00:09:57.913
as the length of x plus
the length of y.

00:10:03.850 --> 00:10:05.690
Everything squared.

00:10:05.690 --> 00:10:09.000
If you just squared this out
you'll get x squared plus 2

00:10:09.000 --> 00:10:10.325
times the length of x times the

00:10:10.325 --> 00:10:12.580
length of y plus y squared.

00:10:12.580 --> 00:10:23.450
So our length of the vector x
plus y squared is less than or

00:10:23.450 --> 00:10:25.500
equal to this quantity
over here.

00:10:25.500 --> 00:10:28.020
And if we just take the square
root of both sides of this,

00:10:28.020 --> 00:10:33.820
you get the length of our vector
x plus y is less than

00:10:33.820 --> 00:10:42.560
or equal to the length of the
vector x by itself plus the

00:10:42.560 --> 00:10:45.800
length of the vector y.

00:10:45.800 --> 00:10:49.470
And we call this the triangle
inequality, which you might

00:10:49.470 --> 00:10:50.865
have remembered from geometry.

00:10:56.030 --> 00:10:58.270
Now why is it called the
triangle inequality?

00:10:58.270 --> 00:11:00.430
Well you could imagine
each of these to be

00:11:00.430 --> 00:11:01.520
separate side of a triangle.

00:11:01.520 --> 00:11:02.600
In fact, let's draw it.

00:11:02.600 --> 00:11:04.190
We can draw this in R2.

00:11:04.190 --> 00:11:08.225
Let me turn my graph paper on.

00:11:08.225 --> 00:11:10.710
Let me see where the
graphs show up.

00:11:10.710 --> 00:11:14.170
If I turn my graph paper
on right there, maybe

00:11:14.170 --> 00:11:15.420
I'll draw it here.

00:11:15.420 --> 00:11:18.540
So let's draw my vector x.

00:11:18.540 --> 00:11:23.260
So let's say that my vector x
look something like this.

00:11:23.260 --> 00:11:24.730
Let's say that's my vector x.

00:11:24.730 --> 00:11:26.610
It's a vector 2, 4.

00:11:26.610 --> 00:11:28.860
So that's my vector x.

00:11:28.860 --> 00:11:32.810
And let's say my vector y-- well
I'm just going to do it

00:11:32.810 --> 00:11:35.130
head to tail because I'm
going to add the two.

00:11:35.130 --> 00:11:38.420
So my vector y-- I'm going to do
it in nonstandard position.

00:11:38.420 --> 00:11:42.690
Let's say it's look something
like-- let's say my vector y

00:11:42.690 --> 00:11:45.330
looks something like this.

00:11:45.330 --> 00:11:48.430
Draw it properly.

00:11:48.430 --> 00:11:49.680
That's my vector y.

00:11:52.500 --> 00:11:56.060
What does x plus y look like?

00:11:56.060 --> 00:11:59.330
And remember, I can't
necessarily draw any two

00:11:59.330 --> 00:12:01.020
vectors on a two-dimensional
space like this.

00:12:01.020 --> 00:12:03.470
I'm just assuming that
these are in R2.

00:12:03.470 --> 00:12:04.986
But this is just to
give you the idea.

00:12:07.650 --> 00:12:09.500
So then this is their
sum, right?

00:12:09.500 --> 00:12:12.490
You took from the tail of
x to the head of y.

00:12:12.490 --> 00:12:17.260
So this vector right here
is the vector x plus y.

00:12:17.260 --> 00:12:19.000
And that's why it's called
the triangle inequality.

00:12:19.000 --> 00:12:22.340
It's just saying that look, this
thing is always going to

00:12:22.340 --> 00:12:27.370
be less than or equal to-- or
the length of this thing is

00:12:27.370 --> 00:12:29.680
always going to be less than or
equal to the length of this

00:12:29.680 --> 00:12:32.160
thing plus the length
of this thing.

00:12:32.160 --> 00:12:33.980
And that's kind of obvious
when you just learn

00:12:33.980 --> 00:12:35.250
two-dimensional geometry.

00:12:35.250 --> 00:12:38.880
That look, this is a much more
efficient way of getting from

00:12:38.880 --> 00:12:40.860
this point to this point
than going out here and

00:12:40.860 --> 00:12:42.200
then going out here.

00:12:42.200 --> 00:12:46.850
And then, what's the case in
which this length is equal to

00:12:46.850 --> 00:12:47.880
these lengths?

00:12:47.880 --> 00:12:50.280
Well if you keep flattening this
triangle out and you go

00:12:50.280 --> 00:12:54.510
to the extreme case where
maybe the vector

00:12:54.510 --> 00:12:55.760
x looks like this.

00:12:58.950 --> 00:13:03.870
And if the vector y is just
kind of going in the exact

00:13:03.870 --> 00:13:08.630
same-- vector y is going in
the exact same direction,

00:13:08.630 --> 00:13:09.880
maybe it's going a little
bit further.

00:13:14.470 --> 00:13:17.790
This is vector x, this
is vector y.

00:13:17.790 --> 00:13:21.120
Now x plus y will just
be this whole vector.

00:13:21.120 --> 00:13:22.770
Now that whole thing
is x plus y.

00:13:22.770 --> 00:13:27.070
And this is the case now where
you actually-- where the

00:13:27.070 --> 00:13:29.330
triangle inequality turns
into an equality.

00:13:29.330 --> 00:13:30.480
That's why that little
equal sign is there.

00:13:30.480 --> 00:13:32.460
The extreme case where

00:13:32.460 --> 00:13:35.560
essentially, x and y are collinear.

00:13:35.560 --> 00:13:36.780
And why does that work out?

00:13:36.780 --> 00:13:40.225
We can even go back to our
math and understand that.

00:13:40.225 --> 00:13:41.950
So let me turn my graph off.

00:13:41.950 --> 00:13:44.220
We can go back to
our math here.

00:13:44.220 --> 00:13:48.050
If I go back to this point,
remember, right here I made

00:13:48.050 --> 00:13:50.760
the statement, look, this thing
is definitely less than

00:13:50.760 --> 00:13:52.180
this thing over here.

00:13:52.180 --> 00:13:56.050
But what if I made
an assumption?

00:13:56.050 --> 00:14:04.480
What if I said that x is equal
to some scalar times y?

00:14:04.480 --> 00:14:06.930
And actually, I have to be
careful because just some

00:14:06.930 --> 00:14:12.420
scalar times y-- remember, our
Cauchy-Schwarz Inequality said

00:14:12.420 --> 00:14:18.290
that look, the inequality turns
into an equality if x is

00:14:18.290 --> 00:14:19.810
some nonzero scalar of y.

00:14:19.810 --> 00:14:21.070
And then we can apply this.

00:14:21.070 --> 00:14:24.300
We can say that the absolute
value of x dot y is the same

00:14:24.300 --> 00:14:25.440
as this over here.

00:14:25.440 --> 00:14:28.600
But I don't have the absolute
value of x dot y here.

00:14:28.600 --> 00:14:29.960
I don't know that this
is positive.

00:14:29.960 --> 00:14:32.340
I can say definitively that this
is a positive quantity

00:14:32.340 --> 00:14:34.280
because I took the absolute
value of it.

00:14:34.280 --> 00:14:36.090
No absolute value here.

00:14:36.090 --> 00:14:39.450
So the only way that I can
assure that this is a positive

00:14:39.450 --> 00:14:41.430
quantity, that this is the same
thing as the absolute

00:14:41.430 --> 00:14:45.500
value of x dot y is to enforce--
if I'm kind of going

00:14:45.500 --> 00:14:48.370
to go down this road, is to
enforce that this term right

00:14:48.370 --> 00:14:51.740
here, that c be positive.

00:14:51.740 --> 00:14:58.890
Because if c is positive, then
x dot y, if x dot y then that

00:14:58.890 --> 00:15:04.840
would be the same thing
as cy dot y.

00:15:04.840 --> 00:15:08.720
Which we know is just the same
thing as c times the magnitude

00:15:08.720 --> 00:15:10.440
of y squared.

00:15:10.440 --> 00:15:12.770
And the only way that I can
ensure that this expression

00:15:12.770 --> 00:15:18.340
right here is equal to the
absolute value of x dot y, the

00:15:18.340 --> 00:15:20.830
only way I can assure this
is that c is positive.

00:15:20.830 --> 00:15:24.280
If c is negative, then this is
going to be a negative number

00:15:24.280 --> 00:15:25.270
while this is a positive.

00:15:25.270 --> 00:15:30.690
So if I assume that this is
positive, then I can say that

00:15:30.690 --> 00:15:36.590
x dot y is equal to the absolute
value of x dot y.

00:15:36.590 --> 00:15:39.170
And since it's a scalar
multiple, then I could say

00:15:39.170 --> 00:15:42.820
that that term is equal to, not
just less than or equal

00:15:42.820 --> 00:15:45.490
to, the magnitude
of x's and y's.

00:15:45.490 --> 00:15:46.660
So hopefully I'm not
confusing you.

00:15:46.660 --> 00:15:50.650
So all I'm saying is, if I can
assume that x is some positive

00:15:50.650 --> 00:15:53.430
scalar multiple of y,
that this wouldn't

00:15:53.430 --> 00:15:54.730
be a less than sign.

00:15:54.730 --> 00:15:57.300
Then I could say that x dot
y is the same thing as the

00:15:57.300 --> 00:16:00.500
absolute value of x dot y
since this is positive.

00:16:00.500 --> 00:16:03.470
And if it's the same thing as
the absolute value of x dot y

00:16:03.470 --> 00:16:05.480
and it's some scalar multiple
of each other, than we could

00:16:05.480 --> 00:16:06.430
go down this other route.

00:16:06.430 --> 00:16:09.850
We could say that this
thing here-- I don't

00:16:09.850 --> 00:16:10.700
want to get too messy.

00:16:10.700 --> 00:16:13.980
We could say that this
is equal to that.

00:16:13.980 --> 00:16:17.350
If this is equal to that, then
this would have become an

00:16:17.350 --> 00:16:20.460
equal sign, not a less than
or equal to sign.

00:16:20.460 --> 00:16:24.770
And then we would have had the
limiting case-- I don't want

00:16:24.770 --> 00:16:25.560
to call it the limiting case.

00:16:25.560 --> 00:16:28.920
But we could say that x plus y--
we would've done the same

00:16:28.920 --> 00:16:31.080
work, but we would've had an
equal sign the whole way.

00:16:31.080 --> 00:16:34.620
Would equal the length of x.

00:16:34.620 --> 00:16:37.070
The length of x plus y would
equal the length of x plus the

00:16:37.070 --> 00:16:42.030
length of y in the situation
where x is equal to some

00:16:42.030 --> 00:16:43.930
positive scalar times y.

00:16:43.930 --> 00:16:48.480
So c is greater than 0.

00:16:48.480 --> 00:16:50.200
These two imply each other.

00:16:50.200 --> 00:16:53.060
And we saw that geometrically.

00:16:53.060 --> 00:16:56.820
I lost my axes here, but we see
that the only time that

00:16:56.820 --> 00:16:59.795
the length of x plus y is equal
to the length of x plus

00:16:59.795 --> 00:17:02.550
the length of y is when
they're collinear.

00:17:02.550 --> 00:17:04.720
Over here this plus this is
clearly-- you can just

00:17:04.720 --> 00:17:09.079
visually look at it-- longer
than this right there.

00:17:09.079 --> 00:17:11.930
So you might be saying Sal,
once again, this linear

00:17:11.930 --> 00:17:13.440
algebra's a little bit silly.

00:17:13.440 --> 00:17:15.250
We learned the triangle
inequality in

00:17:15.250 --> 00:17:16.700
eighth or ninth grade.

00:17:16.700 --> 00:17:19.300
Why did you go through all of
this pain to redefine it?

00:17:19.300 --> 00:17:20.800
And this is the interesting
thing.

00:17:20.800 --> 00:17:24.750
What I just drew here and this
is what you learned in ninth

00:17:24.750 --> 00:17:26.290
grade geometry.

00:17:26.290 --> 00:17:27.890
This is just in R2.

00:17:27.890 --> 00:17:31.085
This is just your Cartesian
coordinates, or I don't want

00:17:31.085 --> 00:17:33.120
to use the word dimension too
much because we're going to

00:17:33.120 --> 00:17:33.870
define that formally.

00:17:33.870 --> 00:17:36.290
But this is kind of your
two-dimensional space

00:17:36.290 --> 00:17:37.900
that's going on.

00:17:37.900 --> 00:17:41.440
What's interesting or what's
useful about linear algebra

00:17:41.440 --> 00:17:44.890
is, we've just defined the
triangle inequality for

00:17:44.890 --> 00:17:49.930
arbitrarily large vectors,
or vectors that have an

00:17:49.930 --> 00:17:51.810
arbitrarily high number
of components.

00:17:51.810 --> 00:17:56.170
Each of these, these don't
have to be in R2.

00:17:56.170 --> 00:18:00.830
This is true if we're in R100
where every vector has a

00:18:00.830 --> 00:18:02.500
hundred components to it.

00:18:02.500 --> 00:18:06.270
We've just defined some notion
of the triangle inequality.

00:18:06.270 --> 00:18:09.790
We've abstracted well beyond
just our two-dimensional

00:18:09.790 --> 00:18:10.800
Cartesian coordinates.

00:18:10.800 --> 00:18:14.380
Well beyond even our three
dimensions to essentially, n

00:18:14.380 --> 00:18:15.210
dimensional space.

00:18:15.210 --> 00:18:16.770
And I haven't defined dimensions
yet, but I think

00:18:16.770 --> 00:18:19.400
you're starting to appreciate
what they are.

00:18:19.400 --> 00:18:22.400
But anyway, hopefully you
found that useful.

00:18:22.400 --> 00:18:24.165
We can now take this result.

00:18:26.795 --> 00:18:31.190
And actually, that result with
this result and define what

00:18:31.190 --> 00:18:33.910
the notion of an angle between
two vectors are.

00:18:33.910 --> 00:18:37.010
Once again, you know, on some
levels you're like well, why

00:18:37.010 --> 00:18:37.640
do we have to define an angle?

00:18:37.640 --> 00:18:41.480
Isn't an angle just-- isn't
that just an angle?

00:18:41.480 --> 00:18:43.510
Well yeah, we know what an angle
is in two dimensions,

00:18:43.510 --> 00:18:46.510
but what does an angle mean when
you abstract things to n

00:18:46.510 --> 00:18:47.270
dimensions?

00:18:47.270 --> 00:18:49.580
Or when you're in Rn.

00:18:49.580 --> 00:18:52.550
So that's what we'll talk
about in the next video.


Proof of the Cauchy-Schwarz inequality

WEBVTT
Kind: captions
Language: en

00:00:00.840 --> 00:00:03.270
Let's say that I have
two nonzero vectors.

00:00:03.270 --> 00:00:07.005
Let's say the first vector is
x, the second vector is y.

00:00:09.920 --> 00:00:13.270
They're both in the set Rn
and they're nonzero.

00:00:17.450 --> 00:00:22.133
It turns out that the absolute
value of their-- let me do it

00:00:22.133 --> 00:00:25.320
in a different color.

00:00:25.320 --> 00:00:26.800
This color's nice.

00:00:26.800 --> 00:00:31.080
The absolute value of their
dot product of the two

00:00:31.080 --> 00:00:35.280
vectors-- and remember, this is
just a scalar quantity-- is

00:00:35.280 --> 00:00:40.840
less than or equal to the
product of their lengths.

00:00:40.840 --> 00:00:43.140
And we've defined the dot
product and we've defined

00:00:43.140 --> 00:00:44.230
lengths already.

00:00:44.230 --> 00:00:47.390
It's less than or equal to the
product of their lengths and

00:00:47.390 --> 00:00:50.730
just to push it even further,
the only time that this is

00:00:50.730 --> 00:00:57.930
equal, so the dot product of the
two vectors is only going

00:00:57.930 --> 00:01:01.575
to be equal to the lengths of
this-- the equal and the less

00:01:01.575 --> 00:01:05.470
than or equal apply only in the
situation-- let me write

00:01:05.470 --> 00:01:11.460
that down-- where one of these
vectors is a scalar multiple

00:01:11.460 --> 00:01:11.920
of the other.

00:01:11.920 --> 00:01:13.580
Or they're collinear.

00:01:13.580 --> 00:01:16.430
You know, one's just kind of the
longer or shorter version

00:01:16.430 --> 00:01:17.530
of the other one.

00:01:17.530 --> 00:01:22.250
So only in the situation where
let's just say x is equal to

00:01:22.250 --> 00:01:24.875
some scalar multiple of y.

00:01:27.970 --> 00:01:30.760
These inequalities or I guess
the equality of this

00:01:30.760 --> 00:01:33.215
inequality, this is called the
Cauchy-Schwarz Inequality.

00:01:43.200 --> 00:01:45.580
So let's prove it because you
can't take something like this

00:01:45.580 --> 00:01:46.680
just at face value.

00:01:46.680 --> 00:01:49.040
You shouldn't just
accept that.

00:01:49.040 --> 00:01:53.280
So let me just construct a
somewhat artificial function.

00:01:53.280 --> 00:01:58.180
Let me construct some function
of-- that's a function of some

00:01:58.180 --> 00:02:00.410
variables, some scalar t.

00:02:00.410 --> 00:02:04.710
Let me define p of t to be equal
to the length of the

00:02:04.710 --> 00:02:12.420
vector t times the vector-- some
scalar t times the vector

00:02:12.420 --> 00:02:15.880
y minus the vector x.

00:02:15.880 --> 00:02:17.300
It's the length of
this vector.

00:02:17.300 --> 00:02:19.320
This is going to be
a vector now.

00:02:19.320 --> 00:02:20.920
That squared.

00:02:20.920 --> 00:02:23.130
Now before I move forward
I want to make one

00:02:23.130 --> 00:02:23.790
little point here.

00:02:23.790 --> 00:02:29.740
If I take the length of any
vector, I'll do it here.

00:02:29.740 --> 00:02:32.890
Let's say I take the length
of some vector v.

00:02:32.890 --> 00:02:36.820
I want you to accept that this
is going to be a positive

00:02:36.820 --> 00:02:39.150
number, or it's at least greater
than or equal to 0.

00:02:39.150 --> 00:02:42.940
Because this is just going to be
each of its terms squared.

00:02:42.940 --> 00:02:45.340
v2 squared all the way
to vn squared.

00:02:45.340 --> 00:02:46.640
All of these are real numbers.

00:02:46.640 --> 00:02:49.550
When you square a real number,
you get something greater than

00:02:49.550 --> 00:02:50.770
or equal to 0.

00:02:50.770 --> 00:02:52.290
When you sum them up, you're
going to have something

00:02:52.290 --> 00:02:53.670
greater than or equal to 0.

00:02:53.670 --> 00:02:55.840
And you take the square root
of it, the principal square

00:02:55.840 --> 00:02:57.370
root, the positive square root,
you're going to have

00:02:57.370 --> 00:02:59.270
something greater than
or equal to 0.

00:02:59.270 --> 00:03:02.930
So the length of any real vector
is going to be greater

00:03:02.930 --> 00:03:04.180
than or equal to 0.

00:03:04.180 --> 00:03:06.690
So this is the length
of a real vector.

00:03:06.690 --> 00:03:11.230
So this is going to be greater
than or equal to 0.

00:03:11.230 --> 00:03:14.400
Now, in the previous video, I
think it was two videos ago, I

00:03:14.400 --> 00:03:18.860
also showed that the magnitude
or the length of a vector

00:03:18.860 --> 00:03:22.950
squared can also be rewritten
as the dot product of that

00:03:22.950 --> 00:03:24.570
vector with itself.

00:03:24.570 --> 00:03:26.830
So let's rewrite this
vector that way.

00:03:29.920 --> 00:03:32.750
The length of this vector
squared is equal to the dot

00:03:32.750 --> 00:03:34.230
product of that vector
with itself.

00:03:34.230 --> 00:03:44.880
So it's ty minus x
dot ty minus x.

00:03:44.880 --> 00:03:49.120
In the last video, I showed
you that you can treat a

00:03:49.120 --> 00:03:52.050
multiplication or you can treat
the dot product very

00:03:52.050 --> 00:03:54.330
similar to regular
multiplication when it comes

00:03:54.330 --> 00:03:57.420
to the associative, distributive
and commutative

00:03:57.420 --> 00:03:58.330
properties.

00:03:58.330 --> 00:04:00.200
So when you multiplied these,
you know, you could kind of

00:04:00.200 --> 00:04:02.340
view this as multiplying
these two binomials.

00:04:02.340 --> 00:04:05.440
You can do it the same way as
you would just multiply two

00:04:05.440 --> 00:04:07.360
regular algebraic binomials.

00:04:07.360 --> 00:04:11.030
You're essentially just using
the distributive property.

00:04:11.030 --> 00:04:13.760
But remember, this isn't just
regular multiplication.

00:04:13.760 --> 00:04:15.480
This is the dot product
we're doing.

00:04:15.480 --> 00:04:18.149
This is vector multiplication
or one version of vector

00:04:18.149 --> 00:04:19.220
multiplication.

00:04:19.220 --> 00:04:24.730
So if we distribute it out, this
will become ty dot ty.

00:04:24.730 --> 00:04:25.850
So let me write that out.

00:04:25.850 --> 00:04:30.850
That'll be ty dot ty.

00:04:30.850 --> 00:04:36.430
And then we'll get a minus--
let me do it this way.

00:04:36.430 --> 00:04:42.580
Then we get the minus
x times this ty.

00:04:42.580 --> 00:04:44.640
Instead of saying times,
I should be very

00:04:44.640 --> 00:04:45.720
careful to say dot.

00:04:45.720 --> 00:04:52.400
So minus x dot ty.

00:04:52.400 --> 00:04:58.810
And then you have this ty
times this minus x.

00:04:58.810 --> 00:05:04.860
So then you have
minus ty dot x.

00:05:04.860 --> 00:05:08.900
And then finally, you have the
x's dot with each other.

00:05:08.900 --> 00:05:12.680
And you can view them as
minus 1x dot minus 1x.

00:05:12.680 --> 00:05:16.080
You could say plus minus 1x.

00:05:16.080 --> 00:05:21.500
I could just view this as plus
minus 1 or plus minus 1.

00:05:21.500 --> 00:05:26.260
So this is minus 1x
dot minus 1x.

00:05:26.260 --> 00:05:26.860
So let's see.

00:05:26.860 --> 00:05:29.940
So this is what my whole
expression simplified to or

00:05:29.940 --> 00:05:30.710
expanded to.

00:05:30.710 --> 00:05:32.890
I can't really call this
a simplification.

00:05:32.890 --> 00:05:35.410
But we can use the fact that
this is commutative and

00:05:35.410 --> 00:05:38.230
associative to rewrite this
expression right here.

00:05:38.230 --> 00:05:45.430
This is equal to y dot
y times t squared.

00:05:45.430 --> 00:05:46.680
t is just a scalar.

00:05:49.270 --> 00:05:50.750
Minus-- and actually,
this is 2.

00:05:50.750 --> 00:05:52.810
These two things
are equivalent.

00:05:52.810 --> 00:05:55.370
They're just rearrangements of
the same thing and we saw that

00:05:55.370 --> 00:05:57.290
the dot product is
associative.

00:05:57.290 --> 00:06:06.260
So this is just equal to 2
times x dot y times t.

00:06:06.260 --> 00:06:09.230
And I should do that in maybe
a different color.

00:06:09.230 --> 00:06:13.080
So these two terms result in
that term right there.

00:06:13.080 --> 00:06:16.570
And then if you just rearrange
these you have a minus 1

00:06:16.570 --> 00:06:17.400
times a minus 1.

00:06:17.400 --> 00:06:20.070
They cancel out, so those will
become plus and you're just

00:06:20.070 --> 00:06:25.140
left with plus x dot x.

00:06:25.140 --> 00:06:27.740
And I should do that in a
different color as well.

00:06:27.740 --> 00:06:29.690
I'll do that in an
orange color.

00:06:29.690 --> 00:06:32.820
So those terms end up
with that term.

00:06:32.820 --> 00:06:35.620
Then of course, that term
results in that term.

00:06:35.620 --> 00:06:37.880
And remember, all I did
is I rewrote this

00:06:37.880 --> 00:06:38.490
thing and said, look.

00:06:38.490 --> 00:06:41.990
This has got to be greater
than or equal to 0.

00:06:41.990 --> 00:06:44.620
So I could rewrite that here.

00:06:44.620 --> 00:06:46.070
This thing is still just
the same thing.

00:06:46.070 --> 00:06:47.450
I've just rewritten it.

00:06:47.450 --> 00:06:52.620
So this is all going to be
greater than or equal to 0.

00:06:52.620 --> 00:06:54.990
Now let's make a little bit of
a substitution just to clean

00:06:54.990 --> 00:06:56.590
up our expression
a little bit.

00:06:56.590 --> 00:06:59.280
And we'll later back substitute
into this.

00:06:59.280 --> 00:07:02.480
Let's define this as a.

00:07:02.480 --> 00:07:07.860
Let's define this piece
right here as b.

00:07:07.860 --> 00:07:10.380
So the whole thing
minus 2x dot y.

00:07:10.380 --> 00:07:11.780
I'll leave the t there.

00:07:11.780 --> 00:07:17.020
And let's define this or
let me just define this

00:07:17.020 --> 00:07:17.825
right here as c.

00:07:17.825 --> 00:07:20.130
X dot x as c.

00:07:20.130 --> 00:07:22.060
So then, what does our
expression become?

00:07:22.060 --> 00:07:29.910
It becomes a times t squared
minus-- I want to be careful

00:07:29.910 --> 00:07:35.480
with the colors-- b
times t plus c.

00:07:39.180 --> 00:07:41.050
And of course, we know that it's
going to be greater than

00:07:41.050 --> 00:07:41.780
or equal to 0.

00:07:41.780 --> 00:07:43.660
It's the same thing as
this up here, greater

00:07:43.660 --> 00:07:44.270
than or equal to 0.

00:07:44.270 --> 00:07:47.125
I could write p of t here.

00:07:47.125 --> 00:07:50.890
Now this is greater than or
equal to 0 for any t that I

00:07:50.890 --> 00:07:51.530
put in here.

00:07:51.530 --> 00:07:53.995
For any real t that
I put in there.

00:08:00.640 --> 00:08:05.190
Let me evaluate our function
at b over 2a.

00:08:05.190 --> 00:08:07.570
And I can definitely do this
because what was a?

00:08:07.570 --> 00:08:10.700
I just have to make sure I'm not
dividing by 0 any place.

00:08:10.700 --> 00:08:13.850
So a was this vector
dotted with itself.

00:08:13.850 --> 00:08:16.290
And we said this was
a nonzero vector.

00:08:16.290 --> 00:08:18.680
So this is the square
of its length.

00:08:18.680 --> 00:08:21.610
It's a nonzero vector, so some
of these terms up here would

00:08:21.610 --> 00:08:23.790
end up becoming positively
when you take its length.

00:08:23.790 --> 00:08:25.710
So this thing right
here is nonzero.

00:08:25.710 --> 00:08:27.310
This is a nonzero vector.

00:08:27.310 --> 00:08:30.880
Then 2 times the dot product
with itself is also going to

00:08:30.880 --> 00:08:31.450
be nonzero.

00:08:31.450 --> 00:08:32.309
So we can do this.

00:08:32.309 --> 00:08:34.990
We don't worry about dividing
by 0, whatever else.

00:08:34.990 --> 00:08:37.049
But what will this
be equal to?

00:08:37.049 --> 00:08:39.200
This'll be equal to-- and I'll
just stick to the green.

00:08:39.200 --> 00:08:42.110
It takes too long to keep
switching between colors.

00:08:42.110 --> 00:08:45.230
This is equal to a times this
expression squared.

00:08:45.230 --> 00:08:49.340
So it's b squared
over 4a squared.

00:08:49.340 --> 00:08:52.090
I just squared 2a to
get the 4a squared.

00:08:52.090 --> 00:08:55.270
Minus b times this.

00:08:55.270 --> 00:08:58.760
So b times-- this is just
regular multiplication.

00:08:58.760 --> 00:09:01.650
b times b over 2a.

00:09:01.650 --> 00:09:03.780
Just write regular
multiplication there.

00:09:03.780 --> 00:09:05.130
Plus c.

00:09:05.130 --> 00:09:07.870
And we know all of that is
greater than or equal to 0.

00:09:07.870 --> 00:09:12.080
Now if we simplify this a little
bit, what do we get?

00:09:12.080 --> 00:09:15.290
Well this a cancels out with
this exponent there and you

00:09:15.290 --> 00:09:18.480
end up with a b squared
right there.

00:09:18.480 --> 00:09:26.150
So we get b squared over 4a
minus b squared over 2a.

00:09:26.150 --> 00:09:27.650
That's that term over there.

00:09:27.650 --> 00:09:31.730
Plus c is greater than
or equal to 0.

00:09:31.730 --> 00:09:33.440
Let me rewrite this.

00:09:33.440 --> 00:09:36.810
If I multiply the numerator and
denominator of this by 2,

00:09:36.810 --> 00:09:38.010
what do I get?

00:09:38.010 --> 00:09:41.110
I get 2b squared over 4a.

00:09:41.110 --> 00:09:43.050
And the whole reason I did
that is to get a common

00:09:43.050 --> 00:09:44.660
denominator here.

00:09:44.660 --> 00:09:45.670
So what do you get?

00:09:45.670 --> 00:09:50.050
You get b squared over 4a minus
2b squared over 4a.

00:09:50.050 --> 00:09:52.600
So what do these two
terms simplify to?

00:09:52.600 --> 00:09:54.930
Well the numerator is b squared
minus 2b squared.

00:09:54.930 --> 00:10:01.200
So that just becomes minus b
squared over 4a plus c is

00:10:01.200 --> 00:10:02.710
greater than or equal to 0.

00:10:02.710 --> 00:10:06.570
These two terms add up to
this one right here.

00:10:06.570 --> 00:10:11.490
Now if we add this to both sides
of the equation, we get

00:10:11.490 --> 00:10:16.260
c is greater than or equal
to b squared over 4a.

00:10:16.260 --> 00:10:17.720
It was a negative on
the left-hand side.

00:10:17.720 --> 00:10:19.570
If I add it to both sides it's
going to be a positive on the

00:10:19.570 --> 00:10:21.760
right-hand side.

00:10:21.760 --> 00:10:24.470
We're approaching something that
looks like an inequality,

00:10:24.470 --> 00:10:28.380
so let's back substitute our
original substitutions to see

00:10:28.380 --> 00:10:30.060
what we have now.

00:10:30.060 --> 00:10:32.660
So where was my original
substitutions that I made?

00:10:32.660 --> 00:10:35.790
It was right here.

00:10:35.790 --> 00:10:37.970
And actually, just to simplify
more, let me multiply both

00:10:37.970 --> 00:10:39.220
sides by 4a.

00:10:41.440 --> 00:10:43.020
I said a, not only
is it nonzero,

00:10:43.020 --> 00:10:44.130
it's going to be positive.

00:10:44.130 --> 00:10:46.070
This is the square
of its length.

00:10:46.070 --> 00:10:49.670
And I already showed you that
the length of any real

00:10:49.670 --> 00:10:51.170
vector's going to be positive.

00:10:51.170 --> 00:10:53.460
And the reason why I'm taking
great pains to show that a is

00:10:53.460 --> 00:10:55.510
positive is because if I
multiply both sides of it I

00:10:55.510 --> 00:10:57.690
don't want to change the
inequality sign.

00:10:57.690 --> 00:10:59.910
So let me multiply both sides
of this by a before I

00:10:59.910 --> 00:11:00.380
substitute.

00:11:00.380 --> 00:11:07.750
So we get 4ac is greater than
or equal to b squared.

00:11:07.750 --> 00:11:08.160
There you go.

00:11:08.160 --> 00:11:09.890
And remember, I took
great pains.

00:11:09.890 --> 00:11:13.400
I just said a is definitely a
positive number because it is

00:11:13.400 --> 00:11:16.830
essentially the square of the
length. y dot y is the square

00:11:16.830 --> 00:11:19.450
of the length of y, and that's
a positive value.

00:11:19.450 --> 00:11:20.320
It has to be positive.

00:11:20.320 --> 00:11:21.970
We're dealing with
real vectors.

00:11:21.970 --> 00:11:24.470
Now let's back substitute
this.

00:11:24.470 --> 00:11:30.030
So 4 times a, 4 times y dot y.

00:11:30.030 --> 00:11:33.420
y dot y is also-- I might as
well just write it there.

00:11:33.420 --> 00:11:39.470
y dot y is the same thing as
the magnitude of y squared.

00:11:39.470 --> 00:11:40.490
That's y dot y.

00:11:40.490 --> 00:11:42.760
This is a.

00:11:42.760 --> 00:11:45.690
y dot y, I showed you that
in the previous video.

00:11:45.690 --> 00:11:46.800
Times c.

00:11:46.800 --> 00:11:49.760
c is x dot x.

00:11:49.760 --> 00:11:53.640
Well x dot x is the
same thing as the

00:11:53.640 --> 00:11:56.200
length of vector x squared.

00:11:56.200 --> 00:11:57.420
So this was c.

00:11:57.420 --> 00:12:01.030
So 4 times a times c is going
to be greater than

00:12:01.030 --> 00:12:03.920
or equal to b squared.

00:12:03.920 --> 00:12:06.760
Now what was b? b was
this thing here.

00:12:06.760 --> 00:12:14.610
So b squared would be 2
times x dot y squared.

00:12:14.610 --> 00:12:17.880
So we've gotten to this
result so far.

00:12:17.880 --> 00:12:19.620
And so what can we
do with this?

00:12:19.620 --> 00:12:21.200
Oh sorry, and this whole
thing is squared.

00:12:21.200 --> 00:12:23.240
This whole thing right
here is b.

00:12:23.240 --> 00:12:25.220
So let's see if we can
simplify this.

00:12:25.220 --> 00:12:27.620
So we get-- let me switch
to a different color.

00:12:27.620 --> 00:12:34.870
4 times the length of y squared
times the length of x

00:12:34.870 --> 00:12:37.660
squared is greater than or equal
to-- if we squared this

00:12:37.660 --> 00:12:46.270
quantity right here, we
get 4 times x dot y.

00:12:46.270 --> 00:12:54.620
4 times x dot y times x dot y.

00:12:54.620 --> 00:12:56.510
Actually, even better, let me
just write it like this.

00:12:56.510 --> 00:13:01.090
Let me just write 4 times
x dot y squared.

00:13:01.090 --> 00:13:02.950
Now we can divide
both sides by 4.

00:13:02.950 --> 00:13:04.600
That won't change
our inequality.

00:13:04.600 --> 00:13:06.250
So that just cancels
out there.

00:13:06.250 --> 00:13:08.050
And now let's take the
square root of both

00:13:08.050 --> 00:13:09.840
sides of this equation.

00:13:09.840 --> 00:13:13.040
So the square roots of both
sides of this equation-- these

00:13:13.040 --> 00:13:15.380
are positive values, so the
square root of this side is

00:13:15.380 --> 00:13:16.840
the square root of each
of its terms. That's

00:13:16.840 --> 00:13:18.325
just an exponent property.

00:13:18.325 --> 00:13:21.150
So if you take the square root
of both sides you get the

00:13:21.150 --> 00:13:28.010
length of y times the length of
x is greater than or equal

00:13:28.010 --> 00:13:29.570
to the square root of this.

00:13:29.570 --> 00:13:31.650
And we're going to take the
positive square root.

00:13:31.650 --> 00:13:33.480
We're going to take the positive
square root on both

00:13:33.480 --> 00:13:34.400
sides of this equation.

00:13:34.400 --> 00:13:36.600
That keeps us from having to
mess with anything on the

00:13:36.600 --> 00:13:38.260
inequality or anything
like that.

00:13:38.260 --> 00:13:42.640
So the positive square root is
going to be the absolute value

00:13:42.640 --> 00:13:44.370
of x dot y.

00:13:44.370 --> 00:13:46.060
And I want to be very careful
to say this is the absolute

00:13:46.060 --> 00:13:51.060
value because it's possible that
this thing right here is

00:13:51.060 --> 00:13:51.755
a negative value.

00:13:51.755 --> 00:13:55.520
But when you square it, you want
to be careful that when

00:13:55.520 --> 00:13:56.710
you take the square root
of it that you

00:13:56.710 --> 00:13:57.960
stay a positive value.

00:13:57.960 --> 00:14:02.050
Because otherwise when we take
the principal square root, we

00:14:02.050 --> 00:14:04.070
might mess with the inquality.

00:14:04.070 --> 00:14:07.130
We're taking the positive square
root, which will be--

00:14:07.130 --> 00:14:08.965
so if you take the absolute
value, you're ensuring that

00:14:08.965 --> 00:14:10.590
it's going to be positive.

00:14:10.590 --> 00:14:12.000
But this is our result.

00:14:12.000 --> 00:14:15.800
The absolute value of the dot
product of our vectors is less

00:14:15.800 --> 00:14:19.510
than the product of the
two vectors lengths.

00:14:19.510 --> 00:14:21.586
So we got our Cauchy-Schwarz
inequality.

00:14:27.600 --> 00:14:36.630
Now the last thing I said is
look, what happens if x is

00:14:36.630 --> 00:14:39.640
equal to some scalar
multiple of y?

00:14:39.640 --> 00:14:41.385
Well in that case, what's
the absolute value?

00:14:41.385 --> 00:14:45.930
The absolute value of x dot y?

00:14:45.930 --> 00:14:48.520
Well that equals--
that equals what?

00:14:48.520 --> 00:14:51.080
If we make the substitution that
equals the absolute value

00:14:51.080 --> 00:14:52.850
of c times y.

00:14:52.850 --> 00:14:59.160
That's just x dot y, which
is equal to just from the

00:14:59.160 --> 00:15:00.730
associative property.

00:15:00.730 --> 00:15:04.800
It's equal to the absolute value
of c times-- we want to

00:15:04.800 --> 00:15:07.910
make sure our absolute value,
keep everything positive.

00:15:07.910 --> 00:15:10.970
y dot y.

00:15:10.970 --> 00:15:22.320
Well this is just equal to c
times the magnitude of y-- the

00:15:22.320 --> 00:15:24.210
length of y squared.

00:15:24.210 --> 00:15:31.260
Well that just is equal to the
magnitude of c times-- or the

00:15:31.260 --> 00:15:34.986
absolute value of our scalar
c times our length of y.

00:15:40.000 --> 00:15:44.290
Well this right here,
I can rewrite this.

00:15:44.290 --> 00:15:46.610
I mean you can prove this to
yourself if you don't believe

00:15:46.610 --> 00:15:49.790
it, but this-- we could put the
c inside of the magnitude

00:15:49.790 --> 00:15:51.630
and that could be a good
exercise for you to prove.

00:15:51.630 --> 00:15:52.300
But it's pretty straightforward.

00:15:52.300 --> 00:15:54.180
You just do the definition
of length.

00:15:54.180 --> 00:15:56.050
And you multiply it by c.

00:15:56.050 --> 00:16:01.530
This is equal to the magnitude
of cy times-- let me say the

00:16:01.530 --> 00:16:06.600
length of cy times
the length of y.

00:16:06.600 --> 00:16:10.620
I've lost my vector notation
someplace over here.

00:16:10.620 --> 00:16:11.580
There you go.

00:16:11.580 --> 00:16:13.920
Now, this is x.

00:16:13.920 --> 00:16:19.370
So this is equal to the length
of x times the length of y.

00:16:19.370 --> 00:16:21.360
So I showed you kind of
the second part of the

00:16:21.360 --> 00:16:24.650
Cauchy-Schwarz Inequality that
this is only equal to each

00:16:24.650 --> 00:16:28.510
other if one of them is a scalar
multiple of the other.

00:16:28.510 --> 00:16:29.540
If you're a little uncomfortable
with some of

00:16:29.540 --> 00:16:31.600
these steps I took, it might
be a good exercise to

00:16:31.600 --> 00:16:32.370
actually prove it.

00:16:32.370 --> 00:16:35.720
For example, to prove that the
absolute value of c times the

00:16:35.720 --> 00:16:39.270
length of the vector y is
the same thing as the

00:16:39.270 --> 00:16:41.890
length of c times y.

00:16:41.890 --> 00:16:43.790
Anyway, hopefully you found
this pretty useful.

00:16:43.790 --> 00:16:47.180
The Cauchy-Schwarz Inequality
we'll use a lot when we prove

00:16:47.180 --> 00:16:49.580
other results in
linear algebra.

00:16:49.580 --> 00:16:51.250
And in a future video, I'll
give you a little more

00:16:51.250 --> 00:16:53.960
intuition about why this makes a
lot of sense relative to the

00:16:53.960 --> 00:16:55.500
dot product.


Proving vector dot product properties

WEBVTT
Kind: captions
Language: en

00:00:00.600 --> 00:00:03.880
In this video, I want to prove
some of the basic properties

00:00:03.880 --> 00:00:06.370
of the dot product, and you
might find what I'm doing in

00:00:06.370 --> 00:00:09.400
this video somewhat mundane.

00:00:09.400 --> 00:00:11.330
You know, to be frank, it
is somewhat mundane.

00:00:11.330 --> 00:00:12.510
But I'm doing it for
two reasons.

00:00:12.510 --> 00:00:15.570
One is, this is the type of
thing that's often asked of

00:00:15.570 --> 00:00:17.670
you when you take a linear
algebra class.

00:00:17.670 --> 00:00:20.530
But more importantly, it gives
you the appreciation that we

00:00:20.530 --> 00:00:24.810
really are kind of building up
a mathematics of vectors from

00:00:24.810 --> 00:00:27.250
the ground up, and you really
can't assume anything.

00:00:27.250 --> 00:00:29.780
You ready to prove everything
for yourself.

00:00:29.780 --> 00:00:33.520
So the first thing I want to
prove is that the dot product,

00:00:33.520 --> 00:00:37.930
when you take the vector dot
product, so if I take v dot w

00:00:37.930 --> 00:00:39.000
that it's commutative.

00:00:39.000 --> 00:00:41.350
That the order that I take the
dot product doesn't matter.

00:00:41.350 --> 00:00:48.140
I want to prove to myself that
that is equal to w dot v.

00:00:48.140 --> 00:00:49.300
And so, how do we do that?

00:00:49.300 --> 00:00:51.580
Well, and this is the general
pattern for a lot of these

00:00:51.580 --> 00:00:52.320
vector proofs.

00:00:52.320 --> 00:00:54.710
Let's just write out
the vectors.

00:00:54.710 --> 00:01:01.460
So v will look like v1, v2,
all the way down to vn.

00:01:01.460 --> 00:01:04.330
Let's say that this
is equal to v.

00:01:04.330 --> 00:01:11.350
And let's say that w is
equal to w1, w2, all

00:01:11.350 --> 00:01:14.990
the way down to wn.

00:01:14.990 --> 00:01:17.590
So what does v dot w equal?

00:01:17.590 --> 00:01:22.840
v dot to w is equal to--
I'll switch colors

00:01:22.840 --> 00:01:24.210
here-- v1 times w1.

00:01:28.720 --> 00:01:37.600
Plus v2 w2 plus all
the way to vn wn.

00:01:37.600 --> 00:01:38.730
Fair enough.

00:01:38.730 --> 00:01:45.190
Now what does w dot v equal?

00:01:45.190 --> 00:01:48.880
Well w dot v-- you know, when I
had made the definition, you

00:01:48.880 --> 00:01:50.300
just multiply the products.

00:01:50.300 --> 00:01:52.930
But I'll just do it in the order
that they gave it to us.

00:01:52.930 --> 00:01:58.340
So it equals w1 v1 plus w2 v2.

00:01:58.340 --> 00:02:02.430
Plus all the way to wn vn.

00:02:02.430 --> 00:02:05.970
Now, these are clearly equal to
each other because if you

00:02:05.970 --> 00:02:09.729
just match up the first term
with the first term, those are

00:02:09.729 --> 00:02:14.510
clearly equal to each other.
v1 w1 is equal to w1 v1.

00:02:14.510 --> 00:02:16.810
And I can say this now because
now we're just dealing with

00:02:16.810 --> 00:02:17.530
regular numbers.

00:02:17.530 --> 00:02:20.470
Here we were dealing with
vectors and we were taking

00:02:20.470 --> 00:02:22.030
this weird type of
multiplication

00:02:22.030 --> 00:02:23.300
called the dot product.

00:02:23.300 --> 00:02:25.360
But now I can definitely say
that these are equal because

00:02:25.360 --> 00:02:27.310
this is just regular
multiplication.

00:02:27.310 --> 00:02:28.925
And this is just a commutative
property.

00:02:31.500 --> 00:02:33.600
Let me see if I'm spelling
commutative.

00:02:37.460 --> 00:02:40.040
We learned this in-- I don't
know when you learned this, in

00:02:40.040 --> 00:02:40.950
second or third grade.

00:02:40.950 --> 00:02:42.890
So you know that those are equal
and by the same argument

00:02:42.890 --> 00:02:44.360
you know that these
two are equal.

00:02:44.360 --> 00:02:47.200
You could just rewrite each of
these terms just by switching

00:02:47.200 --> 00:02:47.810
that around.

00:02:47.810 --> 00:02:51.160
That's just from basic
multiplication of scalar

00:02:51.160 --> 00:02:53.250
numbers, of just regular
real numbers.

00:02:53.250 --> 00:02:55.810
So that's what tells us that
these two things are equal or

00:02:55.810 --> 00:02:57.230
these two things are equal.

00:02:57.230 --> 00:03:01.330
So we've proven to ourselves
that order doesn't matter when

00:03:01.330 --> 00:03:03.100
you take the dot product.

00:03:03.100 --> 00:03:07.020
Now the next thing we could take
a look at is whether the

00:03:07.020 --> 00:03:09.520
dot product exhibits the
distributive property.

00:03:09.520 --> 00:03:12.850
So let me just define another
vector x here.

00:03:12.850 --> 00:03:16.000
Another vector x and you
can imagine how I'm

00:03:16.000 --> 00:03:17.200
going to define it.

00:03:17.200 --> 00:03:22.770
x1, x2, all the way
down to xn.

00:03:22.770 --> 00:03:28.580
Now, what I want to see if the
dot product deals with the

00:03:28.580 --> 00:03:32.200
distributive property the way I
would expect it to, then if

00:03:32.200 --> 00:03:39.320
I were to add v plus w and
then multiply that by x.

00:03:39.320 --> 00:03:41.030
And first of all, it shouldn't
matter what

00:03:41.030 --> 00:03:41.970
order I do that with.

00:03:41.970 --> 00:03:42.590
I just showed it here.

00:03:42.590 --> 00:03:44.080
I could do x dot this thing.

00:03:44.080 --> 00:03:45.380
It shouldn't matter because
I just showed you it's

00:03:45.380 --> 00:03:46.420
commutative.

00:03:46.420 --> 00:03:49.370
But if the distribution works,
then this should be the same

00:03:49.370 --> 00:03:56.230
thing as v dot x plus w dot x.

00:03:56.230 --> 00:03:58.290
If these were just numbers
and this was just regular

00:03:58.290 --> 00:04:00.306
multiplication, you would
multiply by it by each of the

00:04:00.306 --> 00:04:01.280
terms, and that's what
I'm showing here.

00:04:01.280 --> 00:04:07.670
So let's see if this is true
for the dot product.

00:04:07.670 --> 00:04:12.300
So what is v plus w?

00:04:12.300 --> 00:04:20.480
v plus w is equal to-- we just
add up each of their

00:04:20.480 --> 00:04:26.730
corresponding terms. v1 plus
w1, v2 plus w2, all the way

00:04:26.730 --> 00:04:30.460
down to vn plus wn.

00:04:30.460 --> 00:04:31.670
That's that right there.

00:04:31.670 --> 00:04:39.340
And then when we dot that with
x1, x2, all the way down to

00:04:39.340 --> 00:04:41.900
xn, what do we get?

00:04:41.900 --> 00:04:54.330
Well we get v1 plus w1 times
x1 plus v2 plus w2 times x2

00:04:54.330 --> 00:05:01.080
plus all the way to vn
plus wn times xn.

00:05:01.080 --> 00:05:02.400
I just took the dot product
of these two.

00:05:02.400 --> 00:05:05.380
I just multiplied corresponding
components and

00:05:05.380 --> 00:05:06.430
then added them all up.

00:05:06.430 --> 00:05:07.670
That was the dot product.

00:05:07.670 --> 00:05:10.270
This is v plus w dot x.

00:05:10.270 --> 00:05:11.360
Let me write that down.

00:05:11.360 --> 00:05:17.330
This is v plus w dot x.

00:05:17.330 --> 00:05:21.220
Now, let's work on these
things up here.

00:05:21.220 --> 00:05:22.140
Let me write it over here.

00:05:22.140 --> 00:05:25.600
What is v dot x?

00:05:25.600 --> 00:05:27.670
v dot x, we've seen
this before.

00:05:27.670 --> 00:05:32.110
This is just v1 x1.

00:05:32.110 --> 00:05:33.390
No vectors now.

00:05:33.390 --> 00:05:34.650
These are just actual
components.

00:05:34.650 --> 00:05:39.820
Plus v2 x2, all the
way to vn xn.

00:05:39.820 --> 00:05:41.950
What is w dot x?

00:05:41.950 --> 00:05:52.100
w dot x is equal to w1 x1 plus
w2 x2, all the way to wn xn.

00:05:52.100 --> 00:05:54.550
Now what do you get when you
add these two things?

00:05:54.550 --> 00:05:57.840
And notice, here I'm adding
two scalar quantities.

00:05:57.840 --> 00:05:58.350
That's a scalar.

00:05:58.350 --> 00:05:58.900
That's a scalar.

00:05:58.900 --> 00:06:01.250
We're not doing vector
addition anymore.

00:06:01.250 --> 00:06:03.340
So this is a scalar quantity and
this is a scalar quantity.

00:06:03.340 --> 00:06:04.820
So what do I get when
I add them?

00:06:04.820 --> 00:06:18.640
So v dot x plus w dot x is equal
to v1 x1 plus w1 x1 plus

00:06:18.640 --> 00:06:28.940
v2 x2 plus w2 x2, all the
way to vn xn plus wn xn.

00:06:28.940 --> 00:06:30.360
I know, it's very monotonous.

00:06:30.360 --> 00:06:31.870
But you could immediately see
we're just dealing with

00:06:31.870 --> 00:06:32.850
regular numbers here.

00:06:32.850 --> 00:06:36.575
So we can take the x's out
and what do you get?

00:06:36.575 --> 00:06:38.600
Let me write it here.

00:06:38.600 --> 00:06:40.390
This is equal to-- we could
just take the x out,

00:06:40.390 --> 00:06:41.850
factor the x out.

00:06:41.850 --> 00:06:49.710
v1 plus w1, x1 plus v2 plus
w2 x2, all the way

00:06:49.710 --> 00:06:54.130
to vn plus wn xn.

00:06:54.130 --> 00:06:59.340
Which we see this is
the same thing as

00:06:59.340 --> 00:07:02.000
this thing right here.

00:07:02.000 --> 00:07:05.460
So we just showed that this
expression right here, is the

00:07:05.460 --> 00:07:08.380
same thing as that expression
or the distribution-- the

00:07:08.380 --> 00:07:13.010
distributive property seems to
or does apply the way we would

00:07:13.010 --> 00:07:15.470
expect to the dot product.

00:07:15.470 --> 00:07:16.880
I know this is so mundane.

00:07:16.880 --> 00:07:17.270
Why are we doing this?

00:07:17.270 --> 00:07:19.260
But I'm doing this to show you
that we're building things up.

00:07:19.260 --> 00:07:20.540
We couldn't just assume this.

00:07:20.540 --> 00:07:22.200
But the proof is pretty
straightforward.

00:07:22.200 --> 00:07:24.460
And in general, I didn't do
these proofs when I did it for

00:07:24.460 --> 00:07:26.940
vector addition and scalar
multiplication, and I really

00:07:26.940 --> 00:07:30.070
should have. But you can prove
the commutativity of it.

00:07:30.070 --> 00:07:32.740
Or for the scalar multiplication
you could prove

00:07:32.740 --> 00:07:35.600
that distribution works for it
doing a proof exactly the same

00:07:35.600 --> 00:07:36.100
way as this.

00:07:36.100 --> 00:07:39.030
A lot of math books or linear
algebra books just leave these

00:07:39.030 --> 00:07:43.860
as exercises to the student
because it's mundane, so they

00:07:43.860 --> 00:07:45.160
didn't think it was
worth their paper.

00:07:45.160 --> 00:07:48.190
But let me just show you, I
guess, the last property,

00:07:48.190 --> 00:07:52.300
associativity, the associative
property.

00:07:52.300 --> 00:07:53.430
So let me show you.

00:07:53.430 --> 00:07:56.570
If I take some scalar and
I multiply it times

00:07:56.570 --> 00:07:58.710
v, some vector v.

00:07:58.710 --> 00:08:02.640
And then I take the dot product
of that with w, if

00:08:02.640 --> 00:08:05.560
this is associative the way
multiplication in our everyday

00:08:05.560 --> 00:08:09.100
world normally works, this
should be equal to-- and it's

00:08:09.100 --> 00:08:12.020
still a question mark because
I haven't proven it to you.

00:08:12.020 --> 00:08:18.010
It should be equal to
c times v dot w.

00:08:18.010 --> 00:08:18.820
So let's figure it out.

00:08:18.820 --> 00:08:21.780
What's c times the vector v?

00:08:21.780 --> 00:08:27.730
c times the vector v is c times
v1, c times v2, all the

00:08:27.730 --> 00:08:30.560
way down to c times vn.

00:08:30.560 --> 00:08:33.460
And then the vector w, we
already know what that is.

00:08:33.460 --> 00:08:37.440
So dot w is equal to what?

00:08:37.440 --> 00:08:40.870
It's equal to this times
the first term of w.

00:08:40.870 --> 00:08:49.580
So c v1 w1 plus this times the
second term of w, c v2 w2, all

00:08:49.580 --> 00:08:52.970
the way to c vn wn.

00:08:52.970 --> 00:08:53.590
Fair enough.

00:08:53.590 --> 00:08:56.450
That's what this side
is equal to.

00:08:56.450 --> 00:08:58.060
Now let's do this side.

00:08:58.060 --> 00:08:59.970
What is v dot w?

00:08:59.970 --> 00:09:02.440
I'll write it here.

00:09:02.440 --> 00:09:03.880
We've done this multiple
times.

00:09:03.880 --> 00:09:10.780
This is just v1 w1 plus v2
w2, all the way to vn wn.

00:09:10.780 --> 00:09:13.110
I'm getting tired of doing this
and you're probably tired

00:09:13.110 --> 00:09:15.920
of watching it, but it's good
to go through the exercises.

00:09:15.920 --> 00:09:17.500
You know, if someone asked you
to do this now, you'll be able

00:09:17.500 --> 00:09:18.380
to do this.

00:09:18.380 --> 00:09:21.210
Now what is c times this?

00:09:21.210 --> 00:09:26.120
So if I multiply some scalar
times this, that's the same

00:09:26.120 --> 00:09:28.460
thing as multiplying some
scalar times that.

00:09:28.460 --> 00:09:30.650
So I'm just multiplying a scalar
times a big-- this is

00:09:30.650 --> 00:09:33.890
just the regular distributive
property of just numbers, of

00:09:33.890 --> 00:09:35.320
just regular real numbers.

00:09:35.320 --> 00:09:41.510
So this is going to be equal to
c v1 w1 plus c v2 w2 plus

00:09:41.510 --> 00:09:44.760
all the way to c vn wn.

00:09:44.760 --> 00:09:47.480
And we see that this is
equal to this because

00:09:47.480 --> 00:09:49.040
this is equal to this.

00:09:49.040 --> 00:09:51.200
Now the hardest part of this--
I remember when I first took

00:09:51.200 --> 00:09:56.300
linear algebra, I found when
the professor would assign,

00:09:56.300 --> 00:09:57.740
you know, prove this.

00:09:57.740 --> 00:10:00.110
I would have trouble doing it
because it almost seems so

00:10:00.110 --> 00:10:01.830
ridiculously obvious.

00:10:01.830 --> 00:10:03.460
That hey, well, obviously
if you just look at the

00:10:03.460 --> 00:10:06.690
components of them, it just
turns into multiplying of each

00:10:06.690 --> 00:10:08.700
individual component and adding
them up and those are

00:10:08.700 --> 00:10:10.320
associative, so that's
obviously--

00:10:10.320 --> 00:10:11.500
what's there to prove?

00:10:11.500 --> 00:10:13.360
And it only took me a little
while that they just wanted me

00:10:13.360 --> 00:10:14.920
to write that down.

00:10:14.920 --> 00:10:16.900
They didn't want something
earth shattering.

00:10:16.900 --> 00:10:19.400
They just wanted me to show
when you go component by

00:10:19.400 --> 00:10:23.610
component and all you have to
do is assume kind of the

00:10:23.610 --> 00:10:25.840
distributive or the associative
or the commutative

00:10:25.840 --> 00:10:29.800
property of regular numbers,
that you could prove the same

00:10:29.800 --> 00:10:33.770
properties also apply in a very
similar way, to vectors

00:10:33.770 --> 00:10:34.880
and the dot product.

00:10:34.880 --> 00:10:38.480
So hopefully you found this
reasonably useful and I'll see

00:10:38.480 --> 00:10:40.260
you in the next video where we
could use some of these tools

00:10:40.260 --> 00:10:42.050
to actually prove some
more interesting

00:10:42.050 --> 00:10:44.010
properties of vectors.


Vector dot product and vector length

WEBVTT
Kind: captions
Language: en

00:00:00.530 --> 00:00:03.900
We've already made a few
definitions of operations that

00:00:03.900 --> 00:00:05.080
we can do with vectors.

00:00:05.080 --> 00:00:10.620
We've defined addition in
the context of vectors

00:00:10.620 --> 00:00:11.460
and you've seen that.

00:00:11.460 --> 00:00:15.440
If you just have two vectors,
say a1, a2, all the

00:00:15.440 --> 00:00:17.330
way down to a n.

00:00:17.330 --> 00:00:19.600
We defined the addition of this
vector and let's say some

00:00:19.600 --> 00:00:23.180
other vector, b1, b2,
all the way down to

00:00:23.180 --> 00:00:25.300
bn as a third vector.

00:00:25.300 --> 00:00:28.390
If you add these two, we defined
the addition operation

00:00:28.390 --> 00:00:31.360
to be a third-- you will result
in a third vector where

00:00:31.360 --> 00:00:33.230
each of its components are
just the sum of the

00:00:33.230 --> 00:00:36.020
corresponding components of the
two vectors you're adding.

00:00:36.020 --> 00:00:41.780
So it's going to be a1 plus b1,
a2 plus b2, all the way

00:00:41.780 --> 00:00:43.900
down to a n plus bn.

00:00:43.900 --> 00:00:47.170
We knew this and we've done
multiple videos where we use

00:00:47.170 --> 00:00:49.900
this definition of
vector addition.

00:00:49.900 --> 00:00:52.710
We also know about scalar
multiplication.

00:00:57.455 --> 00:01:00.107
Maybe we should just call it
scaling multiplication.

00:01:04.129 --> 00:01:07.070
And that's the case of look, if
I have some real number c

00:01:07.070 --> 00:01:11.170
and I multiply it times some
vector, a1, a2, all the way

00:01:11.170 --> 00:01:15.600
down to a n, we defined scalar
multiplication of a vector to

00:01:15.600 --> 00:01:18.820
be-- some scalar times its
vector will result in

00:01:18.820 --> 00:01:21.020
essentially, this vector were
each of its components are

00:01:21.020 --> 00:01:23.260
multiplied by the scalar.

00:01:23.260 --> 00:01:28.990
ca1, ca2, all the way
down to c a n.

00:01:28.990 --> 00:01:31.540
And so after seeing these two
operations, you might be

00:01:31.540 --> 00:01:33.950
tempted to say, gee, wouldn't
it be nice if there was some

00:01:33.950 --> 00:01:36.440
way to multiply two vectors.

00:01:36.440 --> 00:01:39.280
This is just a scalar times a
vector, just scaling it up.

00:01:39.280 --> 00:01:41.990
And that's actually the actual
effect of what it's doing if

00:01:41.990 --> 00:01:45.100
you visualize it in three
dimensions or less.

00:01:45.100 --> 00:01:47.260
It's actually scaling the
size of the vector.

00:01:47.260 --> 00:01:50.820
And we haven't defined size,
very precisely just yet.

00:01:50.820 --> 00:01:53.810
But you understand at least
this operation.

00:01:53.810 --> 00:01:56.440
For multiplying vectors or
taking the product, there's

00:01:56.440 --> 00:01:57.450
actually two ways.

00:01:57.450 --> 00:02:00.620
And I'm going to define one
of them in this video.

00:02:00.620 --> 00:02:02.000
And that's the dot product.

00:02:07.570 --> 00:02:13.750
And you signify the dot product
by saying a dot b.

00:02:13.750 --> 00:02:16.150
So they borrowed one of the
types of multiplication

00:02:16.150 --> 00:02:18.680
notations that you saw, but you
can't write across here.

00:02:18.680 --> 00:02:21.390
That'll be actually a different
type of vector

00:02:21.390 --> 00:02:22.650
multiplication.

00:02:22.650 --> 00:02:25.810
So the dot product is-- it's
almost fun to take because

00:02:25.810 --> 00:02:28.475
it's mathematically pretty
straightforward, unlike the

00:02:28.475 --> 00:02:29.540
cross product.

00:02:29.540 --> 00:02:34.040
But it's fun to take and it's
interesting because it

00:02:34.040 --> 00:02:39.860
results-- so this is a1, a2,
all the way down to a n.

00:02:39.860 --> 00:02:47.550
That vector dot my b vector: b1,
b2, all the way down to bn

00:02:47.550 --> 00:02:51.330
is going to be equal to the
product of each of their

00:02:51.330 --> 00:02:53.020
corresponding components.

00:02:53.020 --> 00:03:03.780
So a1 b1 added together plus a2
b2 plus a3 b3 plus all the

00:03:03.780 --> 00:03:06.750
way to a n, bn.

00:03:06.750 --> 00:03:07.370
So what is this?

00:03:07.370 --> 00:03:08.640
Is this a vector?

00:03:08.640 --> 00:03:09.740
Well no, this is
just a number.

00:03:09.740 --> 00:03:10.950
This is just going to
be a real number.

00:03:10.950 --> 00:03:13.580
You're just taking the product
and adding together a bunch of

00:03:13.580 --> 00:03:14.160
real numbers.

00:03:14.160 --> 00:03:17.720
So this is just going to be
a scalar, a real scalar.

00:03:17.720 --> 00:03:20.440
So this is just going to be
a scalar right there.

00:03:20.440 --> 00:03:23.300
So in the dot product you
multiply two vectors and you

00:03:23.300 --> 00:03:25.890
end up with a scalar value.

00:03:25.890 --> 00:03:28.090
Let me show you a couple of
examples just in case this was

00:03:28.090 --> 00:03:30.040
a little bit too abstract.

00:03:30.040 --> 00:03:36.590
So let's say that we take the
dot product of the vector 2, 5

00:03:36.590 --> 00:03:40.740
and we're going to dot that
with the vector 7, 1.

00:03:40.740 --> 00:03:45.490
Well, this is just going to be
equal to 2 times 7 plus 5

00:03:45.490 --> 00:03:48.640
times 1 or 14 plus 6.

00:03:48.640 --> 00:03:49.820
No, sorry.

00:03:49.820 --> 00:03:53.980
14 plus 5, which
is equal to 19.

00:03:53.980 --> 00:03:56.980
So the dot product of this
vector and this vector is 19.

00:03:56.980 --> 00:03:58.790
Let me do one more example,
although I think this is a

00:03:58.790 --> 00:04:01.200
pretty straightforward idea.

00:04:01.200 --> 00:04:02.920
Let me do it in mauve.

00:04:02.920 --> 00:04:03.540
OK.

00:04:03.540 --> 00:04:08.500
Say I had the vector 1, 2, 3 and
I'm going to dot that with

00:04:08.500 --> 00:04:13.000
the vector minus 2, 0, 5.

00:04:13.000 --> 00:04:23.120
So it's 1 times minus 2 plus
2 times 0 plus 3 times 5.

00:04:23.120 --> 00:04:27.620
So it's minus 2 plus
0 plus 15.

00:04:27.620 --> 00:04:30.020
Minus 2 plus 15 is
equal to 13.

00:04:30.020 --> 00:04:33.620
That's the dot product
by this definition.

00:04:33.620 --> 00:04:36.795
Now, I'm going to make
another definition.

00:04:36.795 --> 00:04:39.100
I'm going to define the
length of a vector.

00:04:46.710 --> 00:04:49.050
And you might say, Sal,
I know what the length

00:04:49.050 --> 00:04:49.730
of something is.

00:04:49.730 --> 00:04:51.520
I've been measuring things
since I was a kid.

00:04:51.520 --> 00:04:54.860
Why do I have to wait until a
college level or hopefully

00:04:54.860 --> 00:04:56.300
you're taking this before
college maybe.

00:04:56.300 --> 00:04:59.830
But what is now considered a
college level course to have

00:04:59.830 --> 00:05:01.280
length defined for me.

00:05:01.280 --> 00:05:05.110
And the answer is because we're
abstracting things to

00:05:05.110 --> 00:05:09.270
well beyond just R3 or just
three-dimensional space is

00:05:09.270 --> 00:05:09.990
what you're used to.

00:05:09.990 --> 00:05:12.540
We're abstracting that these
vectors could have 50

00:05:12.540 --> 00:05:13.110
components.

00:05:13.110 --> 00:05:17.740
And our definition of length
will satisfy, will work, even

00:05:17.740 --> 00:05:19.720
for these 50 component
vectors.

00:05:19.720 --> 00:05:22.240
And so my definition of length--
but it's also going

00:05:22.240 --> 00:05:25.990
to be consistent with what
we know length to be.

00:05:25.990 --> 00:05:31.240
So if I take the length of a
and the notation we use is

00:05:31.240 --> 00:05:35.610
just these double lines
around the vector.

00:05:35.610 --> 00:05:38.770
The length of my vector a is
equal to-- and this is a

00:05:38.770 --> 00:05:40.290
definition.

00:05:40.290 --> 00:05:46.150
It equals the square root of
each of the terms, each of my

00:05:46.150 --> 00:05:47.820
components, squared.

00:05:47.820 --> 00:05:49.020
Add it up.

00:05:49.020 --> 00:05:54.740
Plus a2 squared plus all the
way to plus a n squared.

00:05:54.740 --> 00:05:56.140
And this is pretty
straightforward.

00:05:56.140 --> 00:06:03.240
If I wanted to take let's
call this was vector b.

00:06:03.240 --> 00:06:07.310
If I want to take the magnitude
of vector b right

00:06:07.310 --> 00:06:08.680
here, this would be what?

00:06:08.680 --> 00:06:14.350
This would be the square root
of 2 squared plus 5 squared,

00:06:14.350 --> 00:06:17.200
which is equal to the square
root of-- what is this?

00:06:17.200 --> 00:06:19.460
This is 4 plus 25.

00:06:19.460 --> 00:06:21.820
The square root of 29.

00:06:21.820 --> 00:06:24.180
So that's the length
of this vector.

00:06:24.180 --> 00:06:26.210
And you might say look,
I already knew that.

00:06:26.210 --> 00:06:28.010
That's from the Pythagorean
theroem.

00:06:28.010 --> 00:06:31.050
If I were to draw my vector
b-- let me draw it.

00:06:31.050 --> 00:06:32.800
Those are my axes.

00:06:32.800 --> 00:06:34.510
My vector b if I draw
it in standard

00:06:34.510 --> 00:06:35.510
form, looks like this.

00:06:35.510 --> 00:06:36.570
I go to the right 2.

00:06:36.570 --> 00:06:37.580
1, 2.

00:06:37.580 --> 00:06:38.600
And I go up 5.

00:06:38.600 --> 00:06:41.650
1, 2, 3, 4, 5.

00:06:41.650 --> 00:06:43.660
So it looks like this.

00:06:43.660 --> 00:06:48.030
My vector b looks like that.

00:06:48.030 --> 00:06:50.090
And from the Pythagorean theorem
you know look, if I

00:06:50.090 --> 00:06:53.650
wanted to figure out the length
of this vector in R2,

00:06:53.650 --> 00:06:56.390
or if I'm drawing it in kind
of two-dimensional space, I

00:06:56.390 --> 00:06:59.330
take this side which is length
2, I take that side which is

00:06:59.330 --> 00:07:02.380
length 5; this is going to be
the square root from the

00:07:02.380 --> 00:07:05.650
Pythagorean theorem of 2
squared plus 5 squared.

00:07:05.650 --> 00:07:07.340
Which is exactly what
we did here.

00:07:07.340 --> 00:07:11.690
So this definition of length is
completely consistent with

00:07:11.690 --> 00:07:15.310
your idea of measuring things
in one-, two- or

00:07:15.310 --> 00:07:16.900
three-dimensional space.

00:07:16.900 --> 00:07:20.580
But what's neat about it is that
now we can start thinking

00:07:20.580 --> 00:07:23.950
about the length of a vector
that maybe has 50 components.

00:07:23.950 --> 00:07:26.630
Which you know, really to
visualize it in our

00:07:26.630 --> 00:07:28.580
traditional way,
makes no sense.

00:07:28.580 --> 00:07:31.920
But we can still apply this
notion of length and start to

00:07:31.920 --> 00:07:35.010
maybe abstract beyond what
we traditionally

00:07:35.010 --> 00:07:37.500
associate length with.

00:07:37.500 --> 00:07:42.230
Now, can we somehow relate
length with the dot product?

00:07:42.230 --> 00:07:45.350
Well what happens if I
dot a with itself?

00:07:45.350 --> 00:07:48.550
What is a dot a?

00:07:48.550 --> 00:07:50.990
So that's equal to-- I'll
just write it out again.

00:07:50.990 --> 00:07:57.250
a1, all the way down to a n
dotted with a1 all the way

00:07:57.250 --> 00:07:59.590
down to a n.

00:07:59.590 --> 00:08:03.290
Well that's equal to a1 times
a1, which is a1 squared.

00:08:03.290 --> 00:08:06.960
Plus a2 times a2.

00:08:06.960 --> 00:08:07.970
a2 squared.

00:08:07.970 --> 00:08:10.760
Plus all the way down, keep
doing that all the way down to

00:08:10.760 --> 00:08:13.990
a n times a n, which
is a n squared.

00:08:13.990 --> 00:08:14.810
But what's this?

00:08:14.810 --> 00:08:16.090
This is the same thing
as the thing you

00:08:16.090 --> 00:08:18.220
see under the radical.

00:08:18.220 --> 00:08:20.080
These two things
are equivalent.

00:08:20.080 --> 00:08:22.540
So we could write our definition
of length, of

00:08:22.540 --> 00:08:26.010
vector length, we can write it
in terms of the dot product,

00:08:26.010 --> 00:08:27.650
of our dot product definition.

00:08:27.650 --> 00:08:32.929
It equals the square root of the
vector dotted with itself.

00:08:32.929 --> 00:08:36.820
Or, if we square both sides,
we could say that our new

00:08:36.820 --> 00:08:45.240
length definition squared is
equal to the dot product of a

00:08:45.240 --> 00:08:47.310
vector with itself.

00:08:47.310 --> 00:08:50.280
And this is a pretty neat--
it's almost trivial to

00:08:50.280 --> 00:08:52.300
actually prove it, but this is
a pretty neat outcome and

00:08:52.300 --> 00:08:56.850
we're going to use this
in future videos.

00:08:56.850 --> 00:08:59.720
So this is an introduction
to what the dot product

00:08:59.720 --> 00:09:01.360
is, what length is.

00:09:01.360 --> 00:09:02.670
In the next video I'm going
to show a bunch of

00:09:02.670 --> 00:09:03.500
properties of it.

00:09:03.500 --> 00:09:05.230
It will almost be mundane, but
I want to get all those

00:09:05.230 --> 00:09:06.680
properties out of the
way, so we can use

00:09:06.680 --> 00:09:09.040
them in future proofs.