Thank you for reporting, we will resolve it shortly
Q.
The number of surjective functions from $A$ to $B$ where $A =\{1,2,3,4\}$ and $B =\{ a , b \}$ is
Relations and Functions - Part 2
Solution:
If $A$ and $B$ are two sets having $m$ and $n$ elements such that
$1 \leq n \leq m =\displaystyle\sum_{ r =1}^{ n }(-1)^{ n - r}\,{}^{ n } C _{ r } r ^{ m }$
Number of surjection from $A$ to $B$
$=\sum_{ r =1}^{ n }(-1)^{2- r } \,{}^{2} C _{ r }( r )^{4}$
$=(-1)^{2-12} C_{1}(1)^{4}+(-1)^{2-2}\,{}^{2} C_{2}(2)^{4}$
$=-2+16=14$