Linear Algebra, Live
Strang §2.1 · Vectors and linear equations

Solving Ax = b: the row picture and the column picture

Lesson 1 ended with the column space: it tells us whether Ax = b has a solution. Now we want to find the solution. Two equations can be read in two ways. In the row picture, each equation is a line, like a clue in a treasure hunt that says “the answer is somewhere on me”. The answer is the one spot on both lines, where they cross. In the column picture, the columns of A are two kinds of steps, as in lesson 1, and we ask how many of each step take us to b. Both readings give the same answer.

Lesson 2 · slide 1Rows and columns
1-232 xy = 111
Key ideas
  1. Row picture: each equation is a line. The solution is where the lines meet.
  2. Column picture: the system says x·(column 1) + y·(column 2) = b. Here x and y are plain numbers. The solution gives the right weights.
  3. Both pictures give the same solution xy. They also fail together: parallel or identical lines always come with dependent columns, and the other way round.
  4. With 3 or more unknowns the column picture stays easy to think about, so we lean on it.

One system, two readings

Take Professor Strang's first example: x − 2y = 1 and 3x + 2y = 11. As a matrix equation it is Axy = b. Here x and y are numbers; on later slides we call the whole vector xy just x.

A = 1−232    b = 111

The row picture: two clues

Each equation is a line, and each says "the answer is on me". x − 2y = 1 is one line. 3x + 2y = 11 is another. The answer is where they cross: 31. Check: 3 − 2 = 1 and 9 + 2 = 11.

Row picture: x − 2y = 1 and 3x + 2y = 11 are two lines. They cross at the answer.

The column picture: a recipe

Now read it by columns, as in lesson 1 (Ax is a combination of the columns):

x·13 + y·−22 = 111
3·13 + 1·−22 = 3 − 29 + 2 = 111 ✓

Now we ask how much of each column makes b. Same answer: x = 3, y = 1.

Column picture: 3 of column 1, then 1 of column 2, reaches b = 111. Same answer, x = 3 and y = 1.

When the pictures go wrong

  • Parallel lines: they never meet, so there is no solution. The columns are dependent and b is off their line.
  • The same line twice: infinitely many solutions. b is on the line of the columns.

Why do the two go together? Lines are parallel when one left side is a multiple of the other, like x + y and 2x + 2y. For x + y and 2x + 2y, A = 1122. Both columns are 12, so they lie on one line. The reason is general: if row 2 is k times row 1, every column looks like (a, ka) = a·1k, so all columns are multiples of 1k.

Why the column picture wins later

With three unknowns, each equation is a plane in space (like a line, but in 3D), and three planes are hard to draw. The column picture stays simple: three arrows and one target.

To solve by hand, though, we use rows. That is elimination, on the next slide.

A bigger example: 3 equations, 3 unknowns

x + y + z = 6    2x + y − z = 1    x + 2y + z = 8
A = 11121−1121    b = 618
Columns: 1·121 + 2·112 + 3·1−11 = 618 ✓

By rows, each equation is now a flat plane in space, and the answer is the one point where all three planes meet: xyz = 123. By columns, it is 1 of column 1, 2 of column 2 and 3 of column 3. Engineers solve systems with thousands of unknowns the same way, with a computer doing the arithmetic.

Next: Looking for the crossing point works for two lines, not for a thousand. Slide 2 gives a step-by-step recipe instead: subtract equations to remove the unknowns one at a time. That is elimination.

Examples

Example 1 · One crossing

x + y = 3 and x − y = 1.

Show solutionHide solution
Rows: the lines cross at 21
Columns: 2·11 + 1·1−1 = 31 = b ✓

Example 2 · The same line twice

x + 2y = 4 and 2x + 4y = 8.

Show solutionHide solution
Rows: the second equation is 2 × the first, so both are one line
Columns: 12 and 24 are dependent, and b = 48 lies on their line

Infinitely many solutions, for example 40 and 02.

Example 3 · No crossing at all

x + y = 2 and 2x + 2y = 5.

Show solutionHide solution
Rows: the second line is x + y = 2.5, parallel to the first. They never meet
Columns: 12 and 12 are the same vector, and b = 25 is not a multiple of 12

Both pictures agree: no solution.

Example 4

Solve 2x + y = 7 and x − y = 2, then check with the column picture.

Show solutionHide solution

Adding the equations: 3x = 9, so x = 3 and y = 1.

Columns: 3·21 + 1·1−1 = 72 ✓

Example 5

What happens with x + y = 1 and x + y = 3? Describe both pictures.

Show solutionHide solution

Rows: two parallel lines, no crossing, no solution.

Columns: both columns are 11. Their combinations stay on the line through 11, and b = 13 is off it.

Exercise Run the row picture, then delete the # at the start of the last line and run again to see the column picture. Edit the code and press Run.
slide_1.py Loading Python…
1
Output · Ctrl+Enter runs
Press Run to execute this slide's code. Ctrl+Enter works too.

Enjoying lesson 2? Get the full course: all 8 lessons through the SVD and PCA, your progress saved lesson by lesson, every solution and 5 extra problems per lesson. $20 once, yours for life.

Questions and comments

Stuck on something, or found a mistake? Ask here and I'll answer. You sign in with GitHub.

The full course

From Ax = b to PCA, by running it

Lessons 1 to 3 are free. Finish all eight and you will be able to:

You get: all 8 lessons with Python labs · every worked example and solution · 5 extra problems per lesson · your progress tracked · answers to your questions · every future update.

$20 once · lifetime access
Continue to checkout →

Already a member? Log in to the course