Function Definition and Mapping
Function Definition and Mapping
In mathematics, a relation is any set of ordered pairs, such as \\((x,y)\\). A function is a special kind of relation.
A relation is a function if each input is matched with exactly one output. The input is usually called the independent variable or the domain value, and the output is called the dependent variable or the range value.
This lesson will help you decide whether a relation is a function by using:
- the definition of a function,
- mapping diagrams, and
- the vertical line test.
These ideas are important because before graphing, composing, or inverting functions, you must first know whether the relation is actually a function.
1. The definition of a function
Suppose a relation contains ordered pairs like \\((1,4)\\), \\((2,7)\\), and \\((3,9)\\). To decide whether it is a function, look only at the first coordinate, the input.
If one input appears with two different outputs, then the relation is not a function.
For example, the relation
$$\{(1,4),(2,7),(3,9)\}$$
is a function because each input has one output.
But the relation
$$\{(1,4),(2,7),(2,8),(3,9)\}$$
is not a function because the input \\(2\\) is matched with both \\(7\\) and \\(8\\).
Notice something important: different inputs can share the same output. That is still a function.
For example,
$$\{(1,5),(2,5),(3,5)\}$$
is a function because each input still has exactly one output.
2. Domain and range in mapping
The domain is the set of all inputs. The range is the set of outputs that actually occur.
In a mapping diagram, domain values are usually written in one oval on the left, and range values are written in another oval on the right. Arrows show which input maps to which output.
For a relation to be a function in a mapping diagram:
- each domain value must have one arrow leaving it,
- no domain value can have two different arrows going to different outputs,
- it is allowed for different inputs to point to the same output.
So when you read a mapping diagram, focus on the arrows coming out of the inputs.
3. How mapping diagrams show functions
Imagine the domain is \\({1,2,3}\\) and the outputs are \\({4,5}\\). If the arrows are
$$1 \to 4, \quad 2 \to 5, \quad 3 \to 5$$
then the relation is a function. Each input has exactly one output.
But if the arrows are
$$1 \to 4, \quad 2 \to 5, \quad 2 \to 4, \quad 3 \to 5$$
then it is not a function, because input \\(2\\) has two outputs.
4. Graphs and the vertical line test
When a relation is shown on a graph, we use the vertical line test to decide whether it is a function.
The rule is simple:
- If any vertical line crosses the graph at more than one point, the relation is not a function.
- If every vertical line crosses the graph at at most one point, the relation is a function.
Why does this work? A vertical line has one fixed \\(x\\)-value. If it crosses the graph more than once, that means the same input \\(x\\) gives more than one output \\(y\\). That breaks the definition of a function.
5. Examples of graphs that are functions
The graph of a line like
$$y=2x+3$$
is a function. Every \\(x\\)-value gives exactly one \\(y\\)-value, so any vertical line meets the graph only once.
The graph of a parabola like
$$y=x^2$$
is also a function. Even though some horizontal lines cross it twice, vertical lines still cross it only once. So it passes the vertical line test.
6. Examples of graphs that are not functions
The relation
$$x=y^2$$
is not a function of \\(x\\). Its graph is a sideways parabola. For many values of \\(x\\), there are two possible \\(y\\)-values, one positive and one negative.
For example, if \\(x=4\\), then
$$4=y^2$$
so \\(y=2\\) or \\(y=-2\\). One input has two outputs, so it is not a function.
A circle also fails the vertical line test. For example,
$$x^2+y^2=9$$
is not a function because many vertical lines hit the circle twice.
7. Common mistakes to avoid
- Mistake 1: Thinking repeated outputs mean it is not a function. Repeated outputs are allowed. Repeated inputs with different outputs are not allowed.
- Mistake 2: Looking at arrows going into an output in a mapping diagram. The key is how many arrows leave each input.
- Mistake 3: Using the horizontal line test instead of the vertical line test. The horizontal line test is for checking whether a function is one-to-one, not for checking whether it is a function at all.
- Mistake 4: Assuming every equation is a function. Some equations represent relations that are not functions.
Worked Example 1: Ordered pairs
Determine whether the relation is a function:
$$\{(-1,2),(0,5),(1,2),(3,7)\}$$
Step 1: Look at the inputs: \\(-1,0,1,3\\).
Step 2: Check whether any input repeats with a different output.
No input repeats.
Conclusion: This relation is a function.
Notice that the output \\(2\\) appears twice, but that is allowed because it comes from two different inputs.
Worked Example 2: Mapping diagram
A mapping diagram shows:
$$2 \to 6, \quad 4 \to 8, \quad 6 \to 8, \quad 8 \to 10$$
Is this a function?
Step 1: Check each input in the domain: \\(2,4,6,8\\).
Step 2: Count the arrows leaving each input.
- \\(2\\) has one arrow to \\(6\\)
- \\(4\\) has one arrow to \\(8\\)
- \\(6\\) has one arrow to \\(8\\)
- \\(8\\) has one arrow to \\(10\\)
Each input has exactly one output.
Conclusion: The relation is a function.
Worked Example 3: Mapping diagram that is not a function
A mapping diagram shows:
$$1 \to 3, \quad 2 \to 4, \quad 2 \to 5, \quad 3 \to 6$$
Determine whether it is a function.
Step 1: Look at input \\(2\\).
Step 2: Input \\(2\\) points to both \\(4\\) and \\(5\\).
That means one input has two outputs.
Conclusion: The relation is not a function.
Worked Example 4: Vertical line test
Determine whether the graph of
$$x=(y-1)^2$$
represents a function of \\(x\\).
Step 1: Recognize the shape. This is a sideways parabola opening to the right.
Step 2: Think about a vertical line, such as \\(x=4\\).
Substitute into the equation:
$$4=(y-1)^2$$
So
$$y-1=2 \quad \text{or} \quad y-1=-2$$
which gives
$$y=3 \quad \text{or} \quad y=-1$$
The same \\(x\\)-value gives two different \\(y\\)-values.
Conclusion: The graph does not represent a function.
8. Quick checklist for deciding if a relation is a function
- If you have ordered pairs, check whether any input is paired with more than one output.
- If you have a mapping diagram, check whether any input has more than one arrow leaving it.
- If you have a graph, use the vertical line test.
- Remember: many-to-one is allowed, but one-to-many is not.
9. Why this matters in function theory
In later work, you will study inverse functions, compositions, and transformations. All of those ideas depend on knowing whether a relation is a function first.
For example, if a relation is not a function, then it cannot behave like a normal input-output rule. That makes it harder or impossible to compose it with other functions in the usual way.
So identifying functions correctly is a basic but very important skill.
Summary
A function is a relation where each input has exactly one output. In ordered pairs, this means no input can appear with two different outputs. In mapping diagrams, each input must have exactly one arrow leaving it. On graphs, a relation is a function if it passes the vertical line test, meaning no vertical line crosses the graph more than once.
Put what you read to the test
You've worked through Function Definition and Mapping. Try answering a few questions to see what stuck — and what might deserve a quick reread before you move on.