Algebra, Geometry and Trigonometry at a Glance
Linear Algebra in Overview and Why It Turns Up Everywhere
What vectors, matrices and eigenvalues are for, with small worked examples and the reason linear methods reach so many fields.
Key takeaways
- A linear transformation preserves addition and scaling, so knowing what it does to a few basic vectors tells you what it does to all of them.
- A matrix records such a transformation, and multiplying matrices corresponds to performing one transformation after another.
- Dimension counts the independent directions needed to describe every vector in a space.
- Eigenvectors are special directions that a transformation only stretches, shrinks or flips, which often makes repeated processes easy to analyze.
- Linear methods spread widely because smooth nonlinear behavior can be approximated linearly near a point.
Linear algebra is the study of quantities that can be added together and scaled, and of the transformations that respect those two operations. It turns up everywhere because many problems are linear to begin with, and many others look linear if you zoom in closely enough. Linear problems are also ones that mathematics can usually solve completely and computers can handle at large scale.
You do not need much background to see the shape of the subject. A few small examples with two numbers at a time already contain most of the main ideas.
Where it starts: several equations at once
Suppose a hypothetical shop sells 10 tickets, some at 2 dollars and some at 5 dollars, and takes in 32 dollars. Call the counts x and y.
x + y = 10
2x + 5y = 32
x = 10 − y (from the first equation)
2(10 − y) + 5y = 32
20 + 3y = 32
y = 4, so x = 6 Geometrically, each equation is a line, and the solution is where the lines cross. Two lines can also be parallel, giving no solution, or coincide, giving infinitely many. That trio of outcomes, none, one or infinitely many (over the real numbers), holds for linear systems of any size. The systematic version of the substitution above is called Gaussian elimination, although methods of the same kind appear in ancient Chinese mathematics.
Vectors: more than arrows
A vector can be pictured as an arrow in the plane, written as a pair such as (3, 1). You add vectors component by component and scale them by multiplying every component by the same number.
The subject becomes powerful when you notice how many other things behave this way. A list of 1,000 measurements is a vector. So is a polynomial of limited degree, since you can add polynomials and multiply them by numbers. So are the solutions of certain differential equations. A collection where addition and scaling obey the usual rules is called a vector space, and every theorem about vector spaces applies to all of these at once.
The scalars are the numbers you scale by. They can be real, complex or drawn from other number systems in which division works.
Basis and dimension
Every vector (a, b) in the plane equals a copy of (1, 0) scaled by a plus a copy of (0, 1) scaled by b. A set of vectors like this, which produces every vector in exactly one way, is called a basis.
Many bases are possible. The pair (1, 1) and (1, −1) also works: the vector (5, 1) equals 3 times (1, 1) plus 2 times (1, −1). What never changes is the count. Every basis of the plane has two vectors, and that number is its dimension.
Dimension measures degrees of freedom. A space of dimension 100 cannot be drawn, but the algebra is the same as in the plane. This is one way to approach thinking about four dimensions and beyond. Some spaces, such as the space of all polynomials, need infinitely many basis vectors, which is where Hilbert spaces and related ideas begin.
Matrices as transformations
A linear transformation T satisfies two rules: T(u + v) = T(u) + T(v), and T(cu) = cT(u). Rotations about the origin, reflections through lines through the origin, stretching and shearing all qualify. Shifting everything sideways does not, because a linear map must send the zero vector to zero.
Because of the two rules, you only need to know where the basis vectors go. A matrix stores exactly that, one column per basis vector. A quarter turn counterclockwise sends (1, 0) to (0, 1) and (0, 1) to (−1, 0):
R = | 0 −1 |
| 1 0 |
R applied to (3, 1) gives (0·3 − 1·1, 1·3 + 0·1) = (−1, 3) Matrix multiplication is defined so that the product means "do one, then the other." Order matters. Reflecting across the horizontal axis and then rotating a quarter turn sends (1, 0) to (0, 1). Rotating first and then reflecting sends it to (0, −1).
Determinants and what gets lost
Each square matrix has a number attached to it called the determinant. For a matrix with rows (a, b) and (c, d), it equals ad − bc. Its size tells you how much the transformation scales areas, and a negative sign means orientation is flipped, as in a mirror.
The quarter turn has determinant (0)(0) − (−1)(1) = 1, which fits: rotating a shape changes neither its area nor its handedness. The matrix with rows (2, 1) and (1, 2) has determinant 4 − 1 = 3, so it triples areas.
A determinant of zero is the warning sign. Take rows (1, 2) and (2, 4). The determinant is 4 − 4 = 0. This map sends every point of the plane onto a single line through (1, 2). Different inputs, such as (2, 0) and (0, 1), land on the same output, so the transformation cannot be undone.
The set of vectors sent to zero is called the kernel, and the set of outputs is the image. For a linear map on a finite-dimensional space, the dimensions of the two add up to the dimension of the starting space. Here that reads 1 + 1 = 2: one direction is crushed, and one survives.
Eigenvalues: finding the natural directions
Take the matrix with rows (2, 1) and (1, 2). Applied to (1, 0) it gives (2, 1), which points in a new direction. Applied to (1, 1) it gives (3, 3), the same direction, three times as long. Applied to (1, −1) it gives (1, −1), unchanged.
A nonzero vector that a transformation merely rescales is an eigenvector, and the scale factor is its eigenvalue. Here the eigenvalues are 3 and 1. Expressed in the basis of eigenvectors, the transformation is just two independent stretches, so applying it ten times multiplies one component by 3¹⁰ and leaves the other alone.
This idea explains the long-run behavior of many repeated processes, the natural frequencies of vibrating structures and the main directions of variation in data. Not every matrix has enough real eigenvectors: the quarter turn above has none.
A repeated process worked through
Say two towns exchange residents in a simplified model. Each year 10% of town A moves to town B, and 20% of town B moves to town A. Nobody else arrives or leaves.
If the populations are a and b, next year's values are 0.9a + 0.2b and 0.1a + 0.8b. That is a matrix applied to the vector (a, b), and predicting many years ahead means applying it many times.
A balance occurs when the two flows match: 0.1a = 0.2b, so a = 2b. With 900 residents in total, that is 600 in A and 300 in B. This balanced vector is an eigenvector with eigenvalue 1. The other eigenvalue is 0.7, with eigenvector (1, −1). It describes the imbalance, which shrinks to 70% of its size each year. Starting from 900 in A and none in B, the excess over 600 goes 300, 210, 147 and onward toward zero.
Why linear methods reach so far
The first reason is that some laws really are linear, or very nearly so over their usual range. Electric circuits made of ideal resistors obey linear equations. In quantum mechanics, states are vectors and time evolution is linear, a subject covered in the linear algebra behind quantum mechanics. When a system is linear, solutions can be added together, which is called superposition.
The second reason comes from calculus. A smooth curve viewed under strong magnification looks like a straight line. So a difficult nonlinear function can be replaced, near a point, by a linear one. Newton's method, many optimization techniques and the analysis of whether an equilibrium is stable all rest on this step. Linear approximation is the one-variable version.
The third reason is computation. Elimination and its refinements are reliable and well understood, and very large systems can be attacked with iterative methods.
Connections that look surprising
Some uses are not obviously about arrows or transformations. Record a network as a matrix with a 1 wherever two points are joined. The powers of that matrix then count walks through the network, as shown in counting walks with adjacency matrices.
Fitting a line to scattered data is another example. No line usually passes through every point, so you look for the closest achievable vector of predictions. The answer is a perpendicular projection, the same geometry as dropping a point straight down onto a plane.
Limits and common misunderstandings
Linearity is a strong assumption. Doubling the input of a linear system doubles the output, and many real systems do not behave that way. Turbulent flow, population interactions and most feedback processes are nonlinear, and a linear approximation can fail badly far from the point where it was made.
Another common confusion concerns the word "linear" itself. The function f(x) = 2x + 3 has a straight-line graph, but it is not a linear transformation, since f(0) is 3. It is called affine.
Finally, matrices are not the subject. They are descriptions that depend on a chosen basis. The underlying transformation stays the same when the basis changes, and much of a first course is about telling which properties belong to the transformation and which to its description. To see where linear algebra sits among other algebraic topics, read algebra at a glance.