Skip to main content

Section 7.1 Functions

Functions are familar mathematical objects from algebra and calculus. We also saw them in Section 1.3.

Definition 7.1.1.

A function, f:X→Y, is a map in which each input is related to one and only one output.
We say X is the domain and Y is the codomain of f.
Let f:X→Y be a map as shown in the figure.
Figure 7.1.3.
Figure 7.1.3 shows a map that is not a function since x2 maps to two different outputs.
Let g:X→Y be a map as shown in the figure.
Figure 7.1.4.
Figure 7.1.4 shows a map that is not a function since x1 does not map to any output.
Let h:X→Y be a map as shown in the figure.
Figure 7.1.5.
Figure 7.1.5 shows a map that is a function since each xi maps to exactly one yi.
For a given x∈X, f(x) is

Definition 7.1.6.

The image or range of a set X under f is the set of outputs of f corresponding to inputs from X. In notation
Im(f)={y∈Y:y=f(x) for some x∈X}.
If f(x)=y we say x is a preimage or an inverse image of y.
Since y can have several preimages, we usually care about the set of all of them.

Definition 7.1.7.

Let f:Xβ†’Y be a function. The set {x∈X:f(x)=y} is the preimage of y.
If we have a map from a finite set to a finite set, we can draw an arrow diagram in which we use arrows to represent the map from X to Y, as in Example 7.1.2.
Let X={a,b,c,d} and Y={0,1,2}. Let f:X→Y be the function given by the following arrow diagram.
Figure 7.1.9.
Find the domain of f.
Answer 1.
{a,b,c,d}
Find the codomain of f.
Answer 2.
{0,1,2}
Find the range or image of f.
Answer 3.
{0,2}
Find f(a).
Answer 4.
0
Find the preimage or inverse image of 0.
Answer 5.
{a,b}
Let f:R→R be given by f(x)=x2.
Find the domain of f.
Answer 1.
R
Find the codomain of f.
Answer 2.
R
Find the range of f.
Answer 3.
[0,∞)
Find the preimage (or inverse image) of 1.
Answer 4.
{1,βˆ’1}
Let f,g be functions from X to Y. Then f=g if f(x)=g(x) for all x∈X.
In this course we want to look at functions to and from sets other than just the real numbers. For example, we may have functions from finite sets to finite sets.
A sequence is a function from Z+ to R. For example, f(n)=1n.
We may also have functions involving Cartesian products of sets. For example, f:Z×Z→Z given by f(a,b)=a+b.
Since a function needs to satisfy the property that each x∈X can only map to one y∈Y, we say a function is well-defined if whenever a=b, f(a)=f(b). Most of the functions you've seen in algebra and calculus are clearly well-defined since when a=b, f(a)=f(b). This property is really only interesting when elements of X have multiple representations. In other words, when two equal elements in X have two different forms. The most familiar set where this happens is Q. For example, 12=24.
Let f:Q→Z be given by f(p/q)=p+q.
Then 1/2=2/4 in Q, but f(1/2)=1+2=3 and f(2/4)=2+4=6. Thus, 1/2=2/4 but f(1/2)β‰ f(2/4).
Thus f is not well-defined, and hence, f is not a function.

Activity 7.1.4.

Let f:Q→Z be given by f(m/n)=m. Show f is not well-defined by finding two equivalent fractions in Q that map to two different integers.

Reading Questions Check Your Understanding

4.

    Let B={2,4,6,8},C={0,1}.
    Let f:B→C be given by f(2)=0,f(4)=1,f(6)=1,f(8)=1.
    True or false: f is a function.
  • True.

  • False.

6.

    Let A={1,2,3},C={0,1}.
    Let f:A×C→C be given by f(a,c)=c.
    Which of the following are in the preimage of 0∈C.
  • (1, 0)
  • (1,0) is in the preimage.
  • (2, 0)
  • (2,0) is in the preimage.
  • (3, 0)
  • (3,0) is in the preimage.
  • (0, 0)
  • (0,0) is not in AΓ—C.
  • 0 is not in AΓ—C.
  • (0, 1)
  • (0,1) is not in AΓ—C, and would not map to 0.
  • 1 is not in AΓ—C.

Exercises Exercises

1.

Let X={1,3,5} and Y={a,b,c,d}. Define the function g:X→Y as the set of ordered pairs
{(1,b),(3,b),(5,b)}.
  1. Write the domain and codomain of g.
  2. What is the range of g?
  3. Is 3 an inverse image of a? Is 1 an inverse image of b?
  4. What is the inverse image of b? What is the inverse image of c?
  5. Represent g as an arrow diagram.

2.

Determine if the following are true or false. Justify your answer.
  1. If two elements in the domain of a function are equal, then their images in the codomain are equal.
  2. If two elements in the codomain of a function are equal, then their preimages in the domain are equal.
  3. A function can have the same output for more than one input.
  4. A function can have the same input for more than one output.

3.

Let A={1,2,3,4,5} and define a function F:P(A)β†’Z where for all sets X in P(A),
F(X)={0if X has an even number of elements1if X has an odd number of elements.
  1. Find F({1,3,4}).
  2. Find F(βˆ…).
  3. Find F({2,3}).
  4. F({2,3,4,5}).

6.

Let X={1,2,3,4} and Y={a,b,c,d,e}. Define g:X→Y by g(1)=a,g(2)=a,g(3)=a and g(4)=d.
  1. Draw an arrow diagram for g.
  2. Let A={2,3},C={a}, and D={b,c}. Find g(A),g(X),gβˆ’1(C),gβˆ’1(D), and gβˆ’1(Y).

7.

Show that each of the following maps is not a function by showing it is not well-defined.
  1. Define g:Q→Z by the rule
    g(mn)=mβˆ’n
    for all integers m and n with n≠0.
  2. Define h:Q→Q by the rule
    h(mn)=m2n
    for all integers m and n with n≠0.