Lesson 4.1 · Introduction to Functions
Relations and functions
A vending machine is dependable: press B4 and you get the same snack every time. A machine that sometimes gave you chips and sometimes gave you a granola bar for the same button would be useless. Functions are the math version of a dependable machine, and they are the main idea of the rest of Algebra 1.
Relations: pairing inputs with outputs
Any time you pair one quantity with another, you have a relation.
Definition
Relation
A relation is any set of ordered pairs . The first number of each pair is the input and the second is the output. The set of all inputs is the domain, and the set of all outputs is the range.
You can show the same relation in several ways. Here is one relation written three ways.
As a set of ordered pairs:
As a table:
| input | ||||
|---|---|---|---|---|
| output |
As a mapping diagram: list the inputs in one column, the outputs in another, and draw an arrow from each input to its output. Here the arrows go , , and .
The domain is and the range is . Notice that appears twice as an output, but you only list it once in the range.
Functions: exactly one output per input
Definition
Function
A function is a relation in which each input has exactly one output. Different inputs are allowed to share an output, but one input is never paired with two different outputs.
The relation above is a function. Every input goes to one place. It doesn't matter that both and go to ; two buttons on a vending machine can hold the same snack.
Now look at . The input is paired with both and , so this relation is not a function. If someone asked "what goes with ?", there would be no single answer.
How to test a relation
Look for a repeated input. If some input appears with two different outputs, the relation is not a function. Repeated outputs are fine.
Common mistake
The most common mistake is checking the wrong column. is a function: the outputs repeat, but each input has only one output. The pair appearing twice would also be fine, since it's the same output both times.
Worked example: Is it a function?
Decide whether each relation is a function.
- The relation that pairs each person with their date of birth.
- The relation that pairs each date of birth with a person born on that date.
Solutions.
- The inputs are all different. Function. (The shared output doesn't matter.)
- The input has two outputs, and . Not a function.
- Each person has exactly one birth date. Function.
- Many people share a birthday, so one date can be paired with several people. Not a function.
The vertical line test
On a graph, each point is an input paired with an output . Points directly above and below each other share the same but have different -values. That gives a quick visual test.
Vertical line test
A graph represents a function if and only if no vertical line crosses the graph more than once.
The parabola below is a function. Any vertical line you draw, like the dashed line , crosses it exactly once.
The sideways parabola below is not a function. The dashed line crosses it twice, at and , so the input has two outputs.
Worked example: Using the vertical line test
Which of these graphs are functions: a line , a circle , and a V-shape ?
- The line is a function. Any vertical line crosses it once (a non-vertical line never doubles back).
- The circle is not a function. The vertical line crosses it at and .
- The V-shape is a function. Although the graph has two branches, they are side by side, never one above the other.
Tip
Only a vertical line counts. A horizontal line crossing a graph twice just means two inputs share an output, which is allowed. The V-shape is crossed twice by the line , and it is still a function.
Functions in the real world
Many everyday rules are functions because the output is determined by the input. The cost of gas is a function of the number of gallons: pump gallons and the price is fixed. The area of a square is a function of its side length. Your grade on a test is a function of which answers you got right.
A quick way to check a real-world relation is to ask: if I know the input, do I know the output for sure? If the answer is yes, it's a function. Knowing someone's height doesn't tell you their exact age, so "height to age" is not a function. But at a given moment, each person has one height, so "person to height" is.
Practice
Which relation is a function?
The relation is a function. Which value cannot be ?
List the range of the relation .
Separate answers with commas, e.g. 2, -5
Which relation is not a function?
Which equation's graph fails the vertical line test?
The graph of is a sideways parabola. List all the outputs that are paired with the input .
Separate answers with commas, e.g. 2, -5
How many of these relations are functions?
- The circle
- The line
Enter a number. Fractions like 3/4 and sqrt(2) are OK.