Lesson 4.1 · Functions
What is a function?
Press B4 on a vending machine and you get pretzels. Press B4 again tomorrow and you get pretzels again. You never press one button and get two different snacks. A function works the same way: you put in an input, and you get back exactly one output.
Inputs and outputs
A function is often given as a rule. Here is one: "multiply the input by 2, then add 1." Feed it some inputs and record what comes out.
| input, | 0 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|---|
| output, | 1 | 3 | 5 | 7 | 9 |
You can also write the rule as an equation, , or as a list of ordered pairs (input, output):
Every input goes in and one definite output comes out. That is the whole idea.
Definition
Function
A function is a rule that assigns to each input exactly one output. We often call the input and the output , and write the pairs as ordered pairs .
Checking a table or a list of pairs
Sometimes you are handed a table with no rule at all. To decide whether it is a function, look at the inputs.
How to spot a function
- If some input appears twice with different outputs, it is not a function.
- If every input has just one output, it is a function.
- Different inputs sharing the same output is fine.
Worked example: Pairs of numbers
Which of these sets of ordered pairs is a function?
- Set A:
- Set B:
Set A is a function. The inputs 1, 2, 3 and 6 each appear once. The output 4 shows up twice (for inputs 1 and 3), but that's allowed. Two buttons on a vending machine can both give pretzels.
Set B is not a function. The input 2 is paired with 1 and with 8. One input, two outputs.
Common mistake
Repeated outputs do not break a function. Only a repeated input with a different output does. Always look down the input column for repeats.
Functions on a graph
When you graph the pairs, each input is a spot on the -axis. Here are the points from Set A:
If two points were stacked one above the other, they would share an input but have different outputs. That gives a quick visual check.
The vertical line test
A graph shows a function if no vertical line crosses it in more than one point.
A circle fails the test. The vertical line crosses this circle twice, near and . The input 2 would have two outputs.
A non-vertical straight line always passes. Any vertical line crosses exactly once.
Functions in everyday situations
Worked example: Is it a function?
- Input: a student in your class. Output: that student's birthday.
- Input: a birthday month. Output: a student born in that month.
Solutions.
- Function. Each student has exactly one birthday. (Two students might share a birthday; that's two inputs with the same output, which is fine.)
- Not a function. The input "March" could give several different students.
Worked example: Using a rule
A function has the rule .
- Find the output when the input is 5.
- Which input gives an output of 17?
Solutions.
- .
- Solve . Add 4: . Divide by 3: . Check: . ✓
Tip
To check a rule, plug your answer back in. If it gives the output you expected, you're done.
Practice
Which set of ordered pairs is a function?
A function has the rule . What is the output when the input is 6?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
A function has the rule . Which input gives an output of 33?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
Is this table a function?
| 2 | 4 | 4 | 6 | |
|---|---|---|---|---|
| 1 | 3 | 5 | 7 |
The graph shows four points. It is not a function. Which input causes the problem?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
Which of these is not a function?
The set is a function. Which value can not be?