Lesson Explainer: Relations and Functions | Nagwa Lesson Explainer: Relations and Functions | Nagwa

Lesson Explainer: Relations and Functions Mathematics • Third Year of Preparatory School

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:

  1. Every element in the first set must be assigned an element in the second set.
  2. 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:

  1. Every element in the first set must have an arrow originating from it.
  2. 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:

  1. Since every input must be assigned an output, every element in the first set must have an arrow originating from it.
  2. 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 {1,2,3,4}. 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 {1,3}.

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
π‘‹βˆ’3038βˆ’10
π‘Œ682048
Relation B
π‘‹βˆ’20βˆ’27βˆ’8
π‘Œ682048

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 βˆ’2 is repeated in the table.

This means that in the relation B, βˆ’2 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(4,12)(4,15)(5,18)(5,21)(6,24)
Relation B(4,12)(5,15)(6,18)(7,21)(8,24)

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 π‘₯={5,7,9,11}?

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 π‘₯:

  1. Since every input must be assigned an output, there must be a point on the diagram with an π‘₯-coordinate equal to every element of π‘₯={5,7,9,11}.
  2. 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 (5,5),(7,9),(9,7), and (11,11). We can see that every element of π‘₯={5,7,9,11} 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 (7,7) and (7,9) 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 𝑋={βˆ’7,βˆ’1,9} and 𝑅={(π‘Ž,βˆ’1),(𝑏,βˆ’7),(βˆ’7,9)}, 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 βˆ’1 and 𝑏 outputs βˆ’7.

We note that (βˆ’7,9)βˆˆπ‘…, so βˆ’7 is assigned the output value of 9. Since 𝑅 is a function, βˆ’7 cannot also be assigned the output value of βˆ’1 or βˆ’7, which means π‘Ž and 𝑏 cannot be βˆ’7.

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 βˆ’7, so we have two options: π‘Ž=9, 𝑏=βˆ’1 or π‘Ž=βˆ’1, 𝑏=9.

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

In both cases, π‘Ž+𝑏=8.

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:
    1. Every element of the input set must have an assigned output.
    2. 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.

Join Nagwa Classes

Attend live sessions on Nagwa Classes to boost your learning with guidance and advice from an expert teacher!

  • Interactive Sessions
  • Chat & Messaging
  • Realistic Exam Questions

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy