A new bijection on m -Dyck paths and application to random sampling - - PowerPoint PPT Presentation

a new bijection on m dyck paths and application to random
SMART_READER_LITE
LIVE PREVIEW

A new bijection on m -Dyck paths and application to random sampling - - PowerPoint PPT Presentation

A new bijection on m -Dyck paths and application to random sampling Axel Bacher LIPN, Universit Paris 13 June 3rd, 2016 Outline Introduction 1 The folding bijection 2 m -ukasiewicz paths and m -Dyck prefixes Folding and unfolding


slide-1
SLIDE 1

A new bijection on m-Dyck paths and application to random sampling

Axel Bacher

LIPN, Université Paris 13

June 3rd, 2016

slide-2
SLIDE 2

Outline

1

Introduction

2

The folding bijection m-Łukasiewicz paths and m-Dyck prefixes Folding and unfolding

3

Random sampling Main algorithm Complexity and limit law

4

Perspectives

slide-3
SLIDE 3

m-Dyck paths and (m+1)-ary trees

m-Dyck path: path in N from 0 to 0 with steps in {+1, −m}. The number of paths of length n = (m+1) n′ is 1 mn′+1 n n′

  • (Fuß-Catalan number).

Random sampling of general classes of trees in time O(n log n), based on the cycle lemma. [Devroye ’12]

slide-4
SLIDE 4

The folding bijection for Dyck paths

One can sample a Dyck path in time O(n) by sampling a Dyck prefix and use the folding bijection to get a pointed Łukasiewicz path.

[Barcucci, Pinzani, Sprugnoli ’92; B., Bodini, Jacquot ’15]

slide-5
SLIDE 5

m-Łukasiewicz paths

m-Łukasiewicz path: non-negative path except at its end. Paths of length n = (m+1) n′ + r have height h = r − (m+1). Their number is r n n n′

  • (Raney number).
slide-6
SLIDE 6

m-Łukasiewicz paths

m-Łukasiewicz path: non-negative path except at its end. Paths of length n = (m+1) n′ + r have height h = r − (m+1). Their number is r n n n′

  • (Raney number).

A pointed path has an associated factorization: w = pq0d · · · qkd, where

  • 0 ≤ h(qi) ≤ m − 1,

i < k 0 ≤ h(qk) ≤ r − 1.

slide-7
SLIDE 7

Decorated m-Dyck prefixes

Paths of length n = (m+1) n′ + r have height h = (m+1) h′ + r.

slide-8
SLIDE 8

Decorated m-Dyck prefixes

a0 = 1 a1 = 3 a2 = 2 Paths of length n = (m+1) n′ + r have height h = (m+1) h′ + r. A decoration of an m-Dyck prefix is defined as a sequence: (a0, . . . , ah′), where

  • 1 ≤ ai ≤ m,

i < h′ 1 ≤ ak ≤ r. (a path has mh′r possible decorations).

slide-9
SLIDE 9

Decorated m-Dyck prefixes

a0 = 1 a1 = 3 a2 = 2 Paths of length n = (m+1) n′ + r have height h = (m+1) h′ + r. A decoration of an m-Dyck prefix is defined as a sequence: (a0, . . . , ah′), where

  • 1 ≤ ai ≤ m,

i < h′ 1 ≤ ak ≤ r. (a path has mh′r possible decorations). A decorated m-Dyck prefix has an associated factorization: w = puq0 · · · uqh′, where h(qi) = ai.

slide-10
SLIDE 10

Folding and unfolding

puq0 · · · uqk pq0d · · · qkd

Theorem

The folding operation is a bijection between decorated m-Dyck prefixes and pointed m-Łukasiewicz paths. Folding or unfolding only requires reading the part of the path after the point.

slide-11
SLIDE 11

Random m-Dyck prefix

We draw u and d steps with probabilities

m m+1 and 1 m+1.

slide-12
SLIDE 12

Random m-Dyck prefix

We draw u and d steps with probabilities

m m+1 and 1 m+1.

slide-13
SLIDE 13

Random m-Dyck prefix

We draw u and d steps with probabilities

m m+1 and 1 m+1.

slide-14
SLIDE 14

Random m-Dyck prefix

We draw u and d steps with probabilities

m m+1 and 1 m+1.

slide-15
SLIDE 15

Random m-Dyck prefix

We draw u and d steps with probabilities

m m+1 and 1 m+1.

slide-16
SLIDE 16

Random m-Dyck prefix

We draw u and d steps with probabilities

m m+1 and 1 m+1.

slide-17
SLIDE 17

Random m-Dyck prefix

We draw u and d steps with probabilities

m m+1 and 1 m+1.

If we go in the negatives, we randomly point the path and unfold.

slide-18
SLIDE 18

Random m-Dyck prefix

We draw u and d steps with probabilities

m m+1 and 1 m+1.

If we go in the negatives, we randomly point the path and unfold.

slide-19
SLIDE 19

Random m-Dyck prefix

We draw u and d steps with probabilities

m m+1 and 1 m+1.

If we go in the negatives, we randomly point the path and unfold.

slide-20
SLIDE 20

Random m-Dyck prefix

We draw u and d steps with probabilities

m m+1 and 1 m+1.

If we go in the negatives, we randomly point the path and unfold.

slide-21
SLIDE 21

Random m-Dyck prefix

We draw u and d steps with probabilities

m m+1 and 1 m+1.

If we go in the negatives, we randomly point the path and unfold.

slide-22
SLIDE 22

Random m-Dyck prefix

We draw u and d steps with probabilities

m m+1 and 1 m+1.

If we go in the negatives, we randomly point the path and unfold.

slide-23
SLIDE 23

Random m-Dyck prefix

We draw u and d steps with probabilities

m m+1 and 1 m+1.

If we go in the negatives, we randomly point the path and unfold.

slide-24
SLIDE 24

Random m-Dyck prefix

We draw u and d steps with probabilities

m m+1 and 1 m+1.

If we go in the negatives, we randomly point the path and unfold. At all times, paths of height (m+1) h′ + r appear with probability proportional to mh′.

slide-25
SLIDE 25

Random m-Łukasiewicz path

We draw a random m-Dyck prefix of length n = (m+1) n′ + r and height h = (m+1) h′ + r. We randomly decorate this prefix and we fold. The result is a uniform pointed m-Łukasiewicz path.

slide-26
SLIDE 26

Complexity

Random m-Łukasiewicz path

w ← ε for i = 1, . . . , n do s ← u with probability

m m+1, d otherwise

w ← ws if h(w) < 0 then randomly point w unfold w (forget the decoration) end if end for randomly decorate w fold w (forget the point) return w

slide-27
SLIDE 27

Complexity

Random m-Łukasiewicz path

w ← ε for i = 1, . . . , n do s ← u with probability

m m+1, d otherwise

w ← ws if h(w) < 0 then randomly point w unfold w (forget the decoration) end if end for randomly decorate w fold w (forget the point) return w We consider complexity in random bits and memory accesses.

slide-28
SLIDE 28

Complexity

Random m-Łukasiewicz path

w ← ε for i = 1, . . . , n do s ← u with probability

m m+1, d otherwise

β w ← ws 1 if h(w) < 0 then randomly point w O(log i) unfold w (forget the decoration) Unif{1, . . . , i} end if end for randomly decorate w O(√n) fold w (forget the point) Unif{1, . . . , n} return w We consider complexity in random bits and memory accesses.

slide-29
SLIDE 29

Complexity

Random m-Łukasiewicz path

w ← ε for i = 1, . . . , n do s ← u with probability

m m+1, d otherwise

β w ← ws 1 if h(w) < 0 then randomly point w O(log i) unfold w (forget the decoration) Unif{1, . . . , i} end if end for randomly decorate w O(√n) fold w (forget the point) Unif{1, . . . , n} return w We consider complexity in random bits and memory accesses. The if branches are independent with probability ∼ 1

2i.

slide-30
SLIDE 30

Complexity (cont.)

Theorem

The cost in random bits and memory accesses satisfies: Bn n

d

− → β; Mn n

d

− → 1 + X + Unif[0, 1]. The number β is the cost in random bits of Bernoulli

  • 1

m+1

  • .

According to [Knuth, Yao ’76], we can take: β ∼ −

1 m+1 log2

  • 1

m+1

m m+1 log2

  • m

m+1

  • .
slide-31
SLIDE 31

Complexity (cont.)

Theorem

The cost in random bits and memory accesses satisfies: Bn n

d

− → β; Mn n

d

− → 1 + X + Unif[0, 1]. The number β is the cost in random bits of Bernoulli

  • 1

m+1

  • .

According to [Knuth, Yao ’76], we can take: β ∼ −

1 m+1 log2

  • 1

m+1

m m+1 log2

  • m

m+1

  • .

The law X is defined by: X =

  • x∈S

Unif[0, x], where S is a Poisson point process of density λ(x) =

1 2x on (0, 1].

slide-32
SLIDE 32

Properties of the limit law

The distribution X =

  • Poissonx∈(0,1](1−x

2x )

Cumulant generating function K(z) = log E(ezX): K(z) = z ey − 1 − y 2y2 dy, κn(X) = 1 2n(n + 1).

slide-33
SLIDE 33

Properties of the limit law

The distribution X =

  • Poissonx∈(0,1](1−x

2x )

Cumulant generating function K(z) = log E(ezX): K(z) = z ey − 1 − y 2y2 dy, κn(X) = 1 2n(n + 1). Distribution function F(x) = P(X ≤ x): F(x) + F ′(x) + 2xF ′′(x) = F(x − 1)

slide-34
SLIDE 34

Properties of the limit law

The distribution X =

  • Poissonx∈(0,1](1−x

2x )

Cumulant generating function K(z) = log E(ezX): K(z) = z ey − 1 − y 2y2 dy, κn(X) = 1 2n(n + 1). Distribution function F(x) = P(X ≤ x): F(x) + F ′(x) + 2xF ′′(x) = F(x − 1) F(x) = sin √ 2x, 0 ≤ x ≤ 1.

slide-35
SLIDE 35

Properties of the limit law

The distribution X =

  • Poissonx∈(0,1](1−x

2x )

Cumulant generating function K(z) = log E(ezX): K(z) = z ey − 1 − y 2y2 dy, κn(X) = 1 2n(n + 1). Distribution function F(x) = P(X ≤ x): F(x) + F ′(x) + 2xF ′′(x) = F(x − 1) F(x) =

  • 2e1−γ

π sin √ 2x, 0 ≤ x ≤ 1.

slide-36
SLIDE 36

Properties of the limit law

The distribution X =

  • Poissonx∈(0,1](1−x

2x )

Cumulant generating function K(z) = log E(ezX): K(z) = z ey − 1 − y 2y2 dy, κn(X) = 1 2n(n + 1). Distribution function F(x) = P(X ≤ x): F(x) + F ′(x) + 2xF ′′(x) = F(x − 1) F(x) =

  • 2e1−γ

π sin √ 2x, 0 ≤ x ≤ 1. Tail distribution asymptotics: 1 − F(x) = x−x(log x)−2x(e/2)x+o(x).

slide-37
SLIDE 37

Graph of the distribution function

1 1 x F(x) 1 1 x

  • 2e1−γ

π sin √ 2x

slide-38
SLIDE 38

Perspectives

Can we use a similar method for other paths (+a, −b)?