Professional Documents
Culture Documents
EAC2022 Lecture2
EAC2022 Lecture2
Sergi Elizalde
Dartmouth College
Denition
Denition
Example
3, 2 + 1, 1 + 2, 1 + 1 + 1.
Denition
Example
3, 2 + 1, 1 + 2, 1 + 1 + 1.
Proposition
n−1
The number of compositions of n with k parts is .
k−1
The total number of compositions of n is 2n−1 .
Proposition
n−1
The number of compositions of n with k parts is .
k−1
The total number of compositions of n is 2n−1 .
Proof.
Proposition
n−1
The number of compositions of n with k parts is .
k−1
The total number of compositions of n is 2n−1 .
Proof.
Proposition
n−1
The number of compositions of n with k parts is .
k−1
The total number of compositions of n is 2n−1 .
Proof.
Proposition
n−1
The number of compositions of n with k parts is .
k−1
The total number of compositions of n is 2n−1 .
Proof.
Denition
Denition
Denition
Example
Denition
Example
Note that {2} ∪ {1, 3} would be the same partition as {1, 3} ∪ {2},
since the order of the sets is irrelevant.
Denition
Let B(n) denote the number of set partitions of [n]. These are
called the Bell numbers.
Denition
Let B(n) denote the number of set partitions of [n]. These are
called the Bell numbers.
Let S(n, k) denote the number of set partitions of [n] into k blocks.
These are called the Stirling numbers of the second kind.
Denition
Let B(n) denote the number of set partitions of [n]. These are
called the Bell numbers.
Let S(n, k) denote the number of set partitions of [n] into k blocks.
These are called the Stirling numbers of the second kind.
Pn
Note that B(n) = k=1 S(n, k).
Denition
Let B(n) denote the number of set partitions of [n]. These are
called the Bell numbers.
Let S(n, k) denote the number of set partitions of [n] into k blocks.
These are called the Stirling numbers of the second kind.
Pn
Note that B(n) = k=1 S(n, k).
Example
S(3, 2) = 3, B(3) = 5.
Denition
Let B(n) denote the number of set partitions of [n]. These are
called the Bell numbers.
Let S(n, k) denote the number of set partitions of [n] into k blocks.
These are called the Stirling numbers of the second kind.
Pn
Note that B(n) = k=1 S(n, k).
Example
S(3, 2) = 3, B(3) = 5.
S(n, 0) = 0, S(n, 1) =
Denition
Let B(n) denote the number of set partitions of [n]. These are
called the Bell numbers.
Let S(n, k) denote the number of set partitions of [n] into k blocks.
These are called the Stirling numbers of the second kind.
Pn
Note that B(n) = k=1 S(n, k).
Example
S(3, 2) = 3, B(3) = 5.
S(n, 0) = 0, S(n, 1) = 1, S(n, n) =
Denition
Let B(n) denote the number of set partitions of [n]. These are
called the Bell numbers.
Let S(n, k) denote the number of set partitions of [n] into k blocks.
These are called the Stirling numbers of the second kind.
Pn
Note that B(n) = k=1 S(n, k).
Example
S(3, 2) = 3, B(3) = 5.
S(n, 0) = 0, S(n, 1) = 1, S(n, n) = 1.
n\k 1 2 3 4 5 6 B(n)
1 1 1
2 1 1 2
3 1 3 1 5
4 1 7 6 1 15
5 1 15 25 10 1 52
6 1 31 90 65 15 1 203
n\k 1 2 3 4 5 6 B(n)
1 1 1
2 1 1 2
3 1 3 1 5
4 1 7 6 1 15
5 1 15 25 10 1 52
6 1 31 90 65 15 1 203
S(n, n − 1) =
n\k 1 2 3 4 5 6 B(n)
1 1 1
2 1 1 2
3 1 3 1 5
4 1 7 6 1 15
5 1 15 25 10 1 52
6 1 31 90 65 15 1 203
n
S(n, n − 1) = 2 .
Proof: choose which two elements are in the same block.
S(n, 2) =
n\k 1 2 3 4 5 6 B(n)
1 1 1
2 1 1 2
3 1 3 1 5
4 1 7 6 1 15
5 1 15 25 10 1 52
6 1 31 90 65 15 1 203
n
S(n, n − 1) = 2 .
Proof: choose which two elements are in the same block.
S(n, 2) = 2n−1 − 1.
Proof: To partition[n] = A1 ∪ A2 , choose A1 to be any subset
except A1 = ∅ and A1 = [n]; then take A2 to be its complement.
n
There are 2 − 2 choices of A1 . Finally, divide by 2 because the
n
order of A1 and A2 is irrelevant, giving (2 − 2)/2 = 2
n−1 − 1.
Proposition
Proposition
Proof.
Proposition
Proof.
Proposition
Proof.
Proposition
n
X n
B(n + 1) = B(k).
k
k=0
Proposition
n
X n
B(n + 1) = B(k).
k
k=0
Proof.
Proposition
n
X n
B(n + 1) = B(k).
k
k=0
Proof.
Example
Example
Example
Example
Example
Example
Example
Example
an =
Example
n
X (−1)i
an = n! .
i!
i=0
Example
n
X (−1)i
an = n! .
i!
i=0
2. Recurrence
2. Recurrence
Example
n
X n
B(n + 1) = B(k).
k
k=0
2. Recurrence
Example
n
X n
B(n + 1) = B(k).
k
k=0
Answer: 2.
Let's call this number an , and look at the rst few values:
n 1 2 3 4 5 6
an 1 2
Let's call this number an , and look at the rst few values:
n 1 2 3 4 5 6
an 1 2 3
Let's call this number an , and look at the rst few values:
n 1 2 3 4 5 6
an 1 2 3 5
Let's call this number an , and look at the rst few values:
n 1 2 3 4 5 6
an 1 2 3 5 8
Let's call this number an , and look at the rst few values:
n 1 2 3 4 5 6
an 1 2 3 5 8 13
Let's call this number an , and look at the rst few values:
n 1 2 3 4 5 6
an 1 2 3 5 8 13
an = an−1 + an−2
an = an−1 + an−2
n−1 n−2
an = an−1 + an−2
n−1 n−2
2. Recurrence
Example
2. Recurrence
Example
3. Algorithm
4. Asymptotic estimate
Example
4. Asymptotic estimate
Example
lim an /bn = 1.
n→∞
4. Asymptotic estimate
Example
lim an /bn = 1.
n→∞
5. Generating function
5. Generating function
Denition
A(z) = a0 + a1 z + a2 z 2 + a3 z 3 + · · · =
X
an z n .
n≥0
Denition
A(z) = a0 + a1 z + a2 z 2 + a3 z 3 + · · · =
X
an z n .
n≥0
A(z) = 1 + rz + r 2 z 2 + r 3 z 3 + . . .
A(z) = 1 + rz + r 2 z 2 + r 3 z 3 + . . .
Note that
r z A(z) = rz + r 2 z 2 + r 3 z 3 + r 4 z 4 + . . . ,
A(z) = 1 + rz + r 2 z 2 + r 3 z 3 + . . .
Note that
r z A(z) = rz + r 2 z 2 + r 3 z 3 + r 4 z 4 + . . . ,
1
A(z) = ,
1 − rz
which gives a compact way to write A(z).
A(z) = 1 + rz + r 2 z 2 + r 3 z 3 + . . .
Note that
r z A(z) = rz + r 2 z 2 + r 3 z 3 + r 4 z 4 + . . . ,
1
A(z) = ,
1 − rz
which gives a compact way to write A(z).
We do not care about the value of z or about convergence of the
series.
Sergi Elizalde Compositions, set partitions, and recurrences
Example 2: compositions
(
1 if n = 0,
cn = n−1
2 if n ≥ 1.
(
1 if n = 0,
cn = n−1
2 if n ≥ 1.
n−1 n
X X X
cn z n = c0 + cn z n = 1 + 2 z
n≥0 n≥1 n≥1
X
n n+1
X
n n z 1−z
=1+ 2 z =1+z 2 z =1+ = .
1 − 2z 1 − 2z
n≥0 n≥0
(
1 if n = 0,
cn = n−1
2 if n ≥ 1.
n−1 n
X X X
cn z n = c0 + cn z n = 1 + 2 z
n≥0 n≥1 n≥1
X
n n+1
X
n n z 1−z
=1+ 2 z =1+z 2 z =1+ = .
1 − 2z 1 − 2z
n≥0 n≥0