Combinatorial Mathematics
(TsinghuaX: 60240013x)
文章目录
Linear Homogeneous Recurrence Relation
Fibonacci Rabbits
Fibonacci number
Fibonacci prime
F
1
2
+
F
2
2
+
⋯
+
F
n
2
=
F
n
F
n
−
1
F_1^2+F_2^2+\dots+F_n^2=F_nF_{n-1}
F12+F22+⋯+Fn2=FnFn−1
Area of the rectangle = Sum of multiple quadrates
Expressions of Fibonacci Numbers
F n = 1 5 ( ( 1 + 5 2 ) n − ( 1 − 5 2 ) n ) F_n=\frac {1}{\sqrt{5}}((\frac {1+\sqrt{5}}{2})^n-(\frac {1-\sqrt{5}}{2})^n) Fn=51((21+5)n−(21−5)n)
Linear Homogeneous Recurrence Relation
Def If sequence
{
a
n
}
\{a_n\}
{an} satisifies:
a
n
+
C
1
a
n
−
1
+
C
2
a
n
−
2
+
⋯
+
C
k
a
n
−
k
=
0
a_n+C_1a_{n-1}+C_2a_{n-2}+\dots+C_ka_{n-k}=0
an+C1an−1+C2an−2+⋯+Ckan−k=0
a
0
=
d
0
,
a
0
=
d
1
,
…
,
a
k
−
1
=
d
k
−
1
a_0=d_0, a_0=d_1,\dots, a_{k-1}=d_{k-1}
a0=d0,a0=d1,…,ak−1=dk−1
C
1
,
C
2
,
…
,
C
k
C_1, C_2, \dots, C_k
C1,C2,…,Ck and
d
0
,
d
1
,
…
,
d
k
−
1
d_0, d_1, \dots, d_{k-1}
d0,d1,…,dk−1 are constants,
C
k
≠
0
C_k≠0
Ck=0, so this expression is called a
k
t
h
k^{th}
kth-order linear homogeneous recurrence relation of
{
a
n
}
\{a_n\}
{an}.
Fibonacci Recurrence
Characteristic Polynomial
C
(
x
)
=
x
k
+
C
1
x
k
−
1
+
⋯
+
C
k
−
1
x
+
C
k
C(x)=x^k+C_1x^{k-1}+\dots+C_{k-1}x+C_k
C(x)=xk+C1xk−1+⋯+Ck−1x+CkCharacteristic polynomial has
k
k
k
- distinct real roots
- Characteristic polynomial C ( x ) C(x) C(x) has multiple roots
- Characteristic polynomial
C
(
x
)
C(x)
C(x) has conjugate complex roots
Summary
Applications
- There’s a point
P
P
P on the plane. It’s the cross of
n
n
n fields
D
1
,
D
2
,
…
D
n
D_1, D_2, \dots D_n
D1,D2,…Dn. Color these
n
n
n fields with
k
k
k colors. We require the color of two adjacent areas to be different.
Calculate the number of arrangements.
Let a n a_n an be the number of arrangement to color these areas. There are 2 situations:
-
D
1
D_1
D1 and
D
n
−
1
D_{n-1}
Dn−1 have the same color
D n D_n Dn has k − 1 k-1 k−1 choices, which is all colors except the one used by D 1 D_1 D1 and D n − 1 D_{n-1} Dn−1;
the arrangements for D n − 2 D_{n-2} Dn−2 to D 1 D_1 D1 are one-to-one correspondent to the arrangements for n − 2 n-2 n−2 areas.
( k − 1 ) a n − 2 (k-1)a_{n-2} (k−1)an−2 -
D
1
D_1
D1 and
D
n
−
1
D_{n-1}
Dn−1 have different colors.
D n D_n Dn has k − 2 k-2 k−2 choices; the arrangements from D 1 D_1 D1 to D n − 1 D_{n-1} Dn−1 are one-to-one correspondent to the arrangements for n − 1 n-1 n−1 areas.
( k − 2 ) a n − 1 (k-2)a_{n-1} (k−2)an−1
∴
a
n
=
(
k
−
2
)
a
n
−
1
+
(
k
−
1
)
a
n
−
2
,
a
2
=
k
(
k
−
1
)
,
a
3
=
k
(
k
−
1
)
(
k
−
2
)
.
\therefore a_n=(k-2)a_{n-1}+(k-1)a_{n-2}, a_2=k(k-1), a_3=k(k-1)(k-2).
∴an=(k−2)an−1+(k−1)an−2,a2=k(k−1),a3=k(k−1)(k−2).
a
1
=
0
,
a
0
=
k
a_1=0, a_0=k
a1=0,a0=k
x
2
−
(
k
−
2
)
x
−
(
k
−
1
)
=
0
x^2-(k-2)x-(k-1)=0
x2−(k−2)x−(k−1)=0
x
1
=
k
−
1
,
x
2
=
−
1.
x_1=k-1, x_2=-1.
x1=k−1,x2=−1.
a
n
=
A
(
k
−
1
)
n
+
B
(
−
1
)
n
a_n=A(k-1)^n+B(-1)^n
an=A(k−1)n+B(−1)n
{
A
+
B
=
k
,
(
k
−
1
)
A
−
B
=
0.
{
A
=
1
,
B
=
k
−
1.
\begin{equation} \left\{ \begin{array}{lr} A+B=k, \\ (k-1)A-B=0. \end{array} \right. \end{equation}\begin{equation} \left\{ \begin{array}{lr} A=1, \\ B=k-1. \end{array} \right. \end{equation}
{A+B=k,(k−1)A−B=0.{A=1,B=k−1.
∴
a
n
=
(
k
−
1
)
n
+
(
k
−
1
)
(
−
1
)
n
,
n
≥
2.
\therefore a_n=(k-1)^n+(k-1)(-1)^n, n \geq 2.
∴an=(k−1)n+(k−1)(−1)n,n≥2.
a
1
=
k
.
a_1=k.
a1=k.
Magical Sequences
Catalan Numbers
- One stack (of infinite size) has the “push” sequence: 1 , 2 , 3 , . . . n 1, 2, 3, ... n 1,2,3,...n. How many ways can the numbers be popped out?
Partition the
n
n
n sequences into two sub-sequences.
f
(
n
)
=
f
(
k
−
1
)
∗
f
(
n
−
k
)
f(n)=f(k-1)*f(n-k)
f(n)=f(k−1)∗f(n−k)
- Binary Tree
How many different shapes can a binary tree with n nodes have?
The root will obviously contain one node.
Assume
T
(
i
,
j
)
T(i, j)
T(i,j) stands the left subtree of the root containing
I
I
I nodes, and right subtree with
j
j
j nodes.
Not counting the root, there are
n
−
1
n-1
n−1 nodes that could be structured as:
C
(
n
)
=
C
(
0
)
∗
C
(
n
−
1
)
+
C
(
1
)
∗
C
(
n
−
2
)
+
⋯
+
C
(
n
−
2
)
∗
C
(
1
)
+
C
(
n
−
1
)
∗
C
(
0
)
C(n) = C(0)*C(n-1) + C(1)*C(n-2) + \dots + C(n-2)*C(1) + C(n-1)*C(0)
C(n)=C(0)∗C(n−1)+C(1)∗C(n−2)+⋯+C(n−2)∗C(1)+C(n−1)∗C(0)
C
(
n
)
=
∑
i
=
0
n
−
1
C
i
C
n
−
i
−
1
C(n)=\sum _{i=0}^{n-1}C_iC_{n-i-1}
C(n)=∑i=0n−1CiCn−i−1
Actually,
C
(
n
)
=
C
(
2
n
,
n
)
)
−
C
(
2
n
−
1
)
=
1
n
+
1
(
2
n
n
)
=
(
2
n
)
!
(
n
+
1
)
!
n
!
=
∏
k
=
2
n
n
+
k
k
C_(n)=C(2n, n))-C(2n-1) =\frac 1{n+1}\binom {2n}{n}=\frac {(2n)!}{(n+1)!n!}=\prod ^n_{k=2}\frac{n+k}k
C(n)=C(2n,n))−C(2n−1)=n+11(n2n)=(n+1)!n!(2n)!=k=2∏nkn+kProof using generating functions,
Dyck Language
Hands across the table
Exponential Generating Functions
Binomial Theorem
(
1
+
x
)
n
=
∑
k
=
0
∞
C
(
n
,
k
)
x
k
=
∑
k
=
0
∞
C
(
n
,
k
)
k
!
k
!
x
k
=
∑
k
=
0
∞
P
(
n
,
k
)
x
k
k
!
(1+x)^n=\sum ^\infty_{k=0}C(n, k)x^k=\sum ^\infty_{k=0}\frac {C(n, k)k!}{k!}x^k=\sum^\infty_{k=0}P(n,k)\frac {x^k}{k!}
(1+x)n=∑k=0∞C(n,k)xk=∑k=0∞k!C(n,k)k!xk=∑k=0∞P(n,k)k!xk
-
3
a
1
,
2
a
2
,
3
a
3
3a_1, 2a_2, 3a_3
3a1,2a2,3a3
How many combinations of length 4 4 4?
Key: 70 70 70
Hint: 4 ! ( 4 3 ! + 3 2 ! 2 ! + 3 2 ! ) = 70 4!(\frac{4}{3!}+\frac3{2!2!}+\frac3{2!})=70 4!(3!4+2!2!3+2!3)=70
For a seq KaTeX parse error: Unexpected character: '' at position 19: …, a_, a_2 \dots̲, construct:
G
e
(
x
)
=
a
0
+
a
1
1
!
x
+
a
2
2
!
x
2
+
a
3
3
!
x
3
+
⋯
+
a
k
k
!
x
k
+
…
G_e(x)=a_0+\frac{a_1}{1!}x+\frac{a_2}{2!}x^2+\frac{a_3}{3!}x^3+\dots+\frac{a_k}{k!}x^k+\dots
Ge(x)=a0+1!a1x+2!a2x2+3!a3x3+⋯+k!akxk+…
G
(
x
)
G(x)
G(x) is known as the exponential generating function of
a
0
,
a
1
,
a
2
,
…
a_0, a_1, a_2,\dots
a0,a1,a2,…
- Using the digits 1, 2, 3 and 4, construct a five digit number where 1 doesn’t appear more than 2 times, but has to appear at least once; 2 can’t appear more than once; 3 can appear up to 3 times but can also not appear in the number; 4 can only appear an even number of times. How many numbers can satisfy these conditions?
Hint:
An
r
r
r digit number that satisfies the condition is
a
r
a_r
ar; the exponential generating function for the seq
a
0
,
a
1
,
…
,
a
10
a_0, a_1, \dots, a_{10}
a0,a1,…,a10 is:
There are 215 215 215 5-digit numbers that satisfy the conditions.
-
With digits 1 , 3 , 5 , 7 , 9 1, 3, 5, 7, 9 1,3,5,7,9, how many n-digit numbers are there, where 3 3 3 and 7 7 7 appear an even number of times, and 1 , 5 , 9 1, 5, 9 1,5,9 don’t have any conditions.
Hint:
Assume an r-digit number that satisfies the conditions is a r a_r ar. Then, the exponential generating function of the seq of a 1 , a 2 , . . . , a 3 a_1, a_2, ..., a_3 a1,a2,...,a3 is:
Derangements
之前浅显的学习笔记
A derangement is a permutation of the elements of a set such that none of the elements appear in their original position.
Suppose the derangement of n elements in a sequence
1
,
2
,
…
n
1, 2, \dots n
1,2,…n is
D
n
D_n
Dn, for every
i
t
h
i^{th}
ith number, it has to switch with the other
n
−
1
n-1
n−1 numbers, followed by a derangement of the other
n
−
2
n-2
n−2 elements. We will have a total of
(
n
−
1
)
D
n
−
2
(n-1)D_{n-2}
(n−1)Dn−2 number of derangements.
For the other part, not considering the number
i
i
i, there is a derangement of the other
n
−
1
n-1
n−1 elements to be done, followed by switching
i
i
i with the other numbers yielding a total of
(
n
−
1
)
D
n
−
1
(n-1)D_{n-1}
(n−1)Dn−1 number of derangements.
D
(
n
)
=
(
n
−
1
)
(
D
n
−
1
+
D
n
−
2
)
,
D
0
=
0
,
D
2
=
1
D(n)=(n-1)(D_{n-1}+D_{n-2}), D_0 = 0, D_2 = 1
D(n)=(n−1)(Dn−1+Dn−2),D0=0,D2=1
∴
D
n
=
1
\therefore D_n = 1
∴Dn=1
D
(
n
)
=
(
n
−
1
)
(
D
n
−
1
+
D
n
−
2
)
,
n
≥
3
D(n)=(n-1)(D_{n-1}+D_{n-2}), n \geq 3
D(n)=(n−1)(Dn−1+Dn−2),n≥3
Stirling Numbers
Stirling numbers of the first kind
n
n
n people group dancing, divided into m disjoint circular groups.
s
(
n
,
0
)
=
0
,
s
(
1
,
1
)
=
1
s(n, 0)=0, s(1, 1)=1
s(n,0)=0,s(1,1)=1
s
(
n
+
1
,
m
)
=
s
(
n
,
m
−
1
)
+
n
∗
s
(
n
,
m
)
s(n+1, m)=s(n, m-1)+n*s(n, m)
s(n+1,m)=s(n,m−1)+n∗s(n,m)
- The n + 1 s t n+1^{st} n+1st person can dance alone, and the others form m − 1 m-1 m−1 groups.
- The n + 1 s t n+1^{st} n+1st person joins a group, and will have n n n choices for groups, while the other n n n people have s ( n , m ) s(n, m) s(n,m) ways of forming groups.
Stirling numbers of the second kind
Definition: The number of ways n n n non-identical balls in m identical boxes where none of the boxes are empty is known as the Stirling number of the second kind.
Theorem: Stirling number of the second kind S ( n , m ) S(n, m) S(n,m) has the following properties:
- S ( n , 0 ) = 0 S(n,0)=0 S(n,0)=0
- S ( n , 1 ) = 1 S(n, 1)=1 S(n,1)=1
- KaTeX parse error: Unexpected character: '' at position 16: S(n, 2) = 2^{n-̲1}-1
Proof:
Assume there are n n n non-identical balls b 1 , b 2 , . . . , b n b_1, b_2, ... , b_n b1,b2,...,bn, from which we pick b 1 b_1 b1. Now for the other n − 1 n-1 n−1 balls, there are two possibilities, either they can be in the same box as b 1 b_1 b1 or a box that doesn’t contain b 1 b_1 b1. But it can only satisfy one of these conditions, therefore there are 2 n − 1 − 1 2^{n-1}-1 2n−1−1 ways of placing the balls. - S ( n , n ) = 1 S(n, n) = 1 S(n,n)=1
Theorem: Stirling number of the second kind satisfies the following recurrence relation.
KaTeX parse error: Unexpected character: '' at position 23: … = m*S(n-1, m)+̲S(n-1, m-1) (n …
Proof: Suppose there are
n
n
n non-identical balls
b
1
,
b
2
,
…
,
b
n
b_1, b_2, \dots, b_n
b1,b2,…,bn, from which we pick a ball
b
1
b_1
b1.
Placing n balls into m boxes where no box is empty can be classified into two possibilities.
- b 1 b_1 b1 is placed on its own in a box, therefore, the count is S ( n − 1 , m − 1 ) S(n-1, m-1) S(n−1,m−1)
- b 1 b_1 b1 is not the only ball in its box. This is equivalent to placing n − 1 n-1 n−1 balls in m m m boxes, where no box is empty. This yields the count S ( n − 1 , m ) . S(n-1, m). S(n−1,m). Out of these boxes, b 1 b_1 b1 can be placed in any of these m m m boxes, so the total number of ways in this possibility equals to m ∗ S ( n − 1 , m ) m*S(n-1, m) m∗S(n−1,m).
A generating function is a clothesline on which we hang up a sequence of numbers.
— — Herbert Wilf