Picking objects

How many ways to pick objects from objects?

Counting functions

Let , , .

Total number of functions is .
Total number of injections is .

One way to calculate the total number of surjections is to first consider the sizes of the preimage sets of every . Define , . We know that for all , and . Let be a solution to . Then, the number of functions satisfying is . Thus, the total number of surjections is

E1

Notice that if we remove the restriction, the formula basically gives the total number of functions from to , courtesy the multinomial theorem:

Evaluating (E1) directly is not easy. We could instead use the inclusion-exclusion principle to isolate all the cases when for some (functions that are not surjective), and subtract it away from . The number of non-surjective functions is

Subtracting it away from , we get (Note that setting the upper limit to or is the same)

Remark 204.1.

Incidentally, the Sterling number of the second kind, which counts the number of ways to partition a set of size into non-empty subsets, is given by

a3db8a

Basic properties of the binomial coefficient

^ easy proof by induction