Eigen Decomposition Explained
Introduction to Linear Algebra
Vectors and Their World
Imagine you're giving someone directions. You probably wouldn't just say, "Walk 5 blocks." You'd say something like, "Walk 3 blocks north and 2 blocks east." This combination of distance and direction is the core idea behind a vector.
In mathematics, a vector is a list of numbers that represents both magnitude (how much) and direction. We typically write them vertically in brackets. This vector represents moving 3 units along the x-axis and 2 units up the y-axis.
Vectors don't just exist on their own. They live in a vector space, which is just the set of all possible vectors of a certain type. The vector above lives in a 2-dimensional space (often called ), which you can think of as a flat plane, like a piece of graph paper. A vector like would live in a 3-dimensional space ().
All vectors in a space start from a central point called the origin, which is just in 2D.
Organizing with Matrices
If a vector is a list of numbers, a matrix is a grid of numbers, organized into rows and columns. You can think of it as a way to bundle several vectors together. For example, this is a 2x3 matrix (2 rows, 3 columns):
Matrices have their own rules for arithmetic.
Addition and Subtraction: This is straightforward. You just add or subtract the corresponding elements. The matrices must have the exact same dimensions to do this.
Scalar Multiplication: This means multiplying the entire matrix by a single number (a scalar). You just multiply every element inside the matrix by that number.
Matrix Multiplication: This is the most important operation. It's not as simple as multiplying corresponding elements. To find the element in the first row and first column of the resulting matrix, you multiply the elements of the first row of the first matrix by the elements of the first column of the second matrix, and then add them up. This process is repeated for every element in the new matrix.
For this to work, the number of columns in the first matrix must equal the number of rows in the second matrix.
The Power of a Single Number
The determinant is a special number that can be calculated from a square matrix (a matrix with the same number of rows and columns). It tells us some surprisingly useful things about the matrix. For a simple 2x2 matrix, the calculation is easy.
Multiply the diagonals and subtract. For the matrix , the determinant is .
So what does this number mean? One of the most important properties is this: if the determinant of a matrix is zero, it means the matrix is "singular." This has big implications, one of which is that its linear transformation squishes space into a lower dimension, like collapsing a 2D plane onto a single line. We can't "undo" this kind of transformation.
Matrices as Actions
The most powerful way to think about matrices is not as static grids of numbers, but as actions. A matrix can represent a linear transformation, which is a function that takes a vector as an input and produces a new vector as an output. This "action" can be something like a rotation, a reflection, a stretch, or a shear.
When we multiply a matrix by a vector, we are applying that matrix's transformation to the vector. For example, the matrix below is a transformation that rotates any 2D vector by 90 degrees counter-clockwise.
Let's apply this transformation to our vector from before:
The matrix took our original vector and rotated it to a new position. Every vector you pass through this matrix will be rotated in the same way. This idea of matrices as transformations is central to almost everything in linear algebra.
Now that we have a handle on these building blocks, we can start exploring some of the deeper properties of these transformations.
