Let A = {1, 2, 3, 4} and B = {a, b} be two sets. Write the total number of onto functions from A to B.
Question:
Let A = {1, 2, 3, 4} and B = {a, b} be two sets. Write the total number of onto functions from A to B.
Solution:
Formula:
When two sets A and B have m and n elements respectively, then the number of onto functions from A to B is
$\left\{\begin{array}{l}\sum_{r=1}^{n}(-1)^{r} n C_{r} r^{m}, \text { if } m \geq n \\ o, \text { if } m
Here, number of elements in A = 4 = m
Number of elements in B = 2 = n
So, $m>\mathrm{n}$
Number of onto functions
$=\sum_{r=1}^{2}(-1)^{r} 2 C_{r} r^{4}$
$=(-1)^{1} 2 C_{1} 1^{4}+(-1)^{2} 2 C_{2} 2^{4}$
$=-2+16$
$=14$