 {{ 'mllessonnumberslides'  message : article.introSlideInfo.bblockCount}} 
 {{ 'mllessonnumberexercises'  message : article.introSlideInfo.exerciseCount}} 
 {{ 'mllessontimeestimation'  message }} 
Here are a few recommended readings before getting started with this lesson.
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.
In the previous exploration, each graph represented a certain relationship between the variables $x$ and $y.$ In fact, the value of $y$ depends on the value of $x.$ Next, the definition of relation is developed along with one way of visualizing it.
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.
Often, a relation is thought of as a set of ordered pairs of the form $(x,y).$ In this case, the $x$values represent the inputs and the $y$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.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.
This mapping diagram shows the relation defined by the set ${(2,8),$ $(1,11),$ $(0,5),$ $(2,8)}.$ Note that $8$ is the output of two different inputs, $2$ and $2.$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.
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.Table of Values:
Ages  $18$  $20$  $23$  $20$  $21$  $19$ 

Heights (m)  $1.70$  $1.96$  $1.85$  $1.75$  $1.91$  $1.87$ 
Mapping Diagram:
Ordered Pairs: ${(18,1.70),$ $(20,1.96),$ $(23,1.85),$ $(20,1.75),$ $(21,1.91),$ $(19,1.87)}$
Coordinate Plane:
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.
Using the information that Ignacio gathered, a relation between the ages and heights can be made and represented using different visualizations.
First, organize the relation using a table of values. Place the ages in the first row and the heights in the second row.
Ages  $18$  $20$  $23$  $20$  $21$  $19$ 

Heights (m)  $1.70$  $1.96$  $1.85$  $1.75$  $1.91$  $1.87$ 
Among all the possible relations, those assigning only one output to every input are of particular interest.
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 $x$ represents the inputs and $y$ the outputs of a function, it is often said that $y$ is a function of $x$
or that $y$ depends on $x.$
$y=f(x)$
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 
Function  Analysis  Domain 

$f(x)=3x$  Multiplication by $3$ is defined for all real numbers.  All real numbers. 
$g(x)=x $  Square roots are not defined for negative numbers.  All nonnegative numbers, that is, $x≥0.$ 
$h(x)=x1 $  Division by zero is undefined.  All real numbers except $0$, that is, $x =0.$ 
Function  Domain  Analysis  Range 

$f(x)=2x$  All integers. ${…,2,1,0,1,2,…}$ 
Every input is multiplied by $2.$ Then, every output is an even number. 
All even numbers. 
$g(x)=x_{2}$  All real numbers.  Every input is squared. Then, every output is nonnegative.  All nonnegative numbers, that is, $y≥0.$ 
$h(x)=4$  All real numbers.  Every input is sent to $4.$  Only the number $4,$ that is, the range is ${4}.$ 
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 $100$ and $100$ to be plugged in as materials. See what happens!
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.
If a user selects $color=0 ,$ then they cannot be sure if the document will be printed in black or $red.$ 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.
Start by writing all the inputs in a column. When the relation is given as a set of coordinates, the inputs are the first components of each pair. If the relation is given as a vertical table, the inputs are the values in the first column. For the given relation, the inputs are $4,$ $0,$ $3,$ and $8.$
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. If the relation is given as a vertical table, the outputs are the values in the second column. For the given relation, the outputs are $3,$ $5,$ and $0.$
From each input, draw an arrow pointing to its corresponding output.
Look for different arrows that have the same tail. That is, inputs from which more than one arrow is drawn.
By definition, for a relation to be a function, every input must be assigned to exactly one output. Here, the input $4$ has two different outputs, $3$ and $5.$ Therefore, the given relation is not a function.
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 

$(y−2)(y+1)=x$  $y=x(x+1)(x−2)$  $xy 2.252 1.750 12 11 01 10.75 20.5 $

Draw the relation on the coordinate plane. The first two relations can be drawn using a graphing calculator or another mathematical software.
Draw vertical lines at different places of the coordinate plane. If one line intersects the graph more than once, the relation is not a function. On the contrary, if no vertical line cuts the graph more than once, the relation is a function.
Notice that $ℓ_{3}$ cuts the first graph at two different points. Also, $m_{2}$ passes through two different points. Then, neither Relation I nor Relation III is a function. In contrast, any vertical line cuts the graph of Relation II at most once. Thus, Relation II is a function.
Keep in mind that, before stating that 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.
When a relation is not a function, it is because there are multiple $y$values that proceed from the same $x$value. Therefore, the graph of such relation would show at least two points directly above the other.
Points with the same $x$value belong to the same vertical line.
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.
Note that $(18,1.75)$ means that some member of Ramsha's family is $18$ years old and $1.75$ meters tall.
Only set $R$ represents a function.
By analyzing the two data sets, some other conclusions can be drawn.
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.
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!
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.