🧮 Algebra

🦾Variables & the Function Machine

Letters that stand in for numbers, and a machine that processes them — the gate to algebra.

There is a mysterious machine on the desk: feed it 3, it hands back 7; feed it 5, it hands back 11. What rule is hiding inside? To crack the case you need two tools: letters that stand in for numbers, and functions that process them.

Letters stand in for numbers

Multiplication has an old rule: swap the two numbers and the result stays the same. Written with real numbers, 3×5=5×33 \times 5 = 5 \times 3 describes exactly one pair. Written with letters:

a×b=b×aa \times b = b \times a

One short line now covers every pair of numbers in the world. A letter that can hold any number like this is called a variable — an empty seat that any number may take.

Letters also change how multiplication is written: 3x3x is shorthand for 3×x3 \times x, with the times sign left out.

Common trap

3x3x means 3×x3 \times x, not 3+x3 + x. If x=4x = 4, then 3x=123x = 12, not 7.

A function is a number machine

Drop a number into the machine, it applies a fixed rule, and a new number comes out. That is a function. Meet the machine whose rule is "double it, then add 1":

  • in 3: 3×2+1=73 \times 2 + 1 = 7
  • in 5: 5×2+1=115 \times 2 + 1 = 11

Mathematicians record the whole machine in one line:

f(x)=2x+1f(x) = 2x + 1

Read it as "f of x equals 2x plus 1": ff names the rule, xx is the input waiting to go in, and f(x)f(x) is the output that comes out.

Substitution: give the variable a job

Pick a value for xx and push it through the rule — that is called evaluating. Take f(x)=3x+1f(x) = 3x + 1:

  • If x=4x = 4: f(4)=3×4+1=13f(4) = 3 \times 4 + 1 = 13
  • If x=10x = 10: f(10)=3×10+1=31f(10) = 3 \times 10 + 1 = 31

Multiply first, then add. And notice the real payoff: the formula was written once, yet it handles every input. That is the whole point of variables — one rule covers every case.

The Guess-the-Rule Machine

The machine below is hiding a rule. Feed it inputs, watch the outputs, and hunt for the pattern until you can name f(x)f(x). Pulling one rule out of a pile of examples is exactly what algebra does all day.

InteractiveGuess-the-Rule Machine

A secret rule hides inside the machine. Feed it numbers and guess the rule!

? ? ?

Output

Check yourself

Quick quiz

  1. 1. If f(x) = 2x + 3, what is f(5)?

  2. 2. What does 3x mean?

  3. 3. A machine turns 2 into 6 and 5 into 15. What is its rule?