Problem: distributing labeled objects into unlabeled boxes
Classifications
EXAMPLE: Assigning 4 employees into 3 unlabeled offices. Each office can contain any number of employees.
:
:
:
:
1730, Stirling (1692-1770)
DEFINITION: , the Stirling number of the second kind, is defined as the # of ways of distributing labeled objects into unlabeled boxes s.t. no box is empty.
The number of ways of distributing labeled objects into unlabeled boxes is .
THEOREM: when .
: the # of ways of distributing labeled objects into labeled boxes such that no box is empty
: the set of ways of distributing labeled objects into labeled boxes.
By the product rule,
: the set of ways where exactly boxes are used,
is a partition of and
//
// inverse binomial transform
Type 4
Problem: distributing unlabeled objects into unlabeled boxes
Classifications
EXAMPLE: # of ways of distributing 4 identical books into 3 identical boxes.
REMARK: The schemes are determined by
Partitions of Integers
DEFINITION: is called an -partition with exactly parts if are all positive integers.
: the # of ways of writing as the sum of positive integers.
,
EXAMPLE: The integer 4 has 4 different partitions into parts
REMARK: solution to the type 4 problem
THEOREM: For , ,
Let the set of -partitions with exactly parts,
Let . Then . // right-hand side
Let the set of -partitions with exactly parts. Then . // left-hand side
is bijective
EXAMPLE: determine and with the above theorem
Computing Recursively
Generating Functions
Catalan number: , // there is a new tool to solve it
DEFINITION: The generating function of a sequence is .
Generating functions are formal power series; we do not discuss their convergence.
EXAMPLE: generating functions of sequences
,
,
,
DEFINITION: Let , .
if for all
Operations
DEFINITION: Let , .
for any constant
We say that is an inverse of if .
The inverse of is denoted as
When has an inverse, define
THEOREM: has an inverse if and only if .
EXAMPLE: Let . Find .
: exists
Denote ; are undetermined coefficients
:
Coefficient of :
Coefficient of :
Coefficient of :
Coefficient of :
, , …,
DEFINITION:
for all integers
, where is a constant
THEOREM: Let and .
DEFINITION: Let and . The extended binomial coefficient
THEOREM: Let be a real number with and let be a real number. Then .
看到S2(n,j)就想起被离散数学支配的恐惧😭
感觉把对象和盒子区分开就简单多了,容易混
Catalan数倒是熟,括号匹配天天见,这个反而懵
形式幂级数这玩意儿,工程上真敢直接算?
当年期末考就是栽在Type 4上,现在看还怕
求问那个公式里的(-1)^i到底是咋来的?
分拆那块看着眼晕,n1>=n2这种顺序记不住啊
生成函数这求逆操作,看例子才看懂点
p_j(n)递推的那个定理,拿具体数验算一遍就清楚了
Type 3和Type 4的区别真让人晕,有人总结下吗?
斯特林数公式背了八百遍还是记不住😭
课上到生成函数那块直接懵了,符号一堆😵💫
斯特林老哥要是知道现在学生背他公式得笑醒
那个(-1)^i的符号变化,看半天才明白是二项式反演
形式幂级数不考虑收敛,工程上真敢这么用?
看到这些数学符号就想起被期末考试支配的恐惧😭
整数分拆在实际编程里有用过吗?
组合数学这东西,学的时候痛苦用的时候真香
p_j(n)递推用Ferrers图理解会清楚很多
生成函数求逆那部分,能不能举个简单例子?
斯特林数在算法题里真遇到过,当时卡了好久
Type 3和4的区别不就是对象和盒子能不能区分嘛
这公式看得我头大,符号太多了吧
当年也被这个坑过,做完题要检查三遍
Type3和Type4主要区别在对象和盒子是否可区分
形式幂级数在密码学里也这么用,没问题
密码学里生成函数主要用在哪块?
p_j(n)递推用Ferrers图讲更直观
看到Catalan数就想起括号匹配的面试题😂
斯特林数在数据库分桶优化里有用过
生成函数求逆跟Z变换确实像,都是形式运算
那个双射构造绝了
Type3和Type4对比着看,瞬间通透了
斯特林数公式怎么记啊,每次考试都现推
斯特林数那个例子,代入数值才算明白
我也觉得代入数值更直观
生成函数不讨论收敛这事,挺有意思