In this explainer, we will learn how to identify, represent, and recognize functions from schematic descriptions, arrow diagrams, and Cartesian diagrams.

In mathematics and the sciences, we are often interested in taking one object and assigning it to a new object using a process to achieve this. For example, we might take the amount of time passed and use this value to determine the position of a car at this time, or we may use the number of trials to calculate the probability of rolling a specific number on a spinner. In these cases, we are taking an input number and then using this to calculate an output value; these are examples of functions.

In general, a function assigns an object (called the input) to another object (called the output). Before we can precisely describe how a function assigns these objects, we need to recall what is meant by a binary relation.

### Definition: Binary Relation on Two Sets

A binary relation on two sets and (often shortened to just “relation”) is a subset of the Cartesian product of the sets . In other words, it is a set of ordered pairs , where and .

If , then we say that is related to .

A binary relation assigns objects to a number of different objects; we can represent this by using an arrow diagram. Let’s consider the following example of the relation “son or daughter of.”

The arrows tell us the direction of the relation. For example, we can see that Amira is connected to Fares by an arrow. This tells us that (Amira, Fares) is an element of the relation and that Amira is the daughter of Fares. We can also further deduce other relations from this diagram. We see that Dalia and Amira have the same parents, so they must be sisters. We can also see that Nabil and Adam share the same mother but have different fathers, so they are half brothers.

We are now ready to define a function as a type of relation.

### Definition: Function

A function is a relation that assigns every input to *exactly* one output.

In particular, if the relation is between the two sets and , then we say that is the domain of the function and is the codomain of the function. We also call the set of all outputs of the function the range.

This means that the domain of a function is a set of all inputs and the codomain is a set that contains all of the possible outputs. It is worth noting that the codomain is different from the range and the range is always a subset of the codomain. We will demonstrate the difference between the domain, the codomain, and the range in detail in a moment.

We can see that our above relation of “son or daughter of” is not a function, since each person has two parents. In other words, each input has two outputs instead of exactly one. We can see this from the arrow diagram.

We see that there are two arrows from Amira, so she has two parents assigned.

For an arrow diagram to represent a function, every element in the first set must be assigned exactly one element in the second set; we can write this as two separate properties:

- Every element in the first set must be assigned an element in the second set.
- Every element in the first set cannot have more than one element in the second set assigned.

Since the arrows tell us the assignments, we can rewrite these properties in terms of the arrows in the diagram:

- Every element in the first set must have an arrow originating from it.
- There can only be one arrow originating from each element in the first set.

An example of a function would be “was born in” since each person was born in only one place and everyone was born somewhere. An arrow diagram for this could be the following.

Since there is exactly one arrow originating from every person, we can conclude that the relation represents a function. We can also determine the domain, codomain, and range of this function.

First, the domain is the first set in the relation. In this case, it is the set of people: {Amira, Dalia, Nabil, Adam, Engy}.

Second, the codomain is the entire second set in the relation. In this case, it is the set of all locations: {New York, Detroit, Seattle, Boston, Chicago}.

Third, the range is the set of all outputs of the function, which will be all of the places in which these people were born. In this case, the range is the set {New York, Detroit, Seattle, Boston}. We can see this in the diagram as the set of places that have an arrow pointing to them.

We note that the codomain and range are different in this function, since none of the listed people is born in Chicago. In general, the range is always a subset of the codomain.

Let’s now see an example where we will determine whether a relation represents a function from a relation diagram.

### Example 1: Determining Whether a Relation Is a Function from a Relation Diagram

True or False: The given figure represents a function.

### Answer

We begin by recalling that a function is a relation that assigns every input to exactly one output. In an arrow diagram, the arrow tells us how the relation assigns elements of each set. If two elements are connected by an arrow, then they are related.

For this relation to represent a function, every input must be assigned to exactly one output. This means that each element in set needs to be assigned to exactly one element in set . However, we can see from the diagram that the element 5 in set is assigned to two elements in set .

Since a function cannot map an input to two different outputs, this cannot be a function, so the statement is false.

In our next example, we will determine which relation represents a function, given several different arrow diagrams of the relation.

### Example 2: Determining Which Relations Are Functions from a Relation Diagram

Which of the following relations represents a function?

### Answer

We begin by recalling that a function is a relation that assigns every input to exactly one output. In an arrow diagram, the arrows tell us how the relation assigns elements of each set; if two elements are connected by an arrow, then they are related.

Therefore, for a relation given by an arrow diagram to represent a function, two things must be true:

- Since every input must be assigned an output, every element in the first set must have an arrow originating from it.
- Since every input must be assigned to exactly one output, there can only be one arrow originating from each input.

We could combine both of these statements into one; however, it is often easier to check each condition separately. Let’s now check both conditions for each of the relations in the given diagram.

In figure A, we note that the input value of is not assigned to any output value; therefore, this does not represent a function.

In figure B, we note that every input is assigned to an output; however, the input value is assigned to two output values. Therefore, this does not represent a function.

In figure C, we note that every input is assigned to an output and that they are assigned to only one output. Therefore, this represents a function.

Hence, only the relation in figure C represents a function.

Although it is not necessary, we can also determine the domain, codomain, and range of the function from option C in the question above. The domain is the set of the input values, which is the set . The codomain is the second set in the relation; it is the set . The range is the set of all outputs from the domain, which is every element mapped to by the function. Since only 1 and 3 are outputs of this function, its range is .

So far, we have only seen functions represented as relation diagrams. However, we recall that we can represent relations in tables, sets of ordered pairs, and Cartesian diagrams. This means we can also represent functions in all of these ways. In all instances, the first element of the ordered pair is the input and the second is the output. We recall that the horizontal coordinate in a Cartesian diagram is usually the input and the vertical coordinate the output.

Let’s now see some examples where we determine which relations represent a function from different representations, starting with a table.

### Example 3: Determining Whether a Relation Is a Function from a Table

Which of the following represents a function with input and output ?

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

0 | 3 | 8 | |||

6 | 8 | 20 | 4 | 8 |

Relation B | |||||
---|---|---|---|---|---|

0 | 7 | ||||

6 | 8 | 20 | 4 | 8 |

### Answer

We begin by recalling that a function is a relation that assigns every input to exactly one output. In a table, the first element usually tells us the input and the corresponding second element is its assigned output.

Therefore, for a table to represent a function, every input must have an assigned output and it must have exactly one assigned output. In other words, we cannot have an input value with two (or more) different outputs. We can check each relation separately to see whether they meet these criteria.

In relation A, we note that there are no blank -values, so every input is assigned an output. Next, we note that each -value only appears once, so no input value is assigned multiple outputs. Therefore, relation A represents a function.

In relation B, we note that there are no blank -values, so every input is assigned an output. Next, we note that the input of is repeated in the table.

This means that in the relation B, is assigned to multiple elements in set , both 6 and 20. In a function, a relation can only assign each input a single output, so this cannot be a function.

Hence, only relation A represents a function.

In our next example, we will determine which relation represents a function from its ordered pairs.

### Example 4: Determining Whether a Relation Is a Function from a Set of Ordered Pairs

Which of the following relations represents a function?

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

Relation B |

### Answer

We begin by recalling that a function is a relation that assigns every input to exactly one output. In an ordered pair, , the first element is related to the second element.

Therefore, for a set of ordered pairs (called a relation) to represent a function, we cannot have the same first entry related to two different second entries. We can check this by seeing which relation has distinct first entries.

In relation A, we see that 4 is related to elements in the second set, both 12 and 15. Similarly, 5 is related to both 18 and 21. Therefore, this is not a function.

In relation B, we see that each of the ordered pairs has a unique first entry, so we can say that this relation represents a function. We can see this more visually by constructing an arrow diagram representing each relation.

In relation A, two elements in the input set are assigned to two elements in the output set, so this is not a function. In relation B, every element in the input set is assigned to exactly one element in the output set, so this is a function.

Hence, the answer is that relation B represents a function.

In our next example, we will determine which of a given list of Cartesian diagrams represents a function.

### Example 5: Determining Whether a Relation Represented by a Cartesian Diagram Is a Function

Which of the following Cartesian diagrams represents a function from to , where ?

### Answer

We begin by recalling that a function is a relation that assigns every input to exactly one output. Any point on the Cartesian diagram of a relation is an ordered pair and tells us that is related to .

Additionally, the horizontal coordinate usually represents the input and the vertical coordinate usually represents the output.

Therefore, since a function must have every element of the input set mapped to exactly one element of the output set, the following two conditions must be true for the Cartesian diagram to represent a function from to :

- Since every input must be assigned an output, there must be a point on the diagram with an -coordinate equal to every element of .
- Since we cannot assign two outputs to the same input, there cannot be two distinct points on the diagram with the same -coordinate on the horizontal axis.

We can then check each of the diagrams separately for each of these conditions.

First, in diagram a, we see that the coordinates of the points on the diagram are , and . We can see that every element of is an -coordinate of a point, so every element of is assigned an output. We can also see each element only appears once, so each is assigned only one output; therefore, this represents a function.

Second, in diagram b, we can notice there is no point on the diagram with -coordinate 5.

Since a function must map every element of the input set to one element in the output set, we can conclude this relation does not represent a function defined on since 5 is not assigned an output.

Third, we have a similar story in diagram c.

11 is not assigned an output, so this cannot represent a function defined on .

Finally, in diagram d, we can see that every input value is assigned an output value. However, we can also notice that 7 is assigned 2 output values.

Since and are both on the diagram of this relation, the relation assigns 7 to two different values, both 7 and 9. A function can only assign each input to one output, so this relation does not represent a function.

Hence, only the relation in diagram a represents a function from to .

In our final example, we will use the fact that a relation is a function to determine the values of unknowns in the relation.

### Example 6: Finding Unknown Values Given a Function between Two Sets

Given that and , where is a function on , find the numerical value of .

### Answer

We begin by recalling that a function on a set is a relation that assigns every “input” element of to exactly one “output” element of . Therefore, since is a function on , it is a relation on , which means it is a subset of . In other words, each element of is an ordered pair, where the first entry in the ordered pair is the input and the second entry is the output.

Since is a function, every input needs to be assigned to one output; this means each element of must be the first entry in one of the ordered pairs of and it cannot appear in more than one ordered pair, otherwise, it would be assigned two outputs.

Since and are the first entry in the ordered pairs of , these are input values of the function. This means that ; we can also see that outputs and outputs .

We note that , so is assigned the output value of 9. Since is a function, cannot also be assigned the output value of or , which means and cannot be .

At this point, there are two possibilities for and . We note that and cannot be equal, otherwise, the same input is assigned two outputs. We also see that only has three elements, and we know that and cannot be , so we have two options: , or , .

Both of these choices make a function; each input from is assigned one output in .

In both cases, .

Let’s finish by recapping some of the important points from this explainer.

### Key Points

- A function is a particular type of relation between two sets.
- A relation is a function if the following two conditions hold:
- Every element of the input set must have an assigned output.
- No element of the input set is mapped to more than one element of the output set.

- If a relation is a function on the two sets and , then we say that is the domain of the function and is the codomain of the function. We also call the set of all outputs of the function the range.
- Functions can be represented as diagrams, as ordered pairs, in tables, or as schematic descriptions.