Beautiful Math
Path

Foundations · Lesson 4

Variables and unknowns

A variable is a name for a quantity that is not fixed yet. Naming the unknown is how relationships become thinkable - in equations, in science, and in machine learning features and parameters.

Core ~28 minDeep study ~78 minWhat is a variable?How do you isolate an unknown?

Before this: What numbers are, Operations as transformations, Fractions and ratios

How this idea was born

Sometimes you know the relationship before you know the number. A missing beam length, an unpaid share of an estate, a pile of goods that must balance a price: the story is clear, the exact figure is not. Without a name for the missing piece, every new case is a fresh scramble of arithmetic.
In ninth-century Baghdad, Muḥammad ibn Mūsā al-Khwārizmī wrote Kitāb al-jabr wa-l-muqābala, a teachable method of restoring and balancing quantities so strangers could follow the steps. Large stretches of the work tackle practical word problems (including inheritance under complex legal rules). From al-jabr we get the word "algebra"; from his Latinized name, "algorithm." The ethic worth stealing is clarity as generosity: write so the next mind can stand on yours.
For a modern rereader, a variable is still a name for a quantity that can take different values, or whose value is not yet determined. Without names, every problem is a pile of specific arithmetic. With names, you write a pattern once. This chapter closes Foundations. Return here whenever a letter appears and you need to ask: is this an unknown to solve for, a general quantity, or a parameter we choose?

First principles

Name before you know

A=πr2A = \pi r^2
Here rr varies; the relationship does not. A variable is a labeled empty seat at the table of a relationship. Fill it with 33 today and 1010 tomorrow; the sentence 2x+12x+1 still means "double then add one."

Unknowns versus placeholders

Two closely related jobs:
  1. Unknown: find xx such that 2x+3=112x + 3 = 11.
  2. General quantity: for every real xx, x+0=xx + 0 = x.
A third job appears in modeling:
  1. Parameter: a named quantity we set or learn (ww in a model, cc in a dosing rule) while other letters play inputs.
Ask which job a letter is doing. Confusion here is the root of many "I don't get algebra" moments.

Equations as truth conditions

An equation claims two expressions name the same amount. Solving finds values that make the claim true.
2x+3=112x + 3 = 11
2x + 311
An equation is a balance: do the same invertible thing to both sides.
Undo transformations from the outside in:
  1. Subtract 33 from both sides: 2x=82x = 8.
  2. Divide by 22: x=4x = 4.
You preserved truth because you applied the same invertible operation to both sides. If two amounts are equal, transforming both by the same invertible map keeps them equal. That is balancing - the operations chapter, raised to a method.

al-Khwārizmī: restoration and balancing

His algebra text (Kitāb al-jabr wa-l-muqābala) teaches methods later summarized as:
  • al-jabr (restoration): repairing an equation by moving terms.
  • al-muqābala (balancing): canceling like terms on opposite sides.
He reduced problems to canonical forms with arithmetic and geometric reasoning. He did not yet have modern letter-algebra; symbolic letter algebra evolved later in Europe. The leap here is treating the unknown systematically and making the method teachable.
From al-jabr we inherit the word "algebra"; from his Latinized name, "algorithm." Diophantus and Indian algebraic traditions also matter historically; this lesson centers al-Khwārizmī because of al-jabr's conceptual clarity for beginners. MacTutor is the safe biography door.

Worked intuition

Example 1 - isolate carefully.
Solve 5x7=3x+95x - 7 = 3x + 9.
Subtract 3x3x: 2x7=92x - 7 = 9.
Add 77: 2x=162x = 16.
Divide by 22: x=8x = 8.
Each step is an invertible transformation applied to both sides.
Example 2 - name ahead of measurement.
"Let LL be the missing beam length. The known span is L+2.4L + 2.4 meters equals 7.17.1." You can rearrange before the tape measure arrives.
Example 3 - same pattern, many stories.
d=rtd = rt is one sentence for every constant-speed trip. Plug in different numbers; the relationship stays. That is the joy of naming.
Example 4 - when equations demand new numbers.
x2=1x^2 = -1 has no real solution. Historically and pedagogically, pressure like this pushes the number system to grow (complex numbers). You do not need the full theory yet. Feel the pressure: equations can force the toolkit to expand.
Example 5 - features and parameters.
A linear model y^=w1x1+w2x2+b\hat{y} = w_1 x_1 + w_2 x_2 + b names inputs xix_i, parameters wi,bw_i, b, and a prediction y^\hat{y}. Training searches for parameter values across many examples. Childhood "let xx be the unknown" becomes "let ww be what we learn."

Common confusions

  • "A letter always means find its number." Sometimes it means "for all," sometimes "parameter," sometimes "unknown." Label the job.
  • "Algebra is alphabet soup." Algebra begins as method: restore, balance, reduce. Letters are seats; the method is the craft.
  • "al-Khwārizmī invented the letter x." Do not mythologize that. Credit systematic treatment of unknowns and teachable procedures.
  • "Doing the same thing to both sides is a school rule." It is conservation of equality under invertible maps. Non-invertible moves (multiply both sides by zero) can destroy information.
  • "If I found one solution, I'm done." Some equations have none, one, or many. The equation is a truth condition; the solution set can be rich.

History and stories

Before algebra, every new number was a new story. With variables, one sentence covers a family of stories. A procedure you can hand to a stranger is an algorithm in embryo.

Real world

Engineers write F=maF = ma before a particular force is measured. Pharmacists write dose =cw= c \cdot w with weight ww variable. Budgeters write "let xx be monthly savings" and relate it to rent and income.
Naming is leverage: reason about structure while data is incomplete, then instantiate when measurements arrive.

Open when you want the machine-learning connection. Skip freely.

Field notes, extra examples, and glossary live here when you want more than the core path.

Carry this forward

  • Variables name quantities that vary or are unknown.
  • Equations assert equality; solving undoes operations symmetrically.
  • Algebra begins as method, not alphabet soup.
  • Foundations checkpoint complete - ahead: equations in depth, functions, graphs, then the road toward linear algebra and probability for AI/ML.

Read more

Go deeper when curiosity hits - videos, essays, and primary trails.

Check your understanding

A short learning loop - try a few, learn from misses, mark complete when you have engaged. No timer, no scoreboard.

1.A variable is…
2.al-Khwārizmī's methods connect because…
3.Joy of x celebrates…
4.In ML, x often names…
5.Why write 2(L+W) before measuring?

Try at least 3 core prompts, or choose I'll return later.