Definition of a Function
Definition of a Function
In math, we often study how one quantity depends on another. For example, the total cost depends on how many items you buy, and the distance traveled depends on how long you move.
A function is a special kind of rule. It takes an input and gives an output. The most important part is this: each input must match with exactly one output.
This idea is the definition of a function:
A function is a rule that assigns exactly one output to each input.
You can think of a function like a machine. You put something in, and the machine gives one result back. If the same input could give two different outputs, then it is not a function.
Important words
- Input: the value you start with
- Output: the value you get from the rule
- Rule: what the function does to the input
We often use letters like \(x\) for the input and \(y\) for the output. For example, in the rule \(y = 2x + 1\), you choose a value for \(x\), and then the rule tells you the value of \(y\).
What makes something a function?
To decide whether something is a function, ask this question:
Does every input have exactly one output?
- If yes, it is a function.
- If no, it is not a function.
There are two common ways something can fail to be a function:
- An input has more than one output.
- An input is missing an output when it should have one in the situation.
Functions can be shown in different ways
In 8th grade, you may see functions represented as:
- words
- tables
- ordered pairs
- equations
- graphs
No matter how the function is shown, the definition stays the same: one input, one output.
1. Functions in words
A rule written in words can describe a function. For example:
“Multiply the input by 3.”
If the input is \(4\), the output is \(12\). If the input is \(7\), the output is \(21\). Each input leads to one output, so this is a function.
2. Functions in a table
A table shows inputs and outputs in pairs.
Example table:
\[ \begin{array}{c|c} x & y \\ \hline 1 & 4 \\ 2 & 7 \\ 3 & 10 \\ 4 & 13 \end{array} \]
Each input value of \(x\) appears once and has one output value of \(y\). So this table represents a function.
If a table showed the same input with two different outputs, it would not be a function.
For example:
\[ \begin{array}{c|c} x & y \\ \hline 2 & 5 \\ 2 & 8 \\ 3 & 7 \end{array} \]
Here, the input \(2\) has outputs \(5\) and \(8\). Since one input gives two outputs, this is not a function.
3. Functions as ordered pairs
An ordered pair looks like \((x, y)\). The first number is the input, and the second number is the output.
Example: \((1, 2), (2, 4), (3, 6), (4, 8)\)
Each input is different and has one output, so this is a function.
Example: \((2, 3), (2, 6), (5, 9)\)
The input \(2\) is paired with both \(3\) and \(6\). That means it is not a function.
4. Functions as equations
An equation can represent a function if each input gives exactly one output.
Example: \(y = x + 4\)
If you choose any value for \(x\), there is only one value of \(y\).
- If \(x = 1\), then \(y = 5\)
- If \(x = 3\), then \(y = 7\)
- If \(x = 10\), then \(y = 14\)
So \(y = x + 4\) is a function.
5. Functions on a graph
On a graph, a function means that each \(x\)-value matches only one \(y\)-value.
A helpful test is the vertical line test:
- If a vertical line touches the graph at only one point each time, the graph is a function.
- If a vertical line touches the graph at more than one point, the graph is not a function.
Why does this work? A vertical line has one fixed \(x\)-value. If it hits the graph in two places, then that same input \(x\) has two outputs \(y\), so it cannot be a function.
Functions and real-life situations
Many real-life rules are functions.
- A number of movie tickets bought and the total cost
- Hours worked and total pay
- Number of miles traveled at a constant rate and total distance
In each case, one input gives one output.
But not every real-life matching is a function.
For example, “student to favorite sports” may not be a function if one student likes basketball and soccer. That one input would have more than one output.
Worked Example 1: Using a rule
Rule: “Multiply the input by 2, then add 1.”
Is this a function?
Step 1: Check what happens to an input.
If the input is \(3\):
$$y = 2(3) + 1 = 7$$
If the input is \(5\):
$$y = 2(5) + 1 = 11$$
Step 2: Ask whether each input gets exactly one output.
Yes. Every input is changed by the same rule and gives one answer.
Answer: Yes, this is a function.
Worked Example 2: Looking at ordered pairs
Decide whether the set \((1, 4), (2, 6), (3, 8), (2, 6)\) is a function.
Step 1: Look at the inputs: \(1, 2, 3, 2\).
The input \(2\) appears twice.
Step 2: Check whether it has different outputs.
Both times, \(2\) is paired with \(6\).
Important idea: Repeating the same ordered pair does not break the function rule. The problem happens only when one input has different outputs.
Answer: Yes, this is still a function.
Worked Example 3: Looking at a table
Decide whether this table represents a function.
\[ \begin{array}{c|c} x & y \\ \hline 4 & 9 \\ 5 & 11 \\ 6 & 13 \\ 5 & 12 \end{array} \]
Step 1: Look for repeated inputs.
The input \(5\) appears twice.
Step 2: Compare the outputs for that input.
One time \(5\) gives \(11\), and another time \(5\) gives \(12\).
Step 3: Use the definition.
One input has two different outputs.
Answer: No, this is not a function.
Worked Example 4: Looking at an equation
Does the equation \(y = 3x - 2\) represent a function?
Step 1: Try some inputs.
- If \(x = 0\), then \(y = 3(0) - 2 = -2\)
- If \(x = 2\), then \(y = 3(2) - 2 = 4\)
- If \(x = -1\), then \(y = 3(-1) - 2 = -5\)
Step 2: Decide if each input gives one output.
Yes. Every value of \(x\) leads to exactly one value of \(y\).
Answer: Yes, \(y = 3x - 2\) is a function.
How this connects to linear and nonlinear patterns
Some functions are linear, and some are nonlinear. Both can still be functions.
A linear function has a graph that is a straight line, such as \(y = 2x + 1\).
A nonlinear function does not have a straight-line graph, such as \(y = x^2\).
The key point is this: being a function is not the same as being linear.
- Some functions are linear.
- Some functions are nonlinear.
- As long as each input has exactly one output, it is a function.
Common mistakes to avoid
- Mistake 1: Thinking all equations are functions. Some are not. Always check whether one input can give more than one output.
- Mistake 2: Looking only at outputs. Outputs are allowed to repeat. Different inputs can have the same output.
- Mistake 3: Forgetting that repeated inputs are okay only if they repeat the same output.
For example, the set \((1, 5), (2, 5), (3, 5)\) is a function. Different inputs all lead to the same output, and that is allowed.
Quick check questions
- Is \((1, 2), (2, 3), (3, 4)\) a function?
- Is \((4, 7), (4, 9), (5, 10)\) a function?
- Does the rule \(y = x - 8\) describe a function?
- If a graph fails the vertical line test, is it a function?
Answers
- Yes, each input has one output.
- No, input \(4\) has two outputs.
- Yes, each input gives exactly one output.
- No, it is not a function.
Summary
A function is a rule that assigns exactly one output to each input. You can recognize functions in words, tables, ordered pairs, equations, and graphs. To check, always ask: Does each input have only one output? If yes, it is a function. If no, it is not.
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.