Paragraph
  1. Consider all functions \(f: \{1,2,3,4,5\} \to \{1,2,3,4,5\}\text{.}\) How many functions are there all together? How many of those are injective? Remember, a function is an injection if every input goes to a different output.

  2. Consider all functions \(f: \{1,2,3,4,5\} \to \{1,2,3,4,5\}\text{.}\) How many of the injections have the property that \(f(x) \ne x\) for any \(x \in \{1,2,3,4,5\}\text{?}\)

    Your friend claims that the answer is:

    \begin{equation*} 5! - \left[ {5\choose 1}4! - {5 \choose 2}3! + {5\choose 3}2! - {5 \choose 4}1! + {5\choose 5}0! \right]\text{.} \end{equation*}

    Explain why this is correct.

  3. Recall that a surjection is a function for which every element of the codomain is in the range. How many of the functions \(f: \{1,2,3,4,5\} \to \{1,2,3,4,5\}\) are surjective? Use PIE!

in-context