小马的世界

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

2021-07-29 · 5 min read
离散数学 数学

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

Enumeration 9A

Principles of Counting

加法原理和乘法原理

Addition Principle

If AA and BB are finite sets and AB=A \cap B =\emptyset, that is AA and BB are disjoint, then AB=A+B|A \cup B| =|A|+|B|.

Multiplication Principle

If AA and BB are finite sets, then A×B=AB|A \times B| =|A||B|.
Recall that A×B={(a,b):aA,bB}A \times B =\{(a,b):a\in A, b\in B \}.

Ordered Selections with Repetition

The number of ordered selections, repetition allowed, of mm things from a set of size nn is nmn^m

Example 1
A=m|A|=m and B=n|B|=n. Let FF donote the set of functions from AA to BB.
F=nnnn=nmF=n \cdot n \cdot n\cdot \dotsc n=n^m

Example 2
S=n|S|=n. Power set of SS is P(S)=222=2nP(S)=2\cdot 2\cdot \dotsc 2 = 2^n

Ordered Selections without Repetition

The number of ordered selections, without repetition, of mm things from a set of size nn is n(n1)(n2)(nm+1)n(n-1)(n-2)\dotsc (n-m+1)

Enumeration 9B

Example 3
A=m|A|=m and B=n|B|=n
How many injective(one-to-one) functions from A to B are there?
Answer: n(n1)(n2)(nm+1)n(n-1)(n-2)\dotsc (n-m+1)

Permutations

A permutation of a nonempty finite set AA is a bijection from AA to AA.
(Frequently, we take A=Nn={1,2,,n}A=\mathbb{N}_n=\{1,2,\dotsc ,n\}).

Example 4
n=5n=5 and α(1)=2,α(2)=4,α(3)=5,α(4)=1,α(5)=3\alpha(1)=2, \alpha(2)=4, \alpha(3)=5, \alpha(4)=1, \alpha(5)=3,
that is
α=(1234524513)\alpha=\begin{pmatrix} 1 & 2 & 3& 4 & 5\\ 2 &4 &5 & 1&3 \end{pmatrix}
α\alpha is a permutation.

Denote the set of all permutations of Nn\mathbb{N}_n by SnS_n
Sn=n(n1)1=n!|S_n|=n(n-1)\dotsc 1=n! (n! is read as n factorial)
n!=n(n1)!n!\overset{\bigtriangleup }{=} n(n-1)! whenn>1n>1
0!=10!\overset{\bigtriangleup }{=} 1

Example 5
Given 10 people p1,p2,,p10p_1, p_2, \dotsc , p_{10}.

  1. In how many ways can the people be lined up in a row?
    Answer: 10!=362880010!=3628800
  2. How may lineups are there if p2,p6,p9p_2, p_6, p_9 want to stand together?
    Answer: Let G={p2,p6,p9}G=\{ p_2, p_6, p_9\} of permutations in {p1,p3,p4,p5,p7,p8,p10,G}\{ p_1, p_3, p_4, p_5, p_7, p_8, p_{10}, G\} , G=3!G= 3!
    Total of desired permutations = 8!3!=2419208!\cdot 3! = 241920.

Unordered Selections with Repetition

In next Note