How to generate a random permutation in a permutation class? Fr´ ed´ erique Bassino (Laboratoire d’informatique de Paris Nord, Universit´ e Paris 13) talk based on joint works with M. Bouvel, V. Feray, L. Gerin, A. Pierrot, C. Pivoteau, D. Rossin Gascom, juin 2016 La Marana, Corse
96
Embed
How to generate a random permutation in a permutation class? · How to generate a random permutation in a permutation class? Fr ed erique Bassino (Laboratoire d’informatique de
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
How to generate a random permutation in apermutation class?
Frederique Bassino(Laboratoire d’informatique de Paris Nord, Universite Paris 13)
talk based on joint works withM. Bouvel, V. Feray, L. Gerin, A. Pierrot, C. Pivoteau, D. Rossin
Gascom, juin 2016 La Marana, Corse
Combinatorial specifications and trees
Combinatorial specifications and their byproducts
[Flajolet & Sedgewick 09]
A combinatorial specification describes (most of the time, recursively) acombinatorial class C (= a family of discrete objects) by ways of atomsand admissible constructions, like disjoint union, product, sequence, . . .
Examples:
D = ε+uDdD ;
T = U + BU = •+
•B
B = ◦+◦U U
;
A1 = Φ1(A1,A2, . . . ,Ap)
A2 = Φ2(A1,A2, . . . ,Ap)
. . .
Ap = Φp(A1,A2, . . . ,Ap)
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 3 / 34
Combinatorial specifications and their byproducts
[Flajolet & Sedgewick 09]
A combinatorial specification describes (most of the time, recursively) acombinatorial class C (= a family of discrete objects) by ways of atomsand admissible constructions, like disjoint union, product, sequence, . . .
Examples:
D = ε+uDdD ;
T = U + BU = •+
•B
B = ◦+◦U U
;
A1 = Φ1(A1,A2, . . . ,Ap)
A2 = Φ2(A1,A2, . . . ,Ap)
. . .
Ap = Φp(A1,A2, . . . ,Ap)
Systematic transcription of an unambiguous specification into:
System of equations for the generating function C (z) =∑
cnzn
[Flajolet & Sedgewick 09]
Recursive [Flajolet, Zimmerman & Van Cutsem 94] and Boltzmannrandom samplers [Duchon, Flajolet, Louchard & Schaeffer 04]
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 3 / 34
Substitution decompositionand decomposition trees
Substitution decomposition of combinatorial objects
Combinatorial analogue of the decomposition of integers as products ofprimes. Applies to relations, graphs, posets, boolean functions, setsystems, . . . and permutations [Mohring & Radermacher 84]
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 5 / 34
Substitution decomposition of combinatorial objects
Combinatorial analogue of the decomposition of integers as products ofprimes. Applies to relations, graphs, posets, boolean functions, setsystems, . . . and permutations [Mohring & Radermacher 84]
Relies on:
a principle for building objects (permutations, graphs) from smallerobjects: the substitution
some “basic objects” for this construction: simple permutations,prime graphs
Required properties:
every object can be (recursively) decomposed using only “basicobjects”
this decomposition is unique
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 5 / 34
Permutations
Permutation of size n = Bijection from [1..n] to itself.Set Sn, and S = ∪nSn.
Two lines notation:
σ =
(1 2 3 4 5 6 7 81 8 3 6 4 2 5 7
)Linear notation:σ = 1 8 3 6 4 2 5 7
Description as aproduct of cycles:σ = (1) (2 8 7 5 4 6) (3)
Graphical description,or diagram:
i
σi
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 6 / 34
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 13 / 34
Permutation classes
• A permutation class is a set C of permutations that is downward closedfor 4, i.e. whenever π 4 σ and σ ∈ C, then π ∈ C.
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 14 / 34
Permutation classes
• A permutation class is a set C of permutations that is downward closedfor 4, i.e. whenever π 4 σ and σ ∈ C, then π ∈ C.
1
12 21
123 132 213 231 312 321
1234 4321. . . . . .. . .1423 3142
σ
means π 4 σ
π
. . .
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 14 / 34
Permutation classes
• A permutation class is a set C of permutations that is downward closedfor 4, i.e. whenever π 4 σ and σ ∈ C, then π ∈ C.
1
12 21
123 132 213 231 312 321
1234 4321. . . . . .. . .1423 3142
σ
means π 4 σ
π
. . .
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 14 / 34
Permutation classes
• A permutation class is a set C of permutations that is downward closedfor 4, i.e. whenever π 4 σ and σ ∈ C, then π ∈ C.
1
12 21
123 132 213 231 312 321
1234 4321. . . . . .. . .1423 3142
σ
means π 4 σ
π
. . .
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 14 / 34
Permutation classes
• A permutation class is a set C of permutations that is downward closedfor 4, i.e. whenever π 4 σ and σ ∈ C, then π ∈ C.
σ
means π 4 σ
π
. . .
C
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 14 / 34
Permutation classes
• A permutation class is a set C of permutations that is downward closedfor 4, i.e. whenever π 4 σ and σ ∈ C, then π ∈ C.
• Notations: Av(π) = the set of permutations that avoid the pattern πAv(B) =
⋂π∈B
Av(π)
• Fact: For every permutation class C, C = Av(B) forB = {σ /∈ C : ∀π 4 σ such that π 6= σ, π ∈ C}.B is an antichain, called the basis of C.
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 14 / 34
Permutation classes
• A permutation class is a set C of permutations that is downward closedfor 4, i.e. whenever π 4 σ and σ ∈ C, then π ∈ C.
• Notations: Av(π) = the set of permutations that avoid the pattern πAv(B) =
⋂π∈B
Av(π)
• Fact: For every permutation class C, C = Av(B) forB = {σ /∈ C : ∀π 4 σ such that π 6= σ, π ∈ C}.B is an antichain, called the basis of C.
• Observations:
Conversely, every set Av(B) is a permutation class.
There exist infinite antichains, hence some permutation classes haveinfinite basis.
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 14 / 34
Permutation classes
• A permutation class is a set C of permutations that is downward closedfor 4, i.e. whenever π 4 σ and σ ∈ C, then π ∈ C.
• Notations: Av(π) = the set of permutations that avoid the pattern πAv(B) =
⋂π∈B
Av(π)
• Fact: For every permutation class C, C = Av(B) forB = {σ /∈ C : ∀π 4 σ such that π 6= σ, π ∈ C}.B is an antichain, called the basis of C.
• Observations:
Conversely, every set Av(B) is a permutation class.
There exist infinite antichains, hence some permutation classes haveinfinite basis.
In this talk, we focus on classes with finite basis.
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 14 / 34
Main steps of an algorithm to compute a specification
Data: B a finite set of permutations
We are interested in C = Av(B).
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 15 / 34
Main steps of an algorithm to compute a specification
Data: B a finite set of permutations
We are interested in C = Av(B).
Step 1: From B (finite) to the simple permutations in CTest whether they are in finite number.
If yes, compute their set SC .
Step 2: From B and SC (both finite) to a specification for CFrom decomposition trees, propagate constraints in the subtrees.
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 15 / 34
Main steps of an algorithm to compute a specification
Data: B a finite set of permutations
We are interested in C = Av(B).
Step 1: From B (finite) to the simple permutations in CTest whether they are in finite number.
If yes, compute their set SC .
Step 2: From B and SC (both finite) to a specification for CFrom decomposition trees, propagate constraints in the subtrees.
Result: A combinatorial specification for C. Hence also:
A polynomial system for the generating function.
Efficient random samplers of permutations in C.
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 15 / 34
Main steps of an algorithm to compute a specification
Data: B a finite set of permutations
We are interested in C = Av(B).
Step 1: From B (finite) to the simple permutations in CTest whether they are in finite number.
If yes, compute their set SC .
Step 2: From B and SC (both finite) to a specification for CFrom decomposition trees, propagate constraints in the subtrees.
Result: A combinatorial specification for C. Hence also:
A polynomial system for the generating function.
Efficient random samplers of permutations in C.
Remark: Substitution-closed classes are a special (and easier) case.
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 15 / 34
One more definition: substitution-closed classes
Def.: A permutation class C is substitution-closed whenπ[α(1), α(2), . . . , α(k)] ∈ C for all π, α(1), α(2), . . . , α(k) ∈ C.
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 16 / 34
One more definition: substitution-closed classes
Def.: A permutation class C is substitution-closed whenπ[α(1), α(2), . . . , α(k)] ∈ C for all π, α(1), α(2), . . . , α(k) ∈ C.
Av(231) (stack sortable permutations) is not substitution-closed :
21[12, 1] = 231
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 16 / 34
One more definition: substitution-closed classes
Def.: A permutation class C is substitution-closed whenπ[α(1), α(2), . . . , α(k)] ∈ C for all π, α(1), α(2), . . . , α(k) ∈ C.
Av(231) (stack sortable permutations) is not substitution-closed :
21[12, 1] = 231
Characterization: C = Av(B) is substitution-closed iff
the decomposition trees of permutations in C are all the ones built on theset SC of simple permutations in C. (and ⊕ and ).
or, equivalently, every permutation in B is simple.
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 16 / 34
One more definition: substitution-closed classes
Def.: A permutation class C is substitution-closed whenπ[α(1), α(2), . . . , α(k)] ∈ C for all π, α(1), α(2), . . . , α(k) ∈ C.
Av(231) (stack sortable permutations) is not substitution-closed :
21[12, 1] = 231
Characterization: C = Av(B) is substitution-closed iff
the decomposition trees of permutations in C are all the ones built on theset SC of simple permutations in C. (and ⊕ and ).
or, equivalently, every permutation in B is simple.
Example: Sep = Av(2413, 3142) is the smallest substitution-closed class thatcontains Av(231).It corresponds to decomposition trees with no prime nodes (SSep = ∅).
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 16 / 34
One more definition: substitution-closed classes
Def.: A permutation class C is substitution-closed whenπ[α(1), α(2), . . . , α(k)] ∈ C for all π, α(1), α(2), . . . , α(k) ∈ C.
Characterization: C = Av(B) is substitution-closed iff
the decomposition trees of permutations in C are all the ones built on theset SC of simple permutations in C. (and ⊕ and ).
or, equivalently, every permutation in B is simple.
Def.: The substitution closure C of C is the smallest substitution-closed classcontaining C.
Construction: C = ∪k>1Ck with C1 = C etCk+1 = {σ[π1, . . . , πn] | σ ∈ C et πi ∈ Ck ∀i ∈ [1..n]}.
Characterization: C is the substitution-closed class built on SC (SC = SC).
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 16 / 34
From the finite basis of Cto the simple permutations in C
Characterizing when a class contains finitely many simples
Theorem [Brignall, Huczynska & Vatter 08]:C = Av(B) contains finitely many simple permutations iff C contains:
1. finitely many parallel alternations
2. and finitely many wedge simple permutations
3. and finitely many proper pin-permutations
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 18 / 34
Characterizing when a class contains finitely many simples
Theorem [Brignall, Huczynska & Vatter 08]:C = Av(B) contains finitely many simple permutations iff C contains:
1. finitely many parallel alternations
2. and finitely many wedge simple permutations
3. and finitely many proper pin-permutations
Complexity : (with n =∑
π∈B |π|, k = |B| and s ≤ m = max |π|)↪→ 1. et 2. solved with pattern matching of small patterns in β ∈ B
in O(n log n) with n =∑
β∈B |β| from [Albert, Aldred, Atkinson &
Holton 01].
↪→ 3. solved using pin words and automata
in O(n · 8m + 2k·s·2s) from [Brignall, Ruskuc & Vatter 08]
↪→ Improvement from effective and recursive construction ofdeterministic and complete automata
Start from C = C〈B?〉, C+ and C−, and propagate the patternavoidance constraints in the subtrees.
Disambiguate the equations, introducing pattern containmentconstraints.
For each term Cεγ1,...,γp〈α1, . . . , αk〉 that appears on the RHS, repeatthis process, recursively.
Properties:
This algorithm terminates and produces a specification for C.
Questions:
What is the complexity?
What is the size of the specification produced?
↪→ It can be exponential in |B|. But how big can it be?
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 26 / 34
Summary: From the basis to the specification
Algorithmic chain from B finite to a specification for C = Av(B).
Is there a finite number of simple permutations in the class C=Av(B)?
O(n log n)
B: finite basis of excluded patterns
B contains only simple permutationsAv(B) is substitution-closed
B contains permutations that are not simpleAv(B) is not substitution-closed
NO
YES
Computation of the subset Sc of simple permutations in C
direct
STOP
O(N. l )4O(N. l . |B| )p+2
O(n log n+p )2k
Compute an ambiguous system by propagation of pattern avoidance constraints
Constraints propagation
Compute an unambiguous system of equationsfor generating functions using the inclusion-exclusion principle
Disambiguation of the combinatorial system
- transform intersecting unions into disjoint unions introducing complement sets- express complement sets by means of pattern containment constraints
Generating functionsBoltzmann sampler
Specification for C
where n =∑
β∈B |β|, p = maxβ∈B |β|, k = |B|, N = |SC |, ` = maxπ∈SC |π|.
Remark: It succeeds only when C contains finitely many simples (and thiscondition is tested algorithmically).
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 27 / 34
Random generation andstudy of random permutations
A specification for C gives access to. . .
A polynomial system defining C (z) (implicitly)[Flajolet & Sedgewick 09]
↪→ Can it be used to obtain information on the dominant singularity ofC (z), or equivalently the growth rate of C?
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 29 / 34
A specification for C gives access to. . .
A polynomial system defining C (z) (implicitly)[Flajolet & Sedgewick 09]
↪→ Can it be used to obtain information on the dominant singularity ofC (z), or equivalently the growth rate of C?
Random samplers of permutations in C:
I by the recursive method [Flajolet, Zimmerman & Van Cutsem 94]
I by the Boltzmann method [Duchon, Flajolet, Louchard & Schaeffer 04]
↪→ Implementation (in progress) to observe random permutations inpermutation classes.
↪→ Can we describe the “average shape” or average properties of randompermutations in permutation classes?For some given classes, or for families of classes?
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 29 / 34
Random permutations in permutation classes
• C1 = Av(2413, 3142) = separables.Substitution-closed with no simples.10000 permutations of size 100 in C1.
• Substitution-closed class C2,with simples 2413, 3142 and 24153.10000 permutations of size 500 in C2.
• C3 = Av(2413, 1243, 2341, 531642, 41352).Not substitution-closed.Almost 30000 permutations of size 500 in C3.
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 30 / 34
Random separable permutations
• Two typical separable permutations of sizes respectively n = 204 523 and
n = 903 073 (a permutation σ is represented here with its diagram: for every
i ≤ n, there is a dot at coordinates (i , σi )).
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 31 / 34
Number of occurrences of a pattern π in a randomseparable permutation
Question: What is the asymptotics in n of the number of occurrences of apattern π in a uniform separable permutation σn of n elements ?
Denote by occ(π, σ) the proportion of occurrences of a pattern π in σ(between all patterns of the same size contained in the permutation).
Let σn be a uniform separable permutation of size n. There exists acollection of random variables (Λπ), π ranging over all permutations, suchthat for all π, 0 ≤ Λπ ≤ 1 and when n→ +∞,
occ(π, σn)(d)→ Λπ,
where(d)→ denotes the convergence in distribution.
if π is a separable permutation of size at least 2, Λπ is a non-deterministicrandom variable. (Clearly, Λπ= 0 or 1 otherwise.)
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 32 / 34
Number of occurrences of a pattern π in a randomseparable permutation
Question: What is the asymptotics in n of the number of occurrences of apattern π in a uniform separable permutation σn of n elements ?Denote by occ(π, σ) the proportion of occurrences of a pattern π in σ(between all patterns of the same size contained in the permutation).
Let σn be a uniform separable permutation of size n. There exists acollection of random variables (Λπ), π ranging over all permutations, suchthat for all π, 0 ≤ Λπ ≤ 1 and when n→ +∞,
occ(π, σn)(d)→ Λπ,
where(d)→ denotes the convergence in distribution.
if π is a separable permutation of size at least 2, Λπ is a non-deterministicrandom variable. (Clearly, Λπ= 0 or 1 otherwise.)
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 32 / 34
Number of occurrences of a pattern π in a randomseparable permutation
Question: What is the asymptotics in n of the number of occurrences of apattern π in a uniform separable permutation σn of n elements ?Denote by occ(π, σ) the proportion of occurrences of a pattern π in σ(between all patterns of the same size contained in the permutation).
Let σn be a uniform separable permutation of size n. There exists acollection of random variables (Λπ), π ranging over all permutations, suchthat for all π, 0 ≤ Λπ ≤ 1 and when n→ +∞,
occ(π, σn)(d)→ Λπ,
where(d)→ denotes the convergence in distribution.
if π is a separable permutation of size at least 2, Λπ is a non-deterministicrandom variable. (Clearly, Λπ= 0 or 1 otherwise.)
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 32 / 34
Construction of Λπ
From a Schroder tree of a separable pattern π (otherwise it does not occurin a separable permutation), we buit a contour.
+
–
–– –
+ –
++ +0,12,14,20
1,9,11
2,4,6,8
3 5 7
10
13
15,17,19
16 18
+ +
A (signed) tree and its (signed) contour
The normalized contour of a uniform Schroder tree converges indistribution to a multiple of the Brownian excursion [Pittman, Rizzolo, 2015].To prove a signed version of this result seems to be very difficult.
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 33 / 34
Construction of Λπ
An excursion is a continuous function f : [0, 1]→ R+ withf (0) = f (1) = 0.From an excursion f and a set of points x = {x1, . . . , xk} in [0, 1], there isa construction to get a Schroder tree, looking at the local minima of fbetween the xi ’s.
+
+
−
x2x1 x3 x4
-
+
+
Extracting a (signed) tree from a (signed) excursion
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 33 / 34
Construction of Λπ
An excursion is a continuous function f : [0, 1]→ R+ withf (0) = f (1) = 0.From an excursion f and a set of points x = {x1, . . . , xk} in [0, 1], there isa construction to get a Schroder tree, looking at the local minima of fbetween the xi ’s.
+
+
−
x2x1 x3 x4
-
+
+
Extracting a (signed) tree from a (signed) excursion
A signed excursion is an excursion where the local minima are given a sign+ or −. Let π be a pattern of size k.Let Ψπ(f , s) be the probability that the signed tree extracted from (f , s) isa signed Schroder tree of π when X consists of k uniform and independentpoints in [0, 1].
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 33 / 34
Construction of Λπ
+
+
−
x2x1 x3 x4
-
+
+
Extracting a (signed) tree from a (signed) excursion
A signed excursion is an excursion where the local minima are given a sign+ or −. Let π be a pattern of size k.Let Ψπ(f , s) be the probability that the signed tree extracted from (f , s) isa signed Schroder tree of π when X consists of k uniform and independentpoints in [0, 1].The signed Brownian excursion as the pair (e, S), where e is the Brownianexcursion, and S assigns signs to the local minima of e in a balanced andindependent manner. Then Λπ = Ψπ(e, S).
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 33 / 34
Permuton interpretation of the result
A permuton is a measure on the square [0, 1]2 with uniform marginals.
The permutation diagram of any permutation σ of size n can be seen as apermuton µσ, up to normalization:
rescale the diagram of σ so that it fits in the unit square,
replace every point (i , σ(i)) by a square[(i − 1)/n, i/n]× [(σ(i)− 1)/n, σ(i)/n] having weight 1/n.
Let σn be a uniform random separable permutation of size n. There existsa random permuton µ such that the permuton µσn associated to σn tendsto µ in distribution.
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 34 / 34
Permuton interpretation of the result
A permuton is a measure on the square [0, 1]2 with uniform marginals.
The permutation diagram of any permutation σ of size n can be seen as apermuton µσ, up to normalization:
rescale the diagram of σ so that it fits in the unit square,
replace every point (i , σ(i)) by a square[(i − 1)/n, i/n]× [(σ(i)− 1)/n, σ(i)/n] having weight 1/n.
Let σn be a uniform random separable permutation of size n. There existsa random permuton µ such that the permuton µσn associated to σn tendsto µ in distribution.
Frederique Bassino (LIPN, Univ. Paris 13) () Random generation of permutations 34 / 34