这是台湾清华赵启超教授离散数学11C11D课程的笔记。
Example 1
Let X and Y be sets with ∣X∣=m and ∣Y∣=n. specifically, suppose that X={1,2,3,…,m} and Y={1,2,3,…,n}, we know that there are nm functions from X to Y.
How many of these functions are onto?
Let this number be denoted by onto(m,n).
Clearly,
onto(m,n)=0 if m<n
onto(m,m)=m! for all m≥1
onto(m,1)=1 for all m≥1
onto(m,2)=2m−2 for all m≥2
Let Ai denote the set of function from X to Y which do not take on the value i in Y 1≤i≤n.
Then onto(m,n)=∣A1∩A2∩…An∣
that is =∣A1∪A2∪…∪An∣
that is =∣S∣−∣A1∪A2∪…∪An∣
where S is the set of all functions from X to Y.
for m≥n, onto(m,n) is also the number of ways to distribute m distinct objects into n numbered(but otherwise identical) containers with no containers left empty.
S(m,n)={mn} is Stirling number of the second kind.
= number of ways to distribute m distinct objects into n identicable containers with no container left empty.
=n!1onto(m,n)
=n!1∑r=0n(−1)r(nr)(n−r)m