• Keine Ergebnisse gefunden

Rules for the construction of Boltzmann samplers

2.3 Cycle pointing

2.4.2 Rules for the construction of Boltzmann samplers

Boltzmann samplers are traditionally denoted using some Pseudo-code notation. We are going to deviate from this tradition, by providing more detailed explanations of each step using words rather than improvised code. By this the author hopes to make the material more accessible to a larger audience. In the following we are always going to suppose that F is a species and x, x1, x2, . . . are nonnegative numbers such that sums F(x), and ZF(x1, x2, . . .) are positive and finite. If F is cycle-pointed, then we also assume that s1, t1, s2, t2, . . . are nonnegative numbers such that ¯ZF(s1, t1;s2, t2;. . .) is positive and finite.

Suppose that we are given a decomposition F=AµB

with µ ∈ {+,·,◦} one of the discussed operations of sum, product and substitu-tion. In order to construct a (P´olya-)Boltzmann-sampler for the speciesF, we may apply certain construction rules in order to obtain a sampler in terms of samplers for the species A and B. In the following we summarize these construction rules for (P´olya-)Boltzmann samplers, following [DFLS04], [FFP07] and [BFKV11]. A treatment for (P´olya-)Boltzmann samplers in the more general context of weighted multisort species is currently in preparation by the author of this thesis.

2.4.2.1 The labelled case Sums

Suppose thatF =P

i=1Fi. Then the following procedure is Boltzmann sampler for F.

1. Draw an integer`≥1 with probability

P(`=i) =Fi(x)/F(x).

2. Return ΓFi(x). That is, the result is a random Boltzmann-distributed Fi -object.

Products

Suppose that F =Qk

i=1Fi. Then the following procedure is a Boltzmann sampler forF.

1. For each 1≤i≤k let

Fi←ΓFi(x).

That is, let Fi, 1 ≤ i ≤ k be independent random variables such that Fi follows a Boltzmann-distribution forFi with parameter x.

2. Let U denote the exterior disjoint union of the label-sets of the Fi. Hence, by a slight abuse of notation,

(F1, . . . , Fk)∈ F[U].

Make a uniformly at random choice of a bijection ν from U to the set of integers [n] withndenoting the size ofU. Return the relabelled objectν.F.

Substitution

Suppose that F = G ◦ H with H[∅] = ∅. The following procedure is a Boltzmann sampler forF.

1. Set

G←ΓG(y) with y=H(x).

That is, letG denote a randomG-object that follows a Boltzmann distribu-tion with parameterH(x).

2. Let V denote the label set of G. For each atomi∈V set Hi ←ΓH(x).

and let Ui denote the label set of Hi. Let U denote the exterior disjoint union of the label sets Ui. Hence, by a slight abuse of notation,

π :={Ui |i∈V} is a partition ofU. Setting

σ:V →π, i7→Ui

and HUi :=Hi for each i∈V we have that

(σ.G,(HQ)Q∈π)∈(G ◦ H)[U].

3. Make a uniformly at random choice of a bijection ν from U to the set of integers [n] withn denoting the size ofU. Return the relabelled object

ν.(σ.G,(HQ)Q∈π).

2.4.2.2 P´olya-Boltzmann samplers Sums

Suppose that F = P

i=1Fi. Then the following procedure is a P´olya-Boltzmann sampler forF.

1. Draw an integer `≥1 with probability

P(`=i) =ZFi(s1, s2, . . .)/ZF(s1, s2, . . .).

2. Return ΓZF`(s1, s2, . . .). That is, the result is a random F`-symmetry fol-lowing a P´olya-Boltzmann distribution with the parameters (s1, s2, . . .).

Products

Suppose that F =Qk

i=1Fi. Then for any finite setU there is a bijection between the set Sym(F)[U] and tuples (S1, . . . , Sk) such that Si is a Fi-symmetry for all i and the label sets of the Si partition the set U. This is due to the fact, that given a F-symmetry ((F1, . . . , Fk), σ) ∈ Sym(F)[U] the permutation σ must leave the label set Qi of the Fi-objectFi invariant and satisfyσ|Qi.Fi =Fi, i.e. (Fi, σ|Qi)∈ Sym(Fi)[Qi].

The following procedure is a P´olya-Boltzmann sampler forF. 1. For each 1≤i≤k set

(Fi, σi)←ΓZFi(s1, s2, . . .).

That is, let Si := (Fi, σi), 1 ≤ i ≤ k be independent random variables such thatSi follows a P´olya-Boltzmann distribution forFi with parameters s1, s2, . . ..

2. By the bijection for the symmetries of products, the tupel (S1, . . . , Sk) cor-responds to an F-symmetry (F, σ) over the (exterior) disjoint union U of the label-sets of theSi. Make a uniformly at random choice of a bijectionν from U to the set of integers [n] with ndenoting the size of U. Return the relabelled symmetry

ν.(F, σ) = (ν.F, νσν−1).

Substitution

Suppose that F = G ◦ H with H[∅] = ∅. The symmetries of the substitution were discussed in detail in Section 2.2.4. The following procedure is a P´olya-Boltzmann sampler forF.

1. Set

(G, σ)←ΓZG(ZH(s1, s2, . . .), ZH(s2, s4, . . .), . . .).

That is, let (G, σ) denote a randomG-symmetry that follows a P´olya-Boltzmann distribution with parametersZH(s1, s2, . . .), ZH(s2, s4, . . .), . . ..

2. For each cycleτ ofσ let|τ|denote its lengths and set (Hτ, στ)←ΓZH(s|τ|, s2|τ|, . . .).

That is, the symmetries (Hτ, στ), τ cycle ofσ, are independent (conditional onσ) and follow P´olya-Boltzmann distributions.

3. For each cycleτ, make|τ|identical copies copies of (Hτ, στ) and assemble a F-symmetry (F, γ) out of (G, σ) and the copies of the (Hτ, στ) as described in Section 2.2.4.

4. Choose bijection ν from the vertex set of (F, γ) to an appropriate sized set of integers [n] and return the relabelled symmetry

ν.(F, γ) = (ν.F, νγν−1).

The Set construction

The following procedure is a P´olya-Boltzmann sampler forF=SET.

1. Let (mi)i∈Nbe an independent family of integersmi≥0 such thatmi follows a Poisson-distribution with parameter si/i.

2. The sequence drawn in the previous step belongs almost surely to NN0. Let σ be a permutation with cycle type (mi)i.

3. Make a uniformly at random choice of a bijection ν from the label set of σ to an appropriate sized set of integers [n] and return the SET-symmetry

(F, νσν−1)

withF = [n] the unique element from SET[n] ={[n]}.

2.4.2.3 P´olya-Boltzmann samplers for cycle-pointed species In the following, we suppose thatF is a cycle pointed species.

Sums

Suppose thatF =P

i=1Fi with cycle-pointed species Fi. Then the following pro-cedure is a P´olya-Boltzmann sampler forF.

1. Draw an integer `≥1 with probability

P(`=i) = ¯ZFi(s1, t1;s2, t2;. . .)/ZF(s1, t1;s2, t2;. . .).

2. Return Γ ¯ZF`(s1, t1;s2, t2;. . .).

Products

Suppose thatF =G?HwithGa cycle-pointed species andHa species. Then for any finite setU there is a canonical choice for a bijection between the set RSym(F)[U] and tuples (S1, S2) with S1 a rooted c-symmetry of G, S2 a symmetry of G, such that the label sets ofS1 and S2 form a partition ofU. The following procedure is a P´olya-Boltzmann sampler forF.

1. Set

S1 ←Γ ¯ZG(s1, t1;s2, t2;. . .).

2. Set

S2←ΓZH(s1, s2, . . .).

3. LetU denote the exterior disjoint union of the label sets of S1 and S2. The tupel (S1, S2) corresponds to a rooted c-symmetry S over the set U.

4. Make a uniformly at random choice of a bijection ν from U to the set of integers [n] with n denoting the size of U. Return the relabelled rooted c-symmetry ν.S.

Substitution

Suppose thatF=G}HwithG cycle-pointed andH[∅] =∅. The symmetries of the substitution were discussed in detail in Section 2.2.4. The following procedure is a P´olya-Boltzmann sampler forF.

1. Set

((G, τ0), σ, v)←Γ ¯ZG(h1,¯h1;h2,¯h2;. . .) with parameters

hi =ZH(si, s2i, . . .) and ¯hi= ¯ZH(si, ti;s2i, t2i;. . .).

2. For each unmarked cycle τ 6=τ0 of σ let |τ|denote its lengths and set (Hτ, στ)←ΓZH(s|τ|, s2|τ|, . . .).

3. For the marked cycleτ0 set

((Hτ0, cτ0), στ0, vτ0)←ΓZH(s0|, t0|;s2|τ0|, t2|τ0|;. . .).

4. For each cycleτ ofσ(including the marked cycleτ0), make|τ|identical copies copies of (Hτ, στ), one for each atom of τ. Assemble a F-symmetry (F, γ) out of (G, σ) and the copies of the (Hτ, στ) as described in Section 2.2.4. Let cdenote the cycle that gets composed out of the|τ0|copies of the cyclecτ0. The marked vertexvτ0 has|τ0|copies (one for each atom ofτ0) and we letu denote the copy that corresponds to the marked atomv0 ofτ0. Thus

((F, c), γ, u) is a rootedc-symmetry of F.

5. Choose bijectionν from the vertex set of ((F, c), γ, u) to an appropriate sized set of integers [n] and return the relabelled rootedc-symmetry

ν.((F, c), γ, u) = ((ν.F, νcν−1), νγν−1, ν.u).

Cycle pointed Set constructions

The following procedure is a P´olya-Boltzmann sampler forF=SET. 1. Choose an integer K ≥1 with distribution

P(K =k) =tk/

X

i=1

ti.

2. Set

(G, σ)←ΓZSET(s1, s2, . . .).

3. Add a disjoint cycle of length K to the permutation σ. Mark one of the atoms of this cycle uniformly at random.

4. Relabel the resulting rooted c-symmetry uniformly at random.

The sampler for the symmetrically cycle pointed species SET~ is identical, only step 1.needs to be replaced with:

1’. Choose an integer K≥2 with distribution P(K =k) =tk/

X

i=2

ti.