How many functions $f: B\to B$ map even numbers to even numbers?

250 Views Asked by At

How many functions $f: B\to B$ map even numbers to even numbers if $B=\{5,2,7,4,9,6\}$?

Because there's a requirement to map even numbers to even numbers then the domain and the range of $f$ is $B'=\{2,4,6\}$ as far as I understand. Then the number of possible functions is $|B'|^{|B'|}=3^3$.

Not sure regarding the correct answer.

2

There are 2 best solutions below

7
On BEST ANSWER

The condition to be satisfied for $f:B\to B$ (so the domain is $B$ and not $B'$) is that $f(B')\subseteq B'$. Since there are no constraints on the image of odd numbers, the number of such functions should be $$\underbrace{|B|^{|B|-|B'|}}_{\text{image of odd numbers}}\cdot \underbrace{|B'|^{|B'|}}_{\text{image of even numbers}}=6^3\cdot 3^3.$$

0
On

That is the number of ways to choose $f(2),f(4),f(6)$. But you need functions which are defined on the whole of $B$, so you still need to choose $f(5),f(7),f(9)$. Each of these can be anything in $B$, so there are $3^3\times 6^3$ ways in total.