## Section7.2Equality of Functions

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.2.1.

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.

In Checkpoint 7.2.2 fill in the blanks to

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

.

$$\text{is equal to}$$

$$\text{for all elements c of A}$$

In the video in Figure 7.2.3 we recall the definition and show how one can determine whether two functions are equal.

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{.}$$

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.

To determine whether the functions

$$f:\mathbb{Z}_{6}\to\mathbb{Z}_{6},\;$$ $$f(x)=(x+1)\bmod 6$$ and

$$g:\mathbb{Z}_{6}\to\mathbb{Z}_{6},\;$$ $$g(x)=(x-1)\bmod 6$$

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{.}$$

$$1$$

$$5$$

$$2$$

$$0$$

$$3$$

$$1$$

$$4$$

$$2$$

$$5$$

$$3$$

$$0$$
$$4$$
$$\text{is not equal to}$$