How many functions $f:\{1,2,3,4,5\}\to\{1,2,3,4,5\}$ there are such that: $f^{-1}(\{1,2,3\})=\{2,3,4,5\}$and $f^{-1}(\{2,3,5\})=\{4,5\}$

functions

How many functions $f:\{1,2,3,4,5\}\to\{1,2,3,4,5\}$ there are such that:
$f^{-1}(\{1,2,3\})=\{2,3,4,5\}$and $f^{-1}(\{2,3,5\})=\{4,5\}$?

I know that if the domain has 5 elements and the codomain has 5 elements than there are $5^5$ functions that can be done but I do not know how to find out how many of them satisfy that conditions.

Best Answer

Notice that you can get a lot of information from $f^{-1}(\{1,2,3\})=\{2,3,4,5\}$ and $f^{-1}(\{2,3,5\})=\{4,5\}$ .

Our first condition gives us that $f(2),f(3),f(4),f(5)\in\{1,2,3\}$ and $f(1)\notin \{1,2,3\}$. Our second condition gives us that $f(4),f(5)\in\{2,3,5\}$ and $f(1),f(2),f(3)\notin \{2,3,5\}$.

Let us examine each value:

  • $f(1)=4$ is the only possible option
  • $f(2)=1$ is the only possible option
  • $f(3)=1$ is the only possible option
  • $f(4)$ can be $2$ or $3$
  • $f(5)$ can be $2$ or $3$

So you have $4$ possible functions.

Related Question