Lectures 24–26 | the bridge to linear algebra
Every function in this course so far has eaten one number and produced one number. This chapter changes that. The input becomes a point in the plane and so does the output, and the function becomes a rule for moving every point at once.
That sounds like a modest extension. It is the doorway to linear algebra, and to nearly everything computational: rotating a photograph, straightening a scanned document, ranking a web page, compressing a video, and running a layer of a neural network are all the same operation, performed on a great many more than two numbers.
A vector in the plane is a displacement: a distance together with a direction. Writing it in components as \(\mathbf{v}=\langle v_1,v_2\rangle\) means "move \(v_1\) across and \(v_2\) up".
Its magnitude is its length, \(|\mathbf{v}|=\sqrt{v_1^{2}+v_2^{2}}\) — Pythagoras again — and its direction is the angle it makes with the positive \(x\)-axis.
What is the magnitude of \(\langle5,12\rangle\)?
decimals, fractions, pi and sqrt( ) are all fine
A vector is not a point. The point \((3,4)\) is a place; the vector \(\langle3,4\rangle\) is an instruction, and the same instruction can be carried out starting from anywhere. Drawn as an arrow, it can be picked up and moved about the plane without becoming a different vector, which is exactly what makes vectors useful for forces, velocities and routes.
Addition: \(\mathbf{u}+\mathbf{v}=\langle u_1+v_1,\ u_2+v_2\rangle\) — do one journey, then the other.
Scalar multiple: \(c\mathbf{v}=\langle cv_1,\ cv_2\rangle\) — same direction, length scaled by \(|c|\), reversed if \(c<0\).
Unit vector: \(\dfrac{\mathbf{v}}{|\mathbf{v}|}\) has length 1 and the same direction — direction stripped of distance.
Compute \(2\langle1,3\rangle-\langle4,-1\rangle\). Give both components.
2 numbers, separated by a comma: first component, then second
An aircraft flies with velocity \(\langle 240,0\rangle\) km/h relative to the air, and the wind blows at \(\langle 0,-60\rangle\) km/h. Find the ground velocity, its speed, and the direction of travel.
Add them: \(\langle240,0\rangle+\langle0,-60\rangle=\langle240,-60\rangle\).
Speed: \(\sqrt{240^{2}+60^{2}}=\sqrt{57600+3600}=247.4\) km/h.
Direction: \(\tan\theta=\dfrac{-60}{240}=-0.25\), so \(\theta=-14.0^{\circ}\) — fourteen degrees south of the heading.
The aircraft is pointing east and travelling east-south-east. Correcting for that is the entire job of navigation, and it is vector subtraction: to make the ground velocity due east, the pilot must aim \(14^{\circ}\) into the wind.
There is no sensible way to multiply two journeys and get a third journey. But there is an extremely useful way to multiply two vectors and get a number, and it answers the question: how much do these two point the same way?
The dot product of \(\mathbf{u}\) and \(\mathbf{v}\) is $$\mathbf{u}\cdot\mathbf{v}=u_1v_1+u_2v_2.$$ It can also be computed from the geometry: $$\mathbf{u}\cdot\mathbf{v}=|\mathbf{u}|\,|\mathbf{v}|\cos\theta,$$ where \(\theta\) is the angle between them. The two formulas always agree — the Law of Cosines from Lecture 20 is what proves it.
Compute \(\langle2,3\rangle\cdot\langle4,-1\rangle\).
decimals, fractions, pi and sqrt( ) are all fine
Read the second formula and the meaning falls out. The dot product is largest when the vectors point the same way (\(\cos0=1\)), zero when they are perpendicular (\(\cos90^{\circ}=0\)), and negative when they point away from each other. It is a similarity score.
If \(\mathbf{u}\cdot\mathbf{v}\) is negative, the angle between \(\mathbf{u}\) and \(\mathbf{v}\) is .
Find the angle between \(\mathbf{u}=\langle3,4\rangle\) and \(\mathbf{v}=\langle-2,6\rangle\), and decide whether \(\langle3,4\rangle\) and \(\langle8,-6\rangle\) are perpendicular.
\(\mathbf{u}\cdot\mathbf{v}=3(-2)+4(6)=18\). Magnitudes: \(|\mathbf{u}|=5\), \(|\mathbf{v}|=\sqrt{40}=6.325\). So $$\cos\theta=\frac{18}{5(6.325)}=0.5692,\qquad \theta=55.3^{\circ}.$$
For the second pair: \(3(8)+4(-6)=24-24=0\). A dot product of zero means \(\cos\theta=0\), so yes, they are perpendicular — checked without drawing anything or finding a single angle.
That is the everyday use of the dot product. Testing perpendicularity by measuring two directions and subtracting is fiddly; testing it by multiplying and adding four numbers is not.
A crate is dragged 12 m along the ground by a rope pulling with a force of 80 N at \(25^{\circ}\) above the horizontal. How much work is done?
Only the part of the force pointing along the motion does any work — the upward part just tries to lift the crate. That part is the projection of the force onto the displacement, of length \(80\cos25^{\circ}=72.5\) N.
So the work is \(72.5\times12=870\) joules, which is exactly the dot product $$\mathbf{F}\cdot\mathbf{d}=|\mathbf{F}||\mathbf{d}|\cos\theta=80(12)\cos25^{\circ}=870\ \text{J}.$$
If the rope were vertical the work would be zero, however hard you pulled: \(\cos90^{\circ}=0\). Physics defines work as a dot product precisely because "how much of this points along that" is the quantity that matters.
Take three short documents and count how often each of a few words appears. Each document becomes a vector of counts — and now two documents can be compared by the angle between their vectors.
The angle, not the dot product itself, because a long document has big counts and would win every dot product simply by being long. Dividing by both magnitudes strips the length out and leaves only the direction: $$\text{similarity}=\frac{\mathbf{u}\cdot\mathbf{v}}{|\mathbf{u}||\mathbf{v}|}=\cos\theta.$$
This is called cosine similarity and it is everywhere: matching a search query to a page, recommending a film, finding duplicate submissions, deciding which sentences in a body of text are about the same thing. Modern systems use vectors with hundreds of components rather than a handful, and nothing about the formula changes — you simply add up more products. The geometry of Chapter 5 is doing the work, in a space no one can picture.
Two documents have count vectors \(\langle2,1\rangle\) and \(\langle20,10\rangle\). What is their cosine similarity?
decimals, fractions, pi and sqrt( ) are all fine
Chapter 1 turned three sentences into arrows by counting words, and stopped there because we had no way to measure the angle between them. We do now.
A modern language model does the same thing, with one important improvement. Counting words treats car and automobile as completely unrelated, since they are different words. Instead, a model assigns every word its own list of a few hundred numbers — called an embedding — and those numbers are not counted, they are learned, by adjusting them until words that tend to appear in similar company end up pointing in similar directions.
Here is the idea with three numbers instead of three hundred.
Using the embeddings \(\text{king}=\langle0.90,0.70,0.10\rangle\), \(\text{queen}=\langle0.85,0.75,0.15\rangle\) and \(\text{pizza}=\langle0.10,0.20,0.95\rangle\), compute the cosine similarity of each pair and rank them.
Magnitudes first: \(|\text{king}|=\sqrt{0.81+0.49+0.01}=1.145\), \(|\text{queen}|=\sqrt{0.7225+0.5625+0.0225}=1.143\), \(|\text{pizza}|=\sqrt{0.01+0.04+0.9025}=0.976\).
king and queen: the dot product is \(0.90(0.85)+0.70(0.75)+0.10(0.15)=0.765+0.525+0.015=1.305\), so $$\cos\theta=\frac{1.305}{1.145\times1.143}=0.997,\qquad \theta=4.3^{\circ}.$$
king and pizza: \(0.09+0.14+0.095=0.325\), giving \(\cos\theta=\dfrac{0.325}{1.145\times0.976}=0.291\) and \(\theta=73.1^{\circ}\).
queen and pizza: \(0.378\), giving \(\cos\theta=0.338\) and \(\theta=70.2^{\circ}\).
Ranking: king and queen are by far the closest, and pizza is roughly equally far from both. Note the direction of the comparison, because it is easy to get backwards: a larger dot product means a smaller angle, which means more similar. Similarity goes up with the dot product, not down.
Almost everything you have seen a language model do rests on this one measurement.
The famous demonstration is that arithmetic on these vectors sometimes behaves like arithmetic on meanings: take the vector for king, subtract man, add woman, and the closest vector to the result is often queen. That is vector addition from earlier in this lecture, performed on direction-encoded meaning. It does not always work, and why it works at all is not fully understood — which is a fair description of a good deal of the field.
Lecture 1 defined a function as a rule taking an input to an output. Nothing in that definition said the input had to be a single number. Let the input be a vector and the output be a vector, and you have a function that moves the whole plane at once.
The linear ones — those that keep the origin fixed and keep straight lines straight and evenly spaced — turn out to be describable by just four numbers.
A \(2\times2\) matrix acts on a vector by $$\begin{pmatrix}a & b\\ c & d\end{pmatrix}\begin{pmatrix}x\\ y\end{pmatrix} =\begin{pmatrix}ax+by\\ cx+dy\end{pmatrix}.$$ Each output coordinate is a dot product: the first row with the input, then the second row with the input.
Compute \(\begin{pmatrix}2&1\\0&3\end{pmatrix}\begin{pmatrix}1\\2\end{pmatrix}\).
2 numbers, separated by a comma: top entry, then bottom
Feed in \(\langle1,0\rangle\), the unit step east, and the answer is \(\langle a,c\rangle\) — the first column. Feed in \(\langle0,1\rangle\), the unit step north, and you get \(\langle b,d\rangle\) — the second column.
So a matrix is nothing more than a record of where the two basic steps land. And that is enough to determine the whole transformation, because every other vector is built from those two: \(\langle3,4\rangle\) is three east-steps and four north-steps, so its image is three times the first column plus four times the second.
When you read a matrix, read its columns as destinations. Almost every matrix in this chapter can be written down by asking "where do I want east to go, and where do I want north to go?" and putting those two answers side by side.
A matrix sends east \(\langle1,0\rangle\) to \(\langle2,1\rangle\) and north \(\langle0,1\rangle\) to \(\langle-1,3\rangle\). Where does it send \(\langle1,1\rangle\)?
2 numbers, separated by a comma: x, then y
| effect | matrix | where east and north go |
|---|---|---|
| scale by \(s\) | \(\begin{pmatrix}s & 0\\ 0 & s\end{pmatrix}\) | both stretched, directions unchanged |
| reflect in the \(x\)-axis | \(\begin{pmatrix}1 & 0\\ 0 & -1\end{pmatrix}\) | east stays, north flips to south |
| shear | \(\begin{pmatrix}1 & k\\ 0 & 1\end{pmatrix}\) | east stays, north leans over by \(k\) |
| rotate by \(\theta\) | \(\begin{pmatrix}\cos\theta & -\sin\theta\\ \sin\theta & \cos\theta\end{pmatrix}\) | east goes to \((\cos\theta,\sin\theta)\) |
Look hard at the rotation matrix. Its first column is exactly the terminal point of Chapter 4 — the place east ends up after turning through \(\theta\) is, by definition, \((\cos\theta,\sin\theta)\). The second column is that point turned a further quarter turn. The whole of the unit circle has walked into linear algebra and become a matrix.
Rotate the point \((4,1)\) by \(90^{\circ}\) anticlockwise about the origin, then by \(30^{\circ}\).
At \(90^{\circ}\): \(\cos90^{\circ}=0\) and \(\sin90^{\circ}=1\), so the matrix is \(\begin{pmatrix}0&-1\\1&0\end{pmatrix}\) and $$\begin{pmatrix}0&-1\\1&0\end{pmatrix}\begin{pmatrix}4\\1\end{pmatrix}=\begin{pmatrix}-1\\4\end{pmatrix}.$$ Sanity check: the point was to the right and slightly up; it is now up and slightly left. ✓
At \(30^{\circ}\): \(\begin{pmatrix}0.866&-0.5\\0.5&0.866\end{pmatrix}\begin{pmatrix}4\\1\end{pmatrix}=\begin{pmatrix}3.464-0.5\\2+0.866\end{pmatrix}=\begin{pmatrix}2.964\\2.866\end{pmatrix}\).
The length should not change under a rotation: \(\sqrt{4^{2}+1^{2}}=4.123\) and \(\sqrt{2.964^{2}+2.866^{2}}=4.123\). ✓ That check catches almost every sign error people make with rotation matrices.
A QR code is photographed rotated \(30^{\circ}\) anticlockwise. Its bottom edge, which should run due east, appears in the photo as \(\langle0.866,0.500\rangle\), and its left edge, which should run due north, appears as \(\langle-0.500,0.866\rangle\). Find the matrix that distorted it, and the one the scanner must apply to undo it. Check on one corner.
The distortion. The columns of a matrix are the destinations of east and north, and we have been handed exactly those: $$M=\begin{pmatrix}0.866 & -0.500\\ 0.500 & 0.866\end{pmatrix}.$$ Those entries are \(\cos30^{\circ}\) and \(\sin30^{\circ}\), so \(M\) is the rotation matrix for \(30^{\circ}\) — which is what we expected, and a good sign that nothing has gone wrong.
The repair. To undo a rotation of \(30^{\circ}\), rotate by \(-30^{\circ}\): $$M^{-1}=\begin{pmatrix}\cos(-30^{\circ}) & -\sin(-30^{\circ})\\ \sin(-30^{\circ}) & \cos(-30^{\circ})\end{pmatrix} =\begin{pmatrix}0.866 & 0.500\\ -0.500 & 0.866\end{pmatrix}.$$ The inverse formula from this lecture agrees: \(\det M=0.866^{2}+0.500^{2}=1\), so \(M^{-1}=\begin{pmatrix}d&-b\\-c&a\end{pmatrix}\), which is the same matrix.
The check. A corner that should sit at \((1,0)\) appears in the photo at \((0.866,0.500)\). Applying \(M^{-1}\): $$\begin{pmatrix}0.866 & 0.500\\ -0.500 & 0.866\end{pmatrix}\begin{pmatrix}0.866\\0.500\end{pmatrix} =\begin{pmatrix}0.750+0.250\\-0.433+0.433\end{pmatrix}=\begin{pmatrix}1\\0\end{pmatrix}.$$ ✓
The scanner applies that one matrix to every pixel and the whole image comes upright at once. This is why the three chunky squares sit in the corners of every QR code: they are not data and not decoration, they are there so that a scanner can measure where east and north ended up, and therefore recover \(M\).
A real photograph is usually worse than a pure rotation — hold the phone at an angle and the square becomes a trapezoid, which needs a slightly larger matrix than the ones in this chapter. The principle does not change: find where a few known points went, deduce the transformation, and invert it.
A pixel's colour is a vector \(\langle R,G,B\rangle\) of three brightnesses from 0 to 255. The standard conversion to greyscale is the dot product with \(\mathbf{w}=\langle0.299,0.587,0.114\rangle\). Find the grey value of the pixel \(\langle200,120,60\rangle\), and explain the choice of weights.
The weights add to 1, so white stays white and black stays black. They are unequal because the eye is far more sensitive to green than to blue: green carries nearly 60% of the perceived brightness and blue barely a tenth. Averaging the three channels equally would make blues look too light and greens too dark.
Notice what has happened to the information. Three numbers became one, so the map is nowhere near one-to-one — \(\langle200,120,60\rangle\) and thousands of other colours all give 137. There is no way back, which is exactly why colourising an old photograph is guesswork rather than arithmetic.
Apply \(B\) and then \(A\). The result is another linear transformation, and its matrix is written \(AB\) — the matrix product. Its columns, as always, are the destinations of east and north: apply \(B\) to each column of the identity, then apply \(A\) to the result.
Every entry is a dot product of a row of the first with a column of the second. The order matters: \(AB\) means "do \(B\) first", and in general \(AB\neq BA\).
Let \(R\) rotate by \(90^{\circ}\) and \(F\) reflect in the \(x\)-axis. Compute \(RF\) and \(FR\), and describe each in words.
\(R=\begin{pmatrix}0&-1\\1&0\end{pmatrix}\), \(F=\begin{pmatrix}1&0\\0&-1\end{pmatrix}\).
$$RF=\begin{pmatrix}0&1\\1&0\end{pmatrix},\qquad FR=\begin{pmatrix}0&-1\\-1&0\end{pmatrix}.$$They are not equal. \(RF\) swaps the coordinates, which is a reflection in the line \(y=x\); \(FR\) swaps and negates both, a reflection in \(y=-x\). Reflect-then-rotate and rotate-then-reflect give mirror images in perpendicular lines.
You met this in Lecture 4 with \(f\circ g\neq g\circ f\), and in Lecture 25 it has the same cause, because matrix multiplication is composition of functions. Socks and shoes, in two dimensions.
The identity \(I=\begin{pmatrix}1&0\\0&1\end{pmatrix}\) leaves every vector alone: east goes to east, north to north.
The inverse \(A^{-1}\) undoes \(A\), meaning \(AA^{-1}=I\). For a \(2\times2\) matrix, $$A^{-1}=\frac{1}{ad-bc}\begin{pmatrix}d&-b\\-c&a\end{pmatrix},$$ provided \(ad-bc\neq0\). That condition is the subject of the next lecture, and it is not a technicality.
Find the inverse of \(\begin{pmatrix}4&1\\3&1\end{pmatrix}\). Enter its four entries row by row: top-left, top-right, bottom-left, bottom-right.
4 numbers, separated by commas, row by row
Two linear equations in two unknowns is the oldest problem in algebra and the most common one in practice. It also turns out to be the same question this course opened with: is anything lost?
Each equation \(ax+by=e\) describes a line. Solving the pair means finding the points on both lines, so geometry settles the matter completely before any algebra is done.
Solve each system, and say which picture it is.
(a) \(\begin{cases}2x+3y=12\\ x-y=1\end{cases}\) (b) \(\begin{cases}2x+4y=6\\ x+2y=5\end{cases}\) (c) \(\begin{cases}2x+4y=6\\ x+2y=3\end{cases}\)
(a) From the second equation \(x=y+1\). Substituting: \(2(y+1)+3y=12\), so \(5y=10\) and \(y=2\), \(x=3\). One crossing point, \((3,2)\).
(b) The second equation doubled is \(2x+4y=10\), which contradicts the first. No solution — the lines are parallel, with the same slope and different intercepts.
(c) The second equation doubled is the first. The two equations say the same thing, so every point on the line \(x+2y=3\) is a solution: infinitely many.
Cases (b) and (c) have identical left-hand sides. Whether a system has no solutions or infinitely many is decided by the constants on the right; whether it has exactly one is decided entirely by the coefficients on the left. That is the fact the determinant captures.
Write the system as \(A\mathbf{x}=\mathbf{b}\): $$\begin{pmatrix}a&b\\c&d\end{pmatrix}\begin{pmatrix}x\\y\end{pmatrix}=\begin{pmatrix}e\\f\end{pmatrix}.$$ Now the question changes character. It is no longer "where do two lines cross" but "which input did the transformation \(A\) send to \(\mathbf{b}\)" — and that is a question about running a function backwards. If \(A\) has an inverse, the answer is immediate: \(\mathbf{x}=A^{-1}\mathbf{b}\), and it is unique.
The determinant of \(A=\begin{pmatrix}a&b\\c&d\end{pmatrix}\) is $$\det A=ad-bc.$$ Geometrically, \(|\det A|\) is the area of the image of the unit square — the parallelogram spanned by the two columns. Its sign records whether the transformation flipped the plane over.
The unit square is sent through \(\begin{pmatrix}3&1\\2&4\end{pmatrix}\). By what factor are areas multiplied?
decimals, fractions, pi and sqrt( ) are all fine
Find the determinant of each and say what the transformation does to area: \(\begin{pmatrix}3&0\\0&2\end{pmatrix}\), \(\begin{pmatrix}1&5\\0&1\end{pmatrix}\), \(\begin{pmatrix}1&0\\0&-1\end{pmatrix}\), \(\begin{pmatrix}2&4\\1&2\end{pmatrix}\).
\(6\): areas are multiplied by 6, which is what stretching by 3 one way and 2 the other should do.
\(1\): a shear leans the square into a parallelogram of the same base and the same height, so the area is unchanged — a fact that is much easier to see than to compute.
\(-1\): area preserved, but the sign says the plane has been turned over. Reflections have negative determinant.
\(2(2)-4(1)=0\): the area is destroyed. The two columns \(\langle2,1\rangle\) and \(\langle4,2\rangle\) are parallel — the second is twice the first — so they span no area at all, and the whole plane has been flattened onto a single line.
Follow the chain. A determinant of zero means the image of the unit square has no area. No area means both columns lie along one line, so the entire plane has been squashed onto that line. Squashing means many different inputs arrive at the same output — so the transformation is not one-to-one. And Lecture 5 told us, back in Chapter 1, that a function which is not one-to-one has no inverse, because information has been destroyed and no rule can invent it back.
So these are all the same statement:
One number, computed by multiplying four entries and subtracting, answers all six questions at once. That is what a good definition does, and it is a fair summary of why linear algebra exists.
Solve \(\begin{cases}3x+y=11\\ 5x+2y=19\end{cases}\) using the inverse matrix, then check the determinant against the geometry.
\(A=\begin{pmatrix}3&1\\5&2\end{pmatrix}\) has \(\det A=6-5=1\), so an inverse exists and the solution is unique: $$A^{-1}=\frac{1}{1}\begin{pmatrix}2&-1\\-5&3\end{pmatrix},\qquad \mathbf{x}=A^{-1}\begin{pmatrix}11\\19\end{pmatrix}=\begin{pmatrix}22-19\\-55+57\end{pmatrix}=\begin{pmatrix}3\\2\end{pmatrix}.$$
Check: \(3(3)+2=11\) ✓ and \(5(3)+2(2)=19\) ✓
For a \(2\times2\) system this is more work than elimination, and nobody would do it by hand. It matters because it scales: the same formula, with a much larger matrix, is how a computer solves ten thousand equations at once — and the determinant is still what tells it whether an answer exists before it starts.
The Hill cipher encrypts text two letters at a time. Letters become numbers \(A=0,B=1,\ldots,Z=25\), each pair is multiplied by a key matrix, and the answers are reduced modulo 26 (that is, wrapped around the alphabet). Using $$K=\begin{pmatrix}3&2\\5&3\end{pmatrix},$$ encrypt the pair HI, then decrypt it again.
Encrypting. \(H=7\) and \(I=8\), so $$K\begin{pmatrix}7\\8\end{pmatrix}=\begin{pmatrix}21+16\\35+24\end{pmatrix}=\begin{pmatrix}37\\59\end{pmatrix} \equiv\begin{pmatrix}11\\7\end{pmatrix} \pmod{26},$$ which is LH.
Decrypting needs \(K^{-1}\). Here \(\det K=9-10=-1\), and working modulo 26 the reciprocal of \(-1\) is \(25\), since \(-1\times25=-25\equiv1\). So $$K^{-1}=25\begin{pmatrix}3&-2\\-5&3\end{pmatrix}=\begin{pmatrix}75&-50\\-125&75\end{pmatrix}\equiv\begin{pmatrix}23&2\\5&23\end{pmatrix}\pmod{26}.$$
Applying it to \(\langle11,7\rangle\): \(23(11)+2(7)=267\equiv7\) and \(5(11)+23(7)=216\equiv8\). That is \(\langle7,8\rangle\) — HI again. ✓
Now the point. A key matrix is only usable if it can be inverted, so its determinant must not be zero — and modulo 26 it must also share no factor with 26, ruling out even determinants and multiples of 13. Choose a key with \(\det K=0\) and you have built the shredder from Lecture 5: different messages encrypt to the same ciphertext, and not even the intended recipient can read it.
Lester Hill published this in 1929. It is far too weak for real use, but it was the first cipher to be built on matrix algebra, and it makes the determinant condition into something you can feel: a zero determinant is a lost message.
A game sprite has a corner at \((30,0)\) relative to its centre, and must spin at \(6^{\circ}\) per frame. Where is the corner after 1 frame and after 15 frames, and why does the studio store an angle rather than repeatedly multiplying?
One frame: \(\begin{pmatrix}\cos6^{\circ}&-\sin6^{\circ}\\ \sin6^{\circ}&\cos6^{\circ}\end{pmatrix}\begin{pmatrix}30\\0\end{pmatrix}=\begin{pmatrix}29.84\\3.14\end{pmatrix}\).
Fifteen frames is a rotation of \(90^{\circ}\), which sends \((30,0)\) to \((0,30)\) exactly. That follows from the exercise above: composing rotations adds the angles, so applying the \(6^{\circ}\) matrix fifteen times equals applying the \(90^{\circ}\) matrix once.
Why not just multiply repeatedly? Because each multiplication rounds off a little, and after a few thousand frames those roundings accumulate until the sprite is visibly stretched — the determinant drifts away from 1. Storing the total angle and rebuilding the matrix each frame keeps the determinant exactly 1 and the shape exactly rigid. This is a real bug that has shipped in real games.
Determinants appeared twice, independently, within a decade. Seki Takakazu wrote about them in Japan in 1683; Leibniz described the same idea in a letter in 1693. Both were trying to decide when a system of equations could be solved, and both found the same combination of coefficients.
Matrices themselves came much later — Cayley, in the 1850s — which is a strange order of events: the test for whether a matrix can be inverted was invented before anyone had written down a matrix.
The collection is complete. You can now sketch, transform, and state the domain and range of: lines, power functions, roots, reciprocals and polynomials; exponentials and logarithms, with their asymptotes; and sine, cosine and tangent, with theirs. And you can now do to the plane what Lecture 4 did to a graph — scale it, shear it, reflect it, rotate it — with a single object of four numbers.
A vector is a journey, and the dot product measures how much two journeys agree — which is how a machine decides that two documents are about the same thing. A matrix is a function that moves the whole plane, and its columns say where east and north end up. Multiplying matrices is doing one thing after another. And the determinant is the area of what the unit square became, so a determinant of zero means the plane was flattened, information was lost, and nothing can be undone.
That last sentence is the one this course has been building toward since Lecture 5, when a shift cipher and a shredder illustrated the difference between a function you can run backwards and one you cannot.
Three doors are now open, and you have been standing in front of all of them.
Calculus takes every approximation in this course and completes it by letting a step size shrink: average rates become instantaneous ones, sums of rectangles become exact areas, polynomial approximations become series, and secant lines become tangents. Nothing will be unfamiliar; the objects are already in your hands.
Linear algebra takes this chapter and removes the restriction to two dimensions. The same columns, the same composition, the same determinant — with a thousand dimensions instead of two, which is where data actually lives.
Machine learning is the two of them at once: a model built from matrices, a loss function measuring its failure, and a hunt for the minimum by rolling downhill. You did that in Lecture 8 with a difference quotient and a step size chosen by hand.
And running underneath all of it is the thing this course has tried hardest to show: mathematics is not a finished object handed down complete. Every idea here was made by somebody, in a particular place, for a reason — in Baghdad, Kerala, Alexandria, Edo, Göttingen — and much of it was contested before it was accepted. It is still being made. You are meeting it in motion.
End of the course.