We now turn to Chapter 7,
which is, uh, matrix examples.
And we'll look at a bunch of matrices that come up in applications.
Uh, it's just to give you an idea of what matrices that,
uh, what- what matrices arise in practice, what they look like.
And also in many cases,
we'll look at things like what does a row mean or a column,
or what does matrix-vector multiplication, uh, mean.
Because that'll always be interesting depending on the application.
So we'll start with geometric transformations.
So a lot of geometric transformations, ah,
in 2D or 3D,
ah, can be represented via matrix multiplication.
So that looks something like this.
Just y equals Ax.
A is- you think of A as a matrix that carries out,
uh, the geometric transformation.
So here's an example.
Consider the mapping or transformation that rotates a vector by Theta radians.
So here's a vector x and it gets rotated over to, uh, Theta radians,
got the same- same norm, but it's been, uh,
rotated and it's been rotated by Theta radians.
Uh, and of course,
in the mathematically positive direction,
uh, that means counterclockwise.
Okay. So that's a - that's a rotation mapping,
uh, and it turns out it has the form y equals Ax.
Now, to get, uh,
to get the entries of a,
uh, there are lots and lots of ways to do it.
But a very simple one is to do things like this.
When you have, uh, y equals Ax,
if x is equal to e1,
the first unit vector,
then y is going to be the first- it's going to be the first column of A.
So for example, if I took e1,
that's this vector here,
uh, and I rotate it by a Theta radians I get to this- this vector.
And sure enough, this distance is the cosine of Theta.
That's our first entry here.
And this height here is sine Theta, and that's here.
Okay? And to get the second column,
we look at Ae2.
So remember that when you have a matrix A and you multiply by e2,
the second unit vector,
what you get is the second column.
So let's take e2,
e2 is this vector and we rotate it, Theta radians.
Whoops. My mistake, that's a little bit too long. But there we go.
[NOISE] So we take that,
and then we say, what- what are the coordinates of that vector?
Well, the x coordinate or x1 coordinate here is going to be minus the sine Theta.
And so there you go. That's that one.
And then the height here of this thing here,
over- over here is going to be cosine Theta.
And so that gives you this thing.
And by the way, a matrix like this is called a rotation matrix for
obvious reasons because it rotates vectors by Theta radians.
Okay. This is just one example.
There are a couple of others.
If you take a look in the book, you'll see more.
Uh, for example, reflection through a plane, things like that.
Uh, and rotation matrices are used in lots and lots of applications,
and in mechanics, uh, in, um,
lots and lots- lots of areas,
uh, in graphics, for example,
when you're, uh, working out,
you know, what does something look like from a certain angle.
Okay. The next, uh,
big group of examples we're going to look at, uh, is pretty generic.
It- it's called selectors.
And I'll tell you what a selector is.
So a matrix, uh,
is a selector if each of its rows has exactly 1,1 and all other entries are 0.
Now, another way to say that is that each row is a unit vector, uh, transposed.
So here's a selector,
I'll just make one for you, right, like this.
Uh, right? So there you go.
Okay? So there's a - there's a three-by-three selector matrix.
And if I multiply this by x1,
x2, x3, that's a vector.
What I- what comes out is that's x3 because I'm just going across here and down here,
then I get x1, then I get x3.
And what it says is,
if you think of this as y and y equals Ax,
then what Ax gives you is each entry of that,
if that's y, each entry is one of the x's.
So each- what it is,
is it's selecting an- an- it's selecting from the entries of x, right?
They can be repeated. So for example here,
x3 shows up there and also shows up there.
So, uh, that's how that works.
Um, and so multiplying by, uh, A,
a vector, uh, basically selects different entries.
Okay. So here's a- here's a- a practical example from,
if you like, signal processing or time series.
Um, here's the matrix A.
And it's an m by 2m matrix and it looks like this.
Um, lots of ways to interpret it.
Uh, so the first row is e1 transpose,
the second row is e3 transpose,
the third is going to be e5 transpose, and so on.
So if you imagine what happens when you multiply this by a vector x, here's what you get.
Um, it will take the first entry in the first component of Ax,
and it will take x3,
that's the third entry of x,
then x5 and so on.
And so for example,
if x was a time series,
uh, then this would be referred,
the slang would- as you would say that the time series has been down-sampled 2x,
meaning I'm taking the first,
the third, the fifth, the seventh, and so on.
Um, and so that's- that's what that.
So you would be able to look at that matrix and say, ah,
that represents if you multiply it by a vector,
that's down sampling, for example.
Um, but this comes up all over the place.
In, uh, a lot of image processing, you get the same thing.
Like image cropping would be a selector, right?
So if I have an image represented by a big long vector and I want to,
uh, do things like crop to some smaller portion of it,
I'm just selecting, uh, various pixels.
And again, it would- A would be a selector matrix.
Okay. So this will come up.
Uh, we'll see this in a lot of applications.