Linear transformations and matrices | Chapter 3, Essence of linear algebra

3Blue1Brown · Beginner ·🔢 Mathematical Foundations ·9y ago

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 e to the pi i, a nontraditional take (old version)
e to the pi i, a nontraditional take (old version)
3Blue1Brown
2 Euler's Formula Poem
Euler's Formula Poem
3Blue1Brown
3 Euler's Formula and Graph Duality
Euler's Formula and Graph Duality
3Blue1Brown
4 What does it feel like to invent math?
What does it feel like to invent math?
3Blue1Brown
5 How to count to 1000 on two hands
How to count to 1000 on two hands
3Blue1Brown
6 Music And Measure Theory
Music And Measure Theory
3Blue1Brown
7 Fractal charm: Space filling curves
Fractal charm: Space filling curves
3Blue1Brown
8 The Brachistochrone, with Steven Strogatz
The Brachistochrone, with Steven Strogatz
3Blue1Brown
9 Snell's law proof using springs
Snell's law proof using springs
3Blue1Brown
10 Triangle of Power
Triangle of Power
3Blue1Brown
11 Essence of linear algebra preview
Essence of linear algebra preview
3Blue1Brown
12 Vectors | Chapter 1, Essence of linear algebra
Vectors | Chapter 1, Essence of linear algebra
3Blue1Brown
13 Linear combinations, span, and basis vectors | Chapter 2, Essence of linear algebra
Linear combinations, span, and basis vectors | Chapter 2, Essence of linear algebra
3Blue1Brown
Linear transformations and matrices | Chapter 3, Essence of linear algebra
Linear transformations and matrices | Chapter 3, Essence of linear algebra
3Blue1Brown
15 Matrix multiplication as composition | Chapter 4, Essence of linear algebra
Matrix multiplication as composition | Chapter 4, Essence of linear algebra
3Blue1Brown
16 Three-dimensional linear transformations | Chapter 5, Essence of linear algebra
Three-dimensional linear transformations | Chapter 5, Essence of linear algebra
3Blue1Brown
17 The determinant | Chapter 6, Essence of linear algebra
The determinant | Chapter 6, Essence of linear algebra
3Blue1Brown
18 Inverse matrices, column space and null space | Chapter 7, Essence of linear algebra
Inverse matrices, column space and null space | Chapter 7, Essence of linear algebra
3Blue1Brown
19 Nonsquare matrices as transformations between dimensions | Chapter 8, Essence of linear algebra
Nonsquare matrices as transformations between dimensions | Chapter 8, Essence of linear algebra
3Blue1Brown
20 Dot products and duality | Chapter 9, Essence of linear algebra
Dot products and duality | Chapter 9, Essence of linear algebra
3Blue1Brown
21 Cross products in the light of linear transformations | Chapter 11, Essence of linear algebra
Cross products in the light of linear transformations | Chapter 11, Essence of linear algebra
3Blue1Brown
22 Cross products | Chapter 10, Essence of linear algebra
Cross products | Chapter 10, Essence of linear algebra
3Blue1Brown
23 Change of basis | Chapter 13, Essence of linear algebra
Change of basis | Chapter 13, Essence of linear algebra
3Blue1Brown
24 Eigenvectors and eigenvalues | Chapter 14, Essence of linear algebra
Eigenvectors and eigenvalues | Chapter 14, Essence of linear algebra
3Blue1Brown
25 Abstract vector spaces | Chapter 16, Essence of linear algebra
Abstract vector spaces | Chapter 16, Essence of linear algebra
3Blue1Brown
26 Who cares about topology?   (Old version)
Who cares about topology? (Old version)
3Blue1Brown
27 3blue1brown channel trailer
3blue1brown channel trailer
3Blue1Brown
28 Binary, Hanoi and Sierpinski, part 1
Binary, Hanoi and Sierpinski, part 1
3Blue1Brown
29 Binary, Hanoi, and Sierpinski, part 2
Binary, Hanoi, and Sierpinski, part 2
3Blue1Brown
30 But what is the Riemann zeta function? Visualizing analytic continuation
But what is the Riemann zeta function? Visualizing analytic continuation
3Blue1Brown
31 Tattoos on Math
Tattoos on Math
3Blue1Brown
32 Fractals are typically not self-similar
Fractals are typically not self-similar
3Blue1Brown
33 Euler's formula with introductory group theory
Euler's formula with introductory group theory
3Blue1Brown
34 The essence of calculus
The essence of calculus
3Blue1Brown
35 The paradox of the derivative | Chapter 2, Essence of calculus
The paradox of the derivative | Chapter 2, Essence of calculus
3Blue1Brown
36 Derivative formulas through geometry | Chapter 3, Essence of calculus
Derivative formulas through geometry | Chapter 3, Essence of calculus
3Blue1Brown
37 Visualizing the chain rule and product rule | Chapter 4, Essence of calculus
Visualizing the chain rule and product rule | Chapter 4, Essence of calculus
3Blue1Brown
38 What's so special about Euler's number e? | Chapter 5, Essence of calculus
What's so special about Euler's number e? | Chapter 5, Essence of calculus
3Blue1Brown
39 Implicit differentiation, what's going on here? | Chapter 6, Essence of calculus
Implicit differentiation, what's going on here? | Chapter 6, Essence of calculus
3Blue1Brown
40 Limits, L'Hôpital's rule, and epsilon delta definitions | Chapter 7, Essence of calculus
Limits, L'Hôpital's rule, and epsilon delta definitions | Chapter 7, Essence of calculus
3Blue1Brown
41 Integration and the fundamental theorem of calculus | Chapter 8, Essence of calculus
Integration and the fundamental theorem of calculus | Chapter 8, Essence of calculus
3Blue1Brown
42 What does area have to do with slope? | Chapter 9, Essence of calculus
What does area have to do with slope? | Chapter 9, Essence of calculus
3Blue1Brown
43 Higher order derivatives | Chapter 10, Essence of calculus
Higher order derivatives | Chapter 10, Essence of calculus
3Blue1Brown
44 Taylor series | Chapter 11, Essence of calculus
Taylor series | Chapter 11, Essence of calculus
3Blue1Brown
45 Pi hiding in prime regularities
Pi hiding in prime regularities
3Blue1Brown
46 All possible pythagorean triples, visualized
All possible pythagorean triples, visualized
3Blue1Brown
47 But how does bitcoin actually work?
But how does bitcoin actually work?
3Blue1Brown
48 How secure is 256 bit security?
How secure is 256 bit security?
3Blue1Brown
49 Hilbert's Curve: Is infinite math useful?
Hilbert's Curve: Is infinite math useful?
3Blue1Brown
50 Thinking outside the 10-dimensional box
Thinking outside the 10-dimensional box
3Blue1Brown
51 Some light quantum mechanics (with minutephysics)
Some light quantum mechanics (with minutephysics)
3Blue1Brown
52 But what is a neural network? | Deep learning chapter 1
But what is a neural network? | Deep learning chapter 1
3Blue1Brown
53 Gradient descent, how neural networks learn | Deep Learning Chapter 2
Gradient descent, how neural networks learn | Deep Learning Chapter 2
3Blue1Brown
54 Backpropagation, intuitively | Deep Learning Chapter 3
Backpropagation, intuitively | Deep Learning Chapter 3
3Blue1Brown
55 Backpropagation calculus | Deep Learning Chapter 4
Backpropagation calculus | Deep Learning Chapter 4
3Blue1Brown
56 The hardest problem on the hardest test
The hardest problem on the hardest test
3Blue1Brown
57 Q&A #2 + Net Neutrality Nuance
Q&A #2 + Net Neutrality Nuance
3Blue1Brown
58 Why this puzzle is impossible
Why this puzzle is impossible
3Blue1Brown
59 But what is the Fourier Transform?  A visual introduction.
But what is the Fourier Transform? A visual introduction.
3Blue1Brown
60 The more general uncertainty principle, regarding Fourier transforms
The more general uncertainty principle, regarding Fourier transforms
3Blue1Brown

This video teaches the fundamental concept of linear transformations and how they can be described using matrices, which is crucial for understanding linear algebra and its applications in machine learning. The video explains how linear transformations can be visualized and described numerically, and how matrices can be used to package the information needed to describe a linear transformation. By watching this video, viewers will gain a deep understanding of linear transformations and matrices,

Key Takeaways
  1. Visualize linear transformations in two dimensions as movements of points in space
  2. Describe linear transformations using matrix vector multiplication
  3. Record the coordinates of the transformed basis vectors to describe a linear transformation
  4. Apply a linear transformation to a vector by multiplying its coordinates by the corresponding columns of the matrix
  5. Interpret the columns of a matrix as the transformed basis vectors
💡 Every matrix can be interpreted as a certain transformation of space, which is a fundamental concept in linear algebra and machine learning.

Related Reads

Up next
How to Open OSM Files (OpenStreetMap Data)
File Extension Geeks
Watch →