topic badge
United States of AmericaVA
Algebra, Functions, and Data Analysis

4.01 Review: Functions and relations

Relations

A relation is a set of ordered pairs which represent a relationship.

For example, we can think of the names of people in a math class and their ages as ordered pairs, like \left(\text{Bob}, 13 \right). These pairs of information represent a relation.

If we chose a specific age (like 13), we could list all the names of the people who are this age. It could be one person, Bob, or it could be multiple. If a teacher wanted to look for the person who was 13 years old, that description might fit four people, which means there is not one clear answer.

We can express the same relation in several different ways: as a mapping, a set of ordered pairs, an input-output table, a graph in the coordinate plane, or as an equation in terms of x and/or y that describes a graph.

A mapping diagram shows how the input values are assigned one or more output values.

Two vertical rectangular sets are shown side by side. The left set contains the numbers -1, 0, 1, and 2, listed from top to bottom. The right set contains the numbers 0, 2, and 4, also listed vertically. Arrows indicate mappings from elements in the left set to elements in the right set as follows: -1 maps to 0; 0 maps to 2; 1 maps to 2; 2 maps to 4. Each arrow points from a number in the left set to a number in the right set, illustrating a function.

A mapping of a relation

We can write an input-output table from the mapping, making sure that each pair is represented.

The first value of a relation is an input value, and the second value is the output value. The input is the value of x that is applied to the relation.

The output is the y, or the answer that is received as a result of putting x into the relation. A table can be laid out horizontally, like this one, or vertically.

x-1012
y2024

This also corresponds to the set of ordered pairs \{(-1, 2), (0, 0), (1, 2), (2, 4)\}, which can be graphed in the coordinate plane.

-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y

A graph of the relation represents the (x, y) pairs in the coordinate plane.

Examples

Example 1

Write the relation \{(2, 2), (4, 4), (6, 3), (7, 5)\} in the table.

x2467
y
Worked Solution
Create a strategy

Write the second coordinate of each ordered pair in the y row, below the x-value it corresponds to.

Apply the idea
x2467
y2435

Example 2

Represent the relation \{(-9, -5), (-5, -10), (-5, -4), (-3, 7), (-2, -4), (-1, 1)\}. on the coordinate plane.

Worked Solution
Create a strategy

The first value of each ordered pair tells us how to move along the x-axis, while the second value tells us how to move along the y-axis.

Apply the idea
-8
-6
-4
-2
2
x
-10
-8
-6
-4
-2
2
4
6
8
y

Example 3

A relation is defined as follows: y=-4 if x is positive, and y=4 if x is 0 or negative.

a

Complete the table.

x-4-3-2-101234
y
Worked Solution
Create a strategy

For each positive x-value, y=-4, otherwise y=4.

Apply the idea

When x=1, \, 2, \, 3, \, 4: y=-4.

When x=0, \, -1, \, -2, \, -3, \, -4: y=4.

x-4-3-2-101234
y44444-4-4-4-4
b

Plot the points on the coordinate plane.

Worked Solution
Create a strategy

Plot the points from the completed table in part (a).

Apply the idea
-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y
Idea summary

A relation is a set of ordered pairs which represent a relationship.

We can express the same relation in several different ways: as a mapping, a set of ordered pairs, an input-output table, a graph in the coordinate plane, or as an equation in terms of x and/or y that describes a graph.

Functions

A function is a special type of relation where each input only has one output. Functions are a way of connecting input values to their corresponding output values.

A function machine with the input arrow on the left leading to the word function in a box with an output arrow on the right.

For example, if we think about placing an order for boba teas, the number of boba teas we order (the input) affects the amount we have to pay (the output).

A graphic with three rows. The first row has one boba tea with a right-facing arrow pointing to $3. The second row has two boba teas with a right-facing arrow pointing to $6. The third row has three boba teas with a right-facing arrow pointing to $9.

Let's say each boba tea costs \$3. If we bought one boba tea, it would cost \$3; if we bought two boba teas, it would cost \$6; and so on.

Notice how the value of the input (the number of boba teas) always produces exactly one output (cost)?

This is an example of a function.

A graphic with three rows. The first row has one boba tea with a right-facing arrow pointing to $3. The second row has two boba teas with a right-facing arrow pointing to $6 and another arrow pointing to $10. The third row has three boba teas with a right-facing arrow pointing to $9.

However, if our friend also ordered 2 boba teas, but was charged \$10 while we paid \$6, we may be confused and assume that the cash register miscalculated the price.

This is not a function.

A set of four function machines representing the function y = -2x. They show input values of -1, 0, 1, and 2, and their corresponding output values of 2, 0, -2, and -4. Ask your teacher for more information.

Another way to look at functions is to look at how inputs map to their output values. The function machine shown represents the relationship y=-2x.

Each input going into the machine is multiplied by -2 and exits the machine as the output, or y-value.

If we put four input values of -1, 0, 1, and 2 into the machine, it gives four output values of 2, 0, -2, and -4.

Notice how each x-value is associated with only one y-value. This means y=-2x is a function.

If we can write a relationship between x and y, then there is a relation.

However, if this relationship only gives one value of y for each x-value (one output for every input), then it is a function.

x-328-15-2
y-138-23-1

This table represents a relation that is a function since each input is only assigned one output. Notice that the output 3 repeats, but the relation is still a function since the inputs are unique.

x-123-1-3-2
y-13-3-431

This table represents a relation but not a function since the input -1 is paired with two outputs of -1 and -4.

Remember, for a relation to be a function, every input (x-value) must correspond to exactly one output (y-value).

It's okay for different inputs to have the same output. For example, in the first table, the inputs 2 and 5 both have the output 3.

However, it's not okay for the same input to have different outputs. In the second table, the input -1 has the outputs -1 and -4.

Sets of ordered pairs can also show whether or not a relation is a function. The following set of ordered pairs is a function since one input matches to one output:\left\{\left(-4,-1\right),\left(-2,0\right),\left(0,1\right),\left(2,0\right),\left(3,-2\right),\left(4,3\right)\right\}

This set of ordered pairs is not a function since the inputs of -4 and 2 each repeat with different outputs. \left\{\left(-4,-1\right),\left(-4,3\right),\left(0,1\right),\left(2,2\right),\left(2,-2\right),\left(4,0\right)\right\}

Graphs can also show one input (x-value) paired with one output (y-value).

By graphing the previous sets of ordered pairs, we see one graph that represents a function and one that does not.

-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y
Function
-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y
Not a function
-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y
Function
-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y
Not a function

Examples

Example 4

This mapping shows the relation F.

A mapping diagram for a relation named F. The input oval (x) on the left contains the numbers 1, 2, 3, and 4. The output oval (y) on the right contains the numbers -1, 0, 1, and 2. An arrow from input 1 points to output -1. Two arrows from input 2 point to outputs 0 and 1. An arrow from input 3 points to output 2. An arrow from input 4 points to output 2
a

Find the output when x=1.

Worked Solution
Create a strategy

We start from the input oval labeled x and follow the line(s) from 1 to the output value(s).

Apply the idea

When x=1, y=-1.

b

Determine if F is a function.

Worked Solution
Create a strategy

For a function, each x-value maps to a unique y-value.

Apply the idea

If we input x=2 into the mapping, we get both y=0 and y=1. This means that F is not a function.

Reflect and check

To be a function, each input value should only map to one output value. For example, G would be a function:

A mapping diagram for a relation named G. The input oval (x) on the left contains the numbers 1, 2, 3, and 4. The output oval (y) on the right contains the numbers -1, 0, and 2. An arrow from input 1 points to output -1. An arrow from input 2 points to output 0. An arrow from input 3 points to output 2. An arrow from input 4 points to output 2.

Example 5

The pairs of values in the table represent a relation between x and y.

x-8-7-6-3279910
y813-18-16-15-2-411-9

Does the relation represent a function?

Worked Solution
Create a strategy

The relation is a function if for every x-value, there is exactly one y-value.

Apply the idea

The x-value of 9 yields the y-values of -4 and 11. So, the points do not represent a function.

Example 6

Oprah makes scarves to sell at the market. It costs her \$2 to produce each one, and she sells them for \$5.

a

Complete the graph of the points representing the relation between the number of scarves sold and her total profit for when 1, 2, 3, 4 and 5 scarves are sold. The first point has been plotted.

-8
-6
-4
-2
2
4
6
8
10
\text{Quantity}
2
4
6
8
10
12
14
16
18
\text{Profit}
Worked Solution
Create a strategy

The total profit can be found using the formula:

\text{Total profit}= \text{Total revenue}-\text{Total cost}

Apply the idea

\text{Total revenue}=\text{Number of scarves sold}\cdot \$5

\text{Total cost}=\text{Number of scarves sold}\cdot \$2

\displaystyle \text{Profit for 1 scarf}\displaystyle =\displaystyle 1\cdot 5 - 1\cdot 2Substitute the number of scarves
\displaystyle =\displaystyle \$3Evaluate
\displaystyle \text{Profit for 2 scarves}\displaystyle =\displaystyle 2\cdot 5 - 2\cdot 2Substitute the number of scarves
\displaystyle =\displaystyle \$6Evaluate
\displaystyle \text{Profit for 3 scarves}\displaystyle =\displaystyle 3\cdot 5 - 3\cdot 2Substitute the number of scarves
\displaystyle =\displaystyle \$9Evaluate
\displaystyle \text{Profit for 4 scarves}\displaystyle =\displaystyle 4\cdot 5 - 4\cdot 2Substitute the number of scarves
\displaystyle =\displaystyle \$12Evaluate
\displaystyle \text{Profit for 5 scarves}\displaystyle =\displaystyle 5\cdot 5 - 5\cdot 2Substitute the number of scarves
\displaystyle =\displaystyle \$15Evaluate

Plot the pairs of values found.

0
1
2
3
4
5
6
7
8
9
\text{Quantity}
2
4
6
8
10
12
14
16
18
\text{Profit}
b

Is this relation a function?

Worked Solution
Create a strategy

This relation is a function if for every quantity sold, there is exactly one total profit.

Apply the idea

Checking each pair of values in the graph, each quantity of scarves sold is associated with only one total profit, so this relation does represent a function.

Idea summary

A relation is a function if and only if each element in the domain is paired with a unique element of the range.

An input (x-value) can only lead to one output (y-value). It's okay for different inputs to go to the same output, but one input cannot go to different outputs.

When checking a set of ordered pairs, look for any repeated x-values. If a repeated x-value has different y-values, it is not a function.

When checking a table, scan the input (x) column or row. If the same input is listed with different outputs, it is not a function.

The vertical line test

Exploration

Move the slider until the vertical line crosses the entire graph.

Press the 'Try another' button to try a new graph.

Loading interactive...
  1. What similarities did you notice in the graphs that were labeled as functions?

  2. How does the vertical line help determine which graphs represent functions?

  3. Is a horizontal line useful in determining if a relation is a function?

An easy way to check if a graph shows a function is to use the Vertical Line Test. If any vertical line can be drawn that hits the graph in more than one spot, it is not a function.

Vertical line test

The graph of a relation is a function if a vertical line intersects the graph of a relation at exactly one point across the entire graph.

Here are two examples of relations being checked with the vertical line test. A function is said to "pass the vertical line test" while a relation that is not a function "fails the vertical line test."

-7
-6
-5
-4
-3
-2
-1
1
2
3
4
5
6
7
x
-7
-6
-5
-4
-3
-2
-1
1
2
3
4
5
6
7
y
Fails the vertical line test (not a function)
-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y
Passes the vertical line test (is a function)

One pair of points is enough to decide that a relation is not a function, but it is not enough to decide that a relation is a function. We must keep checking points on the graph until it either fails the test or we have checked for all x-values.

When classifying, remember that every function is a relation, but not every relation is a function.

Examples

Example 7

Determine whether these graphs show functions.

a
-6
-5
-4
-3
-2
-1
1
2
3
4
5
6
x
-6
-5
-4
-3
-2
-1
1
2
3
4
5
6
y
Worked Solution
Create a strategy

Draw vertical lines throughout the graph and check whether each line crosses at only one point on the graph at a time.

Apply the idea
-6
-5
-4
-3
-2
-1
1
2
3
4
5
6
x
-6
-5
-4
-3
-2
-1
1
2
3
4
5
6
y

Each vertical line passes through the graph only once, so the graph is a function.

b
-8
-6
-4
-2
2
4
x
-4
-3
-2
-1
1
2
3
4
y
Worked Solution
Create a strategy

Draw vertical lines throughout the graph and check whether each line crosses at only one point on the graph at a time.

Apply the idea
-8
-6
-4
-2
2
4
x
-4
-3
-2
-1
1
2
3
4
y

The vertical lines shown cross the graph at multiple points, so the graph is not a function.

c
-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y
Worked Solution
Create a strategy

Draw vertical lines throughout the graph and check whether each line crosses at only one point on the graph at a time.

Apply the idea
-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y

Each vertical line passes through the graph only once, so the graph is a function.

Idea summary

While all functions are relations, not all relations are functions.

The vertical line test for functions:

-5
-4
-3
-2
-1
1
2
3
4
5
x
-5
-4
-3
-2
-1
1
2
3
4
5
y

When looking at a graph, if a vertical line can be drawn anywhere so that it crosses the graph of the relation in more than one place, then the relation is not a function.

What is Mathspace

About Mathspace