Relations and Functions

Let’s start by saying that a relation is simply a set or collection of ordered pairs. Nothing really special about it. An ordered pair, commonly known as a point, has two components which are the [latex]x[/latex] and [latex]y[/latex] coordinates.

This is an example of an ordered pair.

in the point (5,-2), 5 is the x-coordinate while -2 is the y-coordinate

Main Ideas and Ways How to Write or Represent Relations

As long as the numbers come in pairs, then that becomes a relation. If you can write a bunch of points (ordered pairs) then you already know how a relation looks like. For instance, here we have a relation that has five ordered pairs written in set notation using curly braces.

Relation in set notation

{(-2,1),(-2,3),(0,-3),(1,4),(3,1)}

However, aside from set notation, there are other ways to write this same relation. We can show it in a table, plot it on the [latex]xy[/latex]-axis, and express it using a mapping diagram.

  • Relation in table
a table with wherein the x column has entries -2, -2, 0, 1, and 3 while the y column has entries 1, 3, -3, 4 and 1
  • Relation in graph
a graph showing five points on the plane with coordinates (-2,1), (-2,3), (1,4), (3,1) and (0,-3)
  • Relation in mapping diagram
a mapping diagram where the element -2 is mapped to 1 and 3, the 0 is mapped to -3,  1 is mapped to 4, and 3 is mapped to 1

We can also describe the domain and range of a given relation.

  • The domain is the set of all [latex]x[/latex] or input values. We may describe it as the collection of the first values in the ordered pairs.
  • The range is the set of all [latex]y[/latex] or output values. We may describe it as the collection of the second values in the ordered pairs.

So then in the relation below 

{ (-2,1), (-2,3), (0,-3), (1,4), (3,1) }

our domain and range are as follows:

domain is {-2, 0, 1, 3}, range is {-3, 1, 3, 4}

When listing the elements of both domain and range, get rid of duplicates and write them in increasing order.


What Makes a Relation a Function?

On the other hand, a function is actually a “special” kind of relation because it follows an extra rule. Just like a relation, a function is also a set of ordered pairs; however, every [latex]x[/latex]-value must be associated to only one [latex]y[/latex]-value.

Suppose we have two relations written in tables,

  • A relation that is not a function
a table where the x column has entries -3, -1, 0, 5, and 5 while the y column has entries 7, 5, -2, 9, and 3

Since we have repetitions or duplicates of [latex]x[/latex]-values with different [latex]y[/latex]-values, then this relation ceases to be a function.

  • A relation that is a function
a table with entries on the first column of -2, -1, 0, 4, and 5, and entries on the second column of 0, -2, 3, -1, and -3

This relation is definitely a function because every [latex]x[/latex]-value is unique and is associated with only one value of [latex]y[/latex]. Because of this specific property, a relation behaves well. As a result, a function can be thought of as a well-behaved relation.

So for a quick summary, if you see any duplicates or repetitions in the [latex]x[/latex]-values, the relation is not a function. How about this example though? Is this not a function because we have repeating entries in [latex]x[/latex]?

a table with x entries of 1, 1, 3, 3,3 and y entries of 5, 5, -8, -8, -8

Be very careful here. Yes, we have repeating values of [latex]x[/latex] but they are associated with the same value of [latex]y[/latex]. The point (1,5) shows up twice, while the point (3,-8) is written three times. This table can be cleaned up by writing a single copy of the repeating ordered pairs.

the old table is simplified to a new table with entries on the first column of 1,3 and entries on the second column of 5, -8

The relation is now clearly a function!

So in summary, every function is a relation but not all relations are functions. I hope the diagram below clearly illustrates the concept.

A diagram that illustrates that every function is a relation but not all relations are functions.

Examples of How to Determine if a Relation is also a Function

Let’s go over a few more examples by identifying if a given relation is a function or not.

Example 1: Is the relation expressed in the mapping diagram a function?

a mapping diagram where 5 is mapped to 2, 7 to 0, 8 to 1, and 10 to 2

Each element of the domain is being traced to one and only element in the range. However, it is okay for two or more values in the domain to share a common value in the range. That is, even though the elements 5 and 10 in the domain share the same value of 2 in the range, this relation is still a function.


Example 2: Is the relation expressed in the mapping diagram a function?

a mapping diagram where the elements 1, 2, 3, 4 and 5 are mapped to the same element -2

What do you think? Does each value in the domain point to a single value in the range? Absolutely! There’s nothing wrong when four elements coming from the domain are sharing a common value in the range. This is a great example of a function as well.


Example 3: Is the relation expressed in the mapping diagram a function?

-8 is mapped to 7, -1 to 9, 0 to 9, 0 to 9, and 15 to both 7 and 9

Messy? Yes! Confusing? Not really. The only thing I am after is to observe if an element in the domain is being “greedy” by wanting to be paired with more than one element in the range. The element [latex]15[/latex] has two arrows pointing to [latex]7[/latex] and [latex]9[/latex]. This is a clear violation of the requirement to be a function. A function is well behaved, that is, each element in the domain must point to one element in the range. Therefore, this relation is not a function.


Example 4: Is the relation expressed in the mapping diagram a function?

a mapping diagram where the element 5 is being mapped to different elements namely -6, -2, 4, and 11

If you think example #3 was bad, this example is the absolute worst! A single element in the domain is paired with four elements in the range. Remember, if an element in the domain is associated with more than one element in the range, the relation is automatically disqualified as a function. Thus, this relation is absolutely not a function.