hey everyone if I had to choose just one
topic that makes all of the others in
linear algebra start to click and which
too often goes unlearned the first time
a student takes linear algebra it would
be this one the idea of a linear
transformation and its relation to
matrices for this video I'm just going
to focus on what these transformations
look like in the case of two dimensions
and how they relate to the idea of
matrix vector multiplication in
particular I want to show you a way to
think about matrix vector multiplication
that doesn't rely on memorization to
start let's just parse this term linear
transformation transformation is
essentially a fancy word for function
it's something that takes in inputs and
spits out an output for each one
specifically in the context of linear
algebra we like to think about
transformations that take in some vector
and spit out another vector so why use
the word transformation instead of
function if they mean the same thing
well it's to be suggestive of a certain
way to visualize this input-output
relation you see a great way to
understand functions of vectors is to
use movement if a transformation takes
some input vector to some output vector
we imagine that input vector moving over
to the output vector then to understand
the transformation as a whole we might
imagine watching every possible input
vector move over to its corresponding
output vector it gets really crowded to
think about all of the vectors all at
once
each one is an arrow so as I mentioned
last video a nice trick is to
conceptualize each vector not as an
arrow but as a single point the point
where it's tip sets that way to think
about a transformation taking every
possible input vector to some output
vector we watch every point in space
moving to some other point in the case
of transformations in two dimensions to
get a better feel for the whole shape of
the transformation I like to do this
with all of the points on an infinite
grid I also sometimes like to keep a
copy of the grid in the background just
to help keep track of where everything
ends up relative to where it starts
the effect for various transformations
moving around all of the points in space
is you've got to admit beautiful it
gives the feeling of squishing and
morphing space itself as you can imagine
though arbitrary transformations can
look pretty complicated but luckily
linear algebra limits itself to a
special type of transformation ones that
are easier to understand called linear
transformations visually speaking a
transformation is linear if it has two
properties all lines must remain lines
without getting curved and the origin
must remain fixed in place for example
this right here would not be a linear
transformation since the lines get all
curvy and this one right here although
it keeps the line straight is not a
linear transformation because it moves
the origin this one here fixes the
origin and it might look like it keeps
line straight but that's just because
I'm only showing the horizontal and
vertical gridlines when you see what it
does to a diagonal line it becomes clear
that it's not at all linear since it
turns that line all curvy in general you
should think of linear transformations
as keeping gridlines parallel and evenly
spaced
some linear transformations are simple
to think about like rotations about the
origin others are a little trickier to
describe with words
so how do you think you could describe
these transformations numerically if you
were say programming some animations to
make a video teaching the topic what
formula do you give the computer so that
if you give it the coordinates of a
vector it can give you the coordinates
of where that vector lands it turns out
that you only need to record where the
two basis vectors I hat and J hat each
land and everything else will follow
from that for example consider the
vector V with coordinates negative 1/2
meaning that it equals negative 1 times
I hat plus 2 times J hat
if we play some transformation and
follow where all three of these vectors
go the property that grid lines remain
parallel and evenly spaced has a really
important consequence the place where
VLANs will be negative one time's the
vector where I hat landed plus two times
the vector where J hat landed in other
words it started off as a certain linear
combination of I hat and J hat and it
ends up as that same linear combination
of where those two vectors landed this
means you can deduce where V must go
based only on where I hat and J hat each
land this is why I like keeping a copy
of the original grid in the background
for the transformation shown here we can
read off that I hat lands on the
coordinates 1 negative 2 and J hat lands
on the x-axis over at the coordinates 3
0 this means that the vector represented
by negative 1 I hat plus 2 times J hat
ends up at negative 1 times the vector 1
negative 2 plus 2 times the vector 3 0
adding that all together you can deduce
that it has to land on the vector 5/2
this is a good point to pause and ponder
because it's pretty important
now given that I'm actually showing you
the full transformation you could have
just looked to see that V has the
coordinates 5/2 but the cool part here
is that this gives us a technique to
deduce where any vectors land so long as
we have a record of where I hat and J
hat each land without needing to watch
the transformation itself right the
vector with more general coordinates x
and y and it will land on x times the
vector where I hat lands 1 negative 2
plus y times the vector where J hat
lands 3 0 carrying out that sum you see
that it lands at 1 X plus 3y negative 2x
plus 0y I give you any vector and you
can tell me where that vector lands
using this formula what all of this is
saying is that a two dimensional linear
transformation is completely described
by just four numbers the two coordinates
for where I hat lands and the two
coordinates for where J hat lands
isn't that cool it's common to package
these coordinates into a 2x2 grid of
numbers called a 2x2 matrix where you
can interpret the columns as the two
special vectors where I hat and J hat
each land if you're given a 2 by 2
matrix describing a linear
transformation and some specific vector
and you want to know where that linear
transformation takes that vector you can
take the coordinates of the vector
multiply them by the corresponding
columns of the matrix then add together
what you get this corresponds with the
idea of adding the scaled versions of
our new basis vectors
let's see what this looks like in the
most general case where your matrix has
entries ABCD and remember this matrix is
just a way of packaging the information
needed to describe a linear
transformation always remember to
interpret that first column AC as the
place where the first basis vector lands
and that second column BD is the place
where the second basis vector lands when
we apply this transformation to some
vector X Y what do you get
well it'll be x times AC plus y times BD
putting this together you get a vector
ax plus B Y CX plus dy you could even
define this as matrix vector
multiplication when you put the matrix
on the left of the vector like it's a
function then you could make
high-schoolers memorize this without
showing them the crucial part that makes
it feel intuitive but isn't it more fun
to think about these columns as the
transformed versions of your basis
vectors and to think about the result is
the appropriate linear combination of
those vectors
let's practice describing a few linear
transformations with matrices for
example if we rotate all of space 90
degrees counterclockwise then I hat
lands on the coordinates 0 1
and j-hat lands on the coordinates
negative one zero so the matrix we end
up with has columns zero one negative
one zero to figure out what happens to
any vector after a 90 degree rotation
you could just multiply its coordinates
by this matrix
here's a fun transformation with a
special name called a shear in it I hat
remains fixed so the first column of the
matrix is 1 0 but J hat moves over to
the coordinates 1 1 which become the
second column of the matrix and at the
risk of being redundant here figuring
out how a shear transforms a given
vector comes down to multiplying this
matrix by that vector
let's say we want to go the other way
around starting with a matrix say with
columns 1 2 & 3 1 and we want to deduce
what its transformation looks like pause
and take a moment to see if you can
imagine it one way to do this is to
first move I hat to 1 2 then move J hat
to 3 1 always moving the rest of space
in such a way that keeps grid lines
parallel and evenly spaced
if the vectors that I hat and j-hat land
on are linearly dependent which if you
recall from last video means that one is
a scaled version of the other it means
that the linear transformation squishes
all of 2d space onto the line where
those two vectors sit also known as the
one-dimensional span of those two
linearly dependent vectors
to sum up linear transformations are a
way to move around space such that grid
lines remain parallel and evenly spaced
and such that the origin remains fixed
delightfully these transformations can
be described using only a handful of
numbers the coordinates of where each
basis vector lands matrices give us a
language to describe these
transformations where the columns
represent those coordinates and matrix
vector multiplication is just a way to
compute what that transformation does to
a given vector the important takeaway
here is that every time you see a matrix
you can interpret it as a certain
transformation of space once you really
digest this idea you're in a great
position to understand linear algebra
deeply almost all of the topics coming
up from matrix multiplication to
determinants change of basis I ghen
values all of these will become easier
to understand once you start thinking
about matrices as transformations of
space most immediately in the next video
I'll be talking about multiplying two
matrices together see you then
you