Function Machine

Category: Functions   Level: 201

f(x) = 2x + 1: 3 → 7, 0 → 1, -2 → -3

A function is a machine with one rule. Each input goes in, the rule runs, and exactly one output comes out. The input and output pairs land on the graph.

Step through it

Watch it

Animated walkthrough

Step by step

Step 1: Meet the machine

A function is a machine with one fixed rule. This one doubles what goes in, then adds one. No moods, no surprises.

f(x) = 2x + 1

Step 1: Meet the machine

Step 2: Feed in 3

Drop 3 into the machine. It doubles 3 to get 6, adds one, and pushes out 7. Write the pair in the table and plot it.

f(3) = 2 · 3 + 1 = 7

Step 2: Feed in 3

Step 3: Feed in 0

Zero goes in. Double zero is still zero, plus one gives 1.

f(0) = 2 · 0 + 1 = 1

Step 3: Feed in 0

Step 4: Feed in a negative

The machine takes negatives too. Double −2 is −4, and −4 + 1 is −3.

f(-2) = 2 · (-2) + 1 = -3

Step 4: Feed in a negative

Step 5: Connect the pairs

Each input gives exactly one output, so each x gets one point. Every input you could feed in fills the line y = 2x + 1: that line is the graph of f.

graph of f: y = 2x + 1

Step 5: Connect the pairs

All steps at once

Storyboard

Generate it yourself

cd svg-generator
python3 -m svgmath render function-machine --out /tmp/function-machine

Source: svgmath/diagrams/function_basics.py