2.01__Relations_and_functions
2.01__Relations_and_functions
Relations
We often indicate that two numbers are related to each other using notation that we call an ordered pair. This notation pairs two
numbers together using parentheses, for example, (3, 7). You can interpret this as "3 is related to 7". The order is important because
the first number is often thought as an input and the second number is often thought as an output. If we want to indicate a generic
ordered pair, it is common to write it as x, y, where x is used to indicate inputs and y is used to indicate outputs.
Ordered pairs are the building blocks of a relation, which we can use to describe how numbers might be related to each other.
Definition: RELATION
is a relation. We can interpret this as "0 is related to 1", "0 is also related to 2", and "3 is related to 4".
While ordered pairs offer a concise way to show relations, we can also use mapping diagrams with arrows or tables to display
relations, with the first entry (or input) of each ordered pair on the left side of the diagram or table and the second entry (or output)
on the right side of the diagram or table.
Example 2.1.1
Create a mapping diagram and a table for the relation R = {(0, 1), (0, 2), (3, 4)}.
Solution
A mapping diagram connects the related numbers using arrows, with the first entry (or input) on the left side and the second
entry (or output) on the right side.
The pair (0, 1) means "0 is related to 1", so we draw an arrow from 0 pointing to 1, and the pair (0, 2) means "0 is related to
2", so we also draw an arrow from 0 pointing to 2. Similarly, 3, 4 means that "3 is related to 4", so our last arrow starts at 3 and
points to 4.
2.1.1 https://math.libretexts.org/@go/page/108413
If we want to set this up in a table, we place our inputs on the left side and our outputs on the right side:
0 1
0 2
3 4
Since the order of the numbers in each pair matters, it's helpful to be able to talk about just the inputs or just the outputs for a
specific relation. These are what we call the domain and range of a relation.
Definition: DOMAIN
The domain of a relation is the collection of the first entries of each ordered pair.
Example 2.1.2
Find the domain for the relation R = {(0, 1), (0, 2), (3, 4)}.
Solution
The domain is the collection of the first entries of the ordered pairs in a relation. For R , this is the collection
Domain = {0, 3} . Note that even though 0 appears twice as an input, we only list it once.
When we want to talk about the collection of outputs, or the second entry of each ordered pair in a relation, we call this the range
of the relation.
Definition: RANGE
The range of a relation is the collection the second entry of each ordered pair.
We often talk about the range as being the collection of all possible outputs or y values.
Example 2.1.3
Find the range for the relation R = {(0, 1), (0, 2), (3, 4)}.
Solution
The range is the collection of the second entries of the ordered pairs in a relation. For R , this is the collection
Range = {1, 2, 4}. (2.1.2)
Exercise 2.1.4
Find the domain and range for the relation R = {(−3, 5), (−2, 3), (0, 12), (1, −2), (6, 5)}
Answer
The domain is {−3, −2, 0, 1, 6}. The range is {−2, 3, 5, 12}.
Exercise 2.1.5
Find the domain and range for the relation R = {(−4, 2), (−4, 5), (−1, 0), (3, −2), (5, −1)}.
Answer
2.1.2 https://math.libretexts.org/@go/page/108413
The domain is {−4, −1, 3, 5}. The range is {−2, −1, 0, 2, 5}.
We can also determine the domain and range of a relation that has been displayed using a mapping diagram or a table.
Example 2.1.6
Determine the domain and range for the relation shown in the mapping diagram.
Solution
The domain is {−2, −1, 0, 2}. Notice that we do not include 1 in the domain because it is not mapped to anything in the
relation, so it is not an input.
The range is {−5, −4, −3, −2}. Notice that we do not include -1 in the range because it does not have anything that gets
mapped to it by the relation, so it is not an output.
Exercise 2.1.7
Determine the domain and range for the relation shown in the mapping diagram.
Answer
The domain is {−3, −1, 0, 4, 5}. The range is {−2, 0, 1, 2, 7}.
Example 2.1.8
Determine the domain and range for the relation shown in the table.
2.1.3 https://math.libretexts.org/@go/page/108413
Inputs (or x) Outputs (or y)
−2 0
−1 2
3 −2
3 4
5 4
Solution
The domain is {−2, −1, 3, 5}. The range is {−2, 0, 2, 4}.
Exercise 2.1.9
Determine the domain and range for the relation shown in the table.
−17 −3
−5 4
0 −1
7 8
10 4
Answer
The domain is {−17, −5, 0, 7, 10}. The range is {−3, −1, 4, 8}.
Functions
A function is a special type of relation and will be very important throughout the rest of the course.
Definition: FUNCTION
In other words, a function is a specific kind of relation where none of the first entries are repeated. If we want to think about this in
terms of domain and range, each number in the domain is related to exactly one number in the range.
Example 2.1.10
Solution
a. For the relation R = {(0, 1), (1, 3), (3, 4), (5, 2)}, each input has exactly one output, so it is a function.
b. For the relation R = {(0, 1), (0, 2), (3, 4)}, the input 0 has two outputs, 1 and 2, that correspond to it, so this is not a
function (but it is still a relation!).
Exercise 2.1.11
Answer
2.1.4 https://math.libretexts.org/@go/page/108413
a. Not a function
b. Function
A mapping diagram can make it easier to determine if a relation is also a function. When a relation is a function, each input has
exactly one output, so on its mapping diagram, each input will only have one arrow leaving it. When a relation is not a function,
some of the inputs may have more than one output, so some inputs may have multiple arrows leaving it.
Example 2.1.12
Use a mapping diagram to determine if the relation R = {(0, 1), (1, 3), (3, 4), (5, 2)} is a function.
Solution
First, create the mapping diagram corresponding to this relation. You can choose whether or not to include the numbers not
used in the ordered pairs; a few extra numbers isn't a big deal and won't affect the answer.
Since each input on the left only has one arrow attached to it, each input has only one output, meaning R is a function. (it's
okay that not every number is an input or an output!)
Example 2.1.13
Use a mapping diagram to determine if the relation R = {(0, 1), (0, 2), (3, 4)} is a function.
Solution
First, we create the mapping diagram for this relation.
Since 0 has two arrows leaving it, we see that it has two outputs that correspond to it. Therefore, R cannot be a function.
Function Notation
One way to think about a function is as being a rule that pairs one input with one output. The rule can take many forms. For
example, we can use sets of ordered pairs, graphs, and mapping diagrams to describe the function. In the sections that follow, we
2.1.5 https://math.libretexts.org/@go/page/108413
will explore other ways of describing a function, for example, through the use of equations and simple word descriptions.
Before we can talk about writing the rule for a function using an equation, we must define a new notation that we call function
notation. If f is a function, function notation looks like
f (x) = y. (2.1.4)
In other words, if we want to know what a function does to a given input, we indicate the function with f , place the input in
parentheses, and set it equal to the corresponding output. We call this evaluating the function. Note: in this setting, the parentheses
do not represent multiplication; we are not multiplying the function f by the input.
Example 2.1.14
a. f(1)
b. f(5)
c. f(3)
Solution
a. Since the function f sends 1 to 3, f (1) = 3 .
b. Since the function f sends 5 to 2, f (5) = 2 .
c. Since the function f sends 3 to 4, f (3) = 4 .
In a. , for example, this notation is read as "f of 1 is equal to 3", meaning that when we evaluate f with the input 1, the output is 3.
It is helpful to think of a function as a machine. The machine receives input, processes it according to some rule, then outputs a
result. Something goes in (input), then something comes out (output). This is how a function pairs numbers in its domain with
numbers in its range.
For the rest of this course, the rule that a function follows will be given by an equation using a variable. This allows us to evaluate a
function for a much larger collection of numbers than in our previous examples. For example,
f (x) = 2x. (2.1.5)
For this function, the rule is that we take the input number that x represents, and then multiply it by 2.
To evaluate a function f that uses an equation for a rule, we take the input and swap it out for x in the rule.
Example 2.1.15
For the function f (x) = 2x, evaluate the following:
a. f (3)
b. f (−1)
c. f (0)
Solution
a. To evaluate f (3), we substitute the x in the rule that f follows with the 3. Therefore, f (3) = 2 ⋅ 3 = 6. So our final answer
is f (3) = 6 .
b. To evaluate f (−1), we substitute the x in the rule that f follows with the -1. Therefore, f (−1) = 2 ⋅ (−1) = −2. So our
final answer is f (−1) = −2 .
c. To evaluate f (0), we substitute the x in the rule that f follows with the 0. Therefore, f (0) = 2 ⋅ 0 = 0. So our final answer
is f (0) = 0 .
2.1.6 https://math.libretexts.org/@go/page/108413
Exercise 2.1.16
For the function f (x) = x 2
+3 , evaluate the following:
a. f (−2)
b. f (0)
c. f (4)
Answer
a. To evaluate f (−2), we substitute the x in the rule that f follows with the -2. Be careful with the negative! We
recommend surrounding the -2 with parentheses. We get f (−2) = (−2) + 3 = 4 + 3 = 7. . So our final answer is
2
f (−2) = 7 .
b. f (0) = 3 .
c. f (4) = 19.
Exercise 2.1.17
Answer
a. f (−5) = 10
b. f (−1) = 6
c. f (0) = 5
If a function is defined by an equation, then the domain of the function is the set of “permissible x-values,” the values that
produce a real number response defined by the equation.
We sometimes like to say that the domain of a function is the set of “all possible inputs.”
Example 2.1.18
Solution
it is immediately apparent that we can use any value we want for x in the rule f (x) = 3x − 4 . Thus, the domain of f is all real
numbers. We can write that the domain D = R , or we can use interval notation and write that the domain D = (−∞, ∞) .
However, not every input is allowed when defining a function using an equation for the rule. For example, you cannot take the
square root of a negative number and get a real number back, or divide by zero. So let's look at examples that have restrictions to
2.1.7 https://math.libretexts.org/@go/page/108413
their domain.
Example 2.1.19
Solution
It is not possible to take the square root of a negative number. Therefore, x must either be zero or a positive real number. In set-
builder notation, we can describe the domain with D = {x : x ≥ 0} . In interval notation, we write D = [0, ∞) .
Example 2.1.20
Solution
If we define a function with this rule we immediately see that x = 3 will put a zero in the denominator. Division by zero is not
allowed. Therefore, 3 is not in the domain of f . No other x-value will cause a problem. The domain of f is best described with
set-builder notation as D = {x : x ≠ 3} ; that is, any number other than 3 is allowed to be "plugged in" the function
f (x) = x1/(x − 3).
Example 2.1.21
Solution
We can create any real number using the rule 3x − 4 . Therefore, the range of f is all real numbers. We say that the range is
R = R , or we can use interval notation and say that the range is R = (−∞, ∞) .
Just like with the domain, not every function has a range including all real numbers. That is, not every function is capable of
producing all real numbers.
Example 2.1.22
Solution
If we square any real number, it becomes positive. For example, f (−2) = 4 or f (−5) = −25 . If we square zero, we just get
zero back. In other words, f (0) = 0 . Squared numbers can be as large as we want them to be, so the range has to include zero
and any positive number, but it cannot include any negative numbers. So we can describe the range with R = [0, ∞) .
2.1.8 https://math.libretexts.org/@go/page/108413
Example 2.1.23
Find the range for the following function: f (x) = 1/(x − 3)
Solution
No matter what value we place in the denominator, the rule 1/(x − 3) will never produce the number 0. However, it is possible
to create any other real number using this rule. Therefore, the range of this function is everything except 0. We indicate this by
saying that the range is R = {y : y ≠ 0} . In other words, this function can produce any y -value except 0.
Key Concepts
An ordered pair relates one number to another number. The first number is often represented with an x and the second with a
y . Order is important! These numbers cannot be swapped and still have the same meaning.
This page titled 2.1: Relations and functions is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Stanislav
A. Trunov and Elizabeth J. Hale.
2.1: Introduction to Functions by David Arnold is licensed CC BY-NC-SA 2.5. Original source:
https://web.archive.org/web/20200814023923/http://msenux2.redwoods.edu/IntAlgText/.
2.1.9 https://math.libretexts.org/@go/page/108413