Before you can say what a function is, you need a word for the thing a function is a special case of. That word is relation, and its definition is refreshingly short: any set of ordered pairs at all.
The Definition
A relation is a set of ordered pairs. That is the whole thing. These are all relations:
There is no requirement that the pairs follow a pattern, that the inputs be evenly spaced, or that anything sensible happen at all. A relation just relates first coordinates to second coordinates.
The word “ordered” is doing real work.
Domain and Range
Two sets come out of any relation:
- The domain is the set of all first coordinates — every input that appears.
- The range is the set of all second coordinates — every output that appears.
For
Two conventions matter when you write these down. List each value once, because a set has no repeats: the relation
Domain and range get much more involved once relations are given by formulas rather than lists, and each has its own lesson.
Four Ways to Write the Same Relation
A relation can be presented in four ways, and part of the skill here is moving between them freely.
1. As a set of ordered pairs.
2. As a table.
| 1 | 2 | 3 | |
|---|---|---|---|
| 2 | 4 | 6 |
3. As a mapping diagram — the figure above, with an arrow from each input to its output.
4. As a graph — one plotted point per pair.
Each form makes something different obvious. The mapping diagram shows the pairing most directly, which is why it is the best tool for testing whether a relation is a function. The graph shows shape and trend. The table is easiest to extend. The set notation is the most compact.
Finite and Infinite Relations
The examples so far have been finite — a handful of pairs you can list. Relations can just as easily be infinite.
An equation like
This is why the graph of an equation matters. The graph is the relation, drawn.
Set-builder notation handles the infinite case:
When a Relation Is Not a Function
Because a relation has no rules, it is free to do something a function may not: pair a single input with two different outputs.
In
On a mapping diagram the failure is visible instantly: count the arrows leaving each left-hand element. On a graph you use the vertical line test instead.
The Inverse of a Relation
Swap the coordinates in every pair and you get the inverse relation, written
Two things happen when you do this. The domain and range trade places: the domain of
Note that the inverse of a function is not always a function. Reversing
Worked Example A: Domain and Range
Find the domain and range of
- Domain (first coordinates):
- Range (second coordinates):
The output
Worked Example B: Table to Pairs
Write this table as a set of ordered pairs and give its domain.
Pairs:
Worked Example C: Is It a Function?
Which of these are functions?
The first is a function — three inputs all sending to the same output is fine, because each input still has one output. The second is not: the input
Worked Example D: The Inverse
Find the inverse of
Swap each pair:
Its inputs are
Worked Example E: An Infinite Relation
Describe the relation
It contains every pair whose second coordinate is the square of the first:
Common Mistakes to Avoid
- Listing repeats in the domain or range. Sets do not repeat elements;
should be . - Swapping domain and range. Domain comes from the
-values, the first coordinates. - Thinking a repeated output breaks the function rule. It does not. Only a repeated input with different outputs does.
- Assuming every relation must have a formula. A random list of pairs is a relation with no rule at all.
- Forgetting that order matters.
and are different pairs. - Assuming the inverse of a function is a function. Often it is not.
Where Relations Lead Next
- Functions — relations with the one-output rule attached.
- Domain and range as full topics, once relations are given by formulas.
- Inverse functions, where the swap has to produce a function again — possible only for a one-to-one function.
- Graphs of equations. Every equation in
and defines a relation, and its graph is the picture of that relation. - Databases and data science, where a “relation” in the same sense is literally what a table of records is called.
Practice Problems
Work each one before opening the answer.
Problem 1. State the domain and range of
Show answer
Domain
Problem 2. State the domain and range of
Show answer
Domain
Problem 3. Is
Show answer
No. The input
Problem 4. Is
Show answer
Yes. Every input has exactly one output; sharing an output is allowed.
Problem 5. Write
Show answer
Problem 6. Find the inverse of
Show answer
Problem 7. The inverse of a relation is
Show answer
Swap back:
Problem 8. A relation has domain
Show answer
Problem 9. Give two ordered pairs belonging to
Show answer
Any pairs fitting the rule, for example
Problem 10. Is the inverse of
Show answer
The inverse is
Quick Reference
| Term | Meaning |
|---|---|
| Relation | Any set of ordered pairs |
| Domain | The set of all first coordinates |
| Range | The set of all second coordinates |
| Function | A relation where each input has exactly one output |
| Inverse | Every pair swapped; reflects across |
| Four representations | Pairs, table, mapping diagram, graph |
| Repeated outputs | Allowed, and still a function |
| Repeated inputs | Allowed for a relation, not for a function |
A relation with the one-output rule attached is a function, written using function notation. The two sets it produces get full treatment in Domain and Range, and the pairs themselves are covered in Ordered Pairs. More Algebra lessons are available.