$\begingroup$

In the book it is given if A and B are two finite sets containing $m$ and $n$ elements, respectively, then the number of onto functions from A to B will be if

$n \leq m$

$$\sum_{r=1}^n (-1)^{(n-r)} {n \choose r}(r)^m $$

well I can't understand it and I am aware with combinations.

Answers