Synaplume

Foundations Refresher

Numbers, Symbols & Algebra

35 min

Why start here?

Every machine learning model — from a spam filter to ChatGPT — is, underneath everything, a mathematical function that turns numbers into other numbers. Before we can understand those functions, we need to be comfortable with the language they are written in: algebra.

Don't worry if school math feels far away. We rebuild everything from zero.

Variables: boxes with names

A variable is just a named box that holds a number. Instead of saying "some number", we write xx. This lets us describe rules that work for any number:

y=2x+1y = 2x + 1

Read it as: "take xx, double it, add one, call the result yy". If x=3x = 3, then y=7y = 7. If x=10x = 10, then y=21y = 21. One line of symbols describes infinitely many calculations — that is the entire superpower of algebra.

In machine learning you will constantly meet:

  • xx — an input (e.g. the size of a house)
  • yy — an output (e.g. its price)
  • ww and bbweights and bias, the numbers a model learns
  • y^\hat{y} — "y-hat", the model's prediction of yy

The most famous equation in machine learning is barely more complex than the one above:

y^=wx+b\hat{y} = wx + b

That is a complete machine learning model. Seriously. Learning means finding good values for ww and bb.

The rules of the game

Algebra has a small rulebook you already half-know:

  1. Order of operations — parentheses, then powers, then multiplication/division, then addition/subtraction.
  2. Balance — an equation stays true if you do the same thing to both sides. From 2x+1=72x + 1 = 7 you can subtract 1 from both sides (2x=62x = 6), then divide both by 2 (x=3x = 3).
  3. Distributiona(b+c)=ab+aca(b + c) = ab + ac.

Powers, roots and logarithms

  • Powers repeat multiplication: 23=222=82^3 = 2 \cdot 2 \cdot 2 = 8.
  • Roots undo powers: 9=3\sqrt{9} = 3 because 32=93^2 = 9.
  • Logarithms answer "what power do I need?": log28=3\log_2 8 = 3 because 23=82^3 = 8.

Logarithms appear everywhere in ML — in loss functions, in information theory, in probabilities — because they turn huge multiplications into manageable additions:

log(ab)=log(a)+log(b)\log(a \cdot b) = \log(a) + \log(b)

Sigma notation: loops in math

When a formula repeats over many items, mathematicians use Σ\Sigma (sigma) as a "for loop":

i=14i2=1+4+9+16=30\sum_{i=1}^{4} i^2 = 1 + 4 + 9 + 16 = 30

Read it as: "for ii from 1 to 4, add up i2i^2". If you can read a for loop, you can read sigma notation. You will see it in nearly every ML formula, e.g. "sum the error over all training examples".

Key takeaways

  • Variables let one formula describe infinitely many situations.
  • A machine learning model is a formula with adjustable numbers (parameters) like ww and bb.
  • Logs turn multiplication into addition; sigma notation is a for loop.

Check your understanding

0/3 answered
  1. 1.In the model y^=wx+b\hat{y} = wx + b, which values does training adjust?

  2. 2.What does i=13i2\sum_{i=1}^{3} i^2 equal?

  3. 3.Why do logarithms appear so often in ML?

Share:

0% of Mathematics for AI completed

Up nextFunctions & Graphs