Study notes · first-year linear algebra

Linear algebra, translated

Each topic starts with the plain-English idea and a picture, then a worked example, the most common mistakes, and quick questions to test yourself. Practice answers are hidden until you click, so try each problem first.

Before you start

How to study this

Picture first, numbers second, symbols last.

Linear algebra is rarely hard because of the arithmetic. It feels hard because textbooks start with the symbols, and symbols mean nothing until you have a picture to attach them to. These notes give you the picture first.

  • Start in 2D. Anything true in ℝ³ or ℝⁿ can first be drawn on paper in ℝ². Once it makes sense with two numbers, three or more is "the same thing, longer list".
  • Say it in words. After any definition, explain it out loud as if to a friend who never took math. If you can't, you've memorised it rather than understood it.
  • Predict before computing. "Will this dot product be positive or negative?" "Will this matrix have an inverse?" Guessing first builds intuition quickly.
  • Check what kind of answer is wanted. A number? A vector? A matrix? Yes or no? Many lost marks come from giving the wrong type of answer.
  • Check your work. Almost every computation in this course can be checked in under a minute. See Self-check habits at the end.
How the notes are organised

Sections 1–13 are the core course topics, in order. Determinants (12) come just before Cramer's rule because the rule is built from them. The three sections marked + at the end are extra topics for going further.

Reference

Martian to English

Keep this handy. Most confusion is vocabulary.

Textbook saysIt means
scalarJust a regular number.
vector in ℝⁿA list of n numbers, or an arrow in n-dimensional space.
linear combinationA mix: "some amount of this vector plus some amount of that one".
norm ‖v‖The length of the arrow.
unit vectorAn arrow of length exactly 1. Pure direction.
projectionThe shadow one arrow casts on another.
parametric form"Start here, then move t steps this way." The t is the parameter.
hyperplaneWhat one equation describes in ℝⁿ: a line in ℝ², a plane in ℝ³, a 3D "slice" in ℝ⁴.
augmented matrixThe system with the letters and = signs stripped out. Just the numbers.
REFRow echelon form: a staircase of zeros in the bottom-left.
RREFReduced REF: the fully tidied staircase, where you can read the answer straight off.
spanEverywhere you can reach by mixing the given vectors.
linearly independentNone of the vectors is redundant; none can be built from the others.
basisThe smallest set of directions that still reaches everywhere.
dimensionHow many independent directions you have (degrees of freedom).
subspaceA flat thing through the origin: a line, a plane, and so on.
orthogonalPerpendicular (dot product is zero).
normal vectorAn arrow sticking straight out of a plane.
consistent systemHas at least one solution.
homogeneous systemEvery right-hand side is 0. Always has the "all zeros" answer.
trivial solutionThe all-zeros answer.
pivotThe first non-zero number in a row after elimination. Its variable is "decided".
free variableA variable with no pivot. You get to pick its value.
identity matrix IThe "do nothing" matrix. Like multiplying by 1.
invertible / non-singularHas an undo button.
singularSquashes space flat. No undo button.
transpose AᵀFlip the matrix so rows become columns.
null space / kernelEvery vector that the matrix squashes to zero.
eigenvectorA direction the matrix only stretches, never turns.
Topic 1

Vectors

An arrow, or a list of numbers. It's the same thing.

The idea

A vector like (3, 1) is a set of directions: "go 3 right and 1 up". It doesn't care where you start, only how far and which way. You can also read it as a list of data: 3 apples, 1 banana. Both readings are correct, and switching between them is half of this course.

  • Adding vectors means doing one move, then the other. Put them tip to tail.
  • Scaling (multiplying by a number) stretches or shrinks the arrow. A negative number flips it around.
  • Length is just Pythagoras: ‖(3, 4)‖ = √(9 + 16) = 5. More in Norm.
  • ℝⁿ just means "lists of n numbers". (2, 0, −1, 5) lives in ℝ⁴. You can't draw it, but every rule works exactly the same: entry by entry.
u = (3,1) v = (1,2) u + v = (4,3) 034
Walk along u, then along v. You end up where u + v takes you in one step.
Worked example

Let u = (3, 1) and v = (1, 2).

u + v = (3+1, 1+2) = (4, 3)
2u    = (6, 2)                same direction, twice as long
u − v = (3−1, 1−2) = (2, −1)
‖u‖   = √(3² + 1²) = √10 ≈ 3.16

Draw every one of these on graph paper. Which direction does u − v point, and why? (It's the arrow from the tip of v to the tip of u.)

Common mistakes
  • Trying to add vectors of different sizes, like (1, 2) + (1, 2, 3). You can't; they live in different spaces.
  • Mixing up a point (a location) with a vector (a movement). The notation is the same, so context decides.
  • Writing ‖u + v‖ = ‖u‖ + ‖v‖. False, unless they point the same way. Walking 3 km north then 4 km east doesn't put you 7 km from home.
Test yourself
  • If u is walking directions, what does −u mean?
  • What's a vector with length 0? Does it have a direction?
  • Give me a real-life thing that's naturally a list of 4 numbers.
Practice problems

1. With u = (2, −1) and v = (−1, 3), find 3u − v.

(6, −3) − (−1, 3) = (7, −6)

2. Compute (1, 0, 2, −1) + 2(0, 3, 1, 1) in ℝ⁴.

(1, 6, 4, 1). Same rules, just more slots.

Topic 2

Linear combinations

A recipe: some of this vector, plus some of that one.

The idea

A linear combination of v₁ and v₂ is anything of the form c₁v₁ + c₂v₂, where c₁ and c₂ are ordinary numbers (the "weights"). You scale each ingredient, then add.

Practical hook: a smoothie. If a banana gives (100 cal, 1 g protein) and a scoop of yogurt gives (60 cal, 5 g protein), then 2 bananas and 3 scoops give

2·(100, 1) + 3·(60, 5) = (200 + 180, 2 + 15) = (380 cal, 17 g protein)

The interesting question runs backwards: "I want exactly this nutrition. How much of each ingredient do I need?" That's asking for the weights, and it's where systems of equations come from.

1·(1,1) 3·(2,1) (7,4)
(7, 4) = 1·(1, 1) + 3·(2, 1): one blue step, then three orange steps.
Worked example

Can (7, 4) be written as a combination of (1, 1) and (2, 1)?

a(1, 1) + b(2, 1) = (7, 4)

Match each slot:
  a + 2b = 7
  a +  b = 4
Subtract: b = 3, then a = 1

Check: 1·(1, 1) + 3·(2, 1) = (1 + 6, 1 + 3) = (7, 4)   ✓

The big connection: finding weights is solving a system, and the vectors become the columns of the augmented matrix [1 2 | 7; 1 1 | 4]. Keep this in mind; it comes back in sections 8–10.

Common mistakes
  • Thinking weights must be positive or whole numbers. Negative and fractional weights are fine.
  • Putting the vectors in as rows when setting up the system. They go in as columns.
  • Assuming every target can be reached. (1, 2) and (2, 4) point the same way, so no combination of them makes (1, 0).
Test yourself
  • Write (5, −2) as a combination of (1, 0) and (0, 1). (Trivially 5·(1,0) − 2·(0,1). That's what coordinates are.)
  • Is the zero vector a combination of any vectors? (Always: use all weights 0.)
Practice problems

1. Is (1, 2, 3) a linear combination of (1, 0, 1) and (0, 1, 1)?

a(1,0,1) + b(0,1,1) = (a, b, a + b). Need a = 1, b = 2, and then a + b = 3 ✓. Yes.

2. Is (1, 2, 4)?

Same a = 1, b = 2, but a + b = 3 ≠ 4. No. That target sits off the plane the two vectors sweep out.

Topic 3

The norm (length)

Pythagoras, extended to as many slots as you like.

The idea

‖v‖ = √(v₁² + v₂² + … + vₙ²)
  • In 2D it's the hypotenuse. In 3D it's the diagonal of a box. In ℝⁿ it's the same formula with more terms.
  • Distance between two points p and q is ‖p − q‖. Subtract, then take the length.
  • Unit vector: v / ‖v‖. It keeps the direction and sets the length to 1. Think "just the compass heading, no distance".
  • Practical hook: comparing two customers' shopping lists, or two songs' features, by the distance between their vectors. Small distance means similar. Recommendation apps do exactly this in ℝ¹⁰⁰⁰.

Rules worth knowing

RuleIn words
‖v‖ ≥ 0, and = 0 only for v = 0Lengths are never negative.
‖cv‖ = |c|·‖v‖Tripling an arrow triples its length. Flipping it doesn't change the length.
‖u + v‖ ≤ ‖u‖ + ‖v‖Triangle inequality: the direct route is never longer than the detour.
|u·v| ≤ ‖u‖‖v‖Cauchy–Schwarz: why cos θ always lands between −1 and 1.
‖v‖² = v·vLength squared is a dot product with itself.
Worked example
v = (1, 2, 2)
‖v‖ = √(1 + 4 + 4) = √9 = 3
unit vector = (1/3, 2/3, 2/3)
  check: √(1/9 + 4/9 + 4/9) = √1 = 1   ✓

Distance from (1, 2, 3) to (4, 6, 3):
  difference = (3, 4, 0)
  ‖(3, 4, 0)‖ = √(9 + 16 + 0) = 5

In ℝ⁴: ‖(1, 1, 1, 1)‖ = √4 = 2
Common mistakes
  • ‖−3v‖ = 3‖v‖, not −3‖v‖. The absolute value matters.
  • Squaring negatives: (−2)² = 4. Calculators given −2² return −4.
  • Forgetting the square root at the end.
  • ‖u + v‖ ≠ ‖u‖ + ‖v‖ in general.
Practice problems

1. Unit vector in the direction of (3, −4).

Length 5, so (3/5, −4/5).

2. ‖(2, −1, 0, 2)‖

√(4 + 1 + 0 + 4) = 3

3. Find a vector of length 10 pointing the same way as (1, 2, 2).

Unit vector × 10: (10/3, 20/3, 20/3).

Topic 4

The dot product

One number that says how much two arrows agree.

The idea

Multiply matching entries and add them up: (a, b)·(c, d) = ac + bd. The answer is a plain number, not a vector.

Practical hook: you already use dot products at the till. If you buy 2 coffees and 3 muffins at $4 and $3:

(2, 3)·(4, 3) = 2×4 + 3×3 = 17     your bill is $17

Geometric meaning: u·v = ‖u‖‖v‖ cos θ, where θ is the angle between them. So the sign tells you the direction relationship at a glance:

u·v > 0 u·v = 0 u·v < 0
Roughly the same way: positive. Perpendicular: zero. Roughly opposite: negative.

Physics example you may know: work = force · displacement. Only the part of your push that goes along the direction of motion counts. That "part along a direction" idea becomes projections.

It works the same in ℝⁿ: (1, 0, 2, 3)·(2, 5, 1, −1) = 2 + 0 + 2 − 3 = 1.

Worked example
(1, 2)·(4, −2) = 4 − 4 = 0          → perpendicular

Angle between (1, 1) and (1, 0):
  dot = 1,  ‖(1,1)‖ = √2,  ‖(1,0)‖ = 1
  cos θ = 1/√2   →   θ = 45°        ✓ matches the picture
Common mistakes
  • Writing the answer as a vector. A dot product is always a single number.
  • Trying to dot vectors of different sizes. Both must have the same number of entries.
  • Calculator in radians when the question wants degrees (or the reverse).
Test yourself
  • Without computing, is (3, 1)·(−2, 5) positive or negative? Sketch it first.
  • What's u·u? (It's the length squared. Good "aha".)
Practice problems

1. Find k so that (2, k) is perpendicular to (3, −6).

6 − 6k = 0, so k = 1.

2. Angle between (1, 2, 2) and (2, 0, 0).

dot = 2, lengths 3 and 2, so cos θ = 2/6 = 1/3, θ ≈ 70.5°.

Topic 5

Vector projections

The shadow one arrow casts on another.

The idea

Shine a light straight down onto the line of v. The shadow u casts on it is the projection of u onto v. It answers: "how much of u points in v's direction?"

Every vector splits into two pieces: the part along v (the projection) and the part perpendicular to v (what's left over).

Practical hook: a box on a ramp. Gravity pulls straight down, but you split it into the part along the ramp (makes the box slide) and the part into the ramp (pressed against the surface). That split is exactly a projection.

u = (3,4) v = (2,1) proj = (4,2) u − proj
The green shadow lies along v. The dashed leftover meets it at a right angle.

Formulas

vector projection:   proj_v(u) = (u·v / v·v) · v      ← a vector
scalar projection:   comp_v(u) = u·v / ‖v‖             ← a number: signed shadow length
perpendicular part:  u − proj_v(u)

Reading the vector formula: u·v / v·v is just a number, "how many v's long is the shadow". Then you multiply v by it.

Worked example
u = (3, 4),  v = (2, 1)

u·v = 6 + 4 = 10
v·v = 4 + 1 = 5
proj_v(u) = (10/5)·(2, 1) = (4, 2)
perp part = (3, 4) − (4, 2) = (−1, 2)

Check: perp part · v = −2 + 2 = 0   ✓ it really is perpendicular
Check: (4, 2) + (−1, 2) = (3, 4)   ✓ pieces add back to u

Both checks take seconds. Do them every time.

Common mistakes
  • Projecting the wrong way round. proj_v(u) (u's shadow on v) is not proj_u(v). The vector you project onto goes on the bottom and outside.
  • Dividing by ‖v‖ instead of v·v = ‖v‖² in the vector formula.
  • Giving a vector when the question asks for the scalar projection (or "component"), or the reverse.
Test yourself
  • What's the projection of u onto v if they're perpendicular? (Zero vector: no shadow.)
  • What if u is already along v? (u itself.)
  • Does projecting onto 2v instead of v change the answer? (No. Only the line's direction matters.)
Practice problems

1. Project (1, 2, 3) onto (1, 1, 1), and find the perpendicular part.

dot = 6, v·v = 3, so proj = 2·(1,1,1) = (2, 2, 2). Perp = (−1, 0, 1). Check: (−1,0,1)·(1,1,1) = 0 ✓.

2. Distance from the point (3, 4) to the line through the origin in direction (2, 1).

It's the length of the perpendicular part from the worked example: ‖(−1, 2)‖ = √5.

Topic 6

The cross product

Give it two arrows in 3D, get back an arrow perpendicular to both.

The idea

  • u × v is a vector that sticks straight out of the flat surface containing u and v.
  • Its length equals the area of the parallelogram u and v make.
  • Its direction follows the right-hand rule: fingers along u, curl toward v, thumb points to u × v.
  • Real-world: torque. Push a wrench handle, and the bolt turns along the axis perpendicular to both the handle and your push.

The formula, written so it's memorisable:

(a₁, a₂, a₃) × (b₁, b₂, b₃) = ( a₂b₃ − a₃b₂ ,  a₃b₁ − a₁b₃ ,  a₁b₂ − a₂b₁ )
Pattern: for each slot, cover that slot and do a "criss-cross" on the other two.
The middle one is the one people get backwards.
Worked example
(1, 2, 3) × (4, 5, 6)
  x: 2·6 − 3·5 = −3
  y: 3·4 − 1·6 =  6
  z: 1·5 − 2·4 = −3
  answer: (−3, 6, −3)

Check by dotting with both originals:
  (−3, 6, −3)·(1, 2, 3) = −3 + 12 − 9  = 0   ✓
  (−3, 6, −3)·(4, 5, 6) = −12 + 30 − 18 = 0  ✓

This check catches nearly every cross product mistake. Make it a habit.

Common mistakes
  • Order matters: v × u = −(u × v). Swapping flips the arrow.
  • Sign error in the middle component.
  • Trying to take a cross product in 2D. It only exists for 3D vectors.
Test yourself
  • What is u × u? Why? (Zero vector: no parallelogram, no area.)
  • If u × v = 0, what does that tell you about u and v? (They're parallel.)
Practice problem

Find the area of the triangle with corners (0,0,0), (1,0,0), (0,2,0).

(1,0,0) × (0,2,0) = (0, 0, 2), length 2 is the parallelogram's area, so the triangle is half: 1. Sanity check: it's a right triangle with legs 1 and 2, so ½·1·2 = 1.

Topic 7

Lines and planes in ℝⁿ

A line is "start here, walk one way". A plane is "start here, walk two ways".

Lines

Think GPS: a starting point p, a direction d, and time t. Where are you at time t?

x = p + t·d
e.g. start at (1, 0, 2), walk in direction (2, 1, 3):
(x, y, z) = (1, 0, 2) + t(2, 1, 3)
t = 0 → (1, 0, 2),  t = 1 → (3, 1, 5),  t = −1 → (−1, −1, −1)

This formula doesn't care about dimension. A line in ℝ⁴ is just (1, 0, 2, −1) + t(1, 1, 0, 3): one starting point, one direction, one parameter.

Planes, version 1: parametric (works in any ℝⁿ)

A plane needs a starting point and two directions that don't point the same way. Two parameters, because a plane has two degrees of freedom.

x = p + s·u + t·v
Every point on the plane is "start at p, go s steps along u and t steps along v".
That's p plus a linear combination of u and v.

Planes, version 2: one equation (ℝ³ only)

In 3D a plane can also be pinned down by one point on it and one normal vector n that sticks straight out of it, like a pencil standing upright on a table. Every arrow lying in the table is perpendicular to the pencil, so its dot product with n is zero.

n · (x − p) = 0      →      ax + by + cz = d
The coefficients (a, b, c) ARE the normal vector. Read it straight off.
Worked example

Plane through (1, 2, 3) with normal (2, −1, 1):

2(x − 1) − 1(y − 2) + 1(z − 3) = 0
2x − 2 − y + 2 + z − 3 = 0
2x − y + z = 3

Check the point: 2(1) − 2 + 3 = 3   ✓

Plane through three points? Make two arrows between the points, cross them to get the normal, then do the above.

What one equation describes in ℝⁿ

Each equation removes one degree of freedom. In ℝ², ax + by = d is a line. In ℝ³, ax + by + cz = d is a plane. In ℝ⁴, a₁x₁ + a₂x₂ + a₃x₃ + a₄x₄ = d is a 3-dimensional "hyperplane". So a plane in ℝ⁴ needs two equations, which is why the parametric form is the one to use beyond 3D.

Worked example: switching forms

Plane through (1, 0, 0) with directions u = (1, 1, 0) and v = (0, 1, 1). Find its equation.

normal = u × v = (1·1 − 0·1,  0·0 − 1·1,  1·1 − 1·0) = (1, −1, 1)
1(x − 1) − 1(y − 0) + 1(z − 0) = 0
x − y + z = 1

Check p:     1 − 0 + 0 = 1   ✓
Check p + u: (2, 1, 0) → 2 − 1 + 0 = 1   ✓
Worked example: where a line hits a plane

Line (1, 0, 2) + t(2, 1, 3) and plane 2x − y + z = 3. Substitute the line's coordinates into the plane and solve for t.

x = 1 + 2t,  y = t,  z = 2 + 3t
2(1 + 2t) − t + (2 + 3t) = 3
4 + 6t = 3   →   t = −1/6

point = (1 − 1/3, −1/6, 2 − 1/2) = (2/3, −1/6, 3/2)
Check: 4/3 + 1/6 + 3/2 = 8/6 + 1/6 + 9/6 = 3   ✓

If t cancels out and you get something false like 4 = 3, the line is parallel to the plane and never hits it. If you get something always true, the line lies inside the plane.

Distance from a point to a plane

This is a projection onto the normal in disguise:

distance = |a·x₀ + b·y₀ + c·z₀ − d| / ‖(a, b, c)‖
e.g. origin to 2x − y + z = 3:  |0 − 3| / √6 = 3/√6 ≈ 1.22
Common mistakes
  • Using the plane's normal as if it's a direction in the plane. It's the opposite: it points out of the plane.
  • Thinking a line has one equation in 3D. The ax + by + cz = d form is a plane, not a line.
  • Using the same letter for both parameters in a parametric plane, or when intersecting two lines. Use s for one and t for the other.
  • Picking two directions that are multiples of each other. That gives a line, not a plane.
Test yourself
  • What's the normal of the plane z = 0 (the floor)? ((0, 0, 1).)
  • When are two planes parallel? (Normals are multiples of each other.)
Practice problems

1. Line through (1, 0, 2) and (3, 1, 5).

Direction = difference = (2, 1, 3). So (1, 0, 2) + t(2, 1, 3).

2. Plane through the origin perpendicular to (1, −2, 4).

x − 2y + 4z = 0

3. Is the point (3, 2, 2, 5) on the line (1, 0, 2, −1) + t(1, 1, 0, 3) in ℝ⁴?

First slot needs t = 2. Then the point would be (3, 2, 2, 5) ✓. Yes. (Every slot must agree on the same t.)

Topic 8

Systems of linear equations

Several conditions that all have to be true at once.

The idea

Each equation in two unknowns is a line. Solving the system means finding where all the lines meet. In 3 unknowns each equation is a plane. There are only three possibilities, and it's worth being able to draw all three:

one solution no solution infinitely many
Crossing, parallel, or the same line twice. There is never "exactly two" solutions.

"Linear" means each variable appears only multiplied by a number and added: no x², no xy, no sin x, no 1/x. That's what keeps the pictures flat (lines and planes, never curves).

Worked example: words into a system

A cinema sells adult tickets for $12 and child tickets for $8. A group buys 10 tickets for $100. How many of each?

a = adults, c = children
   a +  c = 10      ← count of tickets
 12a + 8c = 100     ← money

From the first: c = 10 − a
12a + 8(10 − a) = 100  →  4a = 20  →  a = 5, c = 5

Check: 5 + 5 = 10 ✓   60 + 40 = 100   ✓

Substitution works for two variables. For three or more it gets messy fast, which is why the course switches to augmented matrices.

Test yourself
  • Can a linear system have exactly two solutions? (No. If it has two, the whole line through them works too.)
  • Can 3 planes in 3D have no common point even though no two are parallel? (Yes, like the three sides of a triangular prism. Great picture.)
  • A homogeneous system (all right-hand sides 0) can never have "no solution". Why? (x = 0 always works.)
Topic 9

Augmented matrices, REF and RREF

High-school elimination, but with tidy bookkeeping.

Augmented matrix: the letters stripped out

The variable names never change during elimination, so stop writing them. Keep only the numbers, one row per equation, one column per variable, and a bar where the = sign was:

 x + 2y −  z = 3          [ 1  2  −1 | 3 ]
2x + 4y +  z = 9    →     [ 2  4   1 | 9 ]
A missing variable gets a 0 in its column. Don't skip it.

The three legal moves

Only ever do these, because none of them change the answer:

  1. Swap two rows. (Listing equations in a different order.)
  2. Multiply a row by a non-zero number. (Doubling both sides.)
  3. Add a multiple of one row to another. (Classic elimination.)

REF vs RREF, in plain words

REF (row echelon form)RREF (reduced REF)
Looks likeA staircase: zeros below every pivotStaircase, each pivot is 1, zeros above and below it
RulesEach pivot is to the right of the one above it. All-zero rows at the bottom.All REF rules, plus pivots = 1 and each pivot is alone in its column
Then you…Back-substitute from the bottom upRead the answer straight off
Unique?No, different people get different REFsYes, everyone gets the same RREF
The same system, at both stages:
REF                      RREF
[ 1  1  1 | 9 ]          [ 1  0  0 | 4 ]
[ 0  2  1 | 7 ]          [ 0  1  0 | 2 ]
[ 0  0  3 | 9 ]          [ 0  0  1 | 3 ]   → x = 4, y = 2, z = 3

Strategy: go left to right, making zeros below each pivot (that gets REF). Then go right to left, scaling pivots to 1 and making zeros above them (that gets RREF).

Worked example
 x + y + z = 6
2x + y − z = 1
 x − y + z = 2

[ 1   1   1 |  6 ]
[ 2   1  −1 |  1 ]
[ 1  −1   1 |  2 ]

R2 → R2 − 2R1,  R3 → R3 − R1
[ 1   1   1 |   6 ]
[ 0  −1  −3 | −11 ]
[ 0  −2   0 |  −4 ]

Row 3 says −2y = −4, so y = 2
Row 2: −2 − 3z = −11, so z = 3
Row 1: x + 2 + 3 = 6, so x = 1

Check in eq. 2: 2(1) + 2 − 3 = 1   ✓
Worked example: RREF with a free variable
[ 1  2  −1 | 3 ]
[ 2  4   1 | 9 ]

R2 → R2 − 2R1          [ 1  2  −1 | 3 ]
                       [ 0  0   3 | 3 ]     ← REF. Pivots in columns x and z.
R2 → R2 / 3            [ 1  2  −1 | 3 ]
                       [ 0  0   1 | 1 ]
R1 → R1 + R2           [ 1  2   0 | 4 ]
                       [ 0  0   1 | 1 ]     ← RREF

Column y has no pivot, so y is free. Let y = t.
  z = 1
  x = 4 − 2t
Solution: (x, y, z) = (4, 0, 1) + t(−2, 1, 0)

Check t = 0: 4 + 0 − 1 = 3 ✓   8 + 0 + 1 = 9   ✓

Look at the answer's shape: a point plus t times a direction. The solution set is a line (section 7). Many topics in this course turn out to be the same idea seen from different angles.

Reading the final grid

A row like [0 0 0 | 5]It says 0 = 5. Impossible, so no solution.
A column with no pivotThat variable is free. Infinitely many solutions; write the answer using a parameter t.
A pivot in every variable columnExactly one solution.
Common mistakes
  • Arithmetic slips with negatives. By far the most common error. Plug the final answer back into the original equations, every time.
  • Doing two row operations at once where one uses a row that's already been changed in the same step.
  • Seeing a row of all zeros [0 0 0 | 0] and deciding there's no solution. That row is harmless (0 = 0); it just means one equation was redundant.
  • Stopping at REF when the question says RREF, or calling something RREF when a pivot isn't 1 or has a non-zero above it.
  • Forgetting to write the free variable as a parameter in the final answer.
Test yourself
  • Why is it OK to add one equation to another? (If both are true, their sum is true.)
  • Why are we allowed to multiply a row by 5 but not by 0? (Multiplying by 0 wipes out an equation and loses information.)
  • 3 equations, 4 unknowns: can there be exactly one solution? (No. At most 3 pivots, so at least one free variable.)
Practice problems

1. x + 2y = 4, 2x + 4y = 8

Second is just 2× the first. Infinitely many: y = t, x = 4 − 2t.

2. x + 2y = 4, 2x + 4y = 9

R2 − 2R1 gives 0 = 1. No solution (parallel lines).

3. Put [1 3 | 5; 0 1 | 2] into RREF.

It's already REF. R1 → R1 − 3R2 gives [1 0 | −1; 0 1 | 2], so x = −1, y = 2.

4. Is [1 0 2 | 3; 0 1 0 | 1; 0 0 0 | 0] in RREF? What's the solution?

Yes. z is free: z = t, y = 1, x = 3 − 2t.

Topic 10

Matrix–vector and matrix–matrix multiplication

A matrix is a machine: vector goes in, vector comes out.

The most useful idea: the column view

Multiplying a matrix by a vector means "take this much of column 1, plus this much of column 2". A bakery example makes it concrete:

              cake  cookie
eggs        [  3      1   ]   [ 2 ]  ← 2 cakes
flour (cups)[  2      3   ] × [ 5 ]  ← 5 batches of cookies

= 2 × (3, 2) + 5 × (1, 3) = (6 + 5, 4 + 15) = (11 eggs, 19 cups)

Each column is a recipe. The vector is how many of each you're making. The answer is your shopping list. That's a linear combination of the columns.

Two ways to compute Ax, same answer

A = [  1  0  2 ]     x = (2, 1, 1)
    [ −1  3  1 ]

Row view (dot each row with x):          ← fastest by hand
  row 1: 1·2 + 0·1 + 2·1 = 4
  row 2: −1·2 + 3·1 + 1·1 = 2

Column view (weights × columns):         ← gives the meaning
  2·(1, −1) + 1·(0, 3) + 1·(2, 1) = (4, 2)   ✓ same

Size check: A is 2×3, x has 3 entries, the answer has 2 entries. The number of columns of A must equal the length of x.

Ax = b is just a system in disguise
[ 1  1 ] [ a ]   [ 10  ]          a +  c = 10
[ 12 8 ] [ c ] = [ 100 ]   means  12a + 8c = 100

That's the cinema problem from section 8. Once you see this, "solve Ax = b" stops being scary.

Matrix × matrix

  • Size rule: (m×n)(n×p) = (m×p). The inner numbers must match; the outer numbers give the answer's size.
  • Entry in row i, column j of AB = (row i of A) · (column j of B).
  • Order matters. AB is usually not BA. Socks-then-shoes is not shoes-then-socks.
Worked example: order matters
1234 × 0110 = 2143 swapped the columns
0110 × 1234 = 3412 swapped the rows

Same two matrices, different order, different answer. This one example is worth more than the rule.

Common mistakes
  • Multiplying entry by entry. That isn't matrix multiplication.
  • Cancelling: AB = AC does not mean B = C in general.
  • Transpose of a product reverses order: (AB)ᵀ = BᵀAᵀ.
Test yourself
  • A is 2×3, B is 3×4. Which of AB and BA exist, and what size? (AB is 2×4; BA doesn't exist.)
  • What does multiplying by (1, 0) pull out of a 2×2 matrix? (The first column.)
  • What does I times any vector give? (The same vector. It's the "do nothing" machine.)
Practice problems

1. [[1, 2], [3, 4]] times (5, 6).

Rows: 5 + 12 = 17, 15 + 24 = 39, so (17, 39).

2. [[1, 2], [3, 4]] times [[2, 0], [1, 1]].

[[1·2 + 2·1, 0 + 2], [3·2 + 4·1, 0 + 4]] = [[4, 2], [10, 4]]

3. Write x − y + 2z = 1, 3y + z = 0 as Ax = b.

A = [[1, −1, 2], [0, 3, 1]], x = (x, y, z), b = (1, 0). Note the 0 for the missing x in row 2.

Topic 11

Matrix inverse

The undo button.

The idea

If A is a machine, A⁻¹ is the machine that reverses it: A⁻¹A = I. You can't divide by a matrix, so to solve Ax = b you multiply both sides by the undo button: x = A⁻¹b.

Some matrices have no inverse. If A squashes the whole plane onto a line, lots of different inputs land on the same output, and there's no way to know which one you started from. You can't unscramble an egg.

The 2×2 shortcut

[ a  b ]⁻¹      1     [  d  −b ]
[ c  d ]    = ─────── [ −c   a ]
               ad − bc
Swap a and d, flip the signs of b and c, divide by ad − bc.
If ad − bc = 0, there is no inverse.

For bigger matrices: write [ A | I ], row reduce until the left side is I, and the right side becomes A⁻¹.

Worked example
A = [ 2  1 ]      ad − bc = 6 − 5 = 1
    [ 5  3 ]

A⁻¹ = [  3  −1 ]
      [ −5   2 ]

Check A·A⁻¹:
  row 1: 2·3 + 1·(−5) = 1,   2·(−1) + 1·2 = 0
  row 2: 5·3 + 3·(−5) = 0,   5·(−1) + 3·2 = 1   ✓ identity
Worked example: using it to solve a system
2x + y = 4          A = [ 2  1 ],  b = (4, 11)
5x + 3y = 11            [ 5  3 ]

x = A⁻¹b = [  3  −1 ] [ 4  ]  =  (12 − 11, −20 + 22) = (1, 2)
           [ −5   2 ] [ 11 ]

Check: 2 + 2 = 4 ✓   5 + 6 = 11   ✓

Keep this system in mind; Cramer's rule (section 13) solves the same one.

Worked example: the [ A | I ] method
A = [ 1  2 ]
    [ 3  7 ]

[ 1  2 | 1  0 ]
[ 3  7 | 0  1 ]

R2 → R2 − 3R1     [ 1  2 |  1  0 ]
                  [ 0  1 | −3  1 ]
R1 → R1 − 2R2     [ 1  0 |  7 −2 ]
                  [ 0  1 | −3  1 ]

A⁻¹ = [  7  −2 ]
      [ −3   1 ]      ✓ matches the 2×2 shortcut (det = 7 − 6 = 1)

Same method for 3×3. If a row of zeros appears on the left side, A has no inverse, so stop there.

Rules worth knowing

  • (A⁻¹)⁻¹ = A. Undoing the undo gets you back where you started.
  • (AB)⁻¹ = B⁻¹A⁻¹. Order reverses.
  • (Aᵀ)⁻¹ = (A⁻¹)ᵀ.
  • Only square matrices can have inverses.
Common mistakes
  • (AB)⁻¹ = B⁻¹A⁻¹, reversed order. To undo "socks then shoes", you take off shoes first.
  • Forgetting the 1/(ad − bc) in front.
  • Writing b/A. Matrix division doesn't exist; it's always multiplication by A⁻¹, and on the correct side.
Practice problems

1. Invert [[4, 7], [2, 6]].

ad − bc = 24 − 14 = 10, so A⁻¹ = (1/10)[[6, −7], [−2, 4]].

2. Does [[2, 4], [1, 2]] have an inverse?

No. 4 − 4 = 0. Notice the first column is twice the second, so it squashes everything onto one line.

Topic 12 · needed for Cramer's rule

Determinants

How much the matrix stretches area (or volume).

The idea

Take the 1×1 unit square and push it through the matrix. It becomes a parallelogram. The determinant is that parallelogram's area.

  • det = 6: areas get 6 times bigger.
  • det negative: space got flipped over, like a mirror image.
  • det = 0: everything got squashed flat. That's exactly why there's no inverse.
1 area 2 [[2,1],[0,1]] → det = 2·1 − 1·0 = 2
The dashed unit square (area 1) becomes the green parallelogram (area 2).

How to compute

  • 2×2: ad − bc.
  • 3×3: cofactor expansion. Tip: expand along whichever row or column has the most zeros; it saves work.
  • Or row reduce to a triangle and multiply the diagonal, tracking what the row moves did:
Row moveEffect on det
Swap two rowsSign flips
Multiply a row by kdet multiplied by k
Add a multiple of one row to anotherNo change
Worked example
A = [ 2  0  1 ]
    [ 1  3  2 ]
    [ 1  1  1 ]

Expand along row 1 (it has a zero):
det = 2·(3·1 − 2·1) − 0·(…) + 1·(1·1 − 3·1)
    = 2·1 + 1·(−2)
    = 0

det = 0, so the columns must be dependent. Sure enough: column 3 = ½·column 1 + ½·column 2. Try to find that combination yourself.

Common mistakes
  • det(A + B) ≠ det A + det B. But det(AB) = det A · det B does hold.
  • det(kA) = kⁿ det A for an n×n matrix, not k det A. Every row gets scaled.
  • Forgetting the alternating + − + signs in cofactor expansion.
Test yourself
  • A rotation matrix: what's its determinant, without computing? (1. Rotating doesn't change area.)
  • If two rows are identical, what's the det? (0. The shape is flat.)
Topic 13

Cramer's rule

Solve for one variable at a time using determinants.

The recipe

For a square system Ax = b with det A ≠ 0:

            det(Aᵢ)
  xᵢ  =  ───────────
            det(A)

Aᵢ = A with column i replaced by b.

In words: to get a variable, swap the answer column into that variable's slot, take the determinant, divide by the original determinant.

Worked example: 2×2
2x + y = 4          A = [ 2  1 ],  b = (4, 11)
5x + 3y = 11            [ 5  3 ]          det A = 6 − 5 = 1

x:  swap b into column 1   [ 4   1 ]   det = 12 − 11 = 1   →  x = 1/1 = 1
                           [ 11  3 ]
y:  swap b into column 2   [ 2   4 ]   det = 22 − 20 = 2   →  y = 2/1 = 2
                           [ 5  11 ]

✓ Same answer as the inverse method in section 11.
Worked example: 3×3
 x + y + z = 6        A = [ 1   1   1 ]    b = (6, 1, 2)
2x + y − z = 1            [ 2   1  −1 ]
 x − y + z = 2            [ 1  −1   1 ]

det A  = 1(1 − 1) − 1(2 + 1) + 1(−2 − 1) = 0 − 3 − 3 = −6

A₁ = [ 6  1  1 ; 1  1 −1 ; 2 −1  1 ]    det = −6    →  x = −6/−6  = 1
A₂ = [ 1  6  1 ; 2  1 −1 ; 1  2  1 ]    det = −12   →  y = −12/−6 = 2
A₃ = [ 1  1  6 ; 2  1  1 ; 1 −1  2 ]    det = −18   →  z = −18/−6 = 3

✓ Same answer as the row reduction in section 9.

Four 3×3 determinants is a lot of arithmetic. Solving one system three ways (row reduction, inverse, Cramer) and getting the same answer is a great confidence builder.

When to use it

Good for2×2 systems, and when a question asks for only one variable (one extra determinant instead of solving everything).
Slow for3×3 and up. Row reduction is usually quicker and less error-prone.
Useless whendet A = 0. Then there's no solution or infinitely many; row reduce to find out which.
Common mistakes
  • Replacing a row with b instead of a column.
  • Dividing upside down: it's det(Aᵢ) / det(A), with the original on the bottom.
  • Using it when det A = 0 (division by zero).
  • Sign slips in the 3×3 determinants. Check the final answer in the original equations.
Test yourself
  • Why does Cramer's rule need det A ≠ 0? Connect it to section 12. (det A = 0 means A squashes space flat, so there isn't one unique answer to find.)
  • A test asks only for y in a 3×3 system. How many determinants do you need? (Two: det A and det A₂.)
Practice problems

1. Solve 3x − 2y = 1, x + 4y = 5 by Cramer's rule.

det A = 12 + 2 = 14. det A₁ = |1 −2; 5 4| = 4 + 10 = 14, so x = 1. det A₂ = |3 1; 1 5| = 15 − 1 = 14, so y = 1. Check: 3 − 2 = 1 ✓, 1 + 4 = 5 ✓.

2. Can Cramer's rule solve x + 2y = 4, 2x + 4y = 8?

No. det A = 4 − 4 = 0. (This system has infinitely many solutions; see section 9.)

Extra topic

Linear transformations

Moves that keep grid lines straight, parallel and evenly spaced, and keep the origin still.

The single most useful trick

The columns of the matrix are where the basic arrows land. Column 1 is where (1, 0) goes; column 2 is where (0, 1) goes. To build any transformation matrix, just ask "where do those two arrows end up?"

Real-world: every rotation, zoom and flip in a video game or photo editor is a matrix doing exactly this.

Move(1,0) goes to(0,1) goes toMatrix
Rotate 90° anticlockwise(0, 1)(−1, 0)0−110
Reflect in the x-axis(1, 0)(0, −1)100−1
Reflect in the line y = x(0, 1)(1, 0)0110
Stretch x by 3(3, 0)(0, 1)3001
Horizontal shear(1, 0)(1, 1)1101
Rotate by θ(cos θ, sin θ)(−sin θ, cos θ)[[cos θ, −sin θ], [sin θ, cos θ]]

Is it linear?

Officially: T(u + v) = T(u) + T(v) and T(cu) = cT(u). Quick screening tests:

  • Does 0 go to 0? If not, it's not linear. So "shift everything right by 1" is out.
  • Any squares, products of variables, sin(x), constants added? Not linear.
  • If each output is just "numbers × variables, added up", it's linear, and you can read off the matrix.
Common mistakes
  • Doing "first A, then B" as AB. It's BA: the matrix closest to the vector acts first, so read right to left.
  • Putting the images of (1,0) and (0,1) in as rows instead of columns.
Practice problems

1. Is T(x, y) = (x + y, 2y) linear? If yes, what's its matrix?

Yes. [[1, 1], [0, 2]]. (Check: (1,0) → (1,0), (0,1) → (1,2), those are the columns.)

2. Is T(x, y) = (x², y) linear?

No. T(2·(1,0)) = (4, 0) but 2·T(1,0) = (2, 0).

3. Find the matrix that rotates 90° anticlockwise and then reflects in the x-axis.

Reflect × Rotate = [[1,0],[0,−1]]·[[0,−1],[1,0]] = [[0,−1],[−1,0]]. Check: (1,0) → rotate → (0,1) → reflect → (0,−1). First column ✓.

Extra topic · builds on linear combinations

Span, independence, basis and subspaces

Often the hardest part of the course. Go slowly and picture everything in 2D and 3D.

Span: where can you get to?

Imagine you can only move along certain arrows, as far as you like, forwards or backwards. The span is every place you can reach.

  • One non-zero arrow in 2D: you can reach a line.
  • Two arrows pointing different ways in 2D: you can reach the whole plane.
  • Two arrows pointing the same way (one is a multiple of the other): still only a line. The second one added nothing.

Independence: is anything redundant?

A set of vectors is independent if none of them can be built from the others. Paint analogy: red, blue and yellow are independent. Add purple and it's redundant, because you could already mix it from red and blue.

How to test: put the vectors in as the columns of a matrix and row reduce. Pivot in every column: independent. Any column without a pivot: dependent. For n vectors in ℝⁿ you can also just check det ≠ 0.

Basis and dimension

A basis is a set of vectors that is independent (no waste) and spans the whole space (reaches everywhere). It's a coordinate system. The number of vectors in any basis is the dimension. The usual one for ℝ² is (1, 0), (0, 1), but (1, 0), (1, 1) works just as well.

Subspaces

A subspace is a flat thing through the origin: a line through 0, a plane through 0, just {0}, or the whole space. Three-part test:

  1. Does it contain the zero vector? (Fastest way to rule things out.)
  2. Add two things in it. Is the result still in it?
  3. Scale something in it. Is the result still in it?
Worked example
Are (1, 2, 3), (4, 5, 6), (7, 8, 9) independent?

Row reduce with them as columns and you'll get only 2 pivots. Dependent.
Specifically: (7, 8, 9) = 2·(4, 5, 6) − (1, 2, 3)
             = (8 − 1, 10 − 2, 12 − 3)  ✓

So they span only a plane in 3D, not all of 3D space.
Common mistakes
  • Thinking more vectors always means a bigger span. Not if they're redundant.
  • Calling the line y = x + 1 a subspace. It misses the origin, so it isn't.
  • Believing a basis is unique. A space has infinitely many bases; they just all have the same size.
  • Rule of thumb: more than n vectors in ℝⁿ are always dependent; fewer than n can never span ℝⁿ.
Test yourself
  • Can 2 vectors span ℝ³? Why not, in picture terms? (Two arrows can only sweep out a plane.)
  • Is any set containing the zero vector independent? (No. 0 = 0·anything, so it's always redundant.)
Practice problems

Which of these are subspaces of ℝ²?

(a) all (x, y) with y = 2x   (b) all with y = 2x + 1   (c) all with xy ≥ 0

(a) Yes: a line through the origin. (b) No: (0, 0) isn't on it. (c) No: (1, 0) and (0, −1) are both in it, but their sum (1, −1) isn't. This one's sneaky; it contains 0, but it fails the addition test.

Extra topic

Eigenvalues and eigenvectors

The directions a matrix doesn't turn, only stretches.

The idea

Most vectors get knocked off their line when a matrix acts on them. A few special ones stay on their own line and just get longer, shorter or flipped. Those are eigenvectors, and the stretch factor is the eigenvalue λ:

A v = λ v        "A does to v what a plain number would"

Picture spinning a globe: every point moves except those on the axis. The axis is an eigenvector with eigenvalue 1. Real uses: Google's original PageRank, vibration modes of bridges, population models.

Recipe

  1. Solve det(A − λI) = 0 for λ. (Why: we need (A − λI)v = 0 to have a non-zero solution, so A − λI must squash something, so its det is 0.)
  2. For each λ, solve (A − λI)v = 0 by row reduction to find v.
Worked example
A = [ 2  1 ]
    [ 1  2 ]

det(A − λI) = (2 − λ)² − 1 = 0
2 − λ = ±1   →   λ = 1 or λ = 3

λ = 3:  A − 3I = [ −1  1 ; 1  −1 ]  →  v = (1, 1)
        check: A(1, 1) = (3, 3) = 3·(1, 1)     ✓
λ = 1:  A − I  = [ 1  1 ; 1  1 ]    →  v = (1, −1)
        check: A(1, −1) = (1, −1) = 1·(1, −1)  ✓

Quick sanity check: the eigenvalues add up to the diagonal sum (2 + 2 = 4 = 1 + 3) and multiply to the det (3 = 1 · 3).

Common mistakes
  • Giving v = 0 as an eigenvector. Zero never counts.
  • Thinking the eigenvector is unique. Any non-zero multiple of it also works; (2, 2) is just as good as (1, 1).
  • Getting only the trivial solution when solving for v. That means λ is wrong; recheck step 1.
Practice problem

Find the eigenvalues and eigenvectors of [[4, 1], [2, 3]].

λ² − 7λ + 10 = (λ − 2)(λ − 5), so λ = 2, 5.
λ = 5: v = (1, 1); check A(1,1) = (5,5) ✓.
λ = 2: v = (1, −2); check A(1,−2) = (2,−4) ✓.
Sum 7 = trace, product 10 = det ✓.

Big picture

How it all connects

Most of the course is one question asked in different ways.

For a square matrix A, every statement below is true together, or they are all false together. Try picking one example matrix and checking a few of them to see they agree.

Textbook versionPlain English
A is invertibleA has an undo button
det A ≠ 0A doesn't squash space flat
Ax = b has exactly one solution for every bEvery output comes from exactly one input
Ax = 0 has only the trivial solutionNothing non-zero gets squashed to zero
The columns are linearly independentNo column is redundant
The columns span ℝⁿThe outputs reach everywhere
RREF of A is IRow reduction gives a pivot in every row and column
Cramer's rule can be used on Ax = bThere's a unique answer to find, one variable at a time
0 is not an eigenvalueNo direction gets crushed to nothing
Why this matters for exams

True/false questions love this list. "If det A = 0, can Ax = b have a unique solution?" becomes easy once you see these are all the same fact.

Habits

Self-check habits

Thirty seconds of checking is worth more marks than any trick.

After finding…Check by…
A solution to a systemPlugging it into the original equations
A linear combination's weightsRebuilding the target vector from them
A unit vectorIts length should come out as exactly 1
A projectionLeftover part · v = 0, and the two pieces add back to u
A cross productDotting it with both original vectors; both should be 0
A line–plane intersectionPlugging the point into the plane's equation
An RREFEvery pivot is 1 and is the only non-zero in its column
A Cramer's rule answerPlugging into the original equations (or solving another way)
A plane's equationPlugging in the given point(s)
An inverseMultiplying A by it; you should get I
A determinantAsking: does 0 make sense? Are columns obviously dependent?
An eigenvectorComputing Av and checking it equals λv
EigenvaluesSum = trace (diagonal sum), product = det
A transformation matrixFeeding in (1, 0) and (0, 1) and seeing where they go
Any answer at allIs it the right type and size? Number, vector, matrix?