In this explainer, we will learn how to identify a function from a relation shown by a set of ordered pairs, a relation diagram, an equation, or a graph.

A **relation**, or mapping, transforms elements from one set onto elements from another. If every input in this mapping has exactly one output,
it is called a **function**.

### Definition: Functions

A function maps *every* element from an input set onto *exactly* one element from an output set. Functions can be either one-to-one
(one input has one output) or many-to-one (many inputs map onto the same output).

If a function maps elements of to , we can use the following notation:

Functions can be represented by ordered pairs of numbers, mapping diagrams, equations, and graphs.

In our first example, we will demonstrate how to apply this definition of a function to determine whether a set of ordered pairs defines a function.

### Example 1: Recognizing Whether a Set of Ordered Pairs Defines a Function

Which of the following relations represents a function?

Relation A | |||||
---|---|---|---|---|---|

Relation B |

### Answer

Recall that a function is a rule that takes every member of a set and maps it onto *exactly one* member in a second set.
For a group of ordered pairs the input is and the output is .
For the group of ordered pairs to represent a function, no two ordered pairs can have the same input with a different output.
In other words, if an ordered pair shares the same -value, their -value must also be the same.

We observe that relation A has two ordered pairs with an -value of 4. If relation A is a function, then the corresponding -values in these ordered pairs must also be the same. However, the ordered pairs are and . Since the -values are not the same, relation A cannot represent a function. Similarly, the relation has two ordered pairs with an -value of 5, but with different -values.

The ordered pairs of relation B have unique -values, so relation B represents a function.

We can represent ordered pairs using a mapping diagram, or relation diagram. These diagrams consist of parallel columns which individually represent the input of the function and the output of the function.

Consider relation A from example 1. We can represent this relation in a mapping diagram as shown below.

We observe that elements 4 and 5 from the input column map to *more than one* element in the output column. This mapping diagram cannot,
therefore, represent a function.

Note: For a mapping diagram to represent a function, every input value must have a single output.

We will now look at an example that requires us to identify a function from three mapping diagrams.

### Example 2: Identifying Functions from Relation Diagrams

Which of the following relations represents a function?

### Answer

In this question, we are presented with three relation diagrams. These diagrams are used to represent the relationship between input values and output
values. A relation diagram represents a function if, and only if, the elements from one set map onto *exactly* one element from the second set.

We will begin by looking at diagram A. Elements and map onto the single elements 1 and 3 respectively.
These inputs do have exactly one output. However, we also know that for a mapping diagram to represent a function, *every* input value must
have an output. Element does not map onto an element in the second set, so relation diagram A does not represent a function. In fact, this is an example of an invalid mapping diagram, since a mapping diagram should provide an output for all inputs.

Next, we consider diagram B.

In this relation diagram, every input has an output. However, the element is mapped onto elements 2 *and*
3 in the second set. Since the elements from one set must map onto *exactly* one element from the second set, relation diagram B
cannot represent a function.

We might deduce, then, that diagram C represents a function. We can verify this by checking that each input has exactly one output. Element maps onto 3, element maps onto 1, and element maps onto 3.

Relation diagram C represents a function.

In the previous example, we saw that C was a relation that represented a function. For this function, the input values (,
, and ) are called the **domain** of the function and the possible output values (1, 2, 3, and 4)
are called the **codomain** of the function. The actual outputs of the function, in this case 1 and 3, are called the **range** of the function.

Since a function can be represented by a set of ordered pairs, it follows that we can also use a graph as a visual representation of a function. The graph of a function is defined by a set of ordered pairs such that .

For instance, consider the function defined by . The set of ordered pairs that represent this function is given by , where . Then, the graph of the function is given by the graph of , as shown below.

This is an example of a **many-to-one** function; there are values in the range of the function that are associated with more than
one value in the domain.

To establish whether a graph represents a function, we use the vertical line test.

### How To: Using the Vertical Line Test

Use a ruler or a straight edge to draw a line parallel to the -axis for some value of . If the vertical line intersects the curve more than once, the graph does not represent a function. If the line does intersect the curve exactly once for a given set of inputs (which does not need to be all real numbers), then the graph does represent a function.

In figure 1, a vertical line intersects the curve twice. This graph does not represent a function. In figure 2, a vertical line intersects the curve exactly once at all points in the functionβs domain, so the graph does represent a function.

We will now demonstrate an application of the vertical line test.

### Example 3: Using the Vertical Line Test to Identify Functions

Which of the following relations represents a function given that is the input and is the output?

### Answer

The vertical line test is a graphical way of determining whether a graph represents a function. If a graph represents a function,
*any* vertical line will intersect the function at most once. We will therefore add a vertical line to both diagrams and inspect
the number of points of intersection with the curves.

Observe that if we add the vertical line to graph (a), the line intersects the curve twice. Hence, graph (a) cannot represent a function.

The vertical line intersects the curve of graph (b) exactly once. We could translate this vertical line by any distance horizontally and this would always be the case.

Hence, graph (b) represents a function.

Our definition of a function says that it is some rule that maps an input onto exactly one output. In many cases, we can define that rule algebraically. For instance, in example 3, the graph that represented a function was the graph of . The function can therefore be defined either as (functional notation) or (arrow notation). This means that we can determine whether represents a function by plotting the graph of and performing the vertical line test.

### Example 4: Recognizing When an Equation Represents a Function

Can the equation be expressed as a function? If yes, state the function.

### Answer

The vertical line test can be used to determine whether a graph represents a function. So, in order to establish whether the equation can be expressed as a function, we can plot its graph.

Recall that the equation of a circle centered at the origin whose radius is units is given by

This means the equation represents a circle centered at the origin with a radius of units. A sketch of this graph is shown below.

To establish whether this graph represents a function, we add a vertical line to the diagram and check the number of points of intersection with the curve. If there are more than one point of intersection, the graph does not represent a function.

The vertical line intersects the curve twice, so this graph, and hence , does not represent a function.

No, the equation cannot be expressed as a function.

In our previous example, it was fairly easy to sketch the graph of the equation so we could perform the vertical line test. However, we might have instead attempted to rewrite the equation in terms of , as

We notice that when we take the square root of both sides of the equation, we take the positive *and negative* square root
of the expression . This means that for any single value of , there could be two possible outputs,
a positive and a negative. Since a function maps *every* element from one set onto *exactly* one element from a second set, we can
deduce that the equation cannot represent a function.

In our final example, we will demonstrate how to perform a similar process to represent an equation in function notation.

### Example 5: Recognizing an Equation Represented in Function Notation

Which of the following is the equation expressed in function notation?

- This cannot be expressed as a function.

### Answer

To write an equation in function notation, we need to see whether we can express as a function of , . We will therefore rearrange the equation to make the subject. We find the cube root of both sides of the equation to obtain

We observe that is now written as a function of ; in other words, to find the value of , we can substitute a value of into the expression .

To express in function notation, we write . The answer is (D).

In the previous example, we rearranged an equation to write as a function of . Performing this process will not always result in a function, and care must be taken to ensure that any -value from the domain of that function yields a unique -value when substituted in. For this reason, any rearrangement that results in needing to invert an even exponent (e.g., the square root or fourth root), will not result in a function.

Let us finish by recapping some key concepts from this explainer.

### Key Points

- A function maps
*every*element from an input set onto*exactly*one element from an output set. - Functions can be either one-to-one (one input has one output) or many-to-one (many inputs map onto the same output).
- Functions can be represented by ordered pairs of numbers, mapping diagrams, equations, and graphs.
- The function notation means that is a function of .
- The arrow notation means that the function maps elements of set onto an element of set .