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.
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.
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$$