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.
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
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
Zero goes in. Double zero is still zero, plus one gives 1.
f(0) = 2 · 0 + 1 = 1
The machine takes negatives too. Double −2 is −4, and −4 + 1 is −3.
f(-2) = 2 · (-2) + 1 = -3
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
cd svg-generator python3 -m svgmath render function-machine --out /tmp/function-machine
Source: svgmath/diagrams/function_basics.py