Relations & Functions
The one rule that decides whether a relation is a function.
The explanation
A relation is any set of input-output pairs. A function is a relation with one restriction: each input has exactly one output.
An input cannot map to two different outputs. But two different inputs *may* share an output — that is perfectly fine.
{(1,3), (2,5), (1,7)} is not a function: the input 1 gives both 3 and 7.
{(1,3), (2,3), (4,3)} is a function: repeated outputs are allowed.
On a graph, use the vertical line test. If any vertical line crosses the graph twice, some input has two outputs, so it is not a function. A circle fails. A parabola passes.
A function from A to B assigns to each element of the domain exactly one element of the codomain. Existence and uniqueness of the output are both required.
The vertical line test is this definition read graphically: a vertical line is the set of points sharing one x, so two intersections mean one input with two outputs.
Asymmetry between inputs and outputs is deliberate. A function may be many-to-one but never one-to-many. Functions that are also one-to-one — where distinct inputs always give distinct outputs, detected by the horizontal line test — are precisely those with an inverse function, which is why that second test appears when inverses are introduced.
Real-world modelling uses the definition as a test of determinism: "cost as a function of weight" claims that a given weight determines exactly one cost. Where that fails, the relationship is a relation but not a function, and no formula f(x) can represent it.
Worked example
Is {(−2,4), (0,0), (2,4)} a function? Is x = y² a function of x?
- Check inputs of the first: −2, 0, 2 are all distinct, so each has one output.
- Repeated output 4 is allowed.
- For x = y², the input x = 4 gives y = 2 and y = −2.
Answer: The first is a function. x = y² is not (it fails the vertical line test).
Common mistakes
- Rejecting a function because two inputs share an output.
- Applying the horizontal line test when checking whether something is a function at all.