Back to paths

Systems of Equations — A Matrix Is Just a List of Rules

A matrix like [[1,1],[1,4]] looks like abstract numbers, but the most grounded way to read one is as a list of constraints with the variable names stripped out — the rack-space-versus-budget algebra an SRE already does by hand. Translate sentences to equations to a system to a matrix, find the solution where the constraints intersect, and see what a singular (impossible) system looks like. Foundational literacy — not how neural nets use matrices. No ML math.

beginner~10 min#math-infra#fundamentals
100Math for the Metal (arithmetic & shapes)Lesson 2 of 4Show

Prerequisites: What Is a Tensor? — A Multidimensional Array


The one-line summary

A matrix like [[1, 1], [1, 4]] looks like a wall of abstract numbers. The most grounded way to read one: it's a list of constraints with the variable names stripped out. And you already write these — every time you do capacity planning. "The rack holds 40 nodes." "The budget is $100k." Each sentence is a rule; together they pin down exactly one valid configuration. That's all a small matrix is — your constraints, stored for a computer.

Equations are just lazy English

You do this algebra daily; you just don't write the symbols. "I have 40 slots in the rack for CPUs and GPUs" — you just said:

C + G = 40

C is how many CPUs, G how many GPUs. The notation isn't math-class abstraction; it's keystroke compression for a sentence you already think in.

Add the money rule — CPUs cost $1k, GPUs $4k, budget $100k:

1·C + 4·G = 100

A "system" is overlapping constraints — solved at the intersection

You never plan against one limit. You have rack space and a budget, and the question is: what config makes both true at once? Geometrically, each equation is a line — every valid (C, G) combination along it — and the answer is where the lines cross: the one config that satisfies both.

Drag the rack capacity and the budget and watch the intersection — the valid config — slide around. Then flip "conflicting constraints" to see what happens when no config can satisfy both:

Simulation: capacity-constraint-explorer

The matrix is the coefficients, with the names stripped off

Here's the translation. Take the system:

1·C + 1·G = 40
1·C + 4·G = 100

A computer doesn't care that the variables are "CPUs" and "GPUs" — it only needs the multipliers. So it keeps just those, as a grid:

A = [[1, 1],
     [1, 4]]      b = [40, 100]

That A is the matrix — a of , nothing more. The English ("CPUs," "budget") lived in your head; the machine stores the numbers. That's the whole demystification: a matrix is a table of rules with the words removed.

Singular: when the rules can't all hold

What if two rules contradict? "Max 40 nodes" and "exactly 55 nodes" plot as parallel lines — same slope, never crossing. There's no config that satisfies both, so the has no solution. (The mirror case: two rules that are secretly the same — identical lines — have infinitely many solutions.) Either way the matrix is — there's no single answer. (Solving a system is basically dividing both sides by the matrix — called inverting it; a singular matrix is the divide-by-zero case, so the operation has no result. That "no result" is what a determinant of 0 signals.)

So how does ML actually use matrices?

Not like this. A neural network never solves Ax = b, never inverts a matrix, and won't throw a "singular matrix" error in normal training. Its matrices are the weights — learned numbers that transform one vector of activations into the next, applied by matmul (the neuron lesson is the real story). It learns them by gradient descent, not by solving.

So why learn this? Because reading a matrix as "a table of coefficients" is the same skill either way — whether those coefficients are constraints you solve (classical ML, optimization, linear solvers) or weights you multiply (deep learning). The grid of numbers stops being mysterious — and you can tell which world you're in: you'll meet the solve-a-system mode reading optimization-tool output or a classical-ML pipeline, while the transform-with-weights mode is what runs on the accelerators you provision.

Why this matters

  • A matrix is no longer abstract. It's a table of rules/numbers with the words stripped — you can read one without flinching, in any context it shows up.
  • You can spot impossible constraints. "Singular / conflicting" is the same shape as an over-constrained capacity plan — recognizing it saves you from chasing a solver bug that's really a contradiction in the requirements.
  • It separates two matrix worlds cleanly: solving systems (classical ML, optimization) vs transforming with weights (neural nets). Knowing which one you're looking at is half of not being confused by "the matrix."

Put it together

Steps
  1. Write the rules

    Take "the rack holds 32 nodes" and "the budget is $80k at $1k/CPU, $4k/GPU," write both as equations, and say what their intersection would tell you.

  2. Strip to a matrix

    Turn that system into a coefficient matrix A and a constants vector b. Say, in one sentence, what got thrown away in the translation.

  3. Break it

    In the sim, flip on conflicting constraints. Explain what "singular" means in plain capacity-planning terms — and then state how this differs from how a neural network uses a matrix.

Review

Flashcards1 / 3

What does the intersection of two constraint lines represent?

Check yourself

Quick exam1 / 3 · 0 correct

When you translate a system of equations into a matrix for a computer, what is kept?

Your notes on this lesson