Linear transformations and matrices | Chapter 3, Essence of linear algebra
Skills:
ML Maths Basics90%
Key Takeaways
The video explains linear transformations and matrices, specifically how linear transformations can be described using matrix vector multiplication and how matrices can be used to package the information needed to describe a linear transformation.
Full Transcript
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 its tip sits. 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 lines straight, but that's just because I'm only showing the horizontal and vertical grid lines. 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 grid lines 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 -1 2, meaning that it equals -1 * I hat + 2 * J hat. If we apply 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 V lands will be -1 * the vector where I hat landed + 2 * 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 -2, and J hat lands on the x-axis over at the coordinates 3 0. This means that the vector represented by -1 I hat + 2 * J hat ends up at -1 * the vector 1 -2 + 2 * 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 cuz 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. Write the vector with more general coordinates x and y, and it will land on x * the vector where I hat lands, 1 -2, + y * the vector where J hat lands, 3 0. Carrying out that sum, you see that it lands at 1x + 3y, -2x + 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 2x2 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 a b c d. 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 a c as the place where the first basis vector lands, and that second column b d as 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 * a c + y * b d. Putting this together, you get a vector ax + by, cx + 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 as 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° counterclockwise, then I hat lands on the coordinates 0 1. And J hat lands on the coordinates -1 0. So, the matrix we end up with has columns 0 1, -1 0. To figure out what happens to any vector after a 90° 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 and 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, eigenvalues, 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. [Music]
Original Description
Quite possibly the most important idea for understanding linear algebra.
Help fund future projects: https://www.patreon.com/3blue1brown
An equally valuable form of support is to simply share some of the videos.
Home page: https://www.3blue1brown.com
Full series: http://3b1b.co/eola
Future series like this are funded by the community, through Patreon, where supporters get early access as the series is being produced.
http://3b1b.co/support
Thanks to these viewers for their contributions to translations
Hebrew: Omer Tuchfeld
Spanish: Juan Carlos Largo
Vietnamese: @ngvutuan2811
------------------
3blue1brown is a channel about animating math, in all senses of the word animate. And you know the drill with YouTube, if you want to stay posted about new videos, subscribe, and click the bell to receive notifications (if you're into that).
If you are new to this channel and want to see more, a good place to start is this playlist: https://goo.gl/WmnCQZ
Various social media stuffs:
Website: https://www.3blue1brown.com
Twitter: https://twitter.com/3Blue1Brown
Patreon: https://patreon.com/3blue1brown
Facebook: https://www.facebook.com/3blue1brown
Reddit: https://www.reddit.com/r/3Blue1Brown
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from 3Blue1Brown · 3Blue1Brown · 14 of 60
1
2
3
4
5
6
7
8
9
10
11
12
13
▶
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
e to the pi i, a nontraditional take (old version)
3Blue1Brown
Euler's Formula Poem
3Blue1Brown
Euler's Formula and Graph Duality
3Blue1Brown
What does it feel like to invent math?
3Blue1Brown
How to count to 1000 on two hands
3Blue1Brown
Music And Measure Theory
3Blue1Brown
Fractal charm: Space filling curves
3Blue1Brown
The Brachistochrone, with Steven Strogatz
3Blue1Brown
Snell's law proof using springs
3Blue1Brown
Triangle of Power
3Blue1Brown
Essence of linear algebra preview
3Blue1Brown
Vectors | Chapter 1, Essence of linear algebra
3Blue1Brown
Linear combinations, span, and basis vectors | Chapter 2, Essence of linear algebra
3Blue1Brown
Linear transformations and matrices | Chapter 3, Essence of linear algebra
3Blue1Brown
Matrix multiplication as composition | Chapter 4, Essence of linear algebra
3Blue1Brown
Three-dimensional linear transformations | Chapter 5, Essence of linear algebra
3Blue1Brown
The determinant | Chapter 6, Essence of linear algebra
3Blue1Brown
Inverse matrices, column space and null space | Chapter 7, Essence of linear algebra
3Blue1Brown
Nonsquare matrices as transformations between dimensions | Chapter 8, Essence of linear algebra
3Blue1Brown
Dot products and duality | Chapter 9, Essence of linear algebra
3Blue1Brown
Cross products in the light of linear transformations | Chapter 11, Essence of linear algebra
3Blue1Brown
Cross products | Chapter 10, Essence of linear algebra
3Blue1Brown
Change of basis | Chapter 13, Essence of linear algebra
3Blue1Brown
Eigenvectors and eigenvalues | Chapter 14, Essence of linear algebra
3Blue1Brown
Abstract vector spaces | Chapter 16, Essence of linear algebra
3Blue1Brown
Who cares about topology? (Old version)
3Blue1Brown
3blue1brown channel trailer
3Blue1Brown
Binary, Hanoi and Sierpinski, part 1
3Blue1Brown
Binary, Hanoi, and Sierpinski, part 2
3Blue1Brown
But what is the Riemann zeta function? Visualizing analytic continuation
3Blue1Brown
Tattoos on Math
3Blue1Brown
Fractals are typically not self-similar
3Blue1Brown
Euler's formula with introductory group theory
3Blue1Brown
The essence of calculus
3Blue1Brown
The paradox of the derivative | Chapter 2, Essence of calculus
3Blue1Brown
Derivative formulas through geometry | Chapter 3, Essence of calculus
3Blue1Brown
Visualizing the chain rule and product rule | Chapter 4, Essence of calculus
3Blue1Brown
What's so special about Euler's number e? | Chapter 5, Essence of calculus
3Blue1Brown
Implicit differentiation, what's going on here? | Chapter 6, Essence of calculus
3Blue1Brown
Limits, L'Hôpital's rule, and epsilon delta definitions | Chapter 7, Essence of calculus
3Blue1Brown
Integration and the fundamental theorem of calculus | Chapter 8, Essence of calculus
3Blue1Brown
What does area have to do with slope? | Chapter 9, Essence of calculus
3Blue1Brown
Higher order derivatives | Chapter 10, Essence of calculus
3Blue1Brown
Taylor series | Chapter 11, Essence of calculus
3Blue1Brown
Pi hiding in prime regularities
3Blue1Brown
All possible pythagorean triples, visualized
3Blue1Brown
But how does bitcoin actually work?
3Blue1Brown
How secure is 256 bit security?
3Blue1Brown
Hilbert's Curve: Is infinite math useful?
3Blue1Brown
Thinking outside the 10-dimensional box
3Blue1Brown
Some light quantum mechanics (with minutephysics)
3Blue1Brown
But what is a neural network? | Deep learning chapter 1
3Blue1Brown
Gradient descent, how neural networks learn | Deep Learning Chapter 2
3Blue1Brown
Backpropagation, intuitively | Deep Learning Chapter 3
3Blue1Brown
Backpropagation calculus | Deep Learning Chapter 4
3Blue1Brown
The hardest problem on the hardest test
3Blue1Brown
Q&A #2 + Net Neutrality Nuance
3Blue1Brown
Why this puzzle is impossible
3Blue1Brown
But what is the Fourier Transform? A visual introduction.
3Blue1Brown
The more general uncertainty principle, regarding Fourier transforms
3Blue1Brown
More on: ML Maths Basics
View skill →
🎓
Tutor Explanation
DeepCamp AI