Calculus

Set Theory

Set Theory Logo

Functions as Relations

Solved Problems

Example 1.

Let \(A = \left\{ {a,b,c,d} \right\}\) and \(B = \left\{ {1,2,3} \right\}.\) Determine which of the following relations from \(A\) to \(B\) are functions:

  1. \(\left\{ {\left( {a,1} \right),\left( {b,2} \right),\left( {c,1} \right),\left( {d,3} \right)} \right\}\)
  2. \(\left\{ {\left( {a,1} \right),\left( {b,1} \right),\left( {b,2} \right),\left( {c,3} \right)} \right\}\)
  3. \(\left\{ {\left( {a,2} \right),\left( {b,2} \right),\left( {c,2} \right),\left( {d,2} \right)} \right\}\)
  4. \(\left\{ {\left( {a,1} \right),\left( {b,2} \right),\left( {c,3} \right),\left( {d,1} \right)} \right\}\)
  5. \(\left\{ {\left( {b,3} \right),\left( {c,2} \right),\left( {d,1} \right),\left( {c,3} \right)} \right\}\)

Solution.

  1. A function.
  2. Not a function since the element \(b\) is related to two output values, \(1\) and \(2\), and the element \(d\) has no output value.
  3. A function.
  4. A function.
  5. Not a function because the element \(c\) has two output values, \(2\) and \(3\), and the element \(a\) has no output value.

Example 2.

Find the domain and range of the following functions:

  1. The function \(f_1\) assigns to each natural number the product of its digits.
  2. The function \(f_2\) assigns to each integer its last digit squared.
  3. The function \(f_3\) assigns to each pair of natural numbers the average value of these numbers.
  4. The function \(f_4\) is a Boolean function in three variables.

Solution.

  1. The domain of the function \(f_1\) is the set of natural numbers. The range of \(f_1\) is the set of nonnegative integers. We can write this in the form
    \[\text{dom}\left( {{f_1}} \right) = \mathbb{N},\;\;\text{rng}\left( {{f_1}} \right) = \mathbb{N} \cup \left\{ 0 \right\}.\]
    For example,
    \[{f_1}\left( {135} \right) = 1 \times 3 \times 5 = 15;\;\;{f_1}\left( {140} \right) = 1 \times 4 \times 0 = 0.\]
  2. The domain of the function \(f_2\) is the set of integers, and the range is the set of nonnegative integers:
    \[\text{dom}\left( {{f_2}} \right) = \mathbb{Z},\;\;\text{rng}\left( {{f_2}} \right) = \mathbb{N} \cup \left\{ 0 \right\}.\]
    Examples:
    \[{f_2}\left( {-125} \right) = 5^2 = 25;\;\;{f_2}\left( {-150} \right) = 0^2 = 0.\]
  3. The domain of the function \(f_3\) is the Cartesian Product \(\mathbb{N} \times \mathbb{N}.\) The range of \(f_3\) is the set of rational numbers \(\mathbb{Q}:\)
    \[\text{dom}\left( {{f_3}} \right) = \mathbb{N} \times \mathbb{N},\;\;\text{rng}\left( {{f_3}} \right) = \mathbb{Q}.\]
    Example:
    \[{f_3}\left( {10,11} \right) = \frac{10+11}{2} = 10.5\]
  4. The domain of the Boolean function \(f_4\) is \({\left\{ {0,1} \right\}^3},\) and the range is the two-element set \(\left\{ {0,1} \right\}.\) So
    \[\text{dom}\left( {{f_4}} \right) = {\left\{ {0,1} \right\}^3},\;\;\text{rng}\left( {{f_4}} \right) = \left\{ {0,1} \right\}.\]
    Examples:
    \[{f_4}\left( {0,1,1} \right) = 1,\;\;{f_4}\left( {1,1,1} \right) = 0.\]

Example 3.

List all functions \(f:\left\{ {a,b,c} \right\} \to \left\{ {0,1} \right\}.\)

Solution.

Total there are \(2^3 = 8\) different functions that are listed below:

\[{f_1} = \left\{ {\left( {a,0} \right),\left( {b,0} \right),\left( {c,0} \right)} \right\},\;\;{f_2} = \left\{ {\left( {a,0} \right),\left( {b,0} \right),\left( {c,1} \right)} \right\},\;\;{f_3} = \left\{ {\left( {a,0} \right),\left( {b,1} \right),\left( {c,0} \right)} \right\},\;\;{f_4} = \left\{ {\left( {a,0} \right),\left( {b,1} \right),\left( {c,1} \right)} \right\},\;\;{f_5} = \left\{ {\left( {a,1} \right),\left( {b,0} \right),\left( {c,0} \right)} \right\},\;\;{f_6} = \left\{ {\left( {a,1} \right),\left( {b,0} \right),\left( {c,1} \right)} \right\},\;\;{f_7} = \left\{ {\left( {a,1} \right),\left( {b,1} \right),\left( {c,0} \right)} \right\},\;\;{f_8} = \left\{ {\left( {a,1} \right),\left( {b,1} \right),\left( {c,1} \right)} \right\}.\]

Example 4.

List all functions \(g:\left\{ {0,1} \right\} \to \left\{ {a,b,c} \right\}.\)

Solution.

The mapping \(g\) between the sets \(\left\{ {0,1} \right\}\) and \(\left\{ {a,b,c} \right\}\) contains \(3^2 = 9\) different functions:

\[{g_1} = \left\{ {\left( {0,a} \right),\left( {1,a} \right)} \right\},\;\;{g_2} = \left\{ {\left( {0,a} \right),\left( {1,b} \right)} \right\},\;\;{g_3} = \left\{ {\left( {0,a} \right),\left( {1,c} \right)} \right\},\;\;{g_4} = \left\{ {\left( {0,b} \right),\left( {1,a} \right)} \right\},\;\;{g_5} = \left\{ {\left( {0,b} \right),\left( {1,b} \right)} \right\},\;\;{g_6} = \left\{ {\left( {0,b} \right),\left( {1,c} \right)} \right\},\;\;{g_7} = \left\{ {\left( {0,c} \right),\left( {1,a} \right)} \right\},\;\;{g_8} = \left\{ {\left( {0,c} \right),\left( {1,b} \right)} \right\},\;\;{g_9} = \left\{ {\left( {0,c} \right),\left( {1,c} \right)} \right\}.\]

Example 5.

The function \(f : \mathbb{R} \to \mathbb{R}\) is defined by \(f\left( x \right) = 5{x^2} - {x^4}.\) Find all preimages of \(6.\)

Solution.

To find the preimages of \(6\) we need to solve the equation

\[f\left( x \right) = 5{x^2} - {x^4} = 6.\]

Let \(u = x^2.\) Then we can write the original equation in terms of \(u:\)

\[{u^2} - 5u + 6 = 0.\]

The roots of the quadratic equation are \({u_1} = 2,\) \({u_2} = 3.\) So we see that either \({x^2} = 2\) or \({x^2} = 3.\) Undo the \(x^2\) by taking the square root:

\[{x^2} = {u_1} = 2,\;\; \Rightarrow {x_{1,2}} = \pm\sqrt 2;\]
\[{x^2} = {u_2} = 3,\;\; \Rightarrow {x_{3,4}} = \pm\sqrt 3 .\]

Hence, the set of all preimages of the number \(6\) is given by

\[x \in \left\{ { - \sqrt 3 , - \sqrt 2 ,\sqrt 2 ,\sqrt 3 } \right\}.\]

Example 6.

The function \(g : \mathbb{Z} \to \mathbb{Z}\) is defined by \(g\left( x \right) = 3{x^2} - {x^4} + 5.\) Find all preimages of \(7.\)

Solution.

The value of the function is equal to \(7.\) Hence, the preimages are defined by the biquadratic equation

\[g\left( x \right) = 3{x^2} - {x^4} + 5 = 7.\]

We substitute \(x^2 = t.\) This produces the quadratic equation

\[{t^2} - 3t + 2 = 0,\]

which has solutions \({t_1}= 1\) and \({t_2} = 2.\)

Now, since \(t = x^2,\) we obtain:

\[{x_1} = - 1,\;\;{x_2} = 1,\;\;{x_3} = - \sqrt 2 ,\;\;{x_4} = \sqrt 2 .\]

We see that only \({x_1}, {x_2} \in \mathbb{Z}.\) Hence, the set of preimages of \(7\) is given by

\[x \in \left\{ { - 1,1} \right\}.\]

Example 7.

The function \(f : \mathcal{P}\left(\left\{{a,b,c}\right\}\right) \to \left\{{0,1,2,3}\right\}\) is given by the formula \(f\left( x \right) = \left| x \right|,\) where \(\left| x \right|\) is the cardinality of the set \(x.\) Calculate the average value of the function \(f.\)

Solution.

The power set of \(\left\{ {a,b,c} \right\}\) includes \(8\) subsets, which are listed along with their cardinality in the table below.

\[{\begin{array}{c|c} \text{Subset} & \text{Cardinality} \\ \hline \varnothing & 0 \\ \left\{ a \right\} & 1 \\ \left\{ b \right\} & 1 \\ \left\{ c \right\} & 1 \\ \left\{ {a,b} \right\} & 2 \\ \left\{ {a,c} \right\} & 2 \\ \left\{ {b,c} \right\} & 2 \\ \left\{ {a,b,c} \right\} & 3 \end{array}}\]

The average value of the function \(f\) is given by

\[\overline f = \frac{{0 + 1 \cdot 3 + 2 \cdot 3 + 3}}{8} = \frac{{12}}{8} = 1.5\]

Example 8.

The function \(g : \mathcal{P}\left({\mathcal{P}\left(\left\{{a,b,c}\right\}\right)}\right) \to \mathbb{N}\cup 0\) is given by the formula \(g\left( x \right) = \left| x \right|,\) where \(\left| x \right|\) is the cardinality of the set \(x.\) Calculate the maximum value of the function \(g.\)

Solution.

The power set \(\mathcal{P}\left( {\left\{ {a,b,c} \right\}} \right)\) consists of \(2^3 = 8\) subsets.

The power set of a set of \(8\) elements has \(2^8\) subsets. The subset with the greatest cardinality is the set itself. Hence, in our case the subset with the greatest cardinality is the power set \(\mathcal{P}\left( {\mathcal{P}\left( {\left\{ {a,b,c} \right\}} \right)} \right).\)

Thus, the maximum value of the function \(g\) is given by

\[{g_{\max }} = \left| {\mathcal{P}\left( {\mathcal{P}\left( {\left\{ {a,b,c} \right\}} \right)} \right)} \right| = {2^{{2^3}}} = {2^8} = 256.\]
Page 1 Page 2