Skip to main content

Chapter 7 Functions

Exercises Practice Problems

1. Listing all functions.

List all the functions from \(\{a,b,c \}\) to \(\{ x,y \}\text{.}\) For example, one function \(f_1\) is given by \(f_1(a)=x\) and \(f_1(b)=y\) and \(f_1(c)=y\text{.}\)

2. Counting functions.

How many functions are there from \(\{a,b,c,d \}\) to \(\{x,y,z \}\text{?}\) This time, justify your answer with an argument rather than listing all possible functions.

3. More counting functions.

Without making lists or drawing pictures, how many functions are there \(\ldots\)

  1. from a four-element set to a ten-element set?

  2. from a ten-element set to a four-element set?

  3. from an \(r\)-element set to an \(s\)-element set?

4. Different Kinds of Functions.

In each of the following problems, give an example of a function \(f: [n] \rightarrow [m]\) of the specified type. You get to pick the values for \(n\) and \(m\text{.}\) Describe your function by using a picture. Then decide if there is a required relationship between \(n\) and \(m\text{,}\) the sizes of the domain and the codomain (also called the "target").

  1. Create a function \(f: [n] \rightarrow [m]\) that is injective (one-to-one) but NOT surjective (onto). What is the required relationship between \(n\) and \(m\text{?}\) (One of: \(n >m\) or \(n < m\) or \(n = m\) or "none.")

  2. Create a function \(f: [n] \rightarrow [m]\) that is injective (one-to-one) and surjective (onto). What is the required relationship between \(n\) and \(m\text{?}\) (One of: \(n >m\) or \(n < m\) or \(n = m\) or "none.")

  3. Create a function \(f: [n] \rightarrow [m]\) that is NOT injective (one-to-one) but is surjective (onto). What is the required relationship between \(n\) and \(m\text{?}\) (One of: \(n >m\) or \(n < m\) or \(n = m\) or "none.")

  4. Create a function \(f: [n] \rightarrow [m]\) that is NOT injective (one-to-one) and NOT surjective (onto). What is the required relationship between \(n\) and \(m\text{?}\) (One of: \(n >m\) or \(n < m\) or \(n = m\) or "none.")

5. Injective? Surjective?

For each of the functions below, decide whether it is injective and/or surjective. If it does not satisfy the property, explain why by giving an example that violates the property. If it does satisfy the property, then provide a proof.

  1. \(f: \Z \rightarrow \Z\) given by \(\displaystyle{f(n) = \left\lfloor \frac{n}{2} \right\rfloor}\) where \(\left\lfloor x \right\rfloor\) is the floor function, which "rounds down" to the nearest integer.

  2. \(g: \Z \rightarrow \Z\) given by \(g(n) = 4n -1\)

  3. \(h: \R \backslash \{ 0 \} \rightarrow \R\) given by \(\displaystyle{h(x) = \frac{x+1}{x}}\text{.}\)