小马的世界

【离散数学】笔记-台湾清华赵启超11C11D Enumeration

2021-08-02 · 3 min read
离散数学 数学

这是台湾清华赵启超教授离散数学11C11D课程的笔记。

Example 1
Let XX and YY be sets with X=m|X|=m and Y=n|Y|=n. specifically, suppose that X={1,2,3,,m}X=\{1,2,3,\dotsc ,m\} and Y={1,2,3,,n}Y=\{1,2,3,\dotsc ,n\}, we know that there are nmn^m functions from XX to YY.

How many of these functions are onto?

Let this number be denoted by onto(m,n)onto(m,n).

Clearly,
onto(m,n)=0onto(m,n)=0 if m<nm<n
onto(m,m)=m!onto(m,m)=m! for all m1m \ge 1
onto(m,1)=1onto(m,1)=1 for all m1m \ge 1
onto(m,2)=2m2onto(m,2)=2^m-2 for all m2m \ge 2

Let AiA_i denote the set of function from XX to YY which do not take on the value ii in YY 1in1\le i \le n.
Then onto(m,n)=A1A2Anonto(m,n)=|\overline{A_1} \cap \overline{A_2} \cap \dotsc \overline{A_n} |
that is =A1A2An=|\overline{A_1 \cup A_2 \cup \dotsc \cup A_n}|
that is =SA1A2An=|S|-|A_1 \cup A_2 \cup \dotsc \cup A_n|
where SS is the set of all functions from XX to YY.

for mnm \ge n, onto(m,n)onto(m,n) is also the number of ways to distribute mm distinct objects into nn numbered(but otherwise identical) containers with no containers left empty.

S(m,n)={mn}S(m,n)=\begin{Bmatrix} m\\n\end{Bmatrix} is Stirling number of the second kind.
= number of ways to distribute mm distinct objects into nn identicable containers with no container left empty.
=1n!onto(m,n)\frac{1}{n!}onto(m,n)
=1n!r=0n(1)r(nr)(nr)m\frac{1}{n!}\sum _{r=0}^n (-1)^r\begin{pmatrix}n\\r \end{pmatrix}(n-r)^m