Two functions are equal if they have the same domain and codomain and their values are the same for all elements of the domain.
Definition7.18.
Let \(A\) and \(B\) be sets and \(f:A\to B\) and \(g:A\to B\) be functions. We say that \(f\) and \(g\) are equal and write \(f=g\) if \(f(a)=g(a)\) for all \(a\in A\text{.}\) If \(f\) and \(g\) are not equal, we write \(f\ne g\text{.}\)
In our definition of the equality of functions, we have assumed that the two functions have the same domain and codomain. Two functions that do not have the same domain and codomain are not equal.
Checkpoint7.19.Definition of equality of functions.
Complete the following:
Let f : A \(\rightarrow\) B and g : A \(\rightarrow\) B be functions. We say that the function f
select
in not equal to
is equal to
is similar to
is like
the function g and write f = g if f(c) = g(c)
select
for one element c of A
for one element c of B
for some elements c of A
for some elements c of B
for all elements c of A
for all elements c of B
.
In the video in Figure 7.20 we recall the definition and show how one can determine whether two functions are equal.
Example7.21.Equal functions.
Let \(f:\Z_5\to\Z_5\) be given by \(f(a):=(a+1)\bmod 5\) and \(g:\Z_5\to\Z_5\) be given by \(g(a):=(a-4)\bmod 5\text{.}\) First, note that the domains of \(f\) and \(g\) are the same and the codomains of \(f\) and \(g\) are the same. We show that \(f=g\) by evaluating both \(f\) and \(g\) at each element of the common domain \(\Z_5=\{0,1,2,3,4\}\) and then comparing the function values for the same elements.
\(f(0)=(0+1)\bmod 5=1\)
\(g(0)=(0-4)\bmod 5=1\)
\(f(1)=(1+1)\bmod 5=2\)
\(g(1)=(1-4)\bmod 5=2\)
\(f(2)=(2+1)\bmod 5=3\)
\(g(2)=(2-4)\bmod 5=3\)
\(f(3)=(3+1)\bmod 5=4\)
\(g(3)=(3-4)\bmod 5=4\)
\(f(4)=(4+1)\bmod5=0\)
\(g(4)=(4-4)\bmod 5=0\)
Since \(f(a)=g(a)\) for all \(a\in\Z_5\text{,}\) we have \(f=g\text{.}\)
Problem7.22.Are these functions equal ?
Decide whether the two functions
\begin{align*}
f:\Z_3\to \Z_3 \amp \text{ given by } f(x)=(x^2+1)\fmod 3\\
g:\Z_3\to \Z_3 \amp \text{ given by } f(x)=(x-2)\fmod 3
\end{align*}
are equal.
Solution.
We evaluate \(f\) and \(g\) at elements of their domain \(\Z_3=\{0,1,2\}\text{.}\) If \(f(x)=g(x)\) for all \(x\in\Z_3\) then \(f=g\text{.}\)
\(f(0)=(0^2+1)\fmod 3 = 1\)
\(g(0)=(0-2) \fmod 3 = 1\)
\(f(1)=(1^2+1)\fmod 3 = 2\)
\(g(1)=(1-2) \fmod 3 = 2\)
\(f(2)=(2^2+1)\fmod 3 = 2\)
\(g(2)=(2-2) \fmod 3 = 0\)
As \(f(2)\ne g(2)\) the two functions \(f\) and \(g\) are not equal.
Now use this method to determine whether two functions are equal.
Checkpoint7.23.Determine whether two functions are equal.
To determine whether the functions
\(f:\mathbb{Z}_{6}\to\mathbb{Z}_{6},\;\)\(f(x)=(x+1)\bmod 6\) and
are equal, evaluate them at all points of their domain:
\(f(0) =\)\(g(0) =\)
\(f(1) =\)\(g(1) =\)
\(f(2) =\)\(g(2) =\)
\(f(3) =\)\(g(3) =\)
\(f(4) =\)\(g(4) =\)
\(f(5) =\)\(g(5) =\)
Now conclude whether they are equal.
The function \(f\)
select
is equal to
is not equal to
the function \(g\text{.}\)
In Example 7.24 we determine whether a function given by a plot is equal to a function given by an equation.
Example7.24.
Let the graph of the function \(f\) be given by
The plot immediately yields that the domain of \(f\) is \(\mathbb{Z}_{9}\) and that the codomain of \(f\) is \(\mathbb{Z}_{10}\text{.}\) We read off the images of the elements of the domain \(f\text{:}\)
Let \(g:\mathbb{Z}_{9}\to\mathbb{Z}_{10}\) be given by \(g(x)=3\cdot x \bmod 10\text{.}\)
We now determine whether the functions\(f\) and \(g\) are equal. We have already found \(f(x)\) for all \(x\in\mathbb{Z}_{9}\text{.}\) Now we compute \(g(x)\) for all \(x\in\mathbb{Z}_{9}\text{.}\) We get:
Because \(f\) and \(g\) have the same domain and codomain and because \(f(x)=g(x)\) for all \(x\in \mathbb{Z}_{9}\) we conclude that the two functions \(f\) and \(g\) are equal.