WEBVTT

00:00:00.047 --> 00:00:02.130
The following content is
provided under a Creative

00:00:02.130 --> 00:00:03.610
Commons license.

00:00:03.610 --> 00:00:05.770
Your support will help
MIT OpenCourseWare

00:00:05.770 --> 00:00:10.050
continue to offer high quality
educational resources for free.

00:00:10.050 --> 00:00:12.590
To make a donation or to
view additional materials

00:00:12.590 --> 00:00:16.180
from hundreds of MIT courses,
visit MIT OpenCourseWare

00:00:16.180 --> 00:00:22.230
at ocw.mit.edu.

00:00:22.230 --> 00:00:27.580
PROFESSOR STRANG: Just to give
an overview in three lines:

00:00:27.580 --> 00:00:32.780
the text is the book of that
name, Computational Science

00:00:32.780 --> 00:00:33.570
and Engineering.

00:00:33.570 --> 00:00:36.390
That was completed
just last year,

00:00:36.390 --> 00:00:41.040
so it really ties pretty
well with the course.

00:00:41.040 --> 00:00:43.890
I don't cover everything
in the book, by all means.

00:00:43.890 --> 00:00:47.630
And I don't, certainly, don't
stand here and read the book.

00:00:47.630 --> 00:00:50.290
That would be no good.

00:00:50.290 --> 00:00:55.430
But you'll be able, if
you miss a class -- well,

00:00:55.430 --> 00:00:56.530
don't miss a class.

00:00:56.530 --> 00:01:01.420
But if you miss a class,
you'll be able, probably,

00:01:01.420 --> 00:01:05.190
to see roughly what we did.

00:01:05.190 --> 00:01:08.100
OK, so the first
part of the semester

00:01:08.100 --> 00:01:10.660
is applied linear algebra.

00:01:10.660 --> 00:01:13.990
And I don't know how many of
you have had a linear algebra

00:01:13.990 --> 00:01:16.470
course, and that's
why I thought I would

00:01:16.470 --> 00:01:19.490
start with a quick review.

00:01:19.490 --> 00:01:23.500
And you'll catch on.

00:01:23.500 --> 00:01:26.670
I want matrices to
come to life, actually.

00:01:26.670 --> 00:01:30.754
You know, instead
of just being a four

00:01:30.754 --> 00:01:33.610
by four array of numbers,
there are four by four,

00:01:33.610 --> 00:01:36.970
or n by n or m by n
array of special numbers.

00:01:36.970 --> 00:01:38.400
They have a meaning.

00:01:38.400 --> 00:01:41.780
When they multiply a
vector, they do something.

00:01:41.780 --> 00:01:45.700
And so it's just, part
of this first step

00:01:45.700 --> 00:01:49.190
is just, like,
getting to recognize,

00:01:49.190 --> 00:01:50.760
what's that matrix doing?

00:01:50.760 --> 00:01:52.180
Where does it come from?

00:01:52.180 --> 00:01:53.910
What are its properties?

00:01:53.910 --> 00:01:57.210
So that's a theme at the start.

00:01:57.210 --> 00:02:04.050
Then differential equations,
like Laplace's equation,

00:02:04.050 --> 00:02:06.530
are beautiful examples.

00:02:06.530 --> 00:02:11.300
So here we get, especially,
to numerical methods,

00:02:11.300 --> 00:02:14.770
finite differences, finite
elements, above all.

00:02:14.770 --> 00:02:16.510
So I think in this
class you'll really

00:02:16.510 --> 00:02:20.390
see how finite elements
work, and other ideas.

00:02:20.390 --> 00:02:21.890
All sorts of ideas.

00:02:21.890 --> 00:02:25.990
And then the last part of
the course is about Fourier.

00:02:25.990 --> 00:02:29.400
That's Fourier series,
that you may have seen,

00:02:29.400 --> 00:02:30.540
and Fourier integrals.

00:02:30.540 --> 00:02:35.000
But also, highly important,
Discrete Fourier Transform,

00:02:35.000 --> 00:02:36.190
DFT.

00:02:36.190 --> 00:02:39.410
That's a fundamental
step for understanding

00:02:39.410 --> 00:02:42.770
what a signal contains.

00:02:42.770 --> 00:02:46.060
Yeah, so that's
great stuff, Fourier.

00:02:46.060 --> 00:02:52.620
OK, what else should
I say before I start?

00:02:52.620 --> 00:02:55.010
I said this was my
favorite course,

00:02:55.010 --> 00:03:01.730
and maybe I'll
elaborate a little.

00:03:01.730 --> 00:03:06.190
Well, I think what I want
to say is that I really

00:03:06.190 --> 00:03:12.740
feel my life is here to teach
you and not to grade you.

00:03:12.740 --> 00:03:16.040
I'm not going to spend this
semester worrying about grades,

00:03:16.040 --> 00:03:18.040
and please don't.

00:03:18.040 --> 00:03:19.610
They come out fine.

00:03:19.610 --> 00:03:22.200
We've got lots to learn.

00:03:22.200 --> 00:03:26.630
And I'll do my very best
to explain it clearly.

00:03:26.630 --> 00:03:30.090
And I know you'll do your best.

00:03:30.090 --> 00:03:31.380
I know from experience.

00:03:31.380 --> 00:03:36.400
This class goes for
it and does it right.

00:03:36.400 --> 00:03:40.510
So that's what makes it so good.

00:03:40.510 --> 00:03:41.410
OK.

00:03:41.410 --> 00:03:45.840
Homeworks, by the way,
well, the first homework

00:03:45.840 --> 00:03:50.870
will simply be a way to get a
grade list, a list of everybody

00:03:50.870 --> 00:03:52.180
taking the course.

00:03:52.180 --> 00:03:55.820
They won't be graded
in great detail.

00:03:55.820 --> 00:03:59.610
Too large a class.

00:03:59.610 --> 00:04:03.520
And you're allowed to talk
to each other about homework.

00:04:03.520 --> 00:04:05.970
So homework is not
an exam at all.

00:04:05.970 --> 00:04:10.450
So let me just leave any
discussion of exams and grades

00:04:10.450 --> 00:04:12.180
for the future.

00:04:12.180 --> 00:04:16.010
I'll tell you, you'll see how
informally the first homework

00:04:16.010 --> 00:04:18.370
will be.

00:04:18.370 --> 00:04:21.120
And I hope it'll go
up on the website.

00:04:21.120 --> 00:04:23.700
The first homework
will be for Monday.

00:04:23.700 --> 00:04:29.340
So it's a bit early, but
it's pretty open-ended.

00:04:29.340 --> 00:04:33.070
If you could take three
problems from 1.1,

00:04:33.070 --> 00:04:36.920
the first section of
the book, any three,

00:04:36.920 --> 00:04:43.960
and any three problems from
1.2, and print your name

00:04:43.960 --> 00:04:46.920
on the homework -- because we're
going to use that to create

00:04:46.920 --> 00:04:50.030
the grade list -- I'll
be completely happy.

00:04:50.030 --> 00:04:51.810
Well, especially if
you get them right

00:04:51.810 --> 00:04:53.820
and do them neatly and so on.

00:04:53.820 --> 00:04:59.110
But actually we won't know.

00:04:59.110 --> 00:05:02.760
So that's for Monday.

00:05:02.760 --> 00:05:03.320
OK.

00:05:03.320 --> 00:05:05.430
And we'll talk more about it.

00:05:05.430 --> 00:05:10.750
I'll announce the TA on the
website and the TA hours,

00:05:10.750 --> 00:05:12.950
the office hours,
and everything.

00:05:12.950 --> 00:05:17.210
There'll be a Friday
afternoon office hour,

00:05:17.210 --> 00:05:20.241
because homeworks will
typically come Monday.

00:05:20.241 --> 00:05:20.740
OK.

00:05:20.740 --> 00:05:27.050
Questions about the course
before I just start?

00:05:27.050 --> 00:05:30.140
OK.

00:05:30.140 --> 00:05:31.660
Another time for questions, too.

00:05:31.660 --> 00:05:41.450
OK, so can we just
start with that matrix?

00:05:41.450 --> 00:05:45.130
So I said about matrices, I'm
interested in their properties.

00:05:45.130 --> 00:05:47.990
Like, I'm going to
ask you about that.

00:05:47.990 --> 00:05:51.050
And then, I'm interested
in their meaning.

00:05:51.050 --> 00:05:53.200
Where do they come from?

00:05:53.200 --> 00:05:56.530
You know, why that matrix
instead of some other?

00:05:56.530 --> 00:06:01.090
And then, the numerical part
is how do we deal with them?

00:06:01.090 --> 00:06:05.400
How do we solve a linear system
with that coefficient matrix?

00:06:05.400 --> 00:06:07.400
What can we say
about the solution?

00:06:07.400 --> 00:06:09.830
So the purpose.

00:06:09.830 --> 00:06:10.330
Right.

00:06:10.330 --> 00:06:15.040
OK, now help me out.

00:06:15.040 --> 00:06:17.520
So I guess my plan
with the video taping

00:06:17.520 --> 00:06:20.410
is, whatever you
say, I'll repeat.

00:06:20.410 --> 00:06:26.140
So say it as clearly
as possible, and it's

00:06:26.140 --> 00:06:30.810
fantastic to have discussion,
conversation here.

00:06:30.810 --> 00:06:34.130
So I'll just repeat it so that
it safely gets on the tape.

00:06:34.130 --> 00:06:35.880
So tell me its properties.

00:06:35.880 --> 00:06:41.310
Tell me the first property that
you notice about that matrix.

00:06:41.310 --> 00:06:41.810
Symmetric.

00:06:41.810 --> 00:06:42.910
Symmetric.

00:06:42.910 --> 00:06:44.150
Right.

00:06:44.150 --> 00:06:45.730
I could have slowed
down a little

00:06:45.730 --> 00:06:48.310
and everybody probably would
have said that at once.

00:06:48.310 --> 00:06:51.790
So that's a symmetric matrix.

00:06:51.790 --> 00:06:54.770
Now we might as well pick
up some matrix notation.

00:06:54.770 --> 00:06:58.970
How do I express the fact
that this a symmetric matrix?

00:06:58.970 --> 00:07:01.890
In simple matrix
notation, I would

00:07:01.890 --> 00:07:07.260
say that K is the
same as K transpose.

00:07:07.260 --> 00:07:11.710
The transpose, everybody
knows, it comes from -- oh,

00:07:11.710 --> 00:07:14.870
I shouldn't say this --
flipping it across the diagonal.

00:07:14.870 --> 00:07:17.830
That's not a very
"math" thing to do.

00:07:17.830 --> 00:07:21.960
But that's the way
to visualize it.

00:07:21.960 --> 00:07:27.560
And let me use a
capital T for transpose.

00:07:27.560 --> 00:07:30.460
So it's symmetric.

00:07:30.460 --> 00:07:31.340
Very important.

00:07:31.340 --> 00:07:32.660
Very, very important.

00:07:32.660 --> 00:07:34.850
That's the most important
class of matrices,

00:07:34.850 --> 00:07:35.840
symmetric matrices.

00:07:35.840 --> 00:07:37.890
We'll see them all
the time, because they

00:07:37.890 --> 00:07:41.310
come from equilibrium problems.

00:07:41.310 --> 00:07:44.870
They come from all sorts
of -- they come everywhere

00:07:44.870 --> 00:07:47.060
in applications.

00:07:47.060 --> 00:07:49.800
And we will be
doing applications.

00:07:49.800 --> 00:07:53.180
The first week or
week and a half,

00:07:53.180 --> 00:07:56.540
you'll see pretty
much discussion

00:07:56.540 --> 00:08:00.710
of matrices and the reasons,
what their meaning is.

00:08:00.710 --> 00:08:03.440
And then we'll get to
physical applications:

00:08:03.440 --> 00:08:05.750
mechanics and more.

00:08:05.750 --> 00:08:06.680
OK.

00:08:06.680 --> 00:08:08.720
All right.

00:08:08.720 --> 00:08:12.230
Now I'm looking for
properties, other properties,

00:08:12.230 --> 00:08:13.430
of that matrix.

00:08:13.430 --> 00:08:18.340
Let me write "2" here so that
you got a spot to put it.

00:08:18.340 --> 00:08:21.420
What are you going to tell
me next about that matrix?

00:08:21.420 --> 00:08:22.040
Periodic.

00:08:22.040 --> 00:08:23.270
Well, okay.

00:08:23.270 --> 00:08:25.200
Actually, that's
a good question.

00:08:25.200 --> 00:08:31.280
Let me write periodic down here.

00:08:31.280 --> 00:08:36.110
You're using that word,
because somehow that pattern

00:08:36.110 --> 00:08:37.480
is suggesting something.

00:08:37.480 --> 00:08:40.150
But you'll see I
have a little more

00:08:40.150 --> 00:08:44.420
to add before I would
use the word periodic.

00:08:44.420 --> 00:08:47.060
So that's great
to see that here.

00:08:47.060 --> 00:08:47.560
What else?

00:08:47.560 --> 00:08:50.260
Somebody else was
going to say something.

00:08:50.260 --> 00:08:51.370
Please.

00:08:51.370 --> 00:08:52.040
Sparse!

00:08:52.040 --> 00:08:53.240
Oh, very good.

00:08:53.240 --> 00:08:54.500
Sparse.

00:08:54.500 --> 00:08:59.350
That's also an obvious
property that you

00:08:59.350 --> 00:09:01.220
see from looking at the matrix.

00:09:01.220 --> 00:09:03.550
What does sparse mean?

00:09:03.550 --> 00:09:05.200
Mostly zeros.

00:09:05.200 --> 00:09:07.870
Well that isn't
mostly zeros, I guess.

00:09:07.870 --> 00:09:11.840
I mean, that's got what,
out of sixteen entries,

00:09:11.840 --> 00:09:13.560
it's got six zeros.

00:09:13.560 --> 00:09:14.930
That doesn't sound like sparse.

00:09:14.930 --> 00:09:20.466
But when I grow the matrix --
because this is just a four

00:09:20.466 --> 00:09:21.040
by four.

00:09:21.040 --> 00:09:24.550
I would even call this one K_4.

00:09:24.550 --> 00:09:29.580
When the matrix
grows to 100 by 100,

00:09:29.580 --> 00:09:31.910
then you really
see it as sparse.

00:09:31.910 --> 00:09:36.490
So if that matrix was 100
by 100, how many non-zeros

00:09:36.490 --> 00:09:37.430
would it have?

00:09:37.430 --> 00:09:44.010
So if n is 100, then the
number of non-zeros -- wow,

00:09:44.010 --> 00:09:46.530
that's the first MATLAB
command I've written.

00:09:46.530 --> 00:09:50.620
A number of non-zeros
of K would be --

00:09:50.620 --> 00:09:53.160
anybody know what it would be?

00:09:53.160 --> 00:10:00.750
I'm just asking to go
up to five by five.

00:10:00.750 --> 00:10:03.860
I'm asking you to keep
that pattern alive.

00:10:03.860 --> 00:10:08.330
Twos on the diagonal,
minus ones above and below.

00:10:08.330 --> 00:10:13.640
So yeah, so 298, would it be?

00:10:13.640 --> 00:10:20.020
A hundred diagonal entries,
99 and 99, maybe 298?

00:10:20.020 --> 00:10:27.590
298 out of 100 by
100 would be what?

00:10:27.590 --> 00:10:29.140
It's been a long summer.

00:10:29.140 --> 00:10:32.090
Yeah, a lot of zeros.

00:10:32.090 --> 00:10:32.710
A lot.

00:10:32.710 --> 00:10:33.210
Right.

00:10:33.210 --> 00:10:37.760
Because the matrix has got what
100 by 100, 10,000 entries.

00:10:37.760 --> 00:10:39.620
Out of 10,000.

00:10:39.620 --> 00:10:42.300
So that's sparse.

00:10:42.300 --> 00:10:46.090
But we see those all the
time, and fortunately we do.

00:10:46.090 --> 00:10:49.050
Because, of course, this
matrix, or even 100 by 100,

00:10:49.050 --> 00:10:53.000
we could deal with
if it was dense.

00:10:53.000 --> 00:10:57.640
But 10,000, 100,000,
or 1 million,

00:10:57.640 --> 00:11:02.390
which happens all the time
now in scientific computation.

00:11:02.390 --> 00:11:04.510
A million by
million dense matrix

00:11:04.510 --> 00:11:07.170
is not a nice thing
to think about.

00:11:07.170 --> 00:11:13.780
A million by million matrix
like this is a cinch.

00:11:13.780 --> 00:11:14.280
OK.

00:11:14.280 --> 00:11:15.940
So sparse.

00:11:15.940 --> 00:11:18.550
What else do you want to say?

00:11:18.550 --> 00:11:19.490
Toeplitz.

00:11:19.490 --> 00:11:22.600
Holy Moses.

00:11:22.600 --> 00:11:23.920
Exactly right.

00:11:23.920 --> 00:11:28.550
But I want to say,
before I use that word,

00:11:28.550 --> 00:11:30.540
so that'll be my
second MATLAB command.

00:11:30.540 --> 00:11:31.060
Thanks.

00:11:31.060 --> 00:11:33.780
Toeplitz.

00:11:33.780 --> 00:11:35.850
What's that mean?

00:11:35.850 --> 00:11:39.680
So this matrix has
a property that we

00:11:39.680 --> 00:11:46.940
see right away, which is?

00:11:46.940 --> 00:11:51.450
I want to stay with Toeplitz
but everybody tell me

00:11:51.450 --> 00:11:54.860
something more about
properties of that matrix.

00:11:54.860 --> 00:11:56.100
Tridiagonal.

00:11:56.100 --> 00:12:02.880
Tridiagonal, so that's almost
a special subcase of sparse.

00:12:02.880 --> 00:12:05.530
It has just three diagonals.

00:12:05.530 --> 00:12:08.440
Tridiagonal matrices
are truly important.

00:12:08.440 --> 00:12:10.070
They come in all
the time, we'll see

00:12:10.070 --> 00:12:14.080
that they come from second order
differential equations, which

00:12:14.080 --> 00:12:17.360
are, thanks to
Newton, the big ones.

00:12:17.360 --> 00:12:23.090
Ok, now it's more than
tridiagonal and what more?

00:12:23.090 --> 00:12:26.850
So what further, we're
getting deeper now.

00:12:26.850 --> 00:12:31.970
What patterns do you see
beyond just tridiagonal,

00:12:31.970 --> 00:12:34.950
because tridiagonal would
allow any numbers there

00:12:34.950 --> 00:12:39.150
but those are not, there's more
of a pattern than just three

00:12:39.150 --> 00:12:42.490
diagonals, what is it?

00:12:42.490 --> 00:12:45.770
Those diagonals are constant.

00:12:45.770 --> 00:12:48.780
If I run down each of
those three diagonals,

00:12:48.780 --> 00:12:50.350
I see the same number.

00:12:50.350 --> 00:12:53.370
Twos, minus ones,
minus ones, and that's

00:12:53.370 --> 00:12:55.670
what the word Toeplitz means.

00:12:55.670 --> 00:13:05.280
Toeplitz is constant diagonal.

00:13:05.280 --> 00:13:05.850
Ok.

00:13:05.850 --> 00:13:09.840
And that kind of
matrix is so important.

00:13:09.840 --> 00:13:17.730
It corresponds, yeah,
if we were in EE,

00:13:17.730 --> 00:13:23.240
I would use the words
time-invariant filter, linear,

00:13:23.240 --> 00:13:23.920
time-invariant.

00:13:23.920 --> 00:13:27.840
So it's linear because
we're dealing with a matrix.

00:13:27.840 --> 00:13:31.750
And it's time-invariant,
shift-invariant.

00:13:31.750 --> 00:13:34.900
I just use all these
equivalent words

00:13:34.900 --> 00:13:38.300
to mean that we're
seeing the same thing row

00:13:38.300 --> 00:13:44.000
by row, except of course, at,
shall I call that the boundary?

00:13:44.000 --> 00:13:46.370
That's like, the end
of the system and this

00:13:46.370 --> 00:13:51.740
is like the other end and
there it's chopped off.

00:13:51.740 --> 00:13:56.070
But if it was ten by ten I
would see that row eight times.

00:13:56.070 --> 00:13:58.980
100 by 100 I'd see it 98 times.

00:13:58.980 --> 00:14:05.030
So it's constant diagonals
and the guy who first

00:14:05.030 --> 00:14:08.350
studied that was Toeplitz.

00:14:08.350 --> 00:14:13.470
And we wouldn't need that
great historical information

00:14:13.470 --> 00:14:18.700
except that MATLAB created a
command to create that matrix.

00:14:18.700 --> 00:14:25.750
K, MATLAB is all set to
create Toeplitz matrices.

00:14:25.750 --> 00:14:30.110
Yeah, so I'll have to put
what MATLAB would put.

00:14:30.110 --> 00:14:37.460
I realize I'm already
using the word MATLAB.

00:14:37.460 --> 00:14:42.030
I think that MATLAB language
is really convenient

00:14:42.030 --> 00:14:44.050
to talk about linear algebra.

00:14:44.050 --> 00:14:46.550
And how many know
MATLAB or have used it?

00:14:46.550 --> 00:14:49.120
Yeah.

00:14:49.120 --> 00:14:53.650
You know it better than I. I
talk a good line with MATLAB

00:14:53.650 --> 00:14:56.760
but I -- the code never runs.

00:14:56.760 --> 00:14:58.300
Never!

00:14:58.300 --> 00:15:02.560
I always forget some
stupid semicolon.

00:15:02.560 --> 00:15:04.970
You may have had
that experience.

00:15:04.970 --> 00:15:11.519
And I just want to say it now
that there are other languages,

00:15:11.519 --> 00:15:13.185
and if you want to
do homeworks and want

00:15:13.185 --> 00:15:18.340
to do your own work in other
languages, that makes sense.

00:15:18.340 --> 00:15:21.290
So the older
established alternatives

00:15:21.290 --> 00:15:25.800
were Mathematica and
Maple and those two

00:15:25.800 --> 00:15:30.230
have symbolic-- they can
deal with algebra as well

00:15:30.230 --> 00:15:33.320
as numbers.

00:15:33.320 --> 00:15:34.990
But there are newer languages.

00:15:34.990 --> 00:15:37.040
I don't know if you know them.

00:15:37.040 --> 00:15:41.270
I just know my friends
say, yes they're terrific.

00:15:41.270 --> 00:15:46.050
Python is one.

00:15:46.050 --> 00:15:49.150
And R. I've just
had a email saying,

00:15:49.150 --> 00:15:53.290
tell your class
about R. And others.

00:15:53.290 --> 00:15:59.670
Ok, so but we'll use MATLAB
language because that's really

00:15:59.670 --> 00:16:01.060
a good common language.

00:16:01.060 --> 00:16:03.370
Ok, so what is a
Toeplitz matrix?

00:16:03.370 --> 00:16:06.050
A Toeplitz matrix is one
with constant diagonals.

00:16:06.050 --> 00:16:09.220
You could use the
word time-invariant,

00:16:09.220 --> 00:16:11.260
linear time-invariant filter.

00:16:11.260 --> 00:16:16.860
And to create K, this
is an 18.085 command.

00:16:16.860 --> 00:16:19.400
It's just set up for us.

00:16:19.400 --> 00:16:26.350
I can create K by telling
the system the first row.

00:16:26.350 --> 00:16:32.360
Two, minus one, zero, zero.

00:16:32.360 --> 00:16:37.340
That would, then if
it wasn't symmetric

00:16:37.340 --> 00:16:40.370
I would have to give
the first column also.

00:16:40.370 --> 00:16:41.990
Toeplitz would be
constant diagonal,

00:16:41.990 --> 00:16:44.130
it doesn't have to be symmetric.

00:16:44.130 --> 00:16:47.050
But if it's symmetric, then
the first row and first column

00:16:47.050 --> 00:16:50.470
are the same vector, so I
just have to give that vector.

00:16:50.470 --> 00:16:55.570
Okay, so that's the
quickest way to create K.

00:16:55.570 --> 00:17:00.100
And of course, if it
was bigger then I would,

00:17:00.100 --> 00:17:08.120
rather than writing 100 zeros,
I could put zeros of 98 and one.

00:17:08.120 --> 00:17:09.930
Wouldn't I have to say that?

00:17:09.930 --> 00:17:11.410
Or is it one and 98?

00:17:11.410 --> 00:17:15.910
You see why it doesn't run.

00:17:15.910 --> 00:17:18.740
Well I guess I'm thinking
of that as a row.

00:17:18.740 --> 00:17:19.610
I don't know.

00:17:19.610 --> 00:17:24.560
Anyway.

00:17:24.560 --> 00:17:26.830
I realize getting this
videotaped means I'm

00:17:26.830 --> 00:17:28.090
supposed to get things right!

00:17:28.090 --> 00:17:31.410
Usually it's like, we'll
get it right later.

00:17:31.410 --> 00:17:36.170
But anyway, that might work.

00:17:36.170 --> 00:17:37.340
Okay.

00:17:37.340 --> 00:17:39.870
So there's a command
that you know.

00:17:39.870 --> 00:17:44.250
"zeros", that creates a matrix
of this size with all zeros.

00:17:44.250 --> 00:17:45.560
Okay.

00:17:45.560 --> 00:17:48.380
That would create
the 100 by 100.

00:17:48.380 --> 00:17:48.910
Good.

00:17:48.910 --> 00:17:50.110
Ok.

00:17:50.110 --> 00:17:53.350
Oh, by the way, as long as
we're speaking about computation

00:17:53.350 --> 00:17:55.710
I've gotta say something more.

00:17:55.710 --> 00:17:59.290
We said that the
matrix is sparse.

00:17:59.290 --> 00:18:02.360
And this 100 by 100 matrix
is certainly sparse.

00:18:02.360 --> 00:18:07.880
But if I create it this way,
I've created all those zeros

00:18:07.880 --> 00:18:13.550
and if I ask MATLAB to work
with that matrix, to square it

00:18:13.550 --> 00:18:18.810
or whatever, it would
carry all those zeros

00:18:18.810 --> 00:18:21.330
and do all those
zero computations.

00:18:21.330 --> 00:18:24.837
In other words, it would
treat K like a dense matrix

00:18:24.837 --> 00:18:27.170
and it would just, it wouldn't
know the zeros were there

00:18:27.170 --> 00:18:29.420
until it looked.

00:18:29.420 --> 00:18:33.840
So I just want to say that if
you have really big systems

00:18:33.840 --> 00:18:38.740
sparse MATLAB is the way to go.

00:18:38.740 --> 00:18:42.930
Because sparse MATLAB keeps
track only of the non-zeros.

00:18:42.930 --> 00:18:45.420
So it knows-- and their
locations, of course.

00:18:45.420 --> 00:18:47.970
What the numbers are
and their location.

00:18:47.970 --> 00:18:50.790
So I could create a
sparse matrix out of that,

00:18:50.790 --> 00:18:53.700
like KS for K sparse.

00:18:53.700 --> 00:18:59.620
I think if I just
did sparse(K) that

00:18:59.620 --> 00:19:01.400
would create a sparse matrix.

00:19:01.400 --> 00:19:04.740
And then if I do
stuff to it, MATLAB

00:19:04.740 --> 00:19:08.280
would automatically know
those zeros were there

00:19:08.280 --> 00:19:12.620
and not spend it's time
multiplying by zero.

00:19:12.620 --> 00:19:14.220
But of course,
this isn't perfect

00:19:14.220 --> 00:19:17.960
because I've created the big
matrix before sparsifying it.

00:19:17.960 --> 00:19:20.700
And better to have created
it in the first place

00:19:20.700 --> 00:19:22.090
as a sparse matrix.

00:19:22.090 --> 00:19:27.510
Ok.

00:19:27.510 --> 00:19:32.010
So those were properties
that you could see.

00:19:32.010 --> 00:19:36.280
Now I'm looking
for little deeper.

00:19:36.280 --> 00:19:39.790
What's the first question I
would ask about a matrix if I

00:19:39.790 --> 00:19:41.830
have to solve a
system of equations,

00:19:41.830 --> 00:19:46.100
say KU=F or something.

00:19:46.100 --> 00:19:53.770
I got a 4 by 4 matrix, four
equations, four unknowns.

00:19:53.770 --> 00:19:57.070
What would I want to know next?

00:19:57.070 --> 00:19:59.780
Is it invertible?

00:19:59.780 --> 00:20:04.140
Is the matrix invertible?

00:20:04.140 --> 00:20:07.030
And that's an important
question and how

00:20:07.030 --> 00:20:10.640
do you recognize an
invertible matrix?

00:20:10.640 --> 00:20:12.100
This one is invertible.

00:20:12.100 --> 00:20:15.360
So let me say K is invertible.

00:20:15.360 --> 00:20:17.110
And what does that mean?

00:20:17.110 --> 00:20:19.410
That means that
there's another matrix,

00:20:19.410 --> 00:20:27.630
K inverse such that K times K
inverse is the identity matrix.

00:20:27.630 --> 00:20:32.190
The identity matrix in
MATLAB would be eye(n)

00:20:32.190 --> 00:20:35.720
and it's the diagonal
matrix of ones.

00:20:35.720 --> 00:20:40.480
It's the unit matrix; it's the
matrix that doesn't do anything

00:20:40.480 --> 00:20:43.360
to a vector.

00:20:43.360 --> 00:20:48.510
So this K has an inverse.

00:20:48.510 --> 00:20:49.910
But how do you know?

00:20:49.910 --> 00:20:53.440
How can you recognize that
a matrix is invertible?

00:20:53.440 --> 00:20:56.530
Because obviously that's a
critical question and many,

00:20:56.530 --> 00:20:59.070
many-- since our
matrices are not--

00:20:59.070 --> 00:21:03.030
a random matrix would
be invertible, for sure,

00:21:03.030 --> 00:21:06.670
but our matrices have
patterns, they're

00:21:06.670 --> 00:21:10.150
created out of a
problem and the question

00:21:10.150 --> 00:21:13.850
of whether that matrix is
invertible is fundamental.

00:21:13.850 --> 00:21:17.260
I mean finite
elements has these,

00:21:17.260 --> 00:21:20.900
zero-energy modes that you have
to watch out for because, what

00:21:20.900 --> 00:21:24.580
are they?

00:21:24.580 --> 00:21:28.130
They produce non-invertible
stiffness matrix.

00:21:28.130 --> 00:21:28.670
Ok.

00:21:28.670 --> 00:21:30.940
So how did we know,
or how could we

00:21:30.940 --> 00:21:34.480
know that this K is invertible?

00:21:34.480 --> 00:21:37.640
Somebody said invertible
and I wrote it down.

00:21:37.640 --> 00:21:39.600
Yeah?

00:21:39.600 --> 00:21:41.880
Well ok.

00:21:41.880 --> 00:21:45.080
Now I get to make a
speech about determinants.

00:21:45.080 --> 00:21:46.890
Don't deal with them!

00:21:46.890 --> 00:21:49.010
Don't touch determinants.

00:21:49.010 --> 00:21:53.180
I mean this particular
four by four

00:21:53.180 --> 00:21:56.230
happens to have a
nice determinant.

00:21:56.230 --> 00:21:58.100
I think it's five.

00:21:58.100 --> 00:22:02.480
But if it was a 100
by 100 how would

00:22:02.480 --> 00:22:06.900
we show that the
matrix was invertible?

00:22:06.900 --> 00:22:10.980
And what I mean by this is the
whole family is invertible.

00:22:10.980 --> 00:22:13.650
All sizes are invertible.

00:22:13.650 --> 00:22:16.640
K_n is invertible
for every n, not just

00:22:16.640 --> 00:22:20.010
this particular guy, whose
determinant we could take.

00:22:20.010 --> 00:22:22.370
But as five by
five, six by six, we

00:22:22.370 --> 00:22:28.100
would be up in the-- but
you're completely right.

00:22:28.100 --> 00:22:33.930
The determinant is a test.

00:22:33.930 --> 00:22:35.990
Alright.

00:22:35.990 --> 00:22:45.530
But I guess I'm saying that it's
not the test that I would use.

00:22:45.530 --> 00:22:49.180
So what I do?

00:22:49.180 --> 00:22:52.540
I would row reduce.

00:22:52.540 --> 00:22:58.330
That's the default
option in linear algebra.

00:22:58.330 --> 00:23:00.660
If you don't know what
to do with a matrix,

00:23:00.660 --> 00:23:03.780
if you want to see what's
going on, row reduce.

00:23:03.780 --> 00:23:04.910
What does that mean?

00:23:04.910 --> 00:23:09.050
That means-- shall I try it?

00:23:09.050 --> 00:23:15.090
So let me just start it,
just so I'm not using

00:23:15.090 --> 00:23:24.590
a word that we don't need.

00:23:24.590 --> 00:23:25.390
Ok.

00:23:25.390 --> 00:23:29.120
And actually, maybe the third
lecture, maybe next Monday

00:23:29.120 --> 00:23:33.120
we'll come back to row reduce.

00:23:33.120 --> 00:23:38.180
So I won't make heavy weather
of that, certainly not now.

00:23:38.180 --> 00:23:39.710
So what is row reduce?

00:23:39.710 --> 00:23:43.510
Just so you know.

00:23:43.510 --> 00:23:46.880
I want to get that
minus one to be a zero.

00:23:46.880 --> 00:23:50.210
I'm aiming for a
triangular matrix.

00:23:50.210 --> 00:23:53.960
I want to clean out
below the diagonal

00:23:53.960 --> 00:23:56.210
because if my matrix
is triangular then

00:23:56.210 --> 00:23:59.560
I can see immediately
everything.

00:23:59.560 --> 00:24:01.330
Right?

00:24:01.330 --> 00:24:06.890
Ultimately I'll reach a matrix
U that'll be upper triangular

00:24:06.890 --> 00:24:11.790
and that first row won't change
but the second row will change.

00:24:11.790 --> 00:24:13.340
And what does it change to?

00:24:13.340 --> 00:24:17.460
How do I clean out, get
a zero in that, where

00:24:17.460 --> 00:24:21.930
the minus one is right now?

00:24:21.930 --> 00:24:29.890
Well I want to use the first
row, the first equation.

00:24:29.890 --> 00:24:33.330
I want to add some
multiple of the first row

00:24:33.330 --> 00:24:36.130
to the second row.

00:24:36.130 --> 00:24:38.970
And what should
that multiple be?

00:24:38.970 --> 00:24:41.330
I want to multiply
that row by something.

00:24:41.330 --> 00:24:43.590
And I'll say "add" today.

00:24:43.590 --> 00:24:46.280
Later I'll say "subtract."

00:24:46.280 --> 00:24:47.360
But what shall I do?

00:24:47.360 --> 00:24:50.130
Just tell me what
the heck to do.

00:24:50.130 --> 00:24:52.470
I've got that row
and I want to use it,

00:24:52.470 --> 00:24:55.380
I want to take a combination
of these two rows.

00:24:55.380 --> 00:24:59.010
This row and some multiple
of this one that'll

00:24:59.010 --> 00:25:00.930
produce a zero.

00:25:00.930 --> 00:25:02.670
This is called the pivot.

00:25:02.670 --> 00:25:07.330
That's the first pivot
P-I-V-O-T. Pivot.

00:25:07.330 --> 00:25:11.290
And then that's the pivot row.

00:25:11.290 --> 00:25:14.170
And what do I do?

00:25:14.170 --> 00:25:15.930
Tell me what to do.

00:25:15.930 --> 00:25:18.180
Add half this row to this one.

00:25:18.180 --> 00:25:21.630
When I add half of that row
to that one, what do I get?

00:25:21.630 --> 00:25:22.610
I get that zero.

00:25:22.610 --> 00:25:26.440
What do I get here
for the second pivot?

00:25:26.440 --> 00:25:27.820
What is it?

00:25:27.820 --> 00:25:30.690
1.5, 3/2.

00:25:30.690 --> 00:25:32.670
Because half of that is, so 3/2.

00:25:32.670 --> 00:25:39.920
And the rest won't change.

00:25:39.920 --> 00:25:43.040
So I'm happy with that zero.

00:25:43.040 --> 00:25:48.140
Now I've got a couple more
entries below that first pivot,

00:25:48.140 --> 00:25:49.340
but they're already zero.

00:25:49.340 --> 00:25:52.070
That's where the
sparseness pays off.

00:25:52.070 --> 00:25:54.890
The tridiagonal really pays off.

00:25:54.890 --> 00:25:59.410
So those zeros say the
first column is finished.

00:25:59.410 --> 00:26:02.670
So I'm ready to go on
to the second column.

00:26:02.670 --> 00:26:08.560
It's like I got to this smaller
problem with the 3/2 here.

00:26:08.560 --> 00:26:12.170
And a zero there.

00:26:12.170 --> 00:26:13.870
What do I do now?

00:26:13.870 --> 00:26:16.200
There is the second pivot, 3/2.

00:26:16.200 --> 00:26:17.720
Below it is a non-zero.

00:26:17.720 --> 00:26:20.030
I gotta get rid of it.

00:26:20.030 --> 00:26:23.400
What do I multiply by now?

00:26:23.400 --> 00:26:24.620
2/3.

00:26:24.620 --> 00:26:28.460
2/3 of that new second
row added to the third row

00:26:28.460 --> 00:26:30.820
will clean out the third row.

00:26:30.820 --> 00:26:32.850
This was already cleaned out.

00:26:32.850 --> 00:26:34.590
This is already a zero.

00:26:34.590 --> 00:26:38.830
But I want to have 2/3 of
this row added to this one so

00:26:38.830 --> 00:26:41.290
what's my new third row?

00:26:41.290 --> 00:26:43.990
Starts with zero and
what's the third pivot now?

00:26:43.990 --> 00:26:46.870
You see the pivots appearing?

00:26:46.870 --> 00:26:52.470
The third pivot will be 4/3
because I've got 2/3 this -1

00:26:52.470 --> 00:26:59.370
and 2 is 6/3 so I have 6/3,
I'm taking 2/3 away, I get 4/3

00:26:59.370 --> 00:27:01.770
and that -1 is still there.

00:27:01.770 --> 00:27:07.060
So you see that
I'm-- this is fast.

00:27:07.060 --> 00:27:08.900
This is really fast.

00:27:08.900 --> 00:27:12.510
And the next step, maybe you
can see the beautiful patterns

00:27:12.510 --> 00:27:13.300
that are coming.

00:27:13.300 --> 00:27:16.990
Do you want to just
guess the fourth pivot?

00:27:16.990 --> 00:27:21.070
5/4, good guess, right.

00:27:21.070 --> 00:27:24.950
5/4.

00:27:24.950 --> 00:27:29.880
Now this is actually how MATLAB
would find the determinant.

00:27:29.880 --> 00:27:32.660
It would do elimination.

00:27:32.660 --> 00:27:34.390
I call that
elimination because it

00:27:34.390 --> 00:27:37.850
eliminated all those
numbers below the diagonal

00:27:37.850 --> 00:27:39.870
and got zeros.

00:27:39.870 --> 00:27:42.510
Now what's the determinant?

00:27:42.510 --> 00:27:45.000
If I asked you for
the determinant,

00:27:45.000 --> 00:27:50.820
and I will very rarely
use the word determinant,

00:27:50.820 --> 00:27:55.620
but I guess I'm into it now,
so tell me the determinant.

00:27:55.620 --> 00:27:58.020
Five.

00:27:58.020 --> 00:27:59.510
Why's that?

00:27:59.510 --> 00:28:01.650
I guess I did say five earlier.

00:28:01.650 --> 00:28:06.420
But how do you know it's five?

00:28:06.420 --> 00:28:10.360
Whatever the determinant of
that matrix is, why is it five?

00:28:10.360 --> 00:28:12.530
Because it's a
triangular matrix.

00:28:12.530 --> 00:28:16.660
Triangular matrices,
you've got all these zeros.

00:28:16.660 --> 00:28:18.340
You can see what's happening.

00:28:18.340 --> 00:28:21.290
And the determinant
of a triangular matrix

00:28:21.290 --> 00:28:24.310
is just the product
down the diagonal.

00:28:24.310 --> 00:28:25.920
The product of these pivots.

00:28:25.920 --> 00:28:29.270
The determinant is the
product of the pivots.

00:28:29.270 --> 00:28:32.350
And that's how MATLAB would
compute a determinant.

00:28:32.350 --> 00:28:35.890
And it would take 2 times
3/2 times 4/3 times 5/4

00:28:35.890 --> 00:28:40.120
and it would give
the answer five.

00:28:40.120 --> 00:28:45.540
My friend Alan Edelman told
me something yesterday.

00:28:45.540 --> 00:28:54.610
MATLAB computes
in floating point.

00:28:54.610 --> 00:29:02.960
So 4/3, that's 1.3333, etc.

00:29:02.960 --> 00:29:06.660
So MATLAB would not, when
it does that multiplication,

00:29:06.660 --> 00:29:08.570
get a whole number.

00:29:08.570 --> 00:29:09.900
Right?

00:29:09.900 --> 00:29:14.210
Because in MATLAB that
would be 1.333 and probably

00:29:14.210 --> 00:29:18.290
it would make that last pivot
a decimal, a long decimal.

00:29:18.290 --> 00:29:22.560
And then when it multiplies
that it gets whatever it gets.

00:29:22.560 --> 00:29:25.400
But it's not exactly
five I think.

00:29:25.400 --> 00:29:30.110
Nevertheless MATLAB will
print the answer five.

00:29:30.110 --> 00:29:31.910
It's cheated actually.

00:29:31.910 --> 00:29:35.510
It's done that
calculation and I don't

00:29:35.510 --> 00:29:39.520
know if it takes the
nearest integer when

00:29:39.520 --> 00:29:43.080
it knows that the-- I
shouldn't tell you this,

00:29:43.080 --> 00:29:46.320
this isn't even interesting.

00:29:46.320 --> 00:29:49.950
If the determinant of an
integer matrix, whole number

00:29:49.950 --> 00:29:52.230
is a whole number,
so MATLAB says,

00:29:52.230 --> 00:29:54.680
better get a whole number.

00:29:54.680 --> 00:29:58.060
And somehow it gets one.

00:29:58.060 --> 00:30:01.240
Actually, it doesn't
always get the right one.

00:30:01.240 --> 00:30:09.670
So maybe later I'll know
the matrix whose determinant

00:30:09.670 --> 00:30:11.530
might not come out right.

00:30:11.530 --> 00:30:15.170
But ours is right, five.

00:30:15.170 --> 00:30:19.700
Now where was this going?

00:30:19.700 --> 00:30:23.420
It got thrown off track
by the determinant.

00:30:23.420 --> 00:30:25.370
What's the real test?

00:30:25.370 --> 00:30:27.830
Well so I said there
are two ways to see

00:30:27.830 --> 00:30:30.690
that a matrix is invertible.

00:30:30.690 --> 00:30:32.160
Or not invertible.

00:30:32.160 --> 00:30:34.990
Here we're talking
about the first way.

00:30:34.990 --> 00:30:39.130
How do I know that this matrix--
I've got an upper triangular

00:30:39.130 --> 00:30:39.730
matrix.

00:30:39.730 --> 00:30:41.650
When is it invertible?

00:30:41.650 --> 00:30:47.310
When is an upper triangular
matrix invertible?

00:30:47.310 --> 00:30:48.502
Upper triangular is great.

00:30:48.502 --> 00:30:49.960
When you've got it
in that form you

00:30:49.960 --> 00:30:51.890
should be able to see stuff.

00:30:51.890 --> 00:30:55.070
So this key question
of invertible,

00:30:55.070 --> 00:31:03.470
which is not obvious
for a typical matrix

00:31:03.470 --> 00:31:06.000
is obvious for a
triangular matrix.

00:31:06.000 --> 00:31:06.780
And why?

00:31:06.780 --> 00:31:10.180
What's the test?

00:31:10.180 --> 00:31:11.630
Well, we could do
the determinant

00:31:11.630 --> 00:31:15.330
but we can say it without
using that long word.

00:31:15.330 --> 00:31:18.730
The diagonal is non-zero.

00:31:18.730 --> 00:31:22.340
K as invertible because
the diagonal-- no,

00:31:22.340 --> 00:31:24.550
it's got a full set of pivots.

00:31:24.550 --> 00:31:26.810
It's got four non-zero pivots.

00:31:26.810 --> 00:31:28.110
That's what it takes.

00:31:28.110 --> 00:31:31.080
That's what it's going
to take to solve systems.

00:31:31.080 --> 00:31:33.880
So this is the first step
in solving this system.

00:31:33.880 --> 00:31:38.290
In other words, to decide
if a matrix is invertible,

00:31:38.290 --> 00:31:41.150
you just go ahead and use it.

00:31:41.150 --> 00:31:46.080
You don't stop first necessarily
to check invertibility.

00:31:46.080 --> 00:31:48.320
You go forward, you
get to this point

00:31:48.320 --> 00:31:51.070
and you see non-zeros
there and then

00:31:51.070 --> 00:31:55.800
you're practically got
to the answer here.

00:31:55.800 --> 00:32:01.530
I'll leave for another day the
final back-- going back upwards

00:32:01.530 --> 00:32:03.760
that gives you the answer.

00:32:03.760 --> 00:32:05.270
So K is invertible.

00:32:05.270 --> 00:32:15.160
That means full set of
pivots. n non-zero pivots.

00:32:15.160 --> 00:32:20.260
And here they are,
two, 3/2, 4/3 and 5/4.

00:32:20.260 --> 00:32:23.270
Worth knowing because this
matrix K is so important.

00:32:23.270 --> 00:32:24.750
We'll see it over
and over again.

00:32:24.750 --> 00:32:30.950
Part of my purpose today
is to give some matrices

00:32:30.950 --> 00:32:35.380
a name because we'll see them
again and you'll know them

00:32:35.380 --> 00:32:38.640
and you'll recognize them.

00:32:38.640 --> 00:32:43.900
While I'm on this invertible
or not invertible business

00:32:43.900 --> 00:32:52.020
I want to ask you to change
K. To make it not invertible.

00:32:52.020 --> 00:32:54.650
Change that matrix.

00:32:54.650 --> 00:32:56.710
How could I change that matrix?

00:32:56.710 --> 00:32:58.430
Well, of course, many ways.

00:32:58.430 --> 00:33:00.950
But I'm interested
in another matrix

00:33:00.950 --> 00:33:04.880
and this'll be among
my special matrices.

00:33:04.880 --> 00:33:07.660
And it will start out the same.

00:33:07.660 --> 00:33:14.560
It'll have these same diagonals.

00:33:14.560 --> 00:33:16.900
It'll be Toeplitz.

00:33:16.900 --> 00:33:20.600
I'm going to call
it C and I want

00:33:20.600 --> 00:33:25.600
to say the reason I'm talking
about it now is that it's not

00:33:25.600 --> 00:33:29.200
going to be invertible.

00:33:29.200 --> 00:33:38.150
And I'm going to tell you a
C and see if you can tell me

00:33:38.150 --> 00:33:40.320
why it is not invertible.

00:33:40.320 --> 00:33:43.270
So here's the difference:
I'm going to put minus one

00:33:43.270 --> 00:33:45.230
in the corners.

00:33:45.230 --> 00:33:49.880
Still zeros there.

00:33:49.880 --> 00:33:56.180
So that matrix C still
has that pattern.

00:33:56.180 --> 00:33:58.740
It's still a Toeplitz
matrix, actually.

00:33:58.740 --> 00:34:07.970
That would still be the matrix
Toeplitz of 2, -1, 0, -1.

00:34:07.970 --> 00:34:11.440
I claim that matrix
is not invertible

00:34:11.440 --> 00:34:18.700
and I claim that we can see that
without computing determinants,

00:34:18.700 --> 00:34:22.290
we can see it without
doing elimination, too.

00:34:22.290 --> 00:34:24.380
MATLAB would see it
by doing elimination.

00:34:24.380 --> 00:34:30.720
We can see it by just
human intelligence.

00:34:30.720 --> 00:34:33.720
Now why?

00:34:33.720 --> 00:34:39.110
How do I recognize a matrix
that's not invertible?

00:34:39.110 --> 00:34:44.450
And then, by converse, how
a matrix that is invertible.

00:34:44.450 --> 00:34:48.690
I claim-- and let
may say first, let

00:34:48.690 --> 00:34:56.830
me say why that letter C. That
letter C stands for circulant.

00:34:56.830 --> 00:35:02.010
It's because-- This word
circulant, why circulant,

00:35:02.010 --> 00:35:05.520
it's because that diagonal
which only had three guys

00:35:05.520 --> 00:35:09.060
circled around to the fourth.

00:35:09.060 --> 00:35:11.370
This diagonal that
only had three entries

00:35:11.370 --> 00:35:14.070
circled around to
the fourth entry.

00:35:14.070 --> 00:35:16.740
This diagonal with two
zeros circled around

00:35:16.740 --> 00:35:17.840
to the other two zeros.

00:35:17.840 --> 00:35:22.550
The diagonal are not only
constant, they loop around.

00:35:22.550 --> 00:35:24.790
And you use the word periodic.

00:35:24.790 --> 00:35:29.460
Now for me, that's
the periodic matrix.

00:35:29.460 --> 00:35:35.140
See, a circulant matrix comes
from a periodic problem.

00:35:35.140 --> 00:35:38.180
Because it loops around.

00:35:38.180 --> 00:35:41.970
It brings numbers,
zero is the same

00:35:41.970 --> 00:35:45.400
as number four or something.

00:35:45.400 --> 00:35:51.320
And why is that not invertible?

00:35:51.320 --> 00:35:55.570
The thing is can
you find a vector?

00:35:55.570 --> 00:35:57.100
Because matrices
multiply vectors,

00:35:57.100 --> 00:35:59.140
that's their whole point.

00:35:59.140 --> 00:36:03.060
Can you see a vector
that it takes to zero?

00:36:03.060 --> 00:36:06.520
Can you see a solution to Cu=0?

00:36:06.520 --> 00:36:10.990
I'm looking for a
u with four entries

00:36:10.990 --> 00:36:18.680
so that I get four zeros.

00:36:18.680 --> 00:36:20.810
Do you see it?

00:36:20.810 --> 00:36:21.990
All ones.

00:36:21.990 --> 00:36:23.710
All ones.

00:36:23.710 --> 00:36:25.460
That will do it.

00:36:25.460 --> 00:36:33.230
So that's a nice, natural
entry, a constant.

00:36:33.230 --> 00:36:37.360
And do you see why
when I-- we haven't

00:36:37.360 --> 00:36:42.170
spoken about multiplying
matrices times vectors.

00:36:42.170 --> 00:36:44.010
And most people
will do it this way.

00:36:44.010 --> 00:36:46.280
And let's do this one this way.

00:36:46.280 --> 00:36:49.142
You take row one times that,
you get two, minus one, zero,

00:36:49.142 --> 00:36:51.020
minus one.

00:36:51.020 --> 00:36:53.730
You get the zero because
of that new number.

00:36:53.730 --> 00:36:58.920
Here we always got zero from
the all ones vector and now

00:36:58.920 --> 00:37:04.190
over here that minus one,
you see it's just right.

00:37:04.190 --> 00:37:09.290
If all the rows add to zero
then this vector of all ones

00:37:09.290 --> 00:37:14.110
will be, I would use the
word "in the null space"

00:37:14.110 --> 00:37:18.280
if you wanted a fancy word,
a linear algebra word.

00:37:18.280 --> 00:37:19.390
What does that mean?

00:37:19.390 --> 00:37:21.330
It solves Cu=0.

00:37:24.770 --> 00:37:29.080
And why does that show that
the matrix isn't invertible?

00:37:29.080 --> 00:37:31.340
Because that's our point here.

00:37:31.340 --> 00:37:35.210
I have a solution to Cu=0.

00:37:35.210 --> 00:37:39.050
I claim that the existence
of such a solution

00:37:39.050 --> 00:37:45.210
has wiped out the possibility
that the matrix is invertible

00:37:45.210 --> 00:37:49.120
because if it was invertible,
what would this lead to?

00:37:49.120 --> 00:37:55.850
If invertible, if C
inverse exists what would

00:37:55.850 --> 00:38:01.760
I do to that equation
that would show me

00:38:01.760 --> 00:38:04.360
that C inverse can't exist?

00:38:04.360 --> 00:38:08.480
Multiply both
sides by C inverse.

00:38:08.480 --> 00:38:11.230
So you're seeing, just
this first day you're

00:38:11.230 --> 00:38:14.330
seeing some of the natural
steps of linear algebra.

00:38:14.330 --> 00:38:17.140
Row reduction,
multiply-- when you

00:38:17.140 --> 00:38:20.530
want to see what's happening,
multiply both sides

00:38:20.530 --> 00:38:21.460
by C inverse.

00:38:21.460 --> 00:38:24.330
That's the same as
in ordinary language,

00:38:24.330 --> 00:38:27.330
do the same thing to
all the equations.

00:38:27.330 --> 00:38:30.100
So I multiply both sides
by the same matrix.

00:38:30.100 --> 00:38:32.670
And here I would get
C^(-1) C u = C^(-1) 0.

00:38:36.050 --> 00:38:40.190
So what does that tell me?

00:38:40.190 --> 00:38:43.970
I made it long, I threw
in this extra step.

00:38:43.970 --> 00:38:51.350
You were going to jump
immediately to C^(-1) C is I,

00:38:51.350 --> 00:38:54.540
is the identity matrix and when
the identity matrix multiplies

00:38:54.540 --> 00:38:57.780
a vector u, you get u.

00:38:57.780 --> 00:38:59.700
And on the right
side, C inverse,

00:38:59.700 --> 00:39:02.290
whatever it is, if it
existed, times zero

00:39:02.290 --> 00:39:05.160
would have to be zero.

00:39:05.160 --> 00:39:08.380
So this would say that
if C inverse exists,

00:39:08.380 --> 00:39:13.020
then the only solution
is u equals zero.

00:39:13.020 --> 00:39:15.660
That's a good way to
recognize invertible matrices.

00:39:15.660 --> 00:39:21.770
If it is invertible then the
only solution to Cu=0 is u=0.

00:39:21.770 --> 00:39:24.620
And that wasn't true here.

00:39:24.620 --> 00:39:28.160
So we conclude C
is not invertible.

00:39:28.160 --> 00:39:32.400
C is therefore not invertible.

00:39:32.400 --> 00:39:36.040
Now can I even jump in.

00:39:36.040 --> 00:39:37.800
I've got two more
matrices that I

00:39:37.800 --> 00:39:43.250
want to tell you about that are
also close cousins of K and C.

00:39:43.250 --> 00:39:50.250
But let me just explain
physically a little bit

00:39:50.250 --> 00:39:54.050
about where these
matrices are coming from.

00:39:54.050 --> 00:39:59.760
So maybe next to K-- so I'm not
going to put periodic there.

00:39:59.760 --> 00:40:01.570
Right?

00:40:01.570 --> 00:40:03.770
That's the one that I
would call periodic.

00:40:03.770 --> 00:40:08.450
This one is fixed at the ends.

00:40:08.450 --> 00:40:13.760
Can I draw a little picture
that aims to show that?

00:40:13.760 --> 00:40:18.730
Aims to show where
this is coming from.

00:40:18.730 --> 00:40:22.610
It's coming from I think
of this as controlling

00:40:22.610 --> 00:40:23.990
like four masses.

00:40:23.990 --> 00:40:27.660
Mass one, mass two,
mass three and mass four

00:40:27.660 --> 00:40:40.390
with springs attached
and with endpoints fixed.

00:40:40.390 --> 00:40:47.290
So if I put some weights on
those masses-- we'll do this;

00:40:47.290 --> 00:40:51.750
masses and springs is going to
be the very first application

00:40:51.750 --> 00:40:55.370
and it will connect
to all these matrices.

00:40:55.370 --> 00:41:05.050
And all I'm doing now is just
asking to draw the system.

00:41:05.050 --> 00:41:06.490
Draw the mechanical system.

00:41:06.490 --> 00:41:09.950
Actually I'll usually
draw it vertically.

00:41:09.950 --> 00:41:14.580
But anyway, it's got
four masses and the fact

00:41:14.580 --> 00:41:17.250
that this minus one
here got chopped off,

00:41:17.250 --> 00:41:19.820
what would I call that end?

00:41:19.820 --> 00:41:21.830
I'd call that a fixed end.

00:41:21.830 --> 00:41:25.910
So this is a fixed,
fixed matrix.

00:41:25.910 --> 00:41:28.560
Both ends are fixed.

00:41:28.560 --> 00:41:30.620
And it's the matrix
that would govern--

00:41:30.620 --> 00:41:34.270
and the springs and
masses all the same

00:41:34.270 --> 00:41:38.530
is what tells me that
the thing is Toeplitz.

00:41:38.530 --> 00:41:42.970
Now what's the picture
that goes with C?

00:41:42.970 --> 00:41:46.680
What's the picture with C?

00:41:46.680 --> 00:41:49.520
Do you have an instinct of that?

00:41:49.520 --> 00:41:52.080
So C is periodic.

00:41:52.080 --> 00:41:57.440
So again we've got four
masses connected by springs.

00:41:57.440 --> 00:42:03.210
But what's up with those masses
to make the problem cyclic,

00:42:03.210 --> 00:42:07.140
periodic, circular,
whatever word you like.

00:42:07.140 --> 00:42:13.190
They're arranged in a ring.

00:42:13.190 --> 00:42:16.450
The fourth guy comes
back to the first one.

00:42:16.450 --> 00:42:22.120
So the four masses would be,
so in some kind of a ring,

00:42:22.120 --> 00:42:27.500
the springs would connect them.

00:42:27.500 --> 00:42:31.940
I don't know if that's
suggestive, but I hope so.

00:42:31.940 --> 00:42:36.990
And what's the point
of, can we just

00:42:36.990 --> 00:42:39.530
speak about
mechanics one moment?

00:42:39.530 --> 00:42:46.080
How does that system differ
from this fixed system?

00:42:46.080 --> 00:42:53.340
Here the whole system
can't move, right?

00:42:53.340 --> 00:42:55.880
If there no force, then
nothing can happen.

00:42:55.880 --> 00:43:00.560
Here the whole system can turn.

00:43:00.560 --> 00:43:02.750
They can all displace
the same amount

00:43:02.750 --> 00:43:05.760
and just turn without any
compression of the springs,

00:43:05.760 --> 00:43:08.890
without any force
having to do anything.

00:43:08.890 --> 00:43:13.280
And that's why the solution
that kills this matrix is

00:43:13.280 --> 00:43:15.050
[1, 1, 1, 1].

00:43:15.050 --> 00:43:19.360
So [1, 1, 1, 1] would
describe a case where all

00:43:19.360 --> 00:43:21.840
the displacements were equal.

00:43:21.840 --> 00:43:25.940
In a way it's like the
arbitrary constant in calculus.

00:43:25.940 --> 00:43:30.250
You're always adding
plus C. So here we've

00:43:30.250 --> 00:43:36.350
got a solution of all ones
that produces zero the way

00:43:36.350 --> 00:43:41.610
the derivative of a constant
function is the zero function.

00:43:41.610 --> 00:43:49.550
So this is just
like an indication.

00:43:49.550 --> 00:43:51.090
Yes, perfect.

00:43:51.090 --> 00:43:52.750
I've got two more matrices.

00:43:52.750 --> 00:43:58.770
Are you okay for two more?

00:43:58.770 --> 00:44:03.810
Yes okay, what are they?

00:44:03.810 --> 00:44:10.110
Okay a different blackboard
for the last two.

00:44:10.110 --> 00:44:17.640
So one of them is going to
come by freeing up this end.

00:44:17.640 --> 00:44:24.580
So I'm going to take
that support away.

00:44:24.580 --> 00:44:29.980
And you might imagine like a
tower oscillating up and down

00:44:29.980 --> 00:44:34.020
or you might turn it upside
down and like a hanging spring,

00:44:34.020 --> 00:44:39.160
or rather four springs with
four masses hanging onto them.

00:44:39.160 --> 00:44:43.470
But this end is fixed and
this is not fixed anymore,

00:44:43.470 --> 00:44:46.160
this is now free.

00:44:46.160 --> 00:44:50.590
And can I tell you the
matrix, the free-fixed matrix.

00:44:50.590 --> 00:44:53.590
Free-fixed.

00:44:53.590 --> 00:44:56.370
Because it's the top
end that I changed,

00:44:56.370 --> 00:44:59.680
I'm going to call it T.
So all the other guys

00:44:59.680 --> 00:45:11.340
are going to be the same but
the top one, the top row,

00:45:11.340 --> 00:45:13.230
the boundary row,
boundary conditions

00:45:13.230 --> 00:45:17.870
are always the tough
part, the tricky part,

00:45:17.870 --> 00:45:20.950
the key part of
a model, and here

00:45:20.950 --> 00:45:25.120
the natural boundary condition
is to have a 1 there.

00:45:25.120 --> 00:45:34.610
That two changed to a one.

00:45:34.610 --> 00:45:37.900
Now if I asked you for the
properties of that matrix--

00:45:37.900 --> 00:45:41.010
so that's the third.
shall I do the fourth one?

00:45:41.010 --> 00:45:44.480
So you have them all, you'll
have the whole picture.

00:45:44.480 --> 00:45:45.940
The fourth one,
well you can guess.

00:45:45.940 --> 00:45:48.950
What's the fourth?

00:45:48.950 --> 00:45:51.470
What am I going to do?

00:45:51.470 --> 00:45:53.380
Free up the other end.

00:45:53.380 --> 00:45:59.420
So this guy had one free
end and the other guy

00:45:59.420 --> 00:46:01.570
has B for both ends.

00:46:01.570 --> 00:46:04.050
B for both ends are
going to be free.

00:46:04.050 --> 00:46:06.840
So this is free-fixed.

00:46:06.840 --> 00:46:08.930
This'll be free-free.

00:46:08.930 --> 00:46:12.240
So that means I
have this free end,

00:46:12.240 --> 00:46:17.010
the usual stuff in
the middle, no change,

00:46:17.010 --> 00:46:23.510
and the last row is what?

00:46:23.510 --> 00:46:27.560
What am I going to put
in the last row? -1, 1.

00:46:27.560 --> 00:46:29.160
-1, 1.

00:46:29.160 --> 00:46:34.740
So I've changed the diagonal.

00:46:34.740 --> 00:46:38.150
There I put a single one in
because I freed up one end.

00:46:38.150 --> 00:46:41.900
With B I freed both ends
and I got two minus ones.

00:46:41.900 --> 00:46:44.420
Now what do you think?

00:46:44.420 --> 00:46:52.860
So we've drawn the free-fixed
one and what's your guess?

00:46:52.860 --> 00:46:55.320
They're all symmetric.

00:46:55.320 --> 00:46:57.200
That's no accident.

00:46:57.200 --> 00:47:00.690
They're all tridiagonal,
no accident again.

00:47:00.690 --> 00:47:02.210
Why are they tridiagonal?

00:47:02.210 --> 00:47:06.020
Physically they're tridiagonal
because that mass is only

00:47:06.020 --> 00:47:07.890
connected to its
two neighbors, it's

00:47:07.890 --> 00:47:10.940
not connected to that mass.

00:47:10.940 --> 00:47:16.390
That's why we get a zero
in the two, four position.

00:47:16.390 --> 00:47:19.180
Because two is not
connected to four.

00:47:19.180 --> 00:47:21.920
So it's tridiagonal.

00:47:21.920 --> 00:47:25.030
And it's not Toeplitz
anymore, right?

00:47:25.030 --> 00:47:27.720
Toeplitz says constant
diagonals and these are not

00:47:27.720 --> 00:47:29.310
quite constant.

00:47:29.310 --> 00:47:33.990
I would create K, I
would take T equal K,

00:47:33.990 --> 00:47:36.830
if I was going to create this
matrix and then I would say

00:47:36.830 --> 00:47:37.330
T(1, 1) = 1.

00:47:40.060 --> 00:47:49.020
That command would fix
up the first entry.

00:47:49.020 --> 00:47:50.580
Yeah, that's a serious question.

00:47:50.580 --> 00:47:53.730
Maybe, can I hang on
until Friday, and even

00:47:53.730 --> 00:47:54.710
maybe next week.

00:47:54.710 --> 00:47:56.310
Because it's very important.

00:47:56.310 --> 00:48:00.980
When I said boundary conditions
are the key to problems,

00:48:00.980 --> 00:48:02.760
I'm serious.

00:48:02.760 --> 00:48:06.790
If I had to think okay, what
do people come in my office

00:48:06.790 --> 00:48:08.780
ask about questions,
I say right away,

00:48:08.780 --> 00:48:10.030
what's the boundary condition?

00:48:10.030 --> 00:48:12.910
Because I know that's
where the problem is.

00:48:12.910 --> 00:48:16.910
And so here we'll see
these guys clearly.

00:48:16.910 --> 00:48:23.360
Fixed and free, very important.

00:48:23.360 --> 00:48:26.330
But also let me say two more
words, I never can resist.

00:48:26.330 --> 00:48:30.510
So fixed means the
displacement is zero.

00:48:30.510 --> 00:48:32.790
Something was set to zero.

00:48:32.790 --> 00:48:36.540
The fifth guy, the fifth over
here, that fifth column was

00:48:36.540 --> 00:48:39.270
knocked out.

00:48:39.270 --> 00:48:47.300
Free means that in here it
could mean that the fifth guy is

00:48:47.300 --> 00:48:49.450
the same as the fourth.

00:48:49.450 --> 00:48:52.080
The slope is zero.

00:48:52.080 --> 00:48:55.760
Fixed is u is zero.

00:48:55.760 --> 00:48:59.010
Free is slope is zero.

00:48:59.010 --> 00:49:04.710
So here I have a slope
of zero at that end,

00:49:04.710 --> 00:49:05.960
here I have it at both ends.

00:49:05.960 --> 00:49:09.440
So maybe that's a
sort of part answer.

00:49:09.440 --> 00:49:12.640
Now I wanted to get to the
difference between these two

00:49:12.640 --> 00:49:15.140
matrices.

00:49:15.140 --> 00:49:19.030
And the main properties.

00:49:19.030 --> 00:49:19.960
So what are we see?

00:49:19.960 --> 00:49:22.210
Symmetric again,
tridiagonal again,

00:49:22.210 --> 00:49:27.760
not quite Toeplitz, but almost,
sort of morally Toeplitz.

00:49:27.760 --> 00:49:32.590
But then the key question
was invertible or not.

00:49:32.590 --> 00:49:34.590
Key question was
invertible or not.

00:49:34.590 --> 00:49:35.090
Right.

00:49:35.090 --> 00:49:37.680
And what's your
guess on these two?

00:49:37.680 --> 00:49:41.030
Do you think that one's
invertible or not?

00:49:41.030 --> 00:49:41.770
Make a guess.

00:49:41.770 --> 00:49:46.140
You're allowed to guess.

00:49:46.140 --> 00:49:47.550
Yeah it is.

00:49:47.550 --> 00:49:48.460
Why's that?

00:49:48.460 --> 00:49:52.740
Because this thing has
still got a support.

00:49:52.740 --> 00:49:56.260
It's not free to shift forever.

00:49:56.260 --> 00:49:57.860
It's held in there.

00:49:57.860 --> 00:50:01.020
So that gives you a
hint about this guy.

00:50:01.020 --> 00:50:04.890
Invertible or not for B?

00:50:04.890 --> 00:50:06.210
No.

00:50:06.210 --> 00:50:09.780
And now prove that it's not.

00:50:09.780 --> 00:50:12.800
Physically you were
saying, well this free guy

00:50:12.800 --> 00:50:19.640
with this thing gone now,
this is now free-free.

00:50:19.640 --> 00:50:21.710
Physically we're saying
the whole thing can move,

00:50:21.710 --> 00:50:24.130
there's nothing holding it.

00:50:24.130 --> 00:50:27.680
But now, for linear algebra,
that's not the proper language.

00:50:27.680 --> 00:50:31.040
You have to say something
about that matrix.

00:50:31.040 --> 00:50:33.010
Maybe tell me
something about Bu=0.

00:50:36.820 --> 00:50:38.950
What are you going
to take for u?

00:50:38.950 --> 00:50:39.770
Yeah.

00:50:39.770 --> 00:50:41.420
Same u.

00:50:41.420 --> 00:50:46.740
We're lucky in this course, u =
[1, 1, 1, 1] is the guilty main

00:50:46.740 --> 00:50:48.800
vector many times.

00:50:48.800 --> 00:50:55.090
Because again the rows are all
adding to zero and the all ones

00:50:55.090 --> 00:51:02.360
vector is in the null space.

00:51:02.360 --> 00:51:06.200
If I could just close
with one more word.

00:51:06.200 --> 00:51:07.810
Because it's the most important.

00:51:07.810 --> 00:51:10.160
Two words, two words.

00:51:10.160 --> 00:51:11.890
Because they're the
most important words,

00:51:11.890 --> 00:51:15.200
they're the words that we're
leading to in this chapter.

00:51:15.200 --> 00:51:18.770
And I'm assuming that for most
people they will be new words,

00:51:18.770 --> 00:51:21.480
but not for all.

00:51:21.480 --> 00:51:24.290
It's a further property
of this matrix.

00:51:24.290 --> 00:51:25.380
So we've got, how many?

00:51:25.380 --> 00:51:27.630
Four properties, or five?

00:51:27.630 --> 00:51:29.900
I'm going to go for one more.

00:51:29.900 --> 00:51:33.680
And I'm just going to
say that name first

00:51:33.680 --> 00:51:36.400
so you know it's coming.

00:51:36.400 --> 00:51:38.110
And then I'll say,
I can't resist

00:51:38.110 --> 00:51:41.110
saying a tiny bit about it.

00:51:41.110 --> 00:51:45.980
I'll use a whole
blackboard for this.

00:51:45.980 --> 00:51:54.530
So I'm going to say that K
and T are -- here it comes,

00:51:54.530 --> 00:52:07.690
take a breath -- positive
definite matrices.

00:52:07.690 --> 00:52:10.390
So if you don't know what
that means, I'm happy.

00:52:10.390 --> 00:52:10.890
Right?

00:52:10.890 --> 00:52:13.420
Because well, I can
tell you one way

00:52:13.420 --> 00:52:16.830
to recognize a positive
definite matrix.

00:52:16.830 --> 00:52:21.190
And while we're at it, let
me tell you about C and B.

00:52:21.190 --> 00:52:32.160
Those are positive semi-definite
because they hit zero somehow.

00:52:32.160 --> 00:52:35.830
Positive means up there,
greater than zero.

00:52:35.830 --> 00:52:40.270
And what is greater than
zero that we've already seen?

00:52:40.270 --> 00:52:42.900
And we'll say more.

00:52:42.900 --> 00:52:44.550
The pivots were.

00:52:44.550 --> 00:52:50.620
So if I have a symmetric matrix
and the pivots are all positive

00:52:50.620 --> 00:52:54.700
then that matrix is not
only invertible, because I'm

00:52:54.700 --> 00:52:56.920
in good shape, the
determinant isn't zero,

00:52:56.920 --> 00:53:00.690
I can go backwards
and do everything,

00:53:00.690 --> 00:53:04.540
those positive numbers are
telling me that more than that,

00:53:04.540 --> 00:53:07.810
the matrix is positive definite.

00:53:07.810 --> 00:53:11.240
So that's a test.

00:53:11.240 --> 00:53:13.500
We'll say more about
positive definite,

00:53:13.500 --> 00:53:17.760
but one way to recognize
it is compute the pivots

00:53:17.760 --> 00:53:18.930
by elimination.

00:53:18.930 --> 00:53:20.630
Are they positive?

00:53:20.630 --> 00:53:23.980
We'll see that all the
eigenvalues are positive.

00:53:23.980 --> 00:53:27.520
The word positive definite
just brings the whole

00:53:27.520 --> 00:53:29.740
of linear algebra together.

00:53:29.740 --> 00:53:33.440
It connects to pivots, it
connects to eigenvalues,

00:53:33.440 --> 00:53:36.530
it connects to least squares,
it's all over the place.

00:53:36.530 --> 00:53:39.790
Determinants too.

00:53:39.790 --> 00:53:42.050
Questions or discussion.

00:53:42.050 --> 00:53:44.970
It's a big class and we're
just meeting for the first time

00:53:44.970 --> 00:53:49.740
but there's lots of time
to, chance to ask me.

00:53:49.740 --> 00:53:52.590
I'll always be here after class.

00:53:52.590 --> 00:53:53.760
So shall we stop today?

00:53:53.760 --> 00:53:58.890
I'll see you Friday
or this afternoon.

00:53:58.890 --> 00:54:03.710
If this wasn't familiar, this
afternoon would be a good idea.

00:54:03.710 --> 00:54:05.220
Thank you.