Suppose you wanted to predict the cost of going to see a movie at the theater, you text a number of your friends who have seen movies recently to ask how much it cost them, here are the responses:
"$14.50 :("
"$8.75 + $3.50 for popcorn"
"five bucks  dollar theater"
"$17.50 :'( broke now"
"$12.75 loved the 3D!"
Can you accurately predict the cost of going to a movie from these responses? Why or why not?
Relations and Functions
Consider two situations shown in the boxes below:
Situation 1: You are selling candy bars for a school fundraiser. Each candy bar costs $3.00  Situation 2: You collect data from several students in your class on their ages and their heights: (18,65"), (17,64"), (18,67"), (18,68"), (17,66") 

In the first situation, let the variable \begin{align*}x\end{align*} represent the number of candy bars that you sell, and let \begin{align*}y\end{align*} represent the amount of money you make. If you sell \begin{align*}x\end{align*} candy bars, you will make \begin{align*}y = 3x\end{align*} dollars. For example, if you sell 25 candy bars, you will make 3(25) = $75.00. Notice that you can use the number of candy bars you sell to predict how much money you will make.
Now consider the second situation. Can you similarly use the data to predict specific height, based on age?
No, this is not the case in the second situation. For example, if a student is 18 years old, there are several heights that the student could be.
The first situation is an example of a function, and the second example is not a function.
A function is a relationship where each input number corresponds to one and only one output number. 

In the first situation, for each different number of candy bar sales you input, there is one and only one output number representing your profit.
In the second situation, if you input "18 years", there are multiple outputs, so you can't identify a specific relationship between age and height.
See the difference?
It is important to note that both situations above are relations. A relation is simply a relationship between two sets of numbers or data. For example, in the second situation, we created a relationship between students’ ages and heights, just by writing each student’s information as an ordered pair. In the first situation, there is a relationship between the number of candy bars you sell and the amount of money you make. The first example is different from the second because it represents a function: every \begin{align*}x\end{align*} is paired with only one \begin{align*}y\end{align*}.
Functions may be presented in many ways. Some of the most common ways to represent functions include: sets of ordered pairs, equations, and graphs. The figure below shows the same function depicted in three different ways.
Examples
Example 1
Earlier, you were given a question about movie tickets.
Does the data you received from your friends represent a function? Can you use the data to predict the cost of going to a movie yourself?
If we were to organize the information we received into ordered pairs, it might look something like: \begin{align*}(1,14.5), (1,8.75), (1,5), (1,17.5), (1,12.75)\end{align*} where each \begin{align*}x\end{align*} value represents the number of tickets bought, and each \begin{align*}y\end{align*} value represents the price.
Since there are many different \begin{align*}y\end{align*} values for the only \begin{align*}x\end{align*} value, it is definitely not a function.
It should be clear now that the information received from friends' text messages cannot really be used to accurately predict the cost of a movie.
Example 2
Determine if each relation is a function.
Representation  Example 

Set of ordered pairs  (1,3), (2,6), (3,9), (4,12) (a subset of the ordered pairs for this function) 
Equation  \begin{align*}y=3x\end{align*} 
Graph 
In the first representation above, we are given a set of ordered pairs. To verify that this is a function, we must ensure that each \begin{align*}x\end{align*}value is associated with a single \begin{align*}y\end{align*}value. In this example, the first number in each pair (the \begin{align*}x\end{align*}value) is different, so we can be certain that there are no cases where a particular \begin{align*}x\end{align*} is associated with more than one \begin{align*}y\end{align*}.
In the second representation, the equation of a line, it is apparent that any number put in place of \begin{align*}x\end{align*} will result in a different \begin{align*}y\end{align*}, since the \begin{align*}x\end{align*} number is simply being multiplied by \begin{align*}3\end{align*}.
The third representation above is a graph. A good way to determine whether a relation is a function when looking at a graph is by doing a "vertical line test". If a vertical line can be drawn anywhere on the graph such that the line crosses the relation in two places, then the relation is not a function. If all possible vertical lines will only cross the relation in one place, then the relation is a function. This works because if a vertical line crosses a relation in more than one place it means that there must be two y values corresponding to one x value in that relation. For example, the graph above of \begin{align*}y = 3x\end{align*} shows it is a function because any vertical line that is drawn only crosses the relation in one place.
Conversely, the graph below of \begin{align*}x\end{align*} = \begin{align*}y\end{align*}^{2} shows it is not a function because a vertical line can be drawn that crosses the relation in two places.
Example 3
Determine if each relation is a function.
 (2, 4), (3, 9), (5, 11), (5, 12)
This relation is not a function because 5 is paired with 11 and with 12.

Function defined as:
This relation is a function because every \begin{align*}x\end{align*} is paired with only one \begin{align*}y\end{align*}. A vertical line through the graph will always only encounter a single point.
Example 4
Determine if the following relation is a function: \begin{align*}(1,4), (0, 3), (1, 5), (1, 7), (2, 15)\end{align*}.
There are two different 'outputs' or \begin{align*}y\end{align*}values for the 'input' or \begin{align*}x\end{align*}value of 1. Because we cannot know whether 1 should go with 5 or 7 at any given time, this relation is not a function.
Example 5
Determine if the following relation is a function: \begin{align*}y = 4x\end{align*}.
This is a function. Any value chosen for x has one and only one associated value for y (4 times as big).
Review
 What is the definition of a function?
 Can a function definition be written in the form \begin{align*}x = 3y\end{align*} instead of \begin{align*}y = 3x\end{align*}?
 Is it mandatory for a function to have both an input and an output?
 Can a statement be a function if there is only one input and output?
 Give an example of a relation that is not a function, and explain why it is not a function.
For questions 6  14, identify each relation as either a function, or not a function:
 (2, 4) (4, 6) (6, 8) (3, 4) (5, 7) (8, 2)
 (1, 6) (0, 4) (4, 0) (1, 6) (3, 8)
 (Jim, Kitty) (Joe, Betty) (Brian, Alice) (Jesus, Anissa) (Ken, Kelli)
 (Jim, Alice) (Joe, Alice) (Brian, Betty) (Jim, Kitty) (Ken, Anissa)
 At a Prom dance, each boy pins a corsage on his date. Is this an example of a function?
 Later, at the same dance, Cory shows up with two dates, does this change the answer?
Review (Answers)
To see the Review answers, open this PDF file and look for section 1.1.