{{ 'ml-label-loading-course' | message }}
{{ toc.name }}
{{ toc.signature }}
{{ tocHeader }} {{ 'ml-btn-view-details' | message }}
{{ tocSubheader }}
{{ 'ml-toc-proceed-mlc' | message }}
{{ 'ml-toc-proceed-tbs' | message }}
Lesson
Exercises
Recommended
Tests
An error ocurred, try again later!
Chapter {{ article.chapter.number }}
{{ article.number }}. 

{{ article.displayTitle }}

{{ article.intro.summary }}
{{ 'ml-btn-show-less' | message }} {{ 'ml-btn-show-more' | message }} expand_more
{{ 'ml-heading-abilities-covered' | message }}
{{ ability.description }} {{ ability.displayTitle }}
{{ 'ml-heading-lesson-settings' | message }}
{{ 'ml-lesson-number-slides' | message : article.intro.bblockCount}}
{{ 'ml-lesson-number-exercises' | message : article.intro.exerciseCount}}
{{ 'ml-lesson-time-estimation' | message }}
When elements of one set are connected somehow with elements of another set, there is a relation between the sets. This lesson will present the formal definition of a relation and its different representations. Also, a particular type of relation, called a function, will be explored in more depth.

Catch-Up and Review

Here are a few recommended readings before getting started with this lesson.

Explore

Comparing Graphs

Consider the following pair of graphs. Apart from the shape of the graphs, what difference can be established between them? If needed, press the button to show a vertical line. Then, move the line horizontally and watch for the number of times it intersects each graph along the way.

Two graphs, one is a function and the other is a not
Discussion

Relations and Mapping Diagrams

In the previous exploration, each graph represented a certain relationship between the variables and In fact, the value of depends on the value of Next, the definition of relation is developed along with one way of visualizing it.

Concept

Relation

A relation, or relationship, is a rule that relates the elements of one set to the elements of another set. The first set is called the set of inputs and the second set is called the set of outputs. In a relation, an input can have zero outputs, one output, or more than one output.

Set of inputs, set of outputs, and an arrow from one set to the other
Often, a relation is thought of as a set of ordered pairs of the form In this case, the values represent the inputs and the values the outputs. However, a relation can also be represented using a mapping diagram, a table of values, or a set of points on a coordinate plane.
relation represented as a mapping diagram, a set of ordered pairs, a table of values, and as points in the coordinate plane
Concept

Mapping Diagram

A mapping diagram is a graphic tool that helps to visualize a relation. In a mapping diagram, the inputs are listed in one set and the outputs in another. Then, arrows are drawn from each input to its corresponding outputs.

A mapping diagram representing the relation {(-2,-8),(-1,11),(0,5),(2,-8)} from the input set [-2,-1,0,2] to the output set [-8,11,5].
This mapping diagram shows the relation defined by the set Note that is the output of two different inputs, and
Example

Representing a Relation in Different Ways

Ignacio, the younger brother of Kriz, loves watching Kriz's college volleyball games. He recorded Kriz and their teammates' names, ages, and heights. Ignacio is such a curious kid that he wants to describe some relations based on these values. Then he will share them with his big sibling.

Tiffaniqua, 18 yo, 1.70m; Kriz, 20 yo, 1.96m; Ramsha, 23 yo, 1.85m; Jordan, 20 yo, 1.75m; Diego, 21 yo, 1.91m; LaShay, 19 yo, 1.87m
Represent the relation between Kriz's teammates' ages and heights using a table of values, a mapping diagram, a set of ordered pairs, and points in a coordinate plane.

Answer

Table of Values:

Ages
Heights (m)

Mapping Diagram:

Mapping diagram

Ordered Pairs:
Coordinate Plane:

Points in the coordinate plane: (18,1.70),(20,1.96),(23,1.85),(20,1.75),(21,1.91),(19,1.87)

Hint

To make a mapping diagram, place all the ages in one set and all the heights in another set. Then, connect each age with its corresponding height using an arrow. To write the relation as a set of ordered pairs, place the ages in the first component and the corresponding heights in the second component.

Solution

Using the information that Ignacio gathered, a relation between the ages and heights can be made and represented using different visualizations.

Table of Values

First, organize the relation using a table of values. Place the ages in the first row and the heights in the second row.

Ages
Heights (m)

Mapping Diagram

The same relation can be displayed using a mapping diagram. Place the ages in a set and the heights in a different set. Then, connect each age with its corresponding height by using arrows. It is not necessary to write twice in the ages set.
Mapping diagram

Set of Ordered Pairs

To write the relation using ordered pairs, the ages will be placed in the first coordinate of each ordered pair, and the corresponding heights will be placed in the second coordinate.

Points in the Coordinate Plane

Finally, the relation between the ages and heights of the players can be represented using points in the coordinate plane. To do so, the ages will be placed along the horizontal axis and the heights along the vertical axis. Here, the axes will be drawn using different scales.
Points in the coordinate plane: (18,1.70),(20,1.96),(23,1.85),(20,1.75),(21,1.91),(19,1.87)
Note that by hovering over each point, the corresponding information is shown.
Discussion

Functions, Domain, and Range

Among all the possible relations, those assigning only one output to every input are of particular interest.

Concept

Function

A function is a relation in which each input is assigned to exactly one output. The set of all possible inputs is called the domain of the function and the set of all possible outputs is called the range. If represents the inputs and the outputs of a function, it is often said that is a function of or that depends on

This way of representing the dependent variable is called function notation. A function can be represented using a table, a mapping diagram, an equation, or a graph.
Representations of functions
Note that every function is a relation, but not every relation is a function. In the following applet, three different relations are analyzed to determine whether they are functions.
Three different mapping diagrams. The second one is not a function because one input has two outputs.
In Relation III, although one of the outputs corresponds to two different inputs, it is still a function because each input has exactly one output. Depending on how a relation is represented, there are different methods to determine whether or not it is a function.
Determining Whether a Relation Is a Function
If represented as Use
a set of coordinates or a table of values a mapping diagram
a graph in the coordinate plane the vertical line test
Concept

Domain

The domain of a function is the set of all values, or inputs, for which the function is defined. For example, consider the following functions.
Their domains can be written by analyzing the definition of each function.
Function Analysis Domain
Multiplication by is defined for all real numbers. All real numbers
Square roots are not defined for negative numbers. All non-negative numbers — that is,
Division by zero is undefined. All real numbers except — that is,
Depending on how a function is represented, its domain can be determined by using different methods.
Graph in the coordinate plane, table of values, set of coordinate pairs, and mapping diagram
The domain of a function also depends on what the function describes. For example, let be a function representing the price of apples at a market. Although the function is defined for all real numbers, it does not make sense to find the price of a negative number of apples or a fraction of an apple. Here, the domain of is all non-negative integers.
Concept

Range

The range of a function is the set of all values, or outputs, of the function. The range of a function depends on both the domain and the function itself. For example, consider the following functions and their defined domains.

Function Domain
All integers
All real numbers
All real numbers

By analyzing the definition of each function along with the given domains, the ranges can be determined.

Function Domain Analysis Range
All integers The function takes any integer input and produces an output that is an even number, as each input is multiplied by All even numbers
All real numbers The function takes any real number input and produces an output that is a non-negative number, as each input is squared. All non-negative numbers — that is,
All real numbers The function takes any real number input and sends it to Only the number — that is, the range is
Depending on how a function is represented, its range can be determined using different methods.
Graph in the coordinate plane, table of values, set of coordinate pairs, and mapping diagram
If two different inputs have the same output, it is not necessary to repeat the output when writing the range.
Illustration

Viewing Functions as Machines

A comparison for a function is to think of it as a machine. The inputs are the materials placed in the machine, and the outputs are the objects created. In the following applet, there are four preset inputs. This particular machine only accepts numbers between and to be plugged in as materials. See what happens!

Machine simulating the function f(x)=x+2. Every number that enters in the machine is increased by 2.
Discussion

Methods to Determine Whether a Relation Is a Function

It is essential to determine whether a relation describes a function or not. For example, imagine that a programmer wrote the following relation for a printer's software.

A laptop with the following code written: if color=0, then print in black; if color=1, then print in blue; if color=2, then print in green; if color=0, the print in red.

If a user selects then they cannot be sure if the document will be printed in black or In this case, the programmer needs to write a relation that is a function. Determining if a relation is a function can be done by using either a mapping diagram or the Vertical Line Test. The appropriate method to be used depends on how the relation is represented.

Method

Determining if a Relation Is a Function Using Mapping Diagrams

Given a relation, a mapping diagram can be used to determine whether the relation is a function. For example, consider the relation given by the following set of coordinates.
To figure out if a relation is a function, there are four steps to follow.
1
List the Inputs
expand_more
Start by writing all the inputs of the relation in a column. The inputs are the first components of each pair if the relation is given as a set of coordinates.
Notice that the number is an input for two different points. In the mapping diagram, it is written only once because multiple arrows can be drawn from it. Therefore, the inputs for the given relation are and
The input numbers 4, 0, -3, and 8 listed in a column.

If the relation is given as a vertical table, the inputs are the values in the first column.

2
List the Outputs
expand_more
Write all the outputs in a second column. When the relation is given as a set of coordinates, the outputs are the second components of each pair.
The number is an output for two different pairs. In the mapping diagram, it is written only once because multiple arrows can be drawn to it. For the given relation, the outputs are and
The input numbers 4, 0, -3, and 8 listed in a left column, and the corresponding output numbers 3, -5, and 0 listed in a right column.

If the relation is given as a vertical table, the outputs are the values in the second column.

3
Connect Inputs and Outputs
expand_more

Draw an arrow from each input to its corresponding output.

The input numbers 4, 0, -3, and 8 listed in a left column, and the corresponding output numbers 3, -5, and 0 listed in a right column. Pairs of inputs and corresponding outputs are shown with arrows: (4,3), (4,-5), (0,-5), (-3,3), and (8,0).
4
Look For Arrows With the Same Tail
expand_more

Check if there are multiple arrows with the same starting input. In other words, identify inputs that have multiple outputs.

The input numbers 4, 0, -3, and 8 listed in a left column, and the corresponding output numbers 3, -5, and 0 listed in a right column. Pairs of inputs and corresponding outputs are shown with arrows: (4,3), (4,-5), (0,-5), (-3,3), and (8,0). The arrows drawn from the input 4 which are (4,3) and (4,-5) are highlighted.

Here, the input has two different outputs, and By definition, for a relation to be a function, every input must be assigned to exactly one output. As such, the given relation is not a function.

Method

Vertical Line Test

The vertical line test is a graphical method to determine whether a given relation is a function. For example, consider the following relations.

Relation I Relation II Relation III
To determine whether the relations are functions, follow these two steps.
1
Draw the Relation on the Coordinate Plane
expand_more

Draw the relation on the coordinate plane. The first two relations can be drawn using a graphing calculator or other mathematical software.

Graph of the three relations: (y-2)(y+1)=x; y=x(x+1)(x-2), and x (-2.25,-2),(-1.75,0),(-1,2),(-1,-1),(0,1),(1,-0.75), and (2,0.5)
2
Draw a Vertical Line and Look at the Intersection Points
expand_more

Draw vertical lines at different places through the coordinate plane. If one of the lines intersects the graph more than once, the relation is not a function. Conversely, if no vertical line cuts the graph more than once, the relation is a function.

Different vertical lines drawn along each relation

Notice that cuts the first graph at two different points. The line also passes through two different points. This means that neither Relation I nor Relation III is a function. However, all of the vertical lines drawn over Relation II only intersect the graph one time at most. Because of this, Relation II is a function.

  • Relation I is not a function.
  • Relation II is a function.
  • Relation III is not a function.

Keep in mind that before stating whether a relation is a function, the vertical lines drawn have to cover the entire domain to ensure that no vertical line cuts the graph more than once.

Why

Intuition Behind the Method

If a relation is not a function, it is because there are multiple values corresponding to the same value. Therefore, the graph of such relation would show at least two points directly above the other.

Points with the same value belong to the same vertical line.

This is why drawing a vertical line and moving it across the graph reveals if the graph is a function or not.
Moving a vertical line across two different graphs
Note that when determining whether a relation is or is not a function, it must be assumed that the graph of a relation continues without any significant change beyond the boundaries of the coordinate plane. If this were not the case, it could never be determined from a graph whether a relation is a function.
Example

Analyzing Relations Using Mapping Diagrams

Ignacio enjoyed displaying the relations between the ages and heights of Kriz's teammates so much that he wanted to go a step further and continue analyzing relations. He then asked Ramsha and Diego the ages and heights of their family members and wrote that data, including each player's values, in the following sets.

R = {(18,1.75),(23,1.85),(12,1.36),(43,1.82),(47,1.82)}, D = {(15,1.72),(21,1.91),(41,1.88),(41,1.94)}

Note that means that some member of Ramsha's family is years old and meters tall.

a What is the domain of
What is the range of
b What is the domain of
What is the range of
c Using mapping diagrams, determine which of the sets represents a function?

Hint

a The domain of a set of coordinate pairs is formed by all the coordinates written first, while the range is formed by all the coordinates written second. When writing sets, do not repeat elements.
b To find the domain, look at the first coordinates of each pair. Similarly, to find the range, look at the second coordinate of each pair. When writing sets, do not repeat elements.
c When represented as a mapping diagram, if only one arrow is drawn from each input, the relation is a function.

Solution

a Given a set of coordinate pairs, the domain includes all the first coordinates, and the range includes all the second coordinates.
R = {(18,1.75),(23,1.85),(12,1.36),(43,1.82),(47,1.82)}
By listing the numbers from least to greatest, and including each element only once, the domain and range of are as follows.
b As done in Part A, to find the domain of look at the first coordinate of each pair. To find the range, look at the second coordinate of each pair.
D = {(15,1.72),(21,1.91),(41,1.88),(41,1.94)}
By listing the numbers from least to greatest, and including each element only once, the domain and range of are as follows.
c Start by drawing a mapping diagram representing the relation given by the sets and The elements in the domains — the ages — will be grouped in one column, and the elements in the ranges — the heights — will be grouped in a second column.
R = {(18,1.75),(23,1.85),(12,1.36),(43,1.82),(47,1.82)}, D = {(15,1.72),(21,1.91),(41,1.88),(41,1.94)}
Then, each age will be connected to the corresponding height using an arrow.
R = {(18,1.75),(23,1.85),(12,1.36),(43,1.82),(47,1.82)}, D = {(15,1.72),(21,1.91),(41,1.88),(41,1.94)}
Remember that for mapping diagrams, a relation is a function if there is only one arrow drawn from each input to an output. In this case, the age is the input.
R = {(18,1.75),(23,1.85),(12,1.36),(43,1.82),(47,1.82)}, D = {(15,1.72),(21,1.91),(41,1.88),(41,1.94)}
In the first mapping diagram, each age is assigned to only one height. Therefore, represents a function. On the contrary, in the second mapping diagram, is assigned to two different heights. In that case, set cannot represent a function.

Only set represents a function.

By analyzing the two data sets, some other conclusions can be drawn.

  • Ramsha's guardians are of different ages and are the same height.
  • Ramsha has two siblings.
  • Diego's guardians are both years old.
  • Diego has one sibling.

Of course, based on the given information, it does not have to be the exact situation. The conclusions were done simply to show one way of interpreting the data recorded.

Example

Analyzing Graphs Using the Vertical Line Test

Hhaving completed some analysis for Kriz's volleyball team, Ignacio now has some free time. He is digging around his school's library computer. He finds some juicy information about a recently created virtual coin. There is a graph that shows the fluctuation in the coin's exchange rate during its first ten days after it was created.
Graph a relation
Ignacio accidentally deletes some part of the database code, and whoa! The graph switched the axes labels. Take a look at the shape of the graph. It changed. Ignacio figures he can use what he has learned recently and make sense of all this!
Graph of a relation
a Find the domain and range of the first graph. Write the answer using compound inequalities.
b Find the domain and range of the second graph.
c Which of the two graphs represents a function?

Hint

a The domain is all the values for which the graph is drawn. Similarly, the range is all the values for which the graph is drawn.
b The domain goes from the minimum to the maximum value along the axis for which the graph is drawn. Similarly, the range goes from the minimum to the maximum value along the axis for which the graph is drawn.
c Use the Vertical Line Test.

Solution

a To find the domain of the graph, travel along the graph making note of the values.
Point moving along the graph. Points in the x-axis are highlighted
As seen, the graph is drawn for every value from to both ends included. Therefore, the domain is To find the range, look at all the values for which the graph is drawn.
Point moving along the graph. Points in the y-axis are highlighted
The range goes from to both endpoints included. Therefore, the range is
b As in Part A, to find the domain of the graph, travel along the graph making note of the values.
Point moving along the graph. Points in the x-axis are highlighted
From the above, the domain is Next, look at the values.
Point moving along the graph. Points in the y-axis are highlighted
The range goes from to It can be written as
c To determine if the first graph represents a function, the Vertical Line Test can be applied. To do so, draw a vertical line, move it horizontally along the domain, focusing on the intersection point.
Moving a vertical line along the graph. Every line cuts the graph at most once.
As seen, any vertical line never intersects the graph more than once. That means the first graph represents a function. Now, repeat the same procedure for the second graph.
Moving a vertical line along the graph. Different vertical lines cut the graph twice or more.
Unlike the previous graph, here, there is at least one vertical line that intersects the graph more than once. This graph does not represent a function.

Only the first graph represents a function.

At first, Ignacio was glad that his mistake only caused the graph to change domains and ranges. He only realized that it was no longer a function when he applied the vertical line test. He better change it back before someone needs to use the database!

Pop Quiz

Analyzing Different Relations

The following applet displays a relation either as a set of ordered pairs, a group of coordinate points in the coordinate plane, or a curve in the coordinate plane. For any given relation, determine whether it is a function.

random relations
Closure

Restricting a Relation to Make It a Function

Consider a relation represented by the following graph. Note that any vertical line drawn between and intersects the graph more than once. Then, by the Vertical Line Test, the graph is not a function. However, by changing the relation's domain using and it is possible to convert the graph into a function.
Graph that is not a function but the domain can be restricted by moving x1 and x2
Now consider the graph of the relation where the domain is all non-negative numbers and the range is all real numbers.
graph of the relation y= +- sqrt(x)
As before, the initial graph is not a function, but it can be converted into a function by restricting either its domain or range. By moving and investigate whether restricting the domain will make the graph a function.
Graph of the function y= +- sqrt(x) where the domain can be restricted by moving x1 and x2
As can be seen, no matter where and are placed, the resulting graph cannot be made into a function. Not to give up too soon, try moving and to restrict the range.
Graph of the function y= +- sqrt(x) where the range can be restricted by moving y1 and y2
There it is! In this case, the graph becomes a function when the range is restricted to a set containing either only non-negative or only non-positive numbers.
In conclusion, when given a relation that is not a function, it might be useful to check whether restricting its domain or range can make the relation become a function.