Free sample lesson · Matrix Math for AI
Algebra Refresh
Remember solving for x, and why does AI still care?
Lesson 1 of the Wondering course Matrix Math for AI
Solving for x, Again
Remember solving for $$x$$? That small skill sits underneath much of the math behind AI.
A variable stands for an unknown value. An equation connects that unknown to values you already know.
You find the unknown with inverse operations, applied equally to both sides.
AI models use the same idea to work out unknown weights. Matrices let them do it for many unknowns at once.
- Variable: Stands for an unknown value.
- Equation: Connects the unknown to known values.
- Inverse operations: Applied equally to both sides.
- AI weights: Unknowns that AI models work out.
- Matrices: Handle many unknowns at once.
This lesson refreshes those habits so later matrix ideas feel familiar.
The Parts of an Equation
Take $$3x + 20 = 50$$. Each piece has a name worth knowing.
The variable $$x$$ is a symbol for an unknown or changing value.
The coefficient 3 multiplies the variable. The constant 20 is a fixed number added on.
These three sit on the left side. The right side is 50, and the equals sign says both sides have the same value.
- 3x + 20 = 50: Both sides have the same value.
- Left side: Holds the unknown.
- Variable: x: The unknown or changing value.
- Coefficient: 3: Multiplies the variable.
- Constant: 20: A fixed number added on.
- Right side: 50: The known total.
That shared value is what makes it an equation.
Keep the Scale Balanced
Picture an equation as a balance scale. The left side and the right side weigh the same.

Notice the beam stays level only when both pans carry equal weight, just as both sides of an equation must stay equal.
If you take 20 off one side only, the scale tips. The equation is no longer true.
So the rule is simple: whatever you do to one side, do to the other.
That keeps the equation balanced while you move step by step toward the answer.
Undo It With the Opposite
To isolate the variable, you peel away everything around it.
Each step uses an inverse operation, the opposite of what was done to $$x$$.
Addition is undone by subtraction. Multiplication is undone by division.
- Undo addition
- Undo multiplication
In $$3x + 20 = 50$$, you remove the added 20 first, then the 3 that multiplies $$x$$.
A common slip: dividing the left side by 3 and forgetting the right side.
Worked Case: The Server Bill
Imagine an IT analyst checking a monthly invoice. The pricing model is cost = 3 × (number of servers) + 20, with cost in hundreds of dollars.
This month's bill comes to 50. How many servers were billed?
Let $$x$$ be the unknown number of servers. The equation becomes $$3x + 20 = 50$$.
Two inverse steps solve it, and one check confirms it.
- Set up: Write 3x + 20 = 50, with x as the number of servers.
- Subtract 20: Subtracting 20 from both sides gives 3x = 30.
- Divide by 3: Dividing both sides by 3 gives x = 10.
- Check: 3 × 10 + 20 = 50, so the bill matches 10 servers.
Always Plug It Back In
Solving is only half the job. Checking is the other half.
Put your value back into the original equation. For the analyst, $$3 \times 10 + 20 = 50$$. Both sides match, so 10 servers is right.
If the sides do not match, something went wrong. Go back through your steps.
- Solve for x
- Substitute into original: Put your value back into the starting equation.
- Both sides equal?
- Accept the answer
- Recheck your steps: Look for the step that went wrong.
- Yes
- No
- Try again
This habit takes seconds and catches mistakes before an invoice gets approved.
AI Uses the Same Form
You likely know the line equation $$y = mx + b$$. A simple AI model has the same shape.
It is written as output = weight × input + bias.
The weight plays the role of the coefficient $$m$$. The bias plays the role of the constant $$b$$.
Notice the server model fits too: 3 acts like a weight and 20 acts like a bias.
Training Flips the Question
In the server case, you knew the rule and solved for the input.
Training an AI model works the other way. The inputs and outputs are observed data. The weights and biases are the unknowns.
Training means finding the weights and biases that make the equations fit that data.
The core move stays the same: an unknown, an equation, and steps to pin it down.
Matrices Handle the Scale
One equation with one unknown is easy by hand.
Real AI systems handle thousands or millions of these equations at once, each with its own weights.
Matrices are the tool that organizes all those variables and equations so a computer can solve them efficiently.
Your foundation: variables, coefficients, constants, and keeping equations balanced. Get comfortable with those, and every later matrix idea gets easier.
- Matrices: Organize all the variables and equations for a computer.
- Many equations at once: Thousands or millions, each with its own weights.
- Variables and balance: Variables, coefficients, constants, and balanced equations.
Each level rests on the one below.
Check yourself
To isolate x in an equation such as 5x + 4 = 29, you apply each inverse operation to _____
- both sides of the equation.
- only the side that contains x.
Answer: both sides of the equation.
An equation says two sides are equal. Doing the same operation to both sides keeps them equal, so the equation stays balanced. Changing only one side breaks that equality and gives a wrong answer.
Place the algebraic components into their correct positions in the breakdown of the equation.
Answer: Coefficient: 3, Variable: x, Constant: 20
In the expression 3x + 20, 3 is the coefficient multiplying the variable x, and 20 is the standalone constant.
When solving an equation, you undo addition with _____ and undo multiplication with _____.
Answer: When solving an equation, you undo addition with subtraction and undo multiplication with division.
Each operation has an inverse that cancels it. Subtraction cancels addition, and division cancels multiplication. That is how you peel away numbers to leave the variable alone.
Keep going
This is lesson 1 of 30 in Matrix Math for AI. Next up:
- Summation Notation
- Coordinates & Graphs
- What Vectors Are
- Vector Arithmetic
- Length & Distance
Wondering turns any topic into short lessons you can read, watch, or listen to, with practice questions and an AI tutor.