Lecture 1 · Week 1· 14:47

What linear algebra is about

Vectors as arrows and as lists; the questions this course answers.

Play: Lecture 1: What linear algebra is about
Lecture · 14:47 · Open on YouTube · Report a problem with this video
TranscriptThe full text of the lecture. Click any sentence to play the video from there.

Welcome to Linear Algebra

Welcome to Linear Algebra. This is the first lecture of a full university course, the kind a mathematics or engineering student takes in their first year. Over thirteen weeks we will meet four times a week in lectures like this one, and once a week in a recitation, where we solve problems together, step by step. Alongside the videos there is a course book. Every lecture has a matching section in the book, with complete definitions, complete proofs, and more worked examples than we have time for here.

And every week has a problem sheet. Doing those problems is not optional decoration. It is how the ideas move from something you have watched into something you can actually use. So why spend a whole semester on linear algebra? Because it is one of the most widely used parts of mathematics. It describes how computer graphics rotate a scene and project it onto your screen. It is how a search engine ranks pages, how a recommendation system guesses what you might like next, and how engineers analyse the vibrations of a bridge.

It is the language of quantum mechanics, of statistics, and of modern machine learning, where almost every computation is, underneath, a computation with vectors and matrices. The reason it shows up everywhere is simple. Linear problems are the problems we can solve completely. And many problems that are not linear can be approximated, at least locally, by ones that are. In this first lecture we will meet the main character of the course, the vector, in its two costumes: as an arrow, and as a list of numbers. Then we will preview the big questions the whole course is built to answer.

Vectors as arrows

Let's start with the picture. In the plane, a vector is an arrow. It has a length, and it points in a direction, and those two things are all it has. In particular, a vector has no fixed starting point. If I slide this arrow around without turning it or stretching it, it is still the same vector. Every one of these arrows represents one single vector. This is natural for the things vectors describe. A displacement, such as three steps east and two steps north, means the same thing wherever you start. So does a velocity, or a force of a given strength in a given direction.

Even so, it is convenient to agree on a standard place to draw them. We will usually draw vectors starting at the origin. Then each vector is completely described by the point where its tip lands. This arrow, drawn from the origin, ends at the point (three, two). To get there, we go three units along the horizontal axis, and two units up. Those two numbers, three and two, are called the components of the vector. The first component measures the horizontal step, and the second measures the vertical step.

Notice what just happened. We started with a geometric object, an arrow, and ended up with a pair of numbers. And it works backwards too: any pair of numbers tells us exactly which arrow to draw. A negative component simply points the other way along that axis. The vector (minus two, one) goes two units left and one unit up. And the vector (zero, zero) is the zero vector: an arrow of length zero, which we draw as a single point.

Vectors as lists

Now for the other costume. Algebraically, a vector is an ordered list of numbers. We write the vector with components three and two as a column, with three on top and two below. Order matters. The column (three, two) and the column (two, three) are different vectors, and their arrows point in different directions. Here is our first formal definition. For a positive whole number n, the set R n is the set of all ordered lists of n real numbers. Its elements are called vectors, and the numbers in each list are called its components, or entries.

Two vectors in R n are equal exactly when every entry matches. So a single equation between vectors in R n really says n separate things at once, one for each component. R two is the plane we have been drawing. R three is ordinary three dimensional space, where a vector has three components, and its arrow needs a third axis. But nothing stops us from going further: R four, R ten, R one million. We cannot draw an arrow in R ten, but we can certainly write down a list of ten numbers. And as we will see, everything we do with arrows still works.

Lists like these are everywhere. A colour on your screen is a vector in R three: the amounts of red, green and blue light. The gold used on these slides is the vector (zero point nine five, zero point seven two, zero point two nine). A recipe is a vector: so many grams of flour, so many grams of sugar, so many eggs. A weather record is a vector: temperature, pressure, humidity and wind speed. In data science, each person in a survey, each image and each document becomes a vector, often with thousands of components. The geometry we build in the plane is what lets us reason about those long lists.

A word on notation. In this course, vectors are written in bold in the book, and with a small arrow on the slides, like v with an arrow. Plain letters such as a, b or x stand for ordinary numbers, which we call scalars.

Adding and scaling

What makes vectors more than just lists is what we can do with them. Linear algebra is built on exactly two operations: adding vectors, and multiplying a vector by a number. To add two vectors as arrows, place the tail of the second at the tip of the first. The sum is the arrow from the start of the first to the tip of the second. Walk along v, then along w, and the sum is the whole trip. As lists, the rule is just as simple. We add matching components, one coordinate at a time.

In the first coordinate, the entry of v is two, and the entry of w is one. Two plus one equals three, so the first entry of the sum is three. In the second coordinate, the entry of v is one, and the entry of w is two. One plus two equals three, so the second entry of the sum is also three. So v plus w is the vector (three, three). And the arrow picture agrees. The trip ends at the point (three, three).

To multiply a vector by a number, we stretch it. Two times v is twice as long and points the same way. One half times v is half as long. And minus one times v has the same length, but points in the opposite direction. As a list, we multiply every component by that number. Two times the vector (two, one) is the vector (four, two). Put the two operations together and you get the most important construction in the course: a linear combination, a times v plus b times w, for any numbers a and b. The next lecture is devoted to these operations and their rules. For now, keep one thing in mind. Everything we do this semester is built from adding and scaling.

Four questions

Let's look ahead. Linear algebra is organised around a small number of big questions. Here are four of them, and they will come back again and again throughout the semester. Question one. Given some vectors, which other vectors can we build from them? For example, can we find numbers x and y so that x times the vector (two, one), plus y times the vector (minus one, one), equals the vector (one, five)? That single vector equation is really two ordinary equations, one for each component. So this question is the same as solving a system of linear equations. Solving systems, and understanding when they have no solution, one solution, or infinitely many, is the subject of weeks two and three.

Question two. What does a matrix do? A matrix is a rectangular table of numbers, but it is best understood as a machine that moves vectors. Feed in a vector, and out comes a new one. Applied to every point of the plane at once, a matrix can rotate it, stretch it, shear it, or flatten it onto a line. And it always keeps grid lines straight, parallel, and evenly spaced. That is what the word linear will mean for us. Question three. Which directions are special? When a matrix moves the plane, most vectors are knocked off their original line. But some vectors stay on their own line, and are only stretched or shrunk.

These are the eigenvectors, and the stretching factors are the eigenvalues. They reveal the hidden structure of a transformation, and they are the key to anything that repeats over time, from population models to the long run behaviour of random processes. Question four. What is the best answer when there is no exact answer? Real measurements are noisy, and a system built from data often has no exact solution. No straight line passes through all of these points. But there is a best line, the one that comes closest in a precise sense. Finding it is a question about distances and right angles. It leads to least squares and, at the end of the course, to the singular value decomposition.

Combining vectors, transforming space, finding special directions, and approximating as well as possible. Keep these four questions in mind. Every topic in the course is a step towards answering one of them.

One problem, three pictures

Let's make question one concrete, with a problem we can solve completely. We want numbers x and y such that two x minus y equals one, and x plus y equals five. The first way to see it is the row picture. Each equation describes a line in the plane. The points on the first line satisfy the first equation, and the points on the second line satisfy the second. A solution has to satisfy both equations, so it is a point on both lines: their intersection. Here the lines cross at the point (two, three). Let's check. Two times two, minus three, is one. And two plus three is five. Both equations hold.

The second way is the column picture. Collect the coefficients of x into one vector, (two, one), and the coefficients of y into another, (minus one, one). Now the system reads: x times the first column, plus y times the second column, equals the vector (one, five). In this picture the question is: how much of each column do we need to reach the target? Take two copies of the first column, which brings us to the point (four, two). Then add three copies of the second, which moves us three left and three up, to (one, five). We have arrived. Let's check this by substituting. Here is the vector equation, and here is the solution: x equals two, and y equals three.

Putting two in place of x, and three in place of y, we get two times the vector (two, one), plus three times the vector (minus one, one). Two times (two, one) is (four, two). And three times (minus one, one) is (minus three, three). Adding them, entry by entry, gives (one, five): exactly the target. Same numbers as before, but a completely different picture. The row picture intersects lines. The column picture combines vectors.

The third way packs everything into one object. Put the two columns side by side to form a matrix A. Put the unknowns into a vector x, and the right hand side into a vector b. The whole system becomes one short equation: A x equals b. All three pictures matter. The row picture gives intuition in small examples. The column picture grows into the theory of span and linear independence. And the compact form, A x equals b, is how we will reason about systems of any size, even with thousands of unknowns. And here is a first glimpse of something deeper. Two lines in the plane usually meet in exactly one point. But they could be parallel and never meet, or they could be the same line and meet everywhere. We will prove that these three cases, no solution, exactly one, or infinitely many, are the only possibilities, in any number of dimensions.

How this course works

Before we finish, a word about how the course is organised, and how to get the most out of it. The thirteen weeks fall into four parts. Weeks one to five build the core tools: vectors, systems of equations, and matrices.

Weeks six to eight rebuild those ideas abstractly, with vector spaces and linear maps, so that they apply far beyond lists of numbers. Weeks nine to eleven study determinants, eigenvalues, and the structure of a single linear map. And weeks twelve and thirteen bring in lengths and angles, ending with the spectral theorem and the singular value decomposition.

This is a mathematics course, so it is written in the language of mathematics. New ideas are introduced by definitions, which say precisely what a word means. Facts about them are stated as theorems, and every theorem comes with a proof: an argument that shows why it must be true. Proofs are not a formality. A proof is where understanding happens. It tells you why a fact holds, and therefore when it applies and when it does not. In lectures we will prove the theorems together, and the book contains every proof in full. Each problem sheet has four kinds of problems: warm up computations, core exam style questions, short proofs, and a challenge. Try them before you look at the solutions. Getting stuck, and then getting unstuck, is the most effective way anyone has found to learn mathematics.

One small convention will help you follow along. Colours keep their meaning throughout the course. Vectors we start from are drawn in coral and in blue, results are drawn in green, and gold marks whatever we are focusing on right now.

Summary

Let's summarise. A vector can be seen as an arrow, with a length and a direction, or as an ordered list of numbers, its components. Drawing arrows from the origin turns one picture into the other. R n is the set of all ordered lists of n real numbers. We can draw R two and R three, but the algebra works in every dimension. Vectors can be added and scaled, and combining those two operations gives linear combinations, the basic construction of the whole subject.

And the course is organised around four questions: what we can build from given vectors, what a matrix does to space, which directions are special, and how to approximate when no exact answer exists. Before the next lecture, read section one point one of the course book, and try the warm up problems on sheet one. Next time, we take a careful look at adding and scaling vectors, and at the rules those operations obey. See you there.

Check yourself

3 questions, from warm-up to stretch

Work each one out on paper, type your answer and press Check. Stuck? Open a hint; the worked solution is there when you need it.

  1. Question 1 of 3 Warm-up

    An arrow starts at the point and ends at the point . Which vector is it? Give its two components.

    Hint 1 of 2

    A vector is a step: how far across and how far up you move from the start of the arrow to its tip.

    Hint 2 of 2

    Count the steps: from to is across, and from to is up.

    Worked solution
    1. From to is steps across; from to is steps up.
    2. So the arrow is the vector . (A shortcut you will meet in Lecture 2: end minus start, .)
    3. Check: starting at and moving by lands at .
  2. Question 2 of 3 Core

    For which number is ?

    Hint 1 of 2

    Two vectors are equal exactly when every entry matches. That gives one equation per entry.

    Hint 2 of 2

    The top entries give and the bottom entries give . Both must hold.

    Worked solution
    1. Equal vectors have equal entries, so and .
    2. The first gives ; the second gives as well, so both hold.
    3. Check: with both sides are .
  3. Question 3 of 3 Stretch

    In the column picture, the system , is . Find and .

    Hint 1 of 2

    Read the rows back as equations: (top) and (bottom).

    Hint 2 of 2

    The top equation gives . Put that into the bottom one.

    Worked solution
    1. The rows say and .
    2. From the first, . Then , so and .
    3. Then .
    4. Check: .

Found a mistake, or something not working on this page? Report it and we'll fix it. See what we've corrected.