Relations and Mappings
Lesson: Relations and Mappings
In mathematics, we often want to describe how one quantity is connected to another. For example, the number of hours studied may be connected to test scores, or the side length of a square may be connected to its area. These connections are called relations and, in special cases, functions.
This lesson will help you understand what relations and mappings are, how to represent them using sets, tables, and graphs, and how to decide whether a relation is a function. A very important tool for graphs is the vertical line test.
1. What is a relation?
A relation is any set of ordered pairs. An ordered pair is written as \\( (x, y) \\), where the first value is the input and the second value is the output.
For example, the set
$$\{(1,2),(2,4),(3,6)\}$$
is a relation. It connects each first number to a second number.
You can think of a relation as a rule or connection between elements of two sets:
- the input values
- the output values
2. Domain and range
Every relation has a domain and a range.
- Domain: the set of all input values, or all first coordinates
- Range: the set of all output values, or all second coordinates
For the relation
$$\{(1,2),(2,4),(3,6)\}$$
the domain is
$$\{1,2,3\}$$
and the range is
$$\{2,4,6\}$$
If a value repeats, we only write it once in the set. Sets do not list duplicates.
3. What is a mapping?
A mapping shows how each input is paired with an output. It is often drawn using a mapping diagram, where values in one set have arrows pointing to values in another set.
For example, if the relation is
$$\{(1,3),(2,5),(4,5)\}$$
then the mapping is:
- \\(1 \to 3\\)
- \\(2 \to 5\\)
- \\(4 \to 5\\)
A mapping helps us see clearly which inputs are connected to which outputs.
4. Different ways to represent relations
Relations can be shown in several ways. You should be comfortable moving between these forms.
- Ordered pairs: \\( (x,y) \\)
- Tables: list inputs and outputs in rows or columns
- Mapping diagrams: arrows from domain to range
- Graphs: points drawn on the coordinate plane
All of these can describe the same relation.
5. What is a function?
A function is a special type of relation.
In a function, each input has exactly one output.
This means:
- an input can point to only one output
- different inputs can point to the same output
- but one input cannot point to two different outputs
So every function is a relation, but not every relation is a function.
For example,
$$\{(1,4),(2,5),(3,6)\}$$
is a function because each input appears only once.
But
$$\{(1,4),(1,5),(2,6)\}$$
is not a function because the input \\(1\\) has two outputs: \\(4\\) and \\(5\\).
6. How to tell if a relation is a function
There are different ways to check.
Using ordered pairs or a table:
Look at the input values. If any input is matched with more than one output, the relation is not a function.
Using a mapping diagram:
Check the arrows from each input. If one input has two arrows going to different outputs, it is not a function.
Using a graph:
Use the vertical line test.
7. The vertical line test
The vertical line test is used to decide if a graph represents a function.
Rule: If any vertical line crosses the graph at more than one point, then the graph is not a function.
This works because a vertical line represents one fixed input value \\(x\\). If that line hits the graph more than once, then the same input has more than one output.
For example:
- A straight line like \\(y = 2x + 1\\) passes the vertical line test, so it is a function.
- A circle like \\(x^2 + y^2 = 9\\) fails the vertical line test, so it is not a function.
For the circle, some \\(x\\)-values have two different \\(y\\)-values, one above the \\(x\\)-axis and one below it.
8. One-to-one, many-to-one, and one-to-many
Mappings can be described in different ways.
- One-to-one: each input has one unique output, and no outputs are shared
- Many-to-one: different inputs share the same output
- One-to-many: one input has more than one output
Only the first two can be functions. A one-to-many mapping is not a function.
Example of many-to-one:
$$\{(1,5),(2,5),(3,7)\}$$
This is a function because each input still has only one output.
Example of one-to-many:
$$\{(2,1),(2,4),(3,5)\}$$
This is not a function because input \\(2\\) has two outputs.
9. Worked Example 1: Find domain and range
Consider the relation
$$\{(-1,2),(0,3),(2,3),(4,7)\}$$
Step 1: Identify the domain.
The domain is the set of first coordinates:
$$\{-1,0,2,4\}$$
Step 2: Identify the range.
The range is the set of second coordinates:
$$\{2,3,7\}$$
Notice that \\(3\\) appears twice in the ordered pairs, but it is written only once in the range.
Answer:
- Domain: \\(\{-1,0,2,4\}\\)
- Range: \\(\{2,3,7\}\\)
10. Worked Example 2: Decide whether a relation is a function
Determine whether
$$\{(1,2),(2,4),(3,6),(2,5)\}$$
is a function.
Step 1: Look at the inputs.
The inputs are \\(1, 2, 3, 2\\).
Step 2: Check whether any input has more than one output.
The input \\(2\\) is paired with \\(4\\) and also with \\(5\\).
Conclusion: This relation is not a function.
Reason: One input has two different outputs.
11. Worked Example 3: Read a mapping diagram
Suppose a mapping diagram shows:
- \\( -2 \to 1 \\)
- \\( 0 \to 1 \\)
- \\( 3 \to 4 \\)
a) Write the relation as ordered pairs.
The relation is
$$\{(-2,1),(0,1),(3,4)\}$$
b) Is it a function?
Yes. Each input has exactly one output.
c) Is it many-to-one?
Yes. The inputs \\(-2\\) and \\(0\\) both map to \\(1\\).
12. Worked Example 4: Use the vertical line test
We compare two graphs.
Graph A: a parabola opening upward, such as
$$y = x^2$$
Any vertical line crosses this graph at only one point.
So Graph A is a function.
Graph B: a circle, such as
$$x^2 + y^2 = 4$$
A vertical line through \\(x=1\\) crosses the circle at two points.
So Graph B is not a function.
13. Important ideas to remember
- A relation is any set of ordered pairs.
- A function is a relation where each input has exactly one output.
- The domain is the set of inputs.
- The range is the set of outputs.
- Repeated outputs are allowed in a function.
- Repeated inputs are allowed only if they always give the same output.
- On a graph, use the vertical line test to decide whether the relation is a function.
14. Common mistakes
- Mistake 1: Thinking that different inputs cannot have the same output. They can. That can still be a function.
- Mistake 2: Looking at repeated outputs instead of repeated inputs when checking for a function.
- Mistake 3: Forgetting that the vertical line test applies to graphs, not tables or lists.
- Mistake 4: Writing repeated values more than once in the domain or range when using set notation.
15. Brief summary
Relations and mappings describe connections between inputs and outputs. A function is a special relation in which every input has exactly one output. You can represent relations using ordered pairs, tables, mappings, and graphs, and you can use the vertical line test to decide from a graph whether a relation is a function.
Put what you read to the test
You've worked through Relations and Mappings. Try answering a few questions to see what stuck — and what might deserve a quick reread before you move on.