Skip to main content
Logo image

Section 7.2 Graphs of Functions

In Definition 7.2 we had introduced the image of an element of the domain under a function. The set of all these images is called the image of the function.

Definition 7.13. Image of a function.

The image of a function \(f:A\to B\) is
\begin{equation*} f(A) = \left\{ f(x) \mid x \in B \right\}. \end{equation*}
For all \(x\) in the domain of \(f:A\to B\) we have \(f(x)\in B\text{,}\) thus the image \(f(A)\) of \(f\) is a subset of codomain \(B\) of \(f\text{.}\)

Example 7.14.

Let \(f:\mathbb{Z}_5\to \mathbb{Z}_5\) be given by \(f(x)=x^2\bmod 5\text{.}\) Then
\begin{gather*} f(0)=0^2\bmod 5=0\bmod 5 = 0\\ f(1)=1^2\bmod 5=1\bmod 5 = 1\\ f(2)=2^2\bmod 5=4\bmod 5 = 4\\ f(3)=3^2\bmod 5=9\bmod 5 = 4\\ f(4)=4^2\bmod 5=16\bmod 5 = 1 \end{gather*}
Thus the image \(f(\mathbb{Z}_5)\) of \(f\) is
\begin{equation*} f(\mathbb{Z}_5)=\left\{ f(x) \mid x \in \mathbb{Z}_5 \right\}=\{0,1,4\}. \end{equation*}
Note that this differs from the codomain of \(f\) which is \(\mathbb{Z}_5=\{0,1,2,3,4\}\text{.}\)
In Section 7.1 we defined functions by algebraic expressions or tables of charts. Another way of representing a function is its graph. Instead of organizing the values in a table we consider them as elements of a Cartesian product. We give an introduction to graphs of functions in the video in Figure 7.15. It is followed by a more detailed discussion.
Figure 7.15. Graphs of Functions by Matt Farmer

Definition 7.16. Graph of a function.

The graph of the function \(f:A\to B\) is
\begin{equation*} \left\{ (x,f(x)) \mid x \in B \right\} \subseteq A\times B. \end{equation*}
In Example 7.17 we obtain a graphical representation a function by applying the graphical representation of Cartesian products from Section 6.3 to the graph of the function.

Example 7.17.

Let \(f:\mathbb{Z}_{6}\to\mathbb{Z}_{5}\) be given by \(f(x)= 2^x \bmod 5\text{.}\)
We have
\begin{align*} f(0) \amp= 2^0 \bmod 5 = 1 \bmod 5 = 1\\ f(1) \amp= 2^1 \bmod 5 = 2 \bmod 5 = 2\\ f(2) \amp= 2^2 \bmod 5 = 4 \bmod 5 = 4\\ f(3) \amp= 2^3 \bmod 5 = 8 \bmod 5 = 3\\ f(4) \amp= 2^4 \bmod 5 = 16 \bmod 5 = 1\\ f(5) \amp= 2^5 \bmod 5 = 32 \bmod 5 = 2 \end{align*}
Thus the graph of \(f\) is:
\begin{align*} \amp\{(x,f(x))\mid x\in \Z_6\}\\ \amp\;=\{(0,f(0)), (1,f(1)), (2,f(2)), (3,f(3)), (4,f(4)), (5,f(5))\}\\ \amp\;=\{(0,1), (1,2), (2,4), (3,3), (4,1), (5,2)\} \subseteq \mathbb{Z}_{6}\times\mathbb{Z}_{5} \end{align*}
The graph of \(f\) and Section 6.3 yield a graphical representation of the function \(f\text{.}\)
The graphical representation of a function yields not only yields its graph but also its domain and codomain, as illustrate in Example 7.18.

Example 7.18.

Suppose that the graph of the function \(h\) is given by
The values on the horizontal axis of the plot are the elements of domain of \(h\text{.}\) So the domain of is
\begin{equation*} \mathbb{Z}_{10}=\{0,1,2,3,4,5,6,7,8,9\}\text{.} \end{equation*}
The codomain are the values on the vertical axis of the plot. Thus the codomain of \(h\) is
\begin{equation*} \mathbb{Z}_{5}=\{0,1,2,3,4\}\text{.} \end{equation*}
The graph of \(h\) are the elements of the Cartesian product \(\mathbb{Z}_{10}\times\mathbb{Z}_5\) which are represented by the black pixels in the plot. We find that the graph of \(h\) is
\begin{equation*} \{ (x,h(x)) \mid x \in A \} = \{ (0,2), (1,0),(2,0), (3,1), (4,0), (5,1), (6,0), (7,4),(8,4),(9,3) \}. \end{equation*}
Because the graph of \(h\) consists of the pairs \((x,h(x))\) where \(x\) is an element of the domain of \(h\text{,}\) we can read off the values \(h(x)\) easily.
In Example 7.19 observe how changing the plot of the graph of a function changes its graph.

Example 7.19.