What is the difference between a relation and a function?
A relation is any set of inputs and outputs, while a function is a specific type of relation where each input has exactly one output. Think of a relation as a general connection, like a contact list on your phone. One person's name might be connected to two different phone numbers, like a cell and a home line.
A function is much stricter. Think of a function like a student ID system. Each student ID number belongs to exactly one student. You will never punch in one student ID and get two different students' names. In math, this means every -value must give you exactly one -value.
What is a relation?
In algebra, a relation is simply a relationship between sets of information. It is most commonly represented as a set of ordered pairs . The set of all starting -values is called the domain, and the set of all resulting -values is called the range.
Any group of points on a graph, any equation, or any table of values is a relation. There are no rules about how the inputs and outputs must connect. The input could link to , , and all at the same time.
What is a function?
A function is a special, well-behaved type of relation. By definition, a function is a relation in which each element of the domain (the input) is paired with exactly one element of the range (the output).
Imagine a vending machine. If you press the button for , you expect a specific candy bar to drop. If you press and it sometimes drops a candy bar and sometimes drops a bag of chips, the machine is broken. In math, we say it is "not a function." A true function gives a consistent, single answer for every input.
How to recognize a function
If you are looking at a list of points or a table, look closely at the -values. If any -value repeats but has different -values, it is not a function. If all the -values are unique, or if repeating -values give the exact same -value, it is a function.
If you are looking at a graph, you can use the Vertical Line Test. Imagine drawing straight vertical lines down through the graph. If any vertical line touches the graph in more than one place, a single -value has multiple -values. This means the graph represents a relation, but not a function.
Where students slip up
The most common mistake is thinking that each output (-value) can only be used once. Functions only restrict the inputs.
Multiple inputs are allowed to map to the exact same output. For example, think about the equation . If you input , the output is . If you input , the output is also . This is perfectly fine. The vending machine has two buttons that both give water. It is still a function because pressing a specific button only ever does one specific thing.
Worked through
Determine whether the following relation is a function:
First, identify all the input values (the -values) in the ordered pairs. The -values are and .
Next, check to see if any -value repeats. We can see that the input appears twice.
Finally, look at the outputs (the -values) for that repeating input. The input is paired with in the first point, but it is paired with in the last point.
Because a single input () maps to two different outputs ( and ), this relation is not a function.
Questions students ask
Ask about this topic
Where this comes from: OpenStax College Algebra · Khan Academy: Algebra 1, Functions Unit
See also