0
$\begingroup$

Let A={1,2,3,4,5}, B = {1,2,3}. What is the number of surjective functions $f: A \rightarrow B$ such that $f(1) \neq 1 , f(2) \neq 2 , f(3) \neq 2 $ ?

I think the we can solve this using the inclusion-exclusion principle. but I cant figure out how.

  • 1
    functions or subjective functions?2017-02-06
  • 0
    @N.S. Surjective functions, I've edited it.2017-02-06

1 Answers 1

0

Hint There are 2 choices for $f(1),f(2),f(3)$ and three choices for $f(4),f(5)$. You can easily figure all the possible functions satisfying this condition.

If you need surjective functions, use inclusion-exclusion to figure out how many such functions don't take the value 1, 2 or 3.

Added For the inclusion exclusion principle, let $$A_k:= \{ f : A \to B | f(1) \neq 1, f(2) \neq 2, f(3) \neq 3 , f(x) \neq k \forall X \}$$

The functions you seek and are not surjective are exactly $$A_1 \cup A_2 \cup A_3$$

  • 0
    How I figure the number of all functions from A to B such that f(2) = 2 and f(3) = 2? I need to know this so I can use it in the inclusion-exclusion principle. Thanks a lot!2017-02-06
  • 0
    @z00x Check the addon, that approach is probably easier to deal with.2017-02-06