Functions: Inputs, Outputs, and Graphs
How can one mathematical rule connect input values to outputs, tables, and graphs?
How this lesson unfolds.
Begin with What turns a mathematical relation into a deterministic 'function machine'? The sequence then connects One input, one output and builds toward Domain and range.
What turns a mathematical relation into a deterministic 'function machine'?
A function operates like a deterministic machine: drop a single input into the hopper, and the machine executes an invariant rule to produce exactly one output.
- $$f: X \to Y, \quad x \mapsto f(x) = 2x + 1$$
- Learning goalModel deterministic input-output relationships using formal mathematical function notation.
- Helpful foundationsVariables · Expressions · Mapping Concept · Introduction to Mathematical Thinking (Keith Devlin, Stanford) · Essence of Linear Algebra (3Blue1Brown)
- Common trapExpecting function rules to vary dynamically; mapping rules remain strictly invariant.
- Next connectionDefining the critical single-valued property: exactly one output per allowed input.
More context & mechanics
A function is an automated mathematical process: feed it an input x, and it runs a fixed rule to produce output f(x). For f(x) = 2x + 1:
- Input 1 produces 2(1) + 1 = 3.
- Input 2 produces 2(2) + 1 = 5.
- Input 5 produces 2(5) + 1 = 11.
Inputs change, but the processing rule is universal and immutable.
In Functional Programming (e.g. Haskell, React pure components, Python lambdas), pure functions guarantee deterministic behavior with no side effects: identical inputs always return identical outputs.
Gottfried Wilhelm Leibniz coined the word "function" in 1673 to denote quantities that depend on a variable curve, later formalized into mapping notation by Peter Gustav Lejeune Dirichlet in 1837.
Mnemonic: "One Rule to Rule All Inputs."
Feed x in, apply the rule, get f(x) out.
Why does a relationship fail to be a function if a single input produces multiple outputs?
A function can never be indecisive; while multiple distinct inputs might yield the same output (like squaring -3 and 3), no single input can ever split into two different outputs.
- $$\forall x \in X, \, \exists! y \in Y \text{ such that } y = f(x)$$
- Learning goalTest whether a mathematical relationship satisfies the single-valued definition of a function.
- Helpful foundationsFunction Concept · Relations · Ordered Pairs · Introduction to Mathematical Thinking (Keith Devlin, Stanford) · Essence of Linear Algebra (3Blue1Brown)
- Common trapAssuming distinct inputs cannot share outputs; many-to-one is valid, but one-to-many is forbidden.
- Next connectionTabulating input-output evaluations into a structured function table.
More context & mechanics
The single most vital rule of functions is determinism: every allowed input must map to exactly one output.
- Two different people can share the same birthday (two inputs → one output: Valid function).
- But one person cannot have two different birthdays (one input → two outputs: Invalid relation).
If input 2 tries to output both 4 and 7, it is a multi-valued relation, not a function.
In Cryptographic Hash Functions (like SHA-256), determinism is non-negotiable: hashing the exact same digital document must always produce the exact same 256-bit hash digest.
Peter Gustav Lejeune Dirichlet in 1837 gave modern mathematics its definitive definition of a function as an arbitrary correspondence that pairs each input with a unique output.
Rule: "Inputs are faithful; Outputs can be shared."
An input never cheats with two outputs!
How does an infinite function rule translate into a discrete, verifiable input-output table?
A function table turns an abstract algebraic recipe into an empirical ledger of coordinate pairs, making numerical trends immediately apparent.
- $$T = \{(x, f(x)) \mid x \in \{-2, 0, 1, 3\}\} = \{(-2, -3), (0, 1), (1, 3), (3, 7)\}$$
- Learning goalEvaluate function rules across test inputs to construct ordered-pair tables.
- Helpful foundationsFunction Evaluation · Ordered Pairs · Arithmetic Substitution · Introduction to Mathematical Thinking (Keith Devlin, Stanford) · Essence of Linear Algebra (3Blue1Brown)
- Common trapEquating the table with the function; tables only sample continuous underlying rules.
- Next connectionPlotting ordered pairs as geometric points on a Cartesian coordinate plane.
More context & mechanics
An algebraic rule like f(x) = 2x + 1 applies to infinitely many numbers. A table captures concrete snapshots of this relationship by picking test inputs and computing their outputs:
- x = -2 ⟹ f(-2) = -3 → (-2, -3)
- x = 0 ⟹ f(0) = 1 → (0, 1)
- x = 1 ⟹ f(1) = 3 → (1, 3)
- x = 3 ⟹ f(3) = 7 → (3, 7)
The table organizes pairs into structured rows, bridging abstract formulas to geometric coordinates.
In Lookup Tables (LUTs) in Game Engines and DSP Audio Plugins, expensive trigonometric or color-grading calculations are precomputed into tables for microsecond retrieval during rendering.
Astronomers like Ptolemy (2nd century CE) compiled the earliest chord tables, and Henry Briggs in 1617 published logarithm tables, demonstrating the power of tabular evaluation centuries before modern computers.
Mnemonic: "Rule is the Recipe; Table is the Sample Plate."
Pairs (x, y) are the ingredients and finished dish.
How does the Vertical Line Test geometrically enforce the 'one output per input' rule on a graph?
The vertical line test translates algebraic determinism into geometry: if any vertical line touches the graph twice, the relation fails to be a single-valued function.
- $$G_f = \{(x, y) \in \mathbb{R}^2 \mid y = f(x), \, x \in \text{dom}(f)\}$$
- Learning goalPlot ordered pairs and apply the Vertical Line Test to verify functions.
- Helpful foundationsCartesian Plane · Function Table · Coordinate Geometry
- Common trapConfusing vertical line testing for functions with horizontal line testing for invertibility.
- Next connectionDetermining allowable input boundaries (domain) and reachable output horizons (range).
More context & mechanics
When you plot all ordered pairs (x, f(x)) on coordinate axes, the function becomes a visible curve.
How do you verify visually that a curve is a true function?
Drop a vertical line anywhere through the graph. Because a vertical line represents a single fixed input x=x₀, it must intersect the curve at at most one point. If it hits twice, that single input has two outputs—disqualifying it as a function (like a complete circle).
In Computer Aided Design (CAD) and Bezier Curve Rendering in Vector Fonts, curves that loop back on themselves cannot be represented as simple functions y = f(x), requiring parametric representations (x(t), y(t)).
René Descartes unified algebra and geometry in 1637, demonstrating that algebraic equations could be experienced as geometric shapes in the Cartesian plane.
Visual Test: "Vertical Line = Single Hit."
If a vertical line slices twice, it's not a function!
What happens when a function encounters an illegal input, and how do domain and range define valid operational boundaries?
The domain defines the allowable universe of inputs where the function makes sense, while the range captures the exact landscape of outputs it actually reaches.
- $$g(x) = \sqrt{x}: \quad \text{dom}(g) = [0, \infty), \quad \text{ran}(g) = [0, \infty) \subset \mathbb{R}$$
- Learning goalDetermine domain restrictions and deduce the resulting output range of real-valued functions.
- Helpful foundationsReal Number Line · Radicals / Fractions · Function Mapping
- Common traptarget codomain is not range—the range contains only actually achieved output values.
- Next connectionConnecting functions and mappings to structural theorems across analysis and calculus.
More context & mechanics
Functions cannot always accept every real number. For g(x) = √(x), negative inputs have no real square root, so the domain is restricted to non-negative reals [0, ∞).
Similarly, the principal square root never yields negative numbers, so the range (actual reachable outputs) is also [0, ∞).
- Domain: Permitted inputs (what can go in).
- Range: Achieved outputs (what can come out).
In Safe Software Engineering and Type Systems (Rust, TypeScript), domain validation prevents runtime fatal errors like division-by-zero or array index out-of-bounds crashes through input validation contracts.
Richard Dedekind and Georg Cantor in the late 19th century formalized the notions of domain and range, ensuring mathematical functions had rigorous set-theoretic boundaries.
Boundary Hook: "Domain is the In-Door; Range is the Out-Door."
Domain = Allowed inputs. Range = Possible outputs.