Surjective function · Exercise-SURJECTIVE-FUNCTION-008

Step-by-step solved exercise: Relations and functions

Let \(\displaystyle A=\{1,2,3,4\}\) and \(\displaystyle B=\{a,b\}\). How many surjective functions \(\displaystyle f\colon A\to B\) are there?

Step by step with comments, a check and common mistakes.

Step-by-step solution

  1. Each element of \(\displaystyle A\) has two possible values in \(\displaystyle B\), so there are \(\displaystyle 2^4\) functions in total.

    \[\displaystyle 2^4=16\]
  2. A function that is not surjective leaves out at least one element of \(\displaystyle B\).

    \[\displaystyle \lvert f(A)\rvert<2\]
  3. The non-surjective functions are exactly the two constant ones, one that takes only \(\displaystyle a\) and one that takes only \(\displaystyle b\).

    \[\displaystyle f\equiv a,\quad f\equiv b\]
  4. Subtracting the two constant functions leaves \(\displaystyle 16-2=14\) surjective functions.

    \[\displaystyle 16-2=14\]

Answer

14

🎯 Build my path to this exercise