CIMPA Summer School
Analysis of Random Structures
An Najah University, Nablus, Palestine
August 18–28, 2014
http://lipn.univ-paris13.fr/~nicodeme/nablus14/Nablus14.php
The school is based upon 8 courses of 6 hours
- 5 courses upon approaches of Analytic Combinatorics
- 2 courses upon Probabilistic Approaches
- 1 course upon Random Graphs
Organising Committee:
Pierre Nicodème
University Paris 13
Naji Qatanani
An Najah University
Speakers:
Cyril Banderier
Frédérique Bassino
Brigitte Chauvin
Hosam Mahmoud
Basile Morcrette
Pierre Nicodème
Nicolas Pouyanne
Subhi Ruzieh
University Paris 13
University Paris 13
University of Versailles
George Washington University
University Paris 6
University Paris 13
University of Versailles
An Najah University
Local organisation:
An Najah University
Sponsors
Many Thanks to
Andrea Sportiello
for this beautiful
poster
Analysis of Random Structures
Summer School, August 18-28, 2014
University An Najah, Nablus
Organizers:
Pierre Nicodème,
Naji Qatanani,
University Paris13
University An Najah
I http://www-lipn.univ-paris13.fr/~nicodeme/nablus14
Content of the School - (6-hours Courses)
Analytic
Combinatorics
Graphs
- Eigenvalues of Graphs - S. Ruzieh
Probabilistic
Approaches
- Random Trees - B. Chauvin
- Urn Models - N. Pouyanne
Pierre Nicodeme - 3
-
Introductory Course - B. Morcrette
Random Walks - C. Banderier
Random Generation - F. Bassino
Random Trees - H. Mahmoud
Statistics of Motifs - P. Nicodème
November 21, 2013
Course I - Introduction to Analytic Combinatorics
Conrado Martinez (I slides.pdf)
I
Basile Morcrette (lecturer)
Keywords: symbolic method, singularity analysis
Pierre Nicodeme - 4
November 21, 2013
Course II - Discrete Random Walks
Cyril Banderier - U. Paris13
I
Keywords: Discrete Lattices, Functional Equations, Fast
enumeration schemes
Pierre Nicodeme - 5
November 21, 2013
Course III: Random Generation of Combinatorial Structures
Frédérique Bassino - U. Paris13
I
Keywords: Large Data, Models, Numerical Validation
Pierre Nicodeme - 6
November 21, 2013
Course IV - Analysis of Random Trees
Hosam Mahmoud - George Washington U.
I
Keywords
data structure, algorithms, recursive decompositions
Pierre Nicodeme - 7
November 21, 2013
Course V -Statistics of Motifs
Pierre Nicodème - U. Paris13
I
Keywords
Random texts, counting occurrences, languages, automatas
Pierre Nicodeme - 8
November 21, 2013
Course VI - Eigenvalues of Graphs
Subhi Ruzieh - An Najah U.
I
Keywords
Adjacency and Distance Matrix, Bounds on Eigenvalues
Pierre Nicodeme - 9
November 21, 2013
Course VII - Random Trees and Probability
Brigitte Chauvin - U. Versailles I course.pdf
I
Keywords Branching process, branching property, martingale,
Pólya urn, binary search tree
Pierre Nicodeme - 10
November 21, 2013
Course VIII - Urn models
Nicolas Pouyanne - U. Versailles
I
Keywords
Pólya urn, replacement rules, enumerative and probabilistic
methods
Pierre Nicodeme - 11
November 21, 2013
Two introductory examples to Analytic Combinatorics
1. Word Statistics
2. Derangements in Permutations
Pierre Nicodeme - 12
November 21, 2013
Part I
The Waiting Time
of First Occurrence of Words
Pierre Nicodeme - 13
November 21, 2013
Waiting time in Uniform Bernoulli Trials
Given a string of 0 and 1 bits, the waiting time of a word w is
I
the position of the rightmost bit
I
of the first occurrence of the word w
Pierre Nicodeme - 14
November 21, 2013
Waiting time in Uniform Bernoulli Trials
Given a string of 0 and 1 bits, the waiting time of a word w is
I
the position of the rightmost bit
I
of the first occurrence of the word w
Flip repetitively a fair coin
I
head gives 1 with probability
I
tail gives 0 with probability
Pierre Nicodeme - 14
1
2
1
2
November 21, 2013
Waiting time in Uniform Bernoulli Trials
Given a string of 0 and 1 bits, the waiting time of a word w is
I
the position of the rightmost bit
I
of the first occurrence of the word w
Flip repetitively a fair coin
I
head gives 1 with probability
I
tail gives 0 with probability
1
2
1
2
Question: does, in the average, (in a random string)
I the words 100 and 111 have the same waiting time?
I or should 100 occurs first?
I or should 111 occurs first?
Pierre Nicodeme - 14
November 21, 2013
00100
Pierre Nicodeme - 15
November 21, 2013
00100
111100
Pierre Nicodeme - 15
November 21, 2013
00100
111100
10111111100
Pierre Nicodeme - 15
November 21, 2013
00100
111100
10111111100
01100
Pierre Nicodeme - 15
November 21, 2013
00100
111100
10111111100
01100
0100
Pierre Nicodeme - 15
November 21, 2013
00100
111100
10111111100
01100
0100
11100
11100
010100
0110100
00100
10111111010111111100
00010100
0101100
Pierre Nicodeme - 15
November 21, 2013
00100
111100
10111111100
01100
0100
11100
11100
010100
0110100
00100
10111111010111111100
00010100
0101100
100010100111
Pierre Nicodeme - 15
November 21, 2013
00100
111100
10111111100
01100
0100
11100
11100
010100
0110100
00100
10111111010111111100
00010100
0101100
100010100111
1100010100111
Pierre Nicodeme - 15
November 21, 2013
00100
111100
10111111100
01100
0100
11100
11100
010100
0110100
00100
10111111010111111100
00010100
0101100
100010100111
1100010100111
1000010111
Pierre Nicodeme - 15
November 21, 2013
00100
111100
10111111100
01100
0100
11100
11100
010100
0110100
00100
10111111010111111100
00010100
0101100
100010100111
1100010100111
1000010111
0011000011000000111
Pierre Nicodeme - 15
November 21, 2013
00100
111100
10111111100
01100
0100
11100
11100
010100
0110100
00100
10111111010111111100
00010100
0101100
100010100111
1100010100111
1000010111
0011000011000000111
010101010101000111
Pierre Nicodeme - 15
November 21, 2013
00100
111100
10111111100
01100
0100
11100
11100
010100
0110100
00100
10111111010111111100
00010100
0101100
100010100111
1100010100111
1000010111
0011000011000000111
010101010101000111
110110110011011010100101100110000011010111
0111
111
001100010111
0100010010010100000100111
00111
000101100101010000111
101010101000101011001010100000010000110111
Pierre Nicodeme - 15
November 21, 2013
1
Pierre Nicodeme - 16
1
10000111
November 21, 2013
1
2
Pierre Nicodeme - 16
1
2
10000111
00011010000. . .
November 21, 2013
1
2
3
Pierre Nicodeme - 16
1
2
3
10000111
00011010000. . .
100111
November 21, 2013
1
2
3
4
Pierre Nicodeme - 16
1
2
3
10000111
00011010000. . .
100111
111011110. . .
November 21, 2013
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Pierre Nicodeme - 16
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
10000111
00011010000. . .
100111
111011110. . .
111011111. . .
001000101. . .
110010110. . .
100110001. . .
101110100
00110000. . .
0111110010. . .
1101011110. . .
1110100
10100101. . .
00100001. . .
0010000111
000011000111111
1001010. . .
00010101001110. . .
111101011. . .
10101001. . .
10100111110. . .
0111010111. . .
0001001. . .
1111101110. . .
0110111000. . .
1000000. . .
0011111101. . .
1100001. . .
0111001000. . .
November 21, 2013
1000 randomly chosen strings
w = 100
w = 111
p
p
p : position of first occurrence of w
Pierre Nicodeme - 17
November 21, 2013
Aim of the computation
W : random variable counting the first occurrence of the
word w in a random string; (rightmost position of the occurrence)
Probability generating function of W
R(z) =
X
P(W = n) × z n
n≥0
Pierre Nicodeme - 18
November 21, 2013
Aim of the computation
W : random variable counting the first occurrence of the
word w in a random string; (rightmost position of the occurrence)
Probability generating function of W
R(z) =
X
P(W = n) × z n
n≥0
By differentiation
I Expectation of W
∂R(z) ∂z z=1
Pierre Nicodeme - 18
=
X
n × P(W = n) = E(W )
n≥0
November 21, 2013
Aim of the computation
W : random variable counting the first occurrence of the
word w in a random string; (rightmost position of the occurrence)
Probability generating function of W
R(z) =
X
P(W = n) × z n
n≥0
By differentiation
I Expectation of W
∂R(z) ∂z z=1
I
=
X
n × P(W = n) = E(W )
n≥0
Second Moment of W
X
∂ ∂R(z) z
=
n2 × P(W = n) = E(W 2 )
∂z
∂z z=1
n≥0
Pierre Nicodeme - 18
November 21, 2013
Aim of the computation
W : random variable counting the first occurrence of the
word w in a random string; (rightmost position of the occurrence)
Probability generating function of W
R(z) =
X
P(W = n) × z n
n≥0
By differentiation
I Expectation of W
∂R(z) ∂z z=1
I
=
X
n × P(W = n) = E(W )
n≥0
Second Moment of W
X
∂ ∂R(z) z
=
n2 × P(W = n) = E(W 2 )
∂z
∂z z=1
n≥0
I
Standard Deviation: σ(W ) =
Pierre Nicodeme - 18
p
E(W 2 ) − E2 (W )
November 21, 2013
More about R(z)
R(z) =
X
P(the word w occurs first at end position n) × z n
n≥0
Example: w = 01
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
P (01 occurs for the first time at position 4) =
Pierre Nicodeme - 19
3
16
November 21, 2013
Ordinary Generating Functions as a Counting Tool
Let
I
A = {0, 1} (alphabet)
I
and S be a set of words.
Then the ordinary generating function S(z) of the set S is
X
P(w) × z |w|
S(z) =
w∈S
and, when the constructions are not ambiguous,
for two sets S1 and S2
S
I if T = S1
S2 , then T (z) = S1 (z) + S2 (z)
I
if T = S1 •S2
(pairwise concatenation),
then T (z) = S1 (z)×S2 (z)
We need bijections between the members
of the formal sets or languages equations
Pierre Nicodeme - 20
November 21, 2013
Examples
Remark
I P(u.v) = P(u) × P(v)
I empty word of size 0
P(.w) = P() × P(w) = P(w)
Assume P(0) = P(1) =
=⇒
P() = 1
1
2
S1 = {, 0, 01, 11, 101}
X
S1 (z) =
w∈S1
P(w)z |w| = 1 +
z z2 z3
+
+
2
2
8
= P()z || +P(0)z |0| +P(01)z |01| +P(11)z |11| +P(101)z |101|
z 1
z 2
z 2
z 3
=
1
+
+
+
+
2
2
2
2
Pierre Nicodeme - 21
November 21, 2013
Examples
I
Non ambiguous Union:
S1 = {0, 01}
S2 = {, 11, 101}
T = S1
Pierre Nicodeme - 22
S
S2 = {, 0, 01, 11, 101}
z z2
+
2
4
z2 z3
S2 (z) = 1 +
+
4
8
z z2 z3
T (z) = 1 + +
+
2
2
8
S1 (z) =
November 21, 2013
Examples
I
Non ambiguous Union:
S1 = {0, 01}
S2 = {, 11, 101}
T = S1
I
S
z z2
+
2
4
z2 z3
S2 (z) = 1 +
+
4
8
z z2 z3
T (z) = 1 + +
+
2
2
8
S1 (z) =
S2 = {, 0, 01, 11, 101}
Ambiguous Union:
S1 = {0, 01}
S2 = {01, 11}
T = S1
Pierre Nicodeme - 22
S
S2 = {0, 01, 11}
z z2
+
2
4
z2 z2
S2 (z) =
+
4
4
z 2z 2
T (z) = +
6= S1 (z) + S2 (z)
2
4
S1 (z) =
November 21, 2013
Examples
Non-Ambiguous Union
I Set of words of even length
E = {, 00, 01, 10, 11, 0000, 0001, . . . } = (0 + 1)2
E(z) = 1+22
I
z 2
+· · ·+22n
2
Set of words of odd length
z 2n
2
?
+· · · = 1+z 2 +· · · =
1
1 − z2
O = {0, 1, 000, 001, 010, . . . , 111, . . . , 00000, . . . } = (0 + 1).E
O(z) = z + z 3 + z 5 + · · · =
I
z
1 − z2
All the words
E
[
O = (0 + 1)?
n
1
z
1
n z
E(z)+O(z) =
+
=
= 1+z+· · ·+2
+. . .
1 − z2 1 − z2
1−z
2
Pierre Nicodeme - 23
November 21, 2013
Examples: Non-Ambiguous Concatenation
U = 0? = {, 0, 00, 000, . . . },
U (z) =
1
z,
1−
2
V = 1.0? = {1, 10, 100, . . . }
V (z) =
z
1
×
2 1− z
2
T = U•V = 0? .1.0?
T (z) = U (z)×V (z) =
z
z n−1
z n
Xz
=
×n×
=
n
z 2
2
2
2
n≥0
2 1−
2
Why?
Pierre Nicodeme - 24
November 21, 2013
Examples: Non-Ambiguous Concatenation
U = 0? = {, 0, 00, 000, . . . },
U (z) =
1
z,
1−
2
V = 1.0? = {1, 10, 100, . . . }
V (z) =
z
1
×
2 1− z
2
T = U•V = 0? .1.0?
T (z) = U (z)×V (z) =
z
z n−1
z n
Xz
=
×n×
=
n
z 2
2
2
2
n≥0
2 1−
2
Why?
5 words of size 5 in T : {10000, 01000, 00100, 00010, 00001}
= {•10000, 0•1000, 00•100, 000•10, 0000•1}
Pierre Nicodeme - 24
November 21, 2013
Examples: Non-Ambiguous Concatenation
U = 0? = {, 0, 00, 000, . . . },
U (z) =
1
z,
1−
2
V = 1.0? = {1, 10, 100, . . . }
V (z) =
z
1
×
2 1− z
2
T = U•V = 0? .1.0?
T (z) = U (z)×V (z) =
z
z n−1
z n
Xz
=
×n×
=
n
z 2
2
2
2
n≥0
2 1−
2
Why?
5 words of size 5 in T : {10000, 01000, 00100, 00010, 00001}
= {•10000, 0•1000, 00•100, 000•10, 0000•1}
= {•10000, 0•1000, 00•100, 000•10, 0000•1}
Pierre Nicodeme - 24
November 21, 2013
Examples: Ambiguous Concatenation
I
Set of words of even length
I
E = {, 00, 01, 10, 11, 0000, 0001, . . . }
z 2
1
E(z) = 1 + 4
+ · · · = 1 + z2 + z4 + · · · =
2
1 − z2
Set of words of odd length
I
O = {0, 1, 000, 001, 010, 011, 100, . . . , 111, . . . , 00000, . . . }
z
O(z) = z + z 3 + z 5 + · · · =
1 − z2
Concatenate E and O
z
G = {w = u.v, u ∈ E, v ∈ O} = O =⇒ G(z) =
1 − z2
But
z
E(z)×O(z) =
= z + 2z 3 + 3z 5 + · · · + nz 2n−1 + . . .
(1−z 2 )2
Why?
Pierre Nicodeme - 25
November 21, 2013
Examples: Ambiguous Concatenation
I
Set of words of even length
I
E = {, 00, 01, 10, 11, 0000, 0001, . . . }
z 2
1
E(z) = 1 + 4
+ · · · = 1 + z2 + z4 + · · · =
2
1 − z2
Set of words of odd length
I
O = {0, 1, 000, 001, 010, 011, 100, . . . , 111, . . . , 00000, . . . }
z
O(z) = z + z 3 + z 5 + · · · =
1 − z2
Concatenate E and O
z
G = {w = u.v, u ∈ E, v ∈ O} = O =⇒ G(z) =
1 − z2
But
z
E(z)×O(z) =
= z + 2z 3 + 3z 5 + · · · + nz 2n−1 + . . .
(1−z 2 )2
Why?
00000 has been obtained as •00000, 00•000, 0000•0
Pierre Nicodeme - 25
November 21, 2013
Guibas-Odlyzko decomposition - Waiting time for a word w
I
R: set of all strings with a single occurrence of w at the right
end
I
N : set of all strings with no occurrence of w
Pierre Nicodeme - 26
November 21, 2013
Guibas-Odlyzko decomposition - Waiting time for a word w
I
R: set of all strings with a single occurrence of w at the right
end
I
N : set of all strings with no occurrence of w
w = 111
111
00100111 ∈ R
10101111 6∈ R
Right Language R
Guibas-Odlyzko decomposition - Waiting time for a word w
I
R: set of all strings with a single occurrence of w at the right
end
I
N : set of all strings with no occurrence of w
w = 111
111
00100111 ∈ R
Right Language R
10101111 6∈ R
Not Language N
01010110000 ∈ N
Pierre Nicodeme - 26
001101110001 6∈ N
November 21, 2013
Autocorrelation of words
The word 111 is autocorrelated
This means that
I by concatenating 1 or 11 to 111
I you find an overlapping occurrence of 111
11111
1111
Pierre Nicodeme - 27
November 21, 2013
Autocorrelation of words
The word 111 is autocorrelated
This means that
I by concatenating 1 or 11 to 111
I you find an overlapping occurrence of 111
11111
1111
The word 100 has no autocorrelation
100100
Pierre Nicodeme - 27
November 21, 2013
Autocorrelation of words
The word 111 is autocorrelated
This means that
I by concatenating 1 or 11 to 111
I you find an overlapping occurrence of 111
11111
1111
The word 100 has no autocorrelation
100100
autocorrelation set Cw of w:
0
Cw = {h : w.h = h .w with |h| < |w|}
C111 = {, 1, 11}
C100 = {}
C10110 = {, 110}
w = 10110 −→
10110 110 = 101 10110 =
| {z } |{z} |{z} | {z }
w
Pierre Nicodeme - 27
h
h0
w
November 21, 2013
Autocorrelation Polynomial
I
It is the ordinary generating function
of the autocorrelation set
Example
w = 010010010
P(0) = P(1) =
1
2
C = {, 010, 010010, 10010010}
010010010010010 =⇒
3 6 8
010010010010010
C(z) = 1 + z + z + z
2
2
2
01001001010010010 10010010010010010 010010010010
010010010010
Pierre Nicodeme - 28
November 21, 2013
Non-Ambiguous Formal Set Equations for R and N
I R: set of all strings with a single occurrence of w at the right end
I N : set of all strings with no occurrence of w
N •{0, 1} = N ∪ R \ {}
Pierre Nicodeme - 29
November 21, 2013
Non-Ambiguous Formal Set Equations for R and N
I R: set of all strings with a single occurrence of w at the right end
I N : set of all strings with no occurrence of w
N •{0, 1} = N ∪ R \ {}
w = 111
10001100101 ∈ N
and 10001100101•{0, 1} =
100011001010
100011001011
∈N
∈N
but
Pierre Nicodeme - 29
November 21, 2013
Non-Ambiguous Formal Set Equations for R and N
I R: set of all strings with a single occurrence of w at the right end
I N : set of all strings with no occurrence of w
N •{0, 1} = N ∪ R \ {}
w = 111
10001100101 ∈ N
100011001010
100011001011
1000110010110
1000110010111
and 10001100101•{0, 1} =
∈N
∈N
but
100011001011 ∈ N
and 100011001011•{0, 1} =
Pierre Nicodeme - 29
∈N
∈R
November 21, 2013
Non-Ambiguous Formal Set Equations for R and N
I R: set of all strings with a single occurrence of w at the right end
I N : set of all strings with no occurrence of w
N •w = R•C
Pierre Nicodeme - 30
November 21, 2013
Non-Ambiguous Formal Set Equations for R and N
I R: set of all strings with a single occurrence of w at the right end
I N : set of all strings with no occurrence of w
N •w = R•C
w = 111
10001100100 ∈ N
and 10001100100•111 = 10001100100111 ∈ RC
Pierre Nicodeme - 30
November 21, 2013
Non-Ambiguous Formal Set Equations for R and N
I R: set of all strings with a single occurrence of w at the right end
I N : set of all strings with no occurrence of w
N •w = R•C
w = 111
10001100100 ∈ N
and 10001100100•111 = 10001100100111 ∈ RC
and
10001100101 ∈ N
and 10001100101•111 = 10001100101111 ∈ RC
Pierre Nicodeme - 30
November 21, 2013
Non-Ambiguous Formal Set Equations for R and N
I R: set of all strings with a single occurrence of w at the right end
I N : set of all strings with no occurrence of w
N •w = R•C
w = 111
10001100100 ∈ N
and 10001100100•111 = 10001100100111 ∈ RC
and
10001100101 ∈ N
and 10001100101•111 = 10001100101111 ∈ RC
and also
100011001011 ∈ N
and 100011001011•111 = 100011001011111 ∈ RC
Pierre Nicodeme - 30
November 21, 2013
Non-Ambiguous Formal Set Equations for R and N
I R: set of all strings with a single occurrence of w at the right end
I N : set of all strings with no occurrence of w
N •w = R•C
w = 111
10001100100 ∈ N
and 10001100100•111 = 10001100100111 ∈ RC
and
10001100101 ∈ N
and 10001100101•111 = 10001100101111 ∈ RC
and also
100011001011 ∈ N
and 100011001011•111 = 100011001011111 ∈ RC
These equations are bijections [Guibas-Odlyzko 1984]
Pierre Nicodeme - 30
November 21, 2013
Translating to Generating Functions
N .{0, 1} = N ∪ R \ {}
N .w = R.C
Pierre Nicodeme - 31
translate to
N (z)×z = N (z)+R(z)−1
N (z)×w(z) = R(z)×C(z)
November 21, 2013
Translating to Generating Functions
N .{0, 1} = N ∪ R \ {}
translate to
N .w = R.C
N (z)×z = N (z)+R(z)−1
N (z)×w(z) = R(z)×C(z)
Solving for R(z) and N (z)
R(z) =
w(z)
(1 − z)C(z) + w(z)
=
P(w)z |w|
(1 − z)C(z) + P(w)z |w|
N (z) =
C(z)
(1 − z)C(z) + w(z)
=
C(z)
(1 − z)C(z) + P(w)z |w|
Pierre Nicodeme - 31
November 21, 2013
Waiting time W for 100 and 111
R(z) =
X
P(W = n)z n =
n≥0
R(z)
=
100
111
z 3 /8
(1−z)×1 + z 3 /8
z 3 /8
z z2
(1−z)(1+ + )+z 3 /8
2 4
z 3 2z 4 4z 5
+
+
+. . .
8
16
32
∂R(z) E(W ) =
∂z z=1
σ(W )
Pierre Nicodeme - 32
w(z)
(1 − z)C(z) + w(z)
=
z 3 z 4 2z 5
+ +
+. . .
8 16 32
8
√
24 ≈ 4.90
14
√
142 ≈ 11.92
November 21, 2013
1000 randomly chosen strings
w = 100
w = 111
E(W ) = 8
E(W ) = 14
σ(W ) ≈ 4.90
σ(W ) ≈ 11.92
p
p
p : position of first occurrence of w
Pierre Nicodeme - 33
November 21, 2013
Back to the Paradox
I
At each position of a random string,
I
the probability of getting one occurrence
1
is for 111 and 100.
8
I
Why does on the average 100 occur before 111?
Pierre Nicodeme - 34
November 21, 2013
Statistics of Words
(Some tools that you can learn during my course)
Aims
I Counting simultaneously occurrences of several words
I Counting occurrences of Motifs (Regular Expressions)
I Hidden Motifs in texts
I Limit laws for the counts
Methods
I Combinatorics of Languages
I Automata constructions
Applications
I Linguistic Analysis
I Bioinformatics (exceptional motifs in DNA, modelling
evolution)
I Analysis of Random Trees
Pierre Nicodeme - 35
November 21, 2013
Part II
Derangements in Permutations
Pierre Nicodeme - 36
November 21, 2013
When nobody gets back its own hat!
“A number n of people go to the opera, leave their hats on hooks
in the cloakroom and grab them at random when leaving.”
“The probability that nobody gets back his own hat is asymptotic
to 1/e ≈ 37%.”
(Comtet, L. “Advanced Combinatorics”, Reidel 1974)
Usual approach: Inclusion-Exclusion
What about an approach by Analytic Combinatorics?
Pierre Nicodeme - 37
November 21, 2013
Permutations as set of cycles
P=
1 2 3 4 5 6
5 6 1 4 3 2
4
1
2
6
5
Pierre Nicodeme - 38
3
November 21, 2013
Permutations as set of cycles
P=
1 2 3 4 5 6
5 6 1 4 3 2
4
1
2
6
5
3
Hat problem
I Give to each person a different number from 1 to n
I Give to each hat the number (or label) of its owner
I If at return time, the resulting permutation
has no cycle of size 1, nobody gets back his hat.
(Such a permutation is called a derangement)
Pierre Nicodeme - 38
November 21, 2013
Exponential Generating Function
I
S set of labelled objects
I
sn number of elements of S of size n
I
exponential generating function S(z) of S:
S(z) =
X
sn ×
n≥0
X z |α|
zn
=
n!
|α|!
α∈S
Example: permutations
I
I
Sn : symmetric group of permutations of size n
[
P=
Sn
n≥0
P (z) =
X
n≥0
Pierre Nicodeme - 39
|Sn | ×
zn
1
=
n!
1−z
November 21, 2013
Admissible Constructions - Unions
Disjoint Union P = P1
P (z) =
[
P2
X z |β|
X z |γ|
X z |α|
=
+
= P1 (z) + P2 (z)
|α|!
|β|!
|γ|!
α∈P
β∈P1
γ∈P2
Example
P1 =
P1 (z) = z+
Pierre Nicodeme - 40
1 2 3
3 1 2
z3
,
3!
1
,
,
1
P2 (z) =
z3
,
3!
P2 =
P (z) = z+
1 2 3
3 2 1
2z 3
= P1 (z)+P2 (z)
3!
November 21, 2013
Admissible Construction - Labelled Product
π1 =
I
1 2 3
3 1 2
,
π2 =
1 2
2 1
How can we make
a labelled product π = π1 ? π2 of π1 and π2 ?
Pierre Nicodeme - 41
November 21, 2013
Admissible Construction - Labelled Product
π1 =
I
1 2 3
3 1 2
,
π2 =
1 2
2 1
How can we make
a labelled product π = π1 ? π2 of π1 and π2 ?
I
It is not
the product of elements in the Symmetric Group!!!
Pierre Nicodeme - 41
November 21, 2013
Admissible Construction - Labelled Product
π1 =
I
1 2 3
3 1 2
,
π2 =
1 2
2 1
How can we make
a labelled product π = π1 ? π2 of π1 and π2 ?
I
It is not
the product of elements in the Symmetric Group!!!
I
The labelled product of π1 and π2 will have 5 labels
How can we distribute them?
Pierre Nicodeme - 41
November 21, 2013
Labelled Product - Example
P1 =
1 2 3
2 3 1
P2 =
1 2
2 1
Compute P1 ?P2
I
I
I
for each “subset” S = (s1 , s2 , s3 ) of size 3 of (1, 2, 3, 4, 5)
apply the permutation P1 to S
(respect each pairwise order in P1 (S) with respect to P1 )
12345 123
245
◦•◦•• ≡
231
452
S = 2 45
Pierre Nicodeme - 42
November 21, 2013
Labelled Product - Example
P1 =
1 2 3
2 3 1
P2 =
1 2
2 1
Compute P1 ?P2
I
I
I
for each “subset” S = (s1 , s2 , s3 ) of size 3 of (1, 2, 3, 4, 5)
apply the permutation P1 to S
(respect each pairwise order in P1 (S) with respect to P1 )
12345 123
245
◦•◦•• ≡
231
452
S = 2 45
I
apply P2 to the remaining “subset” (1, 3) of (12345)
12345
P2 (1, 3) = (3, 1)
◦•◦••
34152
I
take the Union of the resulting permutations
Pierre Nicodeme - 42
November 21, 2013
Labelled Product - Example
Compute P =
Pierre Nicodeme - 43
1 2 3
3 2 1
1 2
?
2 1
November 21, 2013
Labelled Product - Example
Compute P =
1 2 3
3 2 1
•••◦◦
••◦•◦
••◦◦•
•◦••◦
•◦•◦•
•◦◦••
◦•••◦
◦••◦•
◦•◦••
◦◦•••
Pierre Nicodeme - 43
1 2
?
2 1
32154
42513
52431
45322
54321
53241
54321
45312
35142
21543
November 21, 2013
Labelled Product - Example
Compute P =
1 2 3
3 2 1
•••◦◦
••◦•◦
••◦◦•
•◦••◦
•◦•◦•
•◦◦••
◦•••◦
◦••◦•
◦•◦••
◦◦•••
P =
1 2
?
2 1
32154
42513
52431
45322
54321
53241
54321
45312
35142
21543
(32154), (42513), (52143), (43252), (53142),
(54132), (43251), (53241), (54231), (54321)
Pierre Nicodeme - 43
|P | =
5!
3!2!
November 21, 2013
Labelled Products of sets - Generating Functions
A, B: sets of labelled objects
C = A ? B :=
[
α?β
α∈A
β∈B
Ar = number of objects of
Bs =
“ “
Cn =
“ “
Cn =
Pierre Nicodeme - 44
X (r + s)!
Ar Bs
r!s!
r+s=n
=⇒
A
B
C
of size
“ “
“ “
r
s
n
X Ar B s
Cn
=
n!
r! s!
r+s=n
November 21, 2013
Labelled Products of sets - Generating Functions
A, B: sets of labelled objects
C = A ? B :=
[
α?β
α∈A
β∈B
Ar = number of objects of
Bs =
“ “
Cn =
“ “
Cn =
=⇒
X (r + s)!
Ar Bs
r!s!
r+s=n
C(z) =
X Cn z n
n≥0
Pierre Nicodeme - 44
n!
=
r!
of size
“ “
“ “
r
s
n
X Ar B s
Cn
=
n!
r! s!
r+s=n
=⇒
X Ar z r
r≥0
A
B
C
×
X Bs z s
s≥0
s!
= A(z)×B(z)
November 21, 2013
Labelled Products of sets - Generating Functions
A, B: sets of labelled objects
C = A ? B :=
[
α?β
α∈A
β∈B
Ar = number of objects of
Bs =
“ “
Cn =
“ “
Cn =
=⇒
X (r + s)!
Ar Bs
r!s!
r+s=n
C(z) =
X Cn z n
n≥0
n!
=
Associativity: C = B1 ? . . . ? Bk
Pierre Nicodeme - 44
r!
of size
“ “
“ “
r
s
n
X Ar B s
Cn
=
n!
r! s!
r+s=n
=⇒
X Ar z r
r≥0
A
B
C
×
X Bs z s
s≥0
s!
= A(z)×B(z)
C(z) = B1 (z)× . . . ×Bk (z)
November 21, 2013
k-Sequences, k-Sets and Sets
Setk (B) = Seqk (B)/S
S: Equivalence Relation
I identifying two sequences S1 and S2
I if the components of the first are a permutation of the
components of the second
B(z) =
X z |α|
|α|!
α∈B
BSet,k (z) =
κ∈Setk (B)
A = Set(B) =
[
k≥0
Pierre Nicodeme - 45
γ∈Seqk (B)
z |κ|
X
X
BSeq,k (z) =
|κ|!
Setk (B)
BSet,k (z) =
A(z) =
z |γ|
= B(z)k
|γ|!
BSeq,k (z)
B(z)k
=
k!
k!
X B(z)k
k≥0
k!
= exp(B(z))
November 21, 2013
k-Cycles and Cycles
Setk (B) = Seqk (B)/C
C: Equivalence Relation
I identifying two sequences S1 and S2
I if the components of the first are a cyclic permutation
of the components of the second
B(z) =
X z |α|
|α|!
BSeq,k (z) =
α∈B
X
BCyc,k (z) =
κ∈Cyck (B)
A = Cyc(B) =
[
k≥1
Pierre Nicodeme - 46
X
γ∈Seqk (B)
z |κ|
|κ|!
Cyck (B)
BCyc,k (z) =
A(z) =
BSeq,k (z)
B(z)k
=
k
k
X B(z)k
k≥1
z |γ|
= B(z)k
|γ|!
k
= log
1
1 − B(z)
November 21, 2013
Permutations as set of Cycles
I
Cn = Cycles of size n of a permutation
= Cycles of a n-Sequence of a singleton (1)
zn
n! z n
(z/1!)n
=
=
Cn (z) =
n
n
n n!
I
C= all Cycles of a singleton
C(z) =
X zn
n≥1
I
n
= log
1
1−z
Permutation P = Set of Cycles
X n!z
1
1
P (z) = exp log
=
=
1−z
1−z
n!
n≥0
Pierre Nicodeme - 47
November 21, 2013
The cloakroom and hats problem
We need avoiding cycles of length 1 that give back a hat to its
owner: no fixed point in the permutation
The generating function of derangements or set of cycles all of
them of size at least 2 is
2
z3
1
e−z
z
+
+ . . . = exp log
−z =
D(z) = exp
2
3
1−z
1−z
Dn number of permutations of size n without fixed point
D(z) =
X Dn z n
n≥0
n!
=⇒
Dn = n! × [z n ]D(z)
pn := P(nobody finds its own hat in a group of n) =
Pierre Nicodeme - 48
e−z
Dn
= [z n ]
n!
1−z
November 21, 2013
Exact and asymptotic computation of pn
j
z
z2
jz
pn = [z ] 1 − +
+ · · · + (−1)
+ . . . × (1 + z + z 2 + . . . )
1!
2!
j!
1
1
1
= 1 − + + · · · + (−1)n
1! 2!
n!
n
p20
≈ 0.3678794411714423216142442
limn→∞ pn = e−1 ≈ 0.3678794411714423215955238
Pierre Nicodeme - 49
November 21, 2013
Exact and asymptotic computation of pn
j
z
z2
jz
pn = [z ] 1 − +
+ · · · + (−1)
+ . . . × (1 + z + z 2 + . . . )
1!
2!
j!
1
1
1
= 1 − + + · · · + (−1)n
1! 2!
n!
n
p20
≈ 0.3678794411714423216142442
limn→∞ pn = e−1 ≈ 0.3678794411714423215955238
Asymptotic Computation: Cauchy integral
I
1
e−z
pn =
dz = e−1 + O((1/A)n ) (A > 1)
2iπ |z|=A z n+1 (1 − z)
Pierre Nicodeme - 49
November 21, 2013
Permutations with only even size cycles
E(z) =
X
n≥1
n
en z =
X En z n
n!
n≥1
= exp
Pierre Nicodeme - 50
= exp
X
1
1
log
2
1 − z2
n≥1
z 2n
2n
X 2 n
1
(z )
= exp
2
n
n≥1
1
=√
1 − z2
November 21, 2013
Permutations with only even size cycles
E(z) =
X
n≥1
n
en z =
X En z n
n!
n≥1
= exp
= exp
X
1
1
log
2
1 − z2
n≥1
z 2n
2n
X 2 n
1
(z )
= exp
2
n
n≥1
1
=√
1 − z2
H(z) = E 0 (z)(1 − z 2 ) − zE(z) = 0
Pierre Nicodeme - 50
November 21, 2013
Permutations with only even size cycles
E(z) =
X
n≥1
n
en z =
X En z n
n!
n≥1
= exp
= exp
X
1
1
log
2
1 − z2
n≥1
z 2n
2n
X 2 n
1
(z )
= exp
2
n
n≥1
1
=√
1 − z2
H(z) = E 0 (z)(1 − z 2 ) − zE(z) = 0
[z n ]H(z) = 0 =⇒ en+2 = en (n + 1)/(n + 2), (e0 = 1, e1 = 0)
2
E2n+1 = 0
E2n = (2n)! × e2n = 1.3.5 . . . (2n − 1)
Pierre Nicodeme - 50
November 21, 2013
Permutations with only even size cycles
E(z) =
X
n≥1
n
en z =
X En z n
n!
n≥1
= exp
= exp
X
1
1
log
2
1 − z2
n≥1
z 2n
2n
X 2 n
1
(z )
= exp
2
n
n≥1
1
=√
1 − z2
H(z) = E 0 (z)(1 − z 2 ) − zE(z) = 0
[z n ]H(z) = 0 =⇒ en+2 = en (n + 1)/(n + 2), (e0 = 1, e1 = 0)
2
E2n+1 = 0
E2n = (2n)! × e2n = 1.3.5 . . . (2n − 1)
Pierre Nicodeme - 50
November 21, 2013
Automatic Asymptotics
I
Permutations with only even size cycles
2
1
E2n = 1.3.5 . . . (2n − 1) = n![z n ] √
1 − z2
Pierre Nicodeme - 51
November 21, 2013
Some more examples
I
Permutations with an even number of cycles
Even number of Sets of Cycles:
C(z)2
C(z)2n
+ ··· + ...
+ ...
2n!
2!
1
1 1
1−z
= cosh log
=
+
1−z
21−z
2
E ∗ (z) = 1 +
I
Permutations with an odd number of cycles
1
1 1
1−z
∗
O (z) = sinh log
=
−
1−z
21−z
2
Pierre Nicodeme - 52
November 21, 2013
Number of cycles in a random permutations
P (r) : permutations with r cycles
P
(r)
1
(z) =
r!
log
1
1−z
r
We compute the multivariate generating function
r
∞
X
ur
1
P (z, u) =
log
r!
1−z
r=0
Pierre Nicodeme - 53
November 21, 2013
Number of cycles in a random permutations
P (r) : permutations with r cycles
P
(r)
1
(z) =
r!
log
1
1−z
r
We compute the multivariate generating function
r
∞
X
ur
1
P (z, u) =
log
r!
1−z
r=0
By differentiation, with µn the expected number of cycles in a
random permutation of size n
X
1
∂P (z, u) 1
n
log
M (z) =
µn z =
=
∂u
1−z
1−z
u=1
n≥0
1
1
+ ··· +
2
n
µn ∼ log n (n → ∞)
µn = [z n ]M (z) = Hn ≡ 1 +
µ100 = 5.18738,
Pierre Nicodeme - 53
November 21, 2013
Tools for asymptotics
I
Cauchy integrals (with variants such as Hankel contour)
I
Transfer theorems
I
Saddle-points integrals
I
Large powers and semi-large powers theorems
I
Analytic Poissonization and Depoissonization
Pierre Nicodeme - 54
November 21, 2013
Tools for asymptotics
I
Cauchy integrals (with variants such as Hankel contour)
I
Transfer theorems
I
Saddle-points integrals
I
Large powers and semi-large powers theorems
I
Analytic Poissonization and Depoissonization
Some books for Analytic Combinatorics
I On-line-PDF
Pierre Nicodeme - 54
November 21, 2013
Free on-line MOOC Course on Analytic Combinatorics
I https://www.coursera.org/course/ac
This 6-weeks course will be given from February to May 2014 on a
regular basis.
Pierre Nicodeme - 55
November 21, 2013
Practical Information
I
I
I
I
Location of the School: An Najah University, Nablus
Dates: August 18-28
Registration is free
Financial support and number of students:
I
I
I
I
I
I
full financial support for 15 students not living in Nablus
(hotel costs in 2- or 3-persons rooms, lunch at the University
and dinner at the hotel)
full financial support for 15 students living in Nablus (lunch
at the University, dinner at the hotel)
travel expenses are not supported
Professor Assistants: if we have enough funding, we could
partially support a few Professor-Assistants
Application is mandatory before May 1st, 2014. (See the
Web Site of the School)
Social event: there will be a one day excursion organized
during the school; participation will be free.
Pierre Nicodeme - 56
November 21, 2013
© Copyright 2026 Paperzz