Path
Algebra · Lesson 3
Functions as machines
A function is a reliable machine: each allowed input gets exactly one output. That single rule is how models, formulas, and graphs stay coherent.
Core ~27 minDeep study ~78 minWhat makes something a function?What is composition?
Before this: Equations as relationships
How this idea was born
People needed reliable rules long before they had the modern word "function." Convert temperature. Price by weight. Tax by bracket. Given this input, you want exactly one sensible output, every time, so the rule can be reused, shared, and chained with other rules.
Leonhard Euler wrote mathematics the way a generous teacher speaks: clearly, abundantly, and with notation that sticks. Popularizing the habit of writing something like f(x) was not vanity. It was a tool so relationships could be named, composed, and reused. MacTutor's biography is the safe door. The ethic: invent language that makes hard ideas handleable, then use it everywhere.
For a modern rereader, this chapter is where algebra stops being only about solving for an unknown and starts being about building machines. An equation asks "when is this true?" A function says "given this input, here is the output, every time." Functions add the promise of reliability.
First principles
A function from a set of inputs (the domain) to outputs assigns exactly one output to each allowed .
If one input could yield two different outputs, it is not a function. The vertical-line test on a graph encodes the same idea: a vertical line should meet the graph at most once if is a function of .
Domain matters. on the reals needs . A pricing formula may only accept nonnegative quantities. Specifying the domain is part of specifying the machine.
The range is the set of outputs actually produced as runs through the domain. Domain is "what you may feed in." Range is "what can come out."
Examples:
- (linear; domain often all reals unless context restricts)
- (each still has one square; many different can share an output)
- Piecewise rules (tax brackets) are still functions if each allowed input lands in exactly one piece
Algebrica's functions entry defines domain, range, and notation with clear diagrams. Use it when you want a second pass on vocabulary.
Worked intuition
Decisive maps
The vertical-line test is a cartoon of the definition: if a single tried to claim two values, the machine would be indecisive. Functions are decisive. That decisiveness is what lets you compose safely.
Function or not?
| Rule | Function? | Why |
|------|-----------|-----|
| | Yes | Each input has one square |
| "Square root of " on reals | Yes (if we mean the principal root ) | Convention picks one output |
| Circle as of | No | One can give two values |
| Table: , , | Yes | Each input appears once with one output |
Composition
: feed into , then feed that result into . Order usually matters. Converting units twice in a row is composition. So is "discount then tax" versus "tax then discount."
Composition worked example:
Let and .
Same inputs, different order, different machines.
Piecewise functions
Tax brackets are the classic piecewise machine:
Each allowed income falls in exactly one bracket, so is a function. The rule changes, but decisiveness does not.
Invertibility (when it exists)
Unit conversion is a function from Fahrenheit to Celsius. It is invertible here, so you can undo it. Squaring is a function on the reals, but it is not invertible on all reals without restricting the domain, because many inputs share an output.
Thinking "can I undo this?" is already advanced functional thinking, even before formal inverse notation.
To find an inverse, swap input and output roles and solve. If , then . The inverse machine runs backward. Check: compose forward then backward and you should return to where you started.
Evaluating and checking
If , then and . Evaluation is not solving. You are applying the machine, not asking when the output equals something.
If someone asks "solve ," you are finding inputs that produce output 10: , so . Function evaluation and equation solving meet at that question, but they start from different directions.
Quick check: For , does ? Substitute: . Yes. Evaluation is one substitution away from verification.
That habit (substitute, compare) is the same checking instinct from the equations chapter, now applied to machines.
Why this is the gateway to models
A formula is a function. A spreadsheet column computed from another is a function. A trained predictor is a function whose internal knobs we choose.
Euler's notation makes that reusable: name the machine, then apply it.
Common confusions
Confusing "many inputs, one output" with "not a function." sends both and to . That is fine. The ban is the opposite: one input must not fork into two outputs.
Thinking vertical lines are functions of . A vertical line has one and many values. It fails the definition as a function .
Ignoring domain. Writing without context hides whether you mean reals or complexes. In school algebra, assume reals unless told otherwise, and state restrictions.
Assuming composition is commutative. and are different machines in general. Try and .
Treating functions as only formulas. Tables, graphs, and algorithms can define functions. The essence is the unique-output rule, not the presence of an algebraic expression.
Confusing with . The parentheses mean "apply to ," not multiplication. Context matters, but in function notation, is almost always application.
Mixing up range and codomain. The codomain is the set you declare outputs live in. The range is what actually appears. For on the reals, the range is even if you casually say "outputs are real numbers."
Treating as . In general, . Try : but . Only special functions (linear ones) distribute over addition.
History and stories
Leonhard Euler (1707-1783) wrote mathematics the way a generous teacher speaks: clearly, abundantly, and with notation that sticks. MacTutor and standard histories credit him with popularizing notation. That was not vanity. It was language so relationships could be named, composed, and reused.
Before compact function notation, people described processes in words. Naming the machine lets you say "apply again" or "compose with " without re-explaining. Notation revolutions matter emotionally: they shrink the distance between having an idea and sharing it.
Do not treat "Euler invented functions" as a slogan. The concept of correspondence is older; the portable notation and Euler's prolific clarity helped make the modern habit stick.
Real world
- Temperature converters and currency converters: fixed rules, one input, one output.
- Pricing formulas and piecewise tax brackets: the rule may change by interval, but each input still lands in exactly one interval.
- Spreadsheet columns that depend on other columns:
=A2*1.08is a function of A2. - Physical laws written as style rules (force as a function of mass and acceleration, in context).
- GPS distance estimates: input two coordinates, output a distance via a formula (great-circle or flat-earth approximation).
Anywhere you plug in and trust a determined output, you are using a function, whether or not someone wrote .
Curiosity question: Is "tip = 18% of bill" a function of the bill amount? What is the domain in a real restaurant (negative bills? zero bill?)?
Checking a real-world function: If Celsius , verify that gives (freezing) and gives (boiling). The machine should match known anchor points.
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
- One allowed input, exactly one output.
- Composition builds complexity from simple maps.
- Domain is part of the definition.
- Check whether a rule is a function before you compose or invert it.
- Next: seeing functions as graphs in the plane.
Read more
Go deeper when curiosity hits - videos, essays, and primary trails.
- referenceMacTutor - Leonhard Euler
- video3Blue1Brown - Essence of calculus (functions and change)
- videoKhan Academy - What is a function?
- bookSteven Strogatz - The Joy of XPower Tools chapter: functions as transformers.
- articleAlgebrica - FunctionsDomain, range, and function language with diagrams.
Check your understanding
A short learning loop - try a few, learn from misses, mark complete when you have engaged. No timer, no scoreboard.
Try at least 3 core prompts, or choose I'll return later.