Definition of a Function
Definition of a Function
In math, we often look at relationships between two things. For example, the number of hours you practice basketball affects how much total practice time you have. The number of notebooks you buy affects the total cost. These relationships can be shown with tables, mapping diagrams, graphs, and equations.
One very important kind of relationship is called a function.
A function is a rule that matches each input with exactly one output.
You can also think of it this way:
- The input is the starting value.
- The output is the result.
- For it to be a function, one input cannot point to two different outputs.
Inputs are often called independent variables, and outputs are often called dependent variables.
The output is called dependent because it depends on the input.
For example, if the cost of one movie ticket is \(\$8\), then the total cost depends on how many tickets you buy.
If \(t\) is the number of tickets, then the total cost is
$$8t$$Each number of tickets gives exactly one total cost, so this relationship is a function.
Main Idea to Remember: A relation is a function if every input has exactly one output.
It is okay for different inputs to have the same output.
For example:
- Input \(1\) gives output \(5\)
- Input \(2\) gives output \(5\)
This is still a function because each input has only one output.
But if input \(3\) gives output \(4\) and output \(7\), then it is not a function.
That is because one input has more than one output.
Ways to Tell if a Relation Is a Function
You can check whether something is a function in several ways:
- Look at a set of ordered pairs
- Look at a table
- Look at a mapping diagram
- Look at a graph
1. Ordered Pairs
An ordered pair looks like \((x, y)\). The first number, \(x\), is the input. The second number, \(y\), is the output.
Example of a function:
$$\{(1,2), (2,4), (3,6)\}$$Each input appears once and has one output.
Example that is not a function:
$$\{(1,2), (1,5), (3,6)\}$$The input \(1\) has two different outputs: \(2\) and \(5\).
2. Tables
In a table, check whether any input value repeats with a different output.
If an input repeats but keeps the same output, it is still a function. But if the repeated input has different outputs, it is not a function.
3. Mapping Diagrams
A mapping diagram shows arrows from inputs to outputs.
It is a function if every input has exactly one arrow going out from it.
If one input has two arrows going to different outputs, it is not a function.
4. Graphs and the Vertical Line Test
When a relation is shown on a graph, we can use the vertical line test.
The vertical line test says:
- If any vertical line touches the graph in more than one point, the graph is not a function.
- If every vertical line touches the graph in only one point, the graph is a function.
Why does this work? A vertical line checks one input value, or one \(x\)-value. If that one \(x\)-value has more than one \(y\)-value, then one input has more than one output.
That breaks the definition of a function.
Worked Example 1: Ordered Pairs
Decide whether this relation is a function:
$$\{(2,5), (4,7), (6,9), (8,11)\}$$Step 1: Look at the inputs: \(2, 4, 6, 8\).
Step 2: Check whether any input repeats with a different output.
No input repeats.
Answer: Yes, this is a function.
Each input has exactly one output.
Worked Example 2: Table
Decide whether this table shows a function.
| Input | Output |
|---|---|
| 3 | 10 |
| 5 | 12 |
| 3 | 14 |
| 7 | 16 |
Step 1: Look at the inputs: \(3, 5, 3, 7\).
Step 2: Notice that the input \(3\) appears twice.
Step 3: Check the outputs for input \(3\). They are \(10\) and \(14\).
Because one input has two different outputs, this relation is not a function.
Answer: No, it is not a function.
Worked Example 3: Mapping Diagram
Suppose a mapping diagram shows:
- \(1 \to 4\)
- \(2 \to 4\)
- \(3 \to 7\)
Is this a function?
Step 1: Check each input.
- Input \(1\) goes to one output: \(4\)
- Input \(2\) goes to one output: \(4\)
- Input \(3\) goes to one output: \(7\)
Step 2: Notice that inputs \(1\) and \(2\) both go to \(4\).
That is okay. Different inputs can share the same output.
Answer: Yes, it is a function.
Worked Example 4: Vertical Line Test
Imagine a graph of a straight, slanted line like this:
$$y = 2x + 1$$Would this graph be a function?
Step 1: Picture any vertical line crossing the graph.
Step 2: A vertical line will hit the slanted line only once.
So each \(x\)-value has only one \(y\)-value.
Answer: Yes, the graph is a function.
Now imagine a circle graphed on the coordinate plane.
Some vertical lines would hit the circle twice: once on the top half and once on the bottom half.
That means one input would have two outputs.
So a circle is not a function.
Common Mistakes to Avoid
- Mistake 1: Thinking repeated outputs mean it is not a function. Repeated outputs are okay.
- Mistake 2: Forgetting to check whether an input repeats with different outputs.
- Mistake 3: On a graph, using a horizontal line test instead of a vertical line test. For this topic, use the vertical line test.
Quick Check
Decide if each relation is a function.
- $$\{(0,1), (1,3), (2,5)\}$$
- $$\{(4,2), (4,6), (7,8)\}$$
- Inputs \(2, 3, 4\) each have one arrow to outputs \(9, 9, 10\)
Answers:
- Yes, it is a function.
- No, it is not a function because input \(4\) has two outputs.
- Yes, it is a function because each input has exactly one output.
Summary
A function is a relationship where every input has exactly one output.
To decide if something is a function, check for repeated inputs with different outputs. In mapping diagrams, each input should have one arrow out. On graphs, use the vertical line test.
If you remember one rule, remember this: one input cannot have two different outputs.
Put what you read to the test
You've worked through Definition of a Function. Try answering a few questions to see what stuck — and what might deserve a quick reread before you move on.