Lesson 1 of 8 · 15 min
Relations and functions
Describe a relation as a mapping, a set of ordered pairs, a graph or a rule, and use the vertical line test to decide whether it is a function.
What you will be able to do
- Describe a relation as a mapping between sets, a set of ordered pairs, a graph or a rule.
- Classify a relation as one-to-one, many-to-one, one-to-many or many-to-many.
- Decide whether a relation is a function from its ordered pairs, its graph (the vertical line test) or its rule.
Type B4 into a vending machine and you expect the same drink every time. If B4 sometimes gave you water and sometimes juice, you couldn't rely on it. That reliability — one input, exactly one output — is the idea behind a function.
You have been working with relationships between quantities for years: the cost of tickets, the area of a circle of radius , the line . Mathematics calls any such pairing of inputs with outputs a relation.
Definition
Relation
A relation is a set of ordered pairs : each pair links an input to an output . You can show a relation as
- a mapping from a set of inputs to a set of outputs,
- a list or table of ordered pairs,
- a graph — the points on the Cartesian plane, or
- a rule or formula that gives one variable in terms of another, such as or .
The relation as a mapping. Each arrow goes from an input to its output; the rule is .
The same relation can be written as the ordered pairs , drawn as three points on a graph, or given by the rule for . Each representation shows something different: the mapping shows which inputs share outputs, the graph shows the shape, and the rule lets you calculate.
Relations are sorted by how inputs and outputs are matched up.
| Type | What happens | Example | Function? |
|---|---|---|---|
| One-to-one | Each input has one output, and no output is shared | Yes | |
| Many-to-one | Each input has one output, but different inputs can share an output | Yes | |
| One-to-many | Some input has two or more outputs | No | |
| Many-to-many | Outputs are shared and some input has several outputs | No |
Key idea
Function
A function is a relation in which every input is paired with exactly one output.
One-to-one and many-to-one relations are functions. One-to-many and many-to-many relations are not.
Is the relation a function?
On a graph, all the points with the same -value lie on one vertical line. So if some vertical line crosses a graph twice, that -value has two -values — and the graph is not a function.
The vertical line meets the circle twice, so the input has two outputs. The circle is not a function.
Key idea
The vertical line test
A graph represents a function exactly when no vertical line meets it more than once.
Imagine sliding a vertical ruler across the graph from left to right. If it ever touches the graph at two or more points at once, the relation is not a function.
The graph of is shown. The dashed horizontal line meets it three times. Does the graph represent a function?
You can also test a rule without drawing it. Choose an -value and work out how many -values it produces.
- : any gives a single value of . Function.
- : gives , so or . Not a function.
- (a vertical line): the input has infinitely many outputs. Not a function.
- (a horizontal line): every input has the single output . Function.
An equation with in it is a warning sign: solving it usually gives a .
Worked example
Decide whether each relation is a function
Decide whether each relation is a function. Justify each answer.
(a) (b) (c)
Step 1: Test (a): count the outputs for one input
For any , squaring it and subtracting gives exactly one number. Every input has exactly one output.
A rule that builds y from x using ordinary arithmetic gives one output for each input.
Step 2: Test (b): substitute a value of
When : , so and or . The input has two outputs.
One counterexample is enough to show that a relation is not a function.
Step 3: Test (c): substitute a value of
When : , so and or . Again, one input has two outputs.
Step 4: Confirm with the vertical line test
(a) is a parabola, and every vertical line meets it once. (b) is the circle with centre and radius , and (c) is a sideways parabola; the vertical line meets each of them twice.
Try it yourself first, then check the working one step at a time.
Answer
(a) is a function. (b) and (c) are not functions: in each, the input gives two -values.
Method
Choose an -value and solve for .
If one -value gives two -values, it is not a function — quote that counterexample.
If every -value gives exactly one -value, it is a function.
Check with the vertical line test if you can picture the graph.
Watch out for
Choosing in (b): it gives only , which proves nothing. Choose a value strictly inside the circle.
Rejecting (a) because and give the same . Shared outputs are allowed.
Common mistake
Many-to-one is still a function
Students often reject because and both give . That is two inputs sharing an output, which is fine. The definition only forbids one input with two outputs.
The same mix-up happens with graphs: a horizontal line crossing a graph twice does not stop it being a function.
How would you classify the relation ?
Exam tip
Justify with a counterexample
When a question asks you to show or justify that a relation is not a function, one specific counterexample is the clearest proof: "When , or , so one input has two outputs." Naming the vertical line test is good, but say which vertical line fails.
Summary
A relation is a set of ordered pairs. It can be shown as a mapping, a list or table, a graph or a rule.
A function is a relation where every input has exactly one output.
One-to-one and many-to-one relations are functions; one-to-many and many-to-many relations are not.
Vertical line test: a graph is a function exactly when no vertical line meets it more than once.
To test a rule, substitute an -value: if you get two -values (a ), it is not a function.
To justify "not a function", give one -value and its two -values.
Finished the lesson?
Try the 3 quick checks above and the lesson completes itself, or mark it complete now.