← Back to list

You’ve Multiplied Matrices Since School. Nobody Told You What They’re For

I have multiplied a lot of matrices. Through school, through university, and then for years as an engineer, without anyone ever telling me…

Mohammad Nawal Ali in Artificial Intelligence in Plain English · 2026-07-13 08:58 · 5 claps · 6.1 min read
#machine-learning #mathematics #linear-algebra #data-science #programming
Open on Medium ↗
Wiki topics: ML · Machine Learning EDU · Education & Learning 💻 · Programming 📐 · Mathematics 🔬 · Science · General

You’ve Multiplied Matrices Since School. Nobody Told You What They’re For

I have multiplied a lot of matrices. Through school, through university, and then for years as an engineer, without anyone ever telling me what the grid was actually for.

I knew the steps cold: row times column, add up the products, write the number in the box, move on. The how, over and over. Never the what-for. The numbers went in, other numbers came out, and it always felt like arithmetic with extra bookkeeping.

Then it slowly dawned on me that those grids are quietly running a huge share of the things I use every day. The photo I cropped this morning. The search that found this for you. The app deciding what to play next. All of it, the same little grid I’d been drilled on for years and never actually understood.

So here’s the thing nobody ever stopped to explain: what a matrix is for.

The one idea everything else hangs on

A matrix isn’t a box of numbers. It’s a machine that takes something in and moves it.

The simplest version to picture: an arrow. Say you have an arrow pointing right, and you want it pointing up. There’s a little 2×2 grid of numbers that does exactly that. Feed it the “right” arrow, and out comes the “up” arrow. The grid is the instruction for the turn. A different grid stretches the arrow to twice its length. Another one tilts it. The numbers in the box aren’t data; they’re a move.

The four numbers in the grid are an instruction. This one takes an arrow pointing right and turns it to point up. That’s all a matrix is: a move, written down.

The four numbers in the grid are an instruction. This one takes an arrow pointing right and turns it to point up. That’s all a matrix is: a move, written down.

That’s the whole idea, and it stretches further than arrows. More broadly, a matrix is a way to write down how one set of things relates to another, and “multiplying” by it pushes your data through that relationship. Store a relationship in a grid, then run things through it. Hold onto that one sentence. Every example below is that same move wearing a different costume.

It rotates and recolors your photos

Straighten a crooked photo and you’ve done matrix multiplication without noticing.

An image is a grid of pixels, each at some coordinate. Rotate or scale the photo and every pixel coordinate gets multiplied by a matrix that says, precisely, how far to turn or stretch. That’s the geometry.

Color works the same way. Each pixel is three numbers: how much red, green, and blue. Turn a photo to grayscale, or give it that warm vintage cast, and you’re multiplying each pixel’s three numbers by a small matrix that mixes the colors in a fixed recipe. A chunk of the filters you tap on are, underneath, a grid of numbers deciding how to remix light.

Two things happen when you edit a photo, and both are matrix multiplication. On top, rotating or scaling multiplies every pixel’s position by a grid. On the bottom, going grayscale multiplies every pixel’s color by a grid.

Two things happen when you edit a photo, and both are matrix multiplication. On top, rotating or scaling multiplies every pixel’s position by a grid. On the bottom, going grayscale multiplies every pixel’s color by a grid.

You’ve been building them all along

Here’s the one that actually got me. Every table of data I’ve ever made is a matrix.

A spreadsheet, a database table, a CSV: rows going down, columns going across, a value in every cell. That’s a grid. That’s a matrix. Every time I stored users in rows and their details in columns, I was building the exact thing I couldn’t see the point of in class, and calling it a table.

The same numbers, wearing two costumes. Strip a table of its headers and gridlines, draw brackets around what’s left, and it was a matrix the whole time.

The same numbers, wearing two costumes. Strip a table of its headers and gridlines, draw brackets around what’s left, and it was a matrix the whole time.

And it quietly changes what a matrix is. Up to now it’s been a move: rotate this, recolor that. But a grid can just as easily be a record, a way to lay out how one set of things relates to another. Users to their details. Movies to their ratings. Pages to the pages they link to. Once you let a matrix be “a table of relationships,” the biggest systems around you stop looking mysterious, because they’re all built on exactly that.

It ranked the entire web

Google’s original breakthrough was a matrix trick, and it’s a beautiful one.

Picture the whole web as one enormous grid: a row and a column for every page, with a mark wherever one page links to another. That grid is a map of the web’s link structure. Now take a list of “importance” scores, one per page, and multiply it by that grid, over and over. Each pass lets important pages pass some of their importance to the pages they link to. After enough rounds the scores stop moving and settle, and the pages that rose to the top are the ones everyone else effectively voted for.

The web as a grid. Every page is a row and a column, with a dot wherever one page links to another. Multiply the importance scores by that grid over and over, and the pages everyone links to swell to the top.

The web as a grid. Every page is a row and a column, with a dot wherever one page links to another. Multiply the importance scores by that grid over and over, and the pages everyone links to swell to the top.

That settling ranking is PageRank. The web as a matrix, run through itself until the important pages surface. A search engine that reshaped the internet started as repeated multiplication by a grid.

It knows the people you may know

That “People You May Know” list is the same trick, pointed at people instead of pages.

Put everyone on a social network into a grid: a row and a column for each person, with a mark wherever two people are connected. That’s the friend graph, written as a matrix. Now multiply that grid by itself. The result counts, for every pair of people, how many friends they have in common. And two strangers with a big pile of mutual friends are exactly the ones the app decides to introduce.

You and a stranger aren’t connected, but you share two friends. Multiplying the friendship grid by itself counts exactly those shared friends for every pair, and a big count is what puts someone on your ‘People You May Know’ list.

You and a stranger aren’t connected, but you share two friends. Multiplying the friendship grid by itself counts exactly those shared friends for every pair, and a big count is what puts someone on your ‘People You May Know’ list.

A network stored in a grid, and one multiplication pulling a genuinely useful answer out of it. Same move as the web ranking, wearing a different face.

It guesses what you’ll watch next

That “because you watched…” row is a matrix being asked to fill in a blank.

Imagine a giant table: every user is a row, every movie a column, and each cell holds a rating. Almost all of it is empty. You’ve rated a tiny fraction of what exists. The job is to guess the empty cells: how would you rate a film you’ve never opened?

The classic answer factors that giant table into two smaller grids, one that captures each person’s taste, one that captures each movie’s flavor, such that multiplying them back together reproduces the ratings you do know. Once you have those two compact grids, multiply them out fully and the blanks fill in with predictions. That’s matrix factorization, and it’s not a toy: it’s essentially how the famous million-dollar Netflix Prize was won. Modern systems layer more on top, but that grid-splitting idea is still near the core of what suggests your next show or song.

The ratings table is mostly blanks (left). Factor it into two small grids, one for taste and one for flavor, multiply them back, and the blanks turn into predictions (right, in amber). That’s what fills your ‘because you watched…’ row.

The ratings table is mostly blanks (left). Factor it into two small grids, one for taste and one for flavor, multiply them back, and the blanks turn into predictions (right, in amber). That’s what fills your ‘because you watched…’ row.

And it’s the whole engine of the AI everyone’s talking about

Strip the mystique off a neural network and a single layer of it is one matrix multiply.

Your input (an image, a sentence, anything) becomes a list of numbers. The layer multiplies that list by a grid of learned numbers, producing a new, transformed list, then applies one simple nonlinear squish. That’s it. Stack a hundred of those layers and you have the “deep” in deep learning. Training the model means slowly nudging the numbers inside those grids until the stack of transformations turns raw, messy input into a clean answer.

One layer, top: your data is a list of numbers, multiplied by a grid of learned weights, then given a simple squish. Stack a hundred of those, bottom, and raw pixels get turned, grid by grid, into ‘cat’.

One layer, top: your data is a list of numbers, multiplied by a grid of learned weights, then given a simple squish. Stack a hundred of those, bottom, and raw pixels get turned, grid by grid, into ‘cat’.

If you read the last piece, this is the machine behind it. Learning is finding the transformations that bend the data’s space until the answer is easy to read off, and each of those transformations is a matrix.

You were handed the verb and never the sentence

Look back at the list. Straightening a photo, ranking the web, spotting people you may know, guessing your next show, recognizing a face, and every plain table of data you’ve ever built. Underneath, they’re the same move: store a relationship in a grid, then push data through it. Different grids, one operation.

That’s what makes the way we’re taught them so strange. Through school, through university, into the job, we’re handed the verb, multiply, with the sentence carefully removed. No wonder it felt like a chore. A matrix isn’t a box of numbers you crunch to pass a test. It’s a machine that moves information, and once you see that, you start noticing it everywhere: in the photo you crop, the search that found this, the feed that knows you a little too well.

Same grid you were drilled on. It was never the boring part. It was the point.


메타데이터
post_id
01024dabfc5d
slug
youve-multiplied-matrices-since-school-nobody-told-you-what-they-re-for-01024dabfc5d
url
https://ai.plainenglish.io/youve-multiplied-matrices-since-school-nobody-told-you-what-they-re-for-01024dabfc5d
canonical_url
https://ai.plainenglish.io/youve-multiplied-matrices-since-school-nobody-told-you-what-they-re-for-01024dabfc5d
author_url
https://medium.com/@mnawalali4
status
ok
fetched_at
2026-07-14 10:04:23