Some applications of the method of moments in the analysis of - - PowerPoint PPT Presentation

some applications of the method of moments in the
SMART_READER_LITE
LIVE PREVIEW

Some applications of the method of moments in the analysis of - - PowerPoint PPT Presentation

The Method of Moments Example I Example II Example III Counterexample Some applications of the method of moments in the analysis of algorithms Alois Panholzer Institute of Discrete Mathematics and Geometry Vienna University of Technology


slide-1
SLIDE 1

The Method of Moments Example I Example II Example III Counterexample

Some applications of the method of moments in the analysis of algorithms

Alois Panholzer

Institute of Discrete Mathematics and Geometry Vienna University of Technology Alois.Panholzer@tuwien.ac.at Universite de Paris-Nord, 16.2.2010

1 / 64

slide-2
SLIDE 2

The Method of Moments Example I Example II Example III Counterexample

Outline

The Method of Moments Example I Total displacement in linear probing hashing Example II Subtree varieties in recursive trees Example III Total costs of Union-Find-algorithms Counterexample

2 / 64

slide-3
SLIDE 3

The Method of Moments Example I Example II Example III Counterexample

The Method of Moments

3 / 64

slide-4
SLIDE 4

The Method of Moments Example I Example II Example III Counterexample

The Method of Moments

Motivation Average-case analysis of algorithms procedure Quicksort(A:array) . . . end E.g., Quicksort input string: random permutation of size n

◮ number of comparisons

to sort elements

◮ number of recursive calls

to sort elements Analysis of average behaviour of parameters in random structures

5 1 2 4 3 8 6 9 7

E.g., random binary search tree of size n

◮ number of leaves in tree ◮ depth of j-th smallest node in

tree

4 / 64

slide-5
SLIDE 5

The Method of Moments Example I Example II Example III Counterexample

The Method of Moments

Motivation Average-case analysis: Xn: parameter (i.e., random variable) under consideration for random size-n instance

◮ Expectation (= mean value) E(Xn) ◮ Concentration results, Variance V(Xn) ◮ Limiting distribution results

Xn

(d)

− − → X, Xn converges in distribution to r.v. X

◮ Tail estimates (“bounds on rare events”)

5 / 64

slide-6
SLIDE 6

The Method of Moments Example I Example II Example III Counterexample

The Method of Moments

Showing limiting distribution results Basis: Theorem of Fr´ echet and Shohat (Second central limit theorem) If (i) all positive r-th integer moments of Xn converge to the r-th moments of a r.v. X: E(X r

n) → E(X r),

for all r ≥ 1 (ii) the distribution of X is uniquely defined by its moments then Xn

(d)

− − → X, i.e., Xn converges in distribution to X

6 / 64

slide-7
SLIDE 7

The Method of Moments Example I Example II Example III Counterexample

The Method of Moments

Showing limiting distribution results This means: the distribution function Fn(x) = P{Xn ≤ x} of Xn converges pointwise for every x ∈ R to the distribution function F(x) = P{X ≤ x} of X. Consider Xn = n

i=1 Yn,i, Yn,i independent identically distr. as Y ,

P{Y = 1} = P{Y = −1} = 1

2.

7 / 64

slide-8
SLIDE 8

The Method of Moments Example I Example II Example III Counterexample

The Method of Moments

Showing limiting distribution results This means: the distribution function Fn(x) = P{Xn ≤ x} of Xn converges pointwise for every x ∈ R to the distribution function F(x) = P{X ≤ x} of X. Consider Xn = n

i=1 Yn,i, Yn,i independent identically distr. as Y ,

P{Y = 1} = P{Y = −1} = 1

2.

0.2 0.4 0.6 0.8 1 –3 –2 –1 1 2 3 x

n = 10:

7 / 64

slide-9
SLIDE 9

The Method of Moments Example I Example II Example III Counterexample

The Method of Moments

Showing limiting distribution results This means: the distribution function Fn(x) = P{Xn ≤ x} of Xn converges pointwise for every x ∈ R to the distribution function F(x) = P{X ≤ x} of X. Consider Xn = n

i=1 Yn,i, Yn,i independent identically distr. as Y ,

P{Y = 1} = P{Y = −1} = 1

2.

0.2 0.4 0.6 0.8 1 –3 –2 –1 1 2 3 x

n = 20:

7 / 64

slide-10
SLIDE 10

The Method of Moments Example I Example II Example III Counterexample

The Method of Moments

Showing limiting distribution results This means: the distribution function Fn(x) = P{Xn ≤ x} of Xn converges pointwise for every x ∈ R to the distribution function F(x) = P{X ≤ x} of X. Consider Xn = n

i=1 Yn,i, Yn,i independent identically distr. as Y ,

P{Y = 1} = P{Y = −1} = 1

2.

0.2 0.4 0.6 0.8 1 –3 –2 –1 1 2 3 x

n = 40:

7 / 64

slide-11
SLIDE 11

The Method of Moments Example I Example II Example III Counterexample

The Method of Moments

Showing limiting distribution results This means: the distribution function Fn(x) = P{Xn ≤ x} of Xn converges pointwise for every x ∈ R to the distribution function F(x) = P{X ≤ x} of X. Consider Xn = n

i=1 Yn,i, Yn,i independent identically distr. as Y ,

P{Y = 1} = P{Y = −1} = 1

2.

0.2 0.4 0.6 0.8 1 –3 –2 –1 1 2 3 x

n = 80:

7 / 64

slide-12
SLIDE 12

The Method of Moments Example I Example II Example III Counterexample

The Method of Moments

Showing limiting distribution results This means: the distribution function Fn(x) = P{Xn ≤ x} of Xn converges pointwise for every x ∈ R to the distribution function F(x) = P{X ≤ x} of X. Consider Xn = n

i=1 Yn,i, Yn,i independent identically distr. as Y ,

P{Y = 1} = P{Y = −1} = 1

2.

0.2 0.4 0.6 0.8 1 –3 –2 –1 1 2 3 x

n = 160:

7 / 64

slide-13
SLIDE 13

The Method of Moments Example I Example II Example III Counterexample

The Method of Moments

Showing limiting distribution results This means: the distribution function Fn(x) = P{Xn ≤ x} of Xn converges pointwise for every x ∈ R to the distribution function F(x) = P{X ≤ x} of X. Consider Xn = n

i=1 Yn,i, Yn,i independent identically distr. as Y ,

P{Y = 1} = P{Y = −1} = 1

2.

0.2 0.4 0.6 0.8 1 –3 –2 –1 1 2 3 x

n = 320:

7 / 64

slide-14
SLIDE 14

The Method of Moments Example I Example II Example III Counterexample

The Method of Moments

Showing limiting distribution results This means: the distribution function Fn(x) = P{Xn ≤ x} of Xn converges pointwise for every x ∈ R to the distribution function F(x) = P{X ≤ x} of X. Consider Xn = n

i=1 Yn,i, Yn,i independent identically distr. as Y ,

P{Y = 1} = P{Y = −1} = 1

2.

0.2 0.4 0.6 0.8 1 –3 –2 –1 1 2 3 x

n = 640:

7 / 64

slide-15
SLIDE 15

The Method of Moments Example I Example II Example III Counterexample

The Method of Moments

Showing limiting distribution results Point (ii) is satisfied under growth conditions of moments E(X r)

Carleman criterion:

If

  • r≥1

1

2r

  • E(X 2r)

= ∞, then X is uniquely defined by its sequence of moments.

8 / 64

slide-16
SLIDE 16

The Method of Moments Example I Example II Example III Counterexample

The Method of Moments

Applications in average-case analysis Analysis of Algorithms and random structures:

◮ Often: one obtains distributional recurrences for parameters of

interest

◮ In many cases: difficult to treat distributional recurrences

directly

◮ But: recurrences for moments usually simpler

9 / 64

slide-17
SLIDE 17

The Method of Moments Example I Example II Example III Counterexample

The Method of Moments

Applications in average-case analysis A “typical situation”:

◮ Recurrences for E(X r n) are linear ◮ They differ only in the inhomogeneous part ◮ Inhomogeneous part contains lower moments

E(X 1

n ), . . . , E(X r−1 n

)

If method applicable:

  • ne can pump out successively all moments (at least

asymptotically)

10 / 64

slide-18
SLIDE 18

The Method of Moments Example I Example II Example III Counterexample

Example I: Total displacement in linear probing hashing

11 / 64

slide-19
SLIDE 19

The Method of Moments Example I Example II Example III Counterexample

Total displacement in linear probing hashing

Problem description Linear probing hashing

◮ Table of length m ◮ Hash function h maps keys to [1 . . . m] of table addresses ◮ Sequences of n ≤ m elements entering sequentially into table ◮ Each element x is placed at first unoccupied location starting

from h(x) in cyclic order: h(x), h(x) + 1, . . . , m, 1, 2, . . . , h(x) − 1

12 / 64

slide-20
SLIDE 20

The Method of Moments Example I Example II Example III Counterexample

Total displacement in linear probing hashing

Problem description Example of constructing a hash table:

1 2 3 4 5 6 7 8 9 10 1112

13 / 64

slide-21
SLIDE 21

The Method of Moments Example I Example II Example III Counterexample

Total displacement in linear probing hashing

Problem description Example of constructing a hash table:

1 2 3 4 5 6 7 8 9 10 1112

A

A . . . h(A) = 3

13 / 64

slide-22
SLIDE 22

The Method of Moments Example I Example II Example III Counterexample

Total displacement in linear probing hashing

Problem description Example of constructing a hash table:

1 2 3 4 5 6 7 8 9 10 1112

A B

A . . . h(A) = 3 B . . . h(B) = 9

13 / 64

slide-23
SLIDE 23

The Method of Moments Example I Example II Example III Counterexample

Total displacement in linear probing hashing

Problem description Example of constructing a hash table:

1 2 3 4 5 6 7 8 9 10 1112

A B C

A . . . h(A) = 3 B . . . h(B) = 9 C . . . h(C) = 4

13 / 64

slide-24
SLIDE 24

The Method of Moments Example I Example II Example III Counterexample

Total displacement in linear probing hashing

Problem description Example of constructing a hash table:

1 2 3 4 5 6 7 8 9 10 1112

A B C D

A . . . h(A) = 3 B . . . h(B) = 9 C . . . h(C) = 4 D . . . h(D) = 3

13 / 64

slide-25
SLIDE 25

The Method of Moments Example I Example II Example III Counterexample

Total displacement in linear probing hashing

Problem description Example of constructing a hash table:

1 2 3 4 5 6 7 8 9 10 1112

A B C D

A . . . h(A) = 3 B . . . h(B) = 9 C . . . h(C) = 4 D . . . h(D) = 3

13 / 64

slide-26
SLIDE 26

The Method of Moments Example I Example II Example III Counterexample

Total displacement in linear probing hashing

Problem description Example of constructing a hash table:

1 2 3 4 5 6 7 8 9 10 1112

A B C D

A . . . h(A) = 3 B . . . h(B) = 9 C . . . h(C) = 4 D . . . h(D) = 3

13 / 64

slide-27
SLIDE 27

The Method of Moments Example I Example II Example III Counterexample

Total displacement in linear probing hashing

Problem description Example of constructing a hash table:

1 2 3 4 5 6 7 8 9 10 1112

A B C D E

A . . . h(A) = 3 B . . . h(B) = 9 C . . . h(C) = 4 D . . . h(D) = 3 E . . . h(E) = 7

13 / 64

slide-28
SLIDE 28

The Method of Moments Example I Example II Example III Counterexample

Total displacement in linear probing hashing

Problem description Example of constructing a hash table:

1 2 3 4 5 6 7 8 9 10 1112

A B C D E F

A . . . h(A) = 3 B . . . h(B) = 9 C . . . h(C) = 4 D . . . h(D) = 3 E . . . h(E) = 7 F . . . h(F) = 12

13 / 64

slide-29
SLIDE 29

The Method of Moments Example I Example II Example III Counterexample

Total displacement in linear probing hashing

Problem description Example of constructing a hash table:

1 2 3 4 5 6 7 8 9 10 1112

A B C D E F G

A . . . h(A) = 3 B . . . h(B) = 9 C . . . h(C) = 4 D . . . h(D) = 3 E . . . h(E) = 7 F . . . h(F) = 12 G . . . h(G) = 9

13 / 64

slide-30
SLIDE 30

The Method of Moments Example I Example II Example III Counterexample

Total displacement in linear probing hashing

Problem description Example of constructing a hash table:

1 2 3 4 5 6 7 8 9 10 1112

A B C D E F G

A . . . h(A) = 3 B . . . h(B) = 9 C . . . h(C) = 4 D . . . h(D) = 3 E . . . h(E) = 7 F . . . h(F) = 12 G . . . h(G) = 9

13 / 64

slide-31
SLIDE 31

The Method of Moments Example I Example II Example III Counterexample

Total displacement in linear probing hashing

Problem description Example of constructing a hash table:

1 2 3 4 5 6 7 8 9 10 1112

A B C D E F G H

A . . . h(A) = 3 B . . . h(B) = 9 C . . . h(C) = 4 D . . . h(D) = 3 E . . . h(E) = 7 F . . . h(F) = 12 G . . . h(G) = 9 H . . . h(H) = 4

13 / 64

slide-32
SLIDE 32

The Method of Moments Example I Example II Example III Counterexample

Total displacement in linear probing hashing

Problem description Example of constructing a hash table:

1 2 3 4 5 6 7 8 9 10 1112

A B C D E F G H

A . . . h(A) = 3 B . . . h(B) = 9 C . . . h(C) = 4 D . . . h(D) = 3 E . . . h(E) = 7 F . . . h(F) = 12 G . . . h(G) = 9 H . . . h(H) = 4

13 / 64

slide-33
SLIDE 33

The Method of Moments Example I Example II Example III Counterexample

Total displacement in linear probing hashing

Problem description Example of constructing a hash table:

1 2 3 4 5 6 7 8 9 10 1112

A B C D E F G H

A . . . h(A) = 3 B . . . h(B) = 9 C . . . h(C) = 4 D . . . h(D) = 3 E . . . h(E) = 7 F . . . h(F) = 12 G . . . h(G) = 9 H . . . h(H) = 4

13 / 64

slide-34
SLIDE 34

The Method of Moments Example I Example II Example III Counterexample

Total displacement in linear probing hashing

Problem description Displacement d(x) of element x placed at location y: circular distance between h(x) and y: d(x) :=

  • y − h(x),

if h(x) ≤ y, m + h(x) − y,

  • therwise

⇒ Costs of inserting x and searching x in table Total displacement of sequence of n hashed values: sum of the individual displacements ⇒ Construction costs of the table

14 / 64

slide-35
SLIDE 35

The Method of Moments Example I Example II Example III Counterexample

Total displacement in linear probing hashing

Problem description

Assumption:

all mn hash sequences are equally likely Dm,n: Random variable counting the total displacement of a table

  • f length m with n keys hashed

◮ Full table: n = m ◮ Almost full table: n = m − 1 ◮ Sparse tables: n = αm, load factor 0 < α < 1

15 / 64

slide-36
SLIDE 36

The Method of Moments Example I Example II Example III Counterexample

Total displacement in linear probing hashing

Results Theorem [Flajolet, Poblete and Viola, 1998]: Result for almost full tables: the scaled random variable 2

n

3

2 Dn,n−1 converges in distribution to an Airy distributed

random variable: 2 n 3

2 Dn,n−1

(d)

− − → D, where D is determined by its moments: E(Dr) = 2√π Γ((3r − 1)/2)Cr, and the constants Cr satisfy the following recurrence: 2Cr = (3r − 4)rCr−1 +

r−1

  • j=1

r j

  • CjCr−j, for r ≥ 1,

C0 = −1.

16 / 64

slide-37
SLIDE 37

The Method of Moments Example I Example II Example III Counterexample

Total displacement in linear probing hashing

Proof idea

Basic decomposition of almost full tables:

◮ Table length n + 1 with n elements inserted ◮ Before last element is inserted: Two empty cells at position

k + 1 and n + 1

◮ Assumption (circular symmetry): free cell remains at n + 1

⇒ last element to be inserted has any address in [1 . . . k + 1] ⇒ displacement is any value ∈ {0, 1, . . . , k}.

n+1 k+1 17 / 64

slide-38
SLIDE 38

The Method of Moments Example I Example II Example III Counterexample

Total displacement in linear probing hashing

Proof idea

Decomposition leads to recursive description:

Fn,k: number of ways of creating an almost full table with n elements and total displacement k Generating function: Fn(q) :=

k≥0 Fn,kqk

Recurrence: Fn(q) =

n−1

  • k=0

n − 1 k

  • Fk(q)(1 + q + · · · + qk)Fn−1−k(q)

Bivariate generating function: F(z, q) :=

n≥0 Fn(q)zn n!

Functional equation: ∂ ∂z F(z, q) = F(z, q) · F(z, q) − qF(qz, q) 1 − q

18 / 64

slide-39
SLIDE 39

The Method of Moments Example I Example II Example III Counterexample

Total displacement in linear probing hashing

Proof idea

Pumping out all moments:

Generating function of r-th factorial moments: fr(z) := ∂r ∂qr F(z, q)

  • q=1

fr(z) satisfy following linear differential equation: f ′

r (z)(1 − T(z)) − fr(z)T(z)(2 − T(z))

z(1 − T(z)) = Rr(z), where the inhomogeneous part Rr(z) contains the functions f0(z), f1(z), . . . , fr−1(z) and T(z) is the tree function: T(z) = zeT(z)

19 / 64

slide-40
SLIDE 40

The Method of Moments Example I Example II Example III Counterexample

Total displacement in linear probing hashing

Proof idea General solution: fr(z) = eT(z) 1 − T(z) z Rr(u)e−T(u)du Asymptotic behaviour around dominant singularity z = e−1: zfr(z) ∼ Cr (2(1 − ez))3r/2−1/2 , where constants Cr satisfy the following recurrence: 2Cr = (3r − 4)rCr−1 +

r−1

  • j=1

r j

  • CjCr−j, for r ≥ 1,

C0 = −1.

20 / 64

slide-41
SLIDE 41

The Method of Moments Example I Example II Example III Counterexample

Total displacement in linear probing hashing

Proof idea Singularity analysis of generating functions [Flajolet and Odlyzko, 1990]: ⇒ asymptotic equivalent of the r-th factorial and ordinary moments: 2 n 3

2 E(Dr

n,n−1) →

2√π Γ((3r − 1)/2)Cr

21 / 64

slide-42
SLIDE 42

The Method of Moments Example I Example II Example III Counterexample

Total displacement in linear probing hashing

Airy distribution

Airy distribution appears in various contexts:

◮ Number of inversions in trees ◮ Path length in trees ◮ Area under directed lattice paths ◮ Counting problems for polygon models ◮ Number of connected graphs with n vertices and k edges ◮ Additive parameters in context-free grammars

“Similar” functional equations are occurring

22 / 64

slide-43
SLIDE 43

The Method of Moments Example I Example II Example III Counterexample

Example II: Subtree varieties in recursive trees

23 / 64

slide-44
SLIDE 44

The Method of Moments Example I Example II Example III Counterexample

Subtree varieties in recursive trees

Problem description Subtree varieties in rooted trees:

◮ Given: family T of rooted trees ◮ Consider: random rooted tree T of size n of family T ◮ Question: how many subtrees of T have size k = k(n) ?

24 / 64

slide-45
SLIDE 45

The Method of Moments Example I Example II Example III Counterexample

Subtree varieties in recursive trees

Problem description Typical situation for random tree of size n

25 / 64

slide-46
SLIDE 46

The Method of Moments Example I Example II Example III Counterexample

Subtree varieties in recursive trees

Problem description Typical situation for random tree of size n many subtrees of fixed size: size 1 (= leaves)

25 / 64

slide-47
SLIDE 47

The Method of Moments Example I Example II Example III Counterexample

Subtree varieties in recursive trees

Problem description Typical situation for random tree of size n many subtrees of fixed size: size 2

25 / 64

slide-48
SLIDE 48

The Method of Moments Example I Example II Example III Counterexample

Subtree varieties in recursive trees

Problem description Typical situation for random tree of size n many subtrees of fixed size: size 3

25 / 64

slide-49
SLIDE 49

The Method of Moments Example I Example II Example III Counterexample

Subtree varieties in recursive trees

Problem description Typical situation for random tree of size n few subtrees of “large” size: size n/3

25 / 64

slide-50
SLIDE 50

The Method of Moments Example I Example II Example III Counterexample

Subtree varieties in recursive trees

Problem description Typical situation for random tree of size n few subtrees of “large” size: size n/2

25 / 64

slide-51
SLIDE 51

The Method of Moments Example I Example II Example III Counterexample

Subtree varieties in recursive trees

Recursive trees

Recursive trees:

important tree family with many applications

◮ models spread of epidemics ◮ model for pyramid schemes ◮ model for the family trees of preserved copies of ancient texts ◮ related to the Bolthausen-Sznitman coalescence model

26 / 64

slide-52
SLIDE 52

The Method of Moments Example I Example II Example III Counterexample

Subtree varieties in recursive trees

Recursive trees

Combinatorial description of a recursive tree:

◮ non-plane labelled rooted tree ◮ size-n tree labelled with labels 1, 2, . . . , n ◮ labels along path from root to arbitrary node v are increasing

sequence

Random recursive trees:

all (n − 1)! recursive trees of size n appear with equal probability

1 5 2 3

10

7 6 4 8

11

9

27 / 64

slide-53
SLIDE 53

The Method of Moments Example I Example II Example III Counterexample

Subtree varieties in recursive trees

Recursive trees

Simple growth rule for generating random recursive trees:

◮ Step 1: start with root labelled by 1 ◮ Step j: node with label j is attached to any previous node

with equal probability 1/(j − 1)

1

28 / 64

slide-54
SLIDE 54

The Method of Moments Example I Example II Example III Counterexample

Subtree varieties in recursive trees

Recursive trees

Simple growth rule for generating random recursive trees:

◮ Step 1: start with root labelled by 1 ◮ Step j: node with label j is attached to any previous node

with equal probability 1/(j − 1)

1 1 2 p=1

28 / 64

slide-55
SLIDE 55

The Method of Moments Example I Example II Example III Counterexample

Subtree varieties in recursive trees

Recursive trees

Simple growth rule for generating random recursive trees:

◮ Step 1: start with root labelled by 1 ◮ Step j: node with label j is attached to any previous node

with equal probability 1/(j − 1)

1 1 2 p=1 1 2 3 p=1/2

28 / 64

slide-56
SLIDE 56

The Method of Moments Example I Example II Example III Counterexample

Subtree varieties in recursive trees

Recursive trees

Simple growth rule for generating random recursive trees:

◮ Step 1: start with root labelled by 1 ◮ Step j: node with label j is attached to any previous node

with equal probability 1/(j − 1)

1 1 2 p=1 1 2 1 3 2 3 p=1/2 p=1/2

28 / 64

slide-57
SLIDE 57

The Method of Moments Example I Example II Example III Counterexample

Subtree varieties in recursive trees

Recursive trees

Simple growth rule for generating random recursive trees:

◮ Step 1: start with root labelled by 1 ◮ Step j: node with label j is attached to any previous node

with equal probability 1/(j − 1)

1 1 2 p=1 1 2 1 3 2 3 p=1/2 p=1/2 1 2 3

p=1/3

4

28 / 64

slide-58
SLIDE 58

The Method of Moments Example I Example II Example III Counterexample

Subtree varieties in recursive trees

Recursive trees

Simple growth rule for generating random recursive trees:

◮ Step 1: start with root labelled by 1 ◮ Step j: node with label j is attached to any previous node

with equal probability 1/(j − 1)

1 1 2 p=1 1 2 1 3 2 3 p=1/2 p=1/2 1 2 3 1 2 3

p=1/3 p=1/3

4 4

28 / 64

slide-59
SLIDE 59

The Method of Moments Example I Example II Example III Counterexample

Subtree varieties in recursive trees

Recursive trees

Simple growth rule for generating random recursive trees:

◮ Step 1: start with root labelled by 1 ◮ Step j: node with label j is attached to any previous node

with equal probability 1/(j − 1)

1 1 2 p=1 1 2 1 3 2 3 p=1/2 p=1/2 1 2 3 1 2 3 1 2 3

p=1/3 p=1/3 p=1/3

4 4 4

28 / 64

slide-60
SLIDE 60

The Method of Moments Example I Example II Example III Counterexample

Subtree varieties in recursive trees

Recursive trees

Simple growth rule for generating random recursive trees:

◮ Step 1: start with root labelled by 1 ◮ Step j: node with label j is attached to any previous node

with equal probability 1/(j − 1)

1 1 2 p=1 1 2 1 3 2 3 p=1/2 p=1/2 1 2 3 1 2 3 1 2 3 1 2 3

p=1/3 p=1/3 p=1/3 p=1/3

4 4 4 4

28 / 64

slide-61
SLIDE 61

The Method of Moments Example I Example II Example III Counterexample

Subtree varieties in recursive trees

Recursive trees

Simple growth rule for generating random recursive trees:

◮ Step 1: start with root labelled by 1 ◮ Step j: node with label j is attached to any previous node

with equal probability 1/(j − 1)

1 1 2 p=1 1 2 1 3 2 3 p=1/2 p=1/2 1 2 3 1 2 3 1 2 3 1 2 3 1 2 4

p=1/3 p=1/3 p=1/3 p=1/3 p=1/3

4 4 4 4 3

28 / 64

slide-62
SLIDE 62

The Method of Moments Example I Example II Example III Counterexample

Subtree varieties in recursive trees

Recursive trees

Simple growth rule for generating random recursive trees:

◮ Step 1: start with root labelled by 1 ◮ Step j: node with label j is attached to any previous node

with equal probability 1/(j − 1)

1 1 2 p=1 1 2 1 3 2 3 p=1/2 p=1/2 1 2 3 1 2 3 1 2 3 1 2 3 1 2 4 1 2 3

p=1/3 p=1/3 p=1/3 p=1/3 p=1/3 p=1/3

4 4 4 4 3 4

28 / 64

slide-63
SLIDE 63

The Method of Moments Example I Example II Example III Counterexample

Subtree varieties in recursive trees

Results Xn,k: number of subtrees of size k in random recursive tree of size n Theorem [Feng, Mahmoud and Pan, 2006+]: there are three phases for behaviour of Xn,k depending on the growth of k = k(n)

◮ subcritical case: k/√n → 0 ◮ critical case: k/√n → c > 0 ◮ supercritical case: k/√n → ∞

29 / 64

slide-64
SLIDE 64

The Method of Moments Example I Example II Example III Counterexample

Subtree varieties in recursive trees

Results

◮ subcritical case: k/√n → 0:

normalized r. v. asympt. Gaussian distributed Xn,k −

n k(k+1)

  • (2k2−1)n

k(k+1)2(2k+1) (d)

− − → N(0, 1)

◮ critical case: k/√n → c > 0:

Xn,k asymp. Poisson-distributed Xn,k

(d)

− − → Poisson( 1

c2 ) ◮ supercritical case: k/√n → ∞:

Xn,k asymp. denenerate Xn,k

(d)

− − → X, with P{X = 0} = 1

30 / 64

slide-65
SLIDE 65

The Method of Moments Example I Example II Example III Counterexample

Subtree varieties in recursive trees

Proof idea Decomposition of recursive trees according root degree: T =

1 ×

  • {ǫ} ˙

∪ T ˙ ∪ 1/2! · T ∗ T ˙ ∪ 1/3! · T ∗ T ∗ T ˙ ∪ · · ·

  • =

1 × exp(T )

Generating functions: Mk(z, v) :=

n≥1

  • m≥0 P{Xn,k = m}zn

n! vm

Differential equation: ∂ ∂z Mk(z, v) = exp

  • Mk(z, v)
  • + (v − 1)zk−1

31 / 64

slide-66
SLIDE 66

The Method of Moments Example I Example II Example III Counterexample

Subtree varieties in recursive trees

Proof idea Explicit solution of generating function:

Mk(z, v) = (v − 1)zk k + log     1 1 −

z

  • e

(v−1)tk k

dt    

Exact solution for factorial moments:

E

  • X r

n,k

  • = [

[n ≥ kr + 1] ]n kr

r

  • ℓ=1

n − kr − 1 ℓ − 1

× ×

  • j1+···+jℓ=r

jq≥1, 1≤q≤ℓ

  • r

j1, . . . , jℓ

  • 1

i=1(jik + 1)

32 / 64

slide-67
SLIDE 67

The Method of Moments Example I Example II Example III Counterexample

Subtree varieties in recursive trees

Proof idea Critical case: ⇒ Asymptotically Poisson distribed n/k2 → λ → E

  • X r

n,k

  • → λr

Subcritical case: ⇒ Dealing with cancellations Normalized r.v. ˜ Xn,k := Xn,k−E(Xn,k)

V(Xn,k)

⇒ Asymptotically Gaussian distributed E

  • ˜

Xn,k

  • ν(k)n

2d

  • → (2d)!

d! 2d , for d ≥ 0, E

  • ˜

Xn,k

  • ν(k)n

2d+1

  • → 0,

for d ≥ 0

33 / 64

slide-68
SLIDE 68

The Method of Moments Example I Example II Example III Counterexample

Subtree varieties in recursive trees

Remarks

Application of method of moments to asympt. Gaussian r.v.:

◮ heavy cancellations ⇒ high computational effort ◮ method usually only “last weapon”

34 / 64

slide-69
SLIDE 69

The Method of Moments Example I Example II Example III Counterexample

Subtree varieties in recursive trees

Remarks

Application of method of moments to asympt. Gaussian r.v.:

◮ heavy cancellations ⇒ high computational effort ◮ method usually only “last weapon”

One might try first:

◮ analytic methods (saddle point method, continuity theorem of

Levy, quasi-power theorem)

◮ central limit theorems for sums of independent or weakly

dependent r.v.

◮ Stein’s method ◮ contraction method ◮ martingale description

34 / 64

slide-70
SLIDE 70

The Method of Moments Example I Example II Example III Counterexample

Example III: Total costs of Union-Find-algorithms

35 / 64

slide-71
SLIDE 71

The Method of Moments Example I Example II Example III Counterexample

Total costs in Union-Find-algorithms

Problem description Union-Find-problem

◮ Maintaining representation of equivalence classes

(= partitions of a finite set)

◮ Two basic operations:

◮ Union: merge two different equivalence classes s and t into a

single equivalence class

◮ Find: find equivalence class that contains a given element x

Problem arises naturally in applications in computer science (e.g., minimum-cost spanning tree algorithms)

36 / 64

slide-72
SLIDE 72

The Method of Moments Example I Example II Example III Counterexample

Total costs in Union-Find-algorithms

Problem description

Data structure for Union-Find problem, Aho et al [1974]:

◮ consider partition P(S) of finite set S ◮ for every element x ∈ S: store in R[x] name of the

equivalence class containing x

◮ for every equivalence class s ∈ P(S):

◮ store in N[s] the number of elements of s ◮ store in L[s] the elements of s in a linked list 37 / 64

slide-73
SLIDE 73

The Method of Moments Example I Example II Example III Counterexample

Total costs in Union-Find-algorithms

Problem description

Basic algorithm for operation Union, Yao [1976]:

“Quick Find Weighted” (QFW): if we merge different equivalence classes s and t then we update the class with less elements:

◮ if N[s] ≤ N[t]:

set R[x] := t for all x in L[s] append L[s] to L[t], set N[t] := N[t] + N[s] call new equivalence class t

◮ otherwise

set R[x] := s for all x in L[t] append L[t] to L[s] set N[s] := N[s] + N[t] call new equivalence class s

38 / 64

slide-74
SLIDE 74

The Method of Moments Example I Example II Example III Counterexample

Total costs in Union-Find-algorithms

Problem description

Cost of Union-operation:

◮ Costs when merging equivalence classes s and t:

measured by number of updated elements, i.e., the number of allocations R[x] := s or R[x] := t

◮ QFW: cost of merging step is given by minimum of the class

sizes min(N[s], N[t])

39 / 64

slide-75
SLIDE 75

The Method of Moments Example I Example II Example III Counterexample

Total costs in Union-Find-algorithms

Problem description

Basic model for sequences of Union-operations, Yao [1976]:

Random spanning tree model:

◮ deal with set S of size n ◮ at the beginning all elements x ∈ S are forming equivalence

class {x}

◮ n equivalence classes will be merged into larger and larger

classes by carrying out Union-operations according following Merging rule

40 / 64

slide-76
SLIDE 76

The Method of Moments Example I Example II Example III Counterexample

Total costs in Union-Find-algorithms

Problem description

Merging rule:

◮ choose at random a spanning tree of complete graph with

vertex set S

◮ choose a random ordering of the edges of this spanning tree

by enumerating it from 1 to n − 1

◮ leads to sequence of edges e1 = (x1, y1), e2 = (x2, y2), . . . ,

en−1 = (xn−1, yn−1), with xi, yi ∈ S

◮ gives then sequence of Union-operations

Union(R[x1], R[y1]), Union(R[x2], R[y2]), . . . , Union(R[xn−1], R[yn−1])

◮ ⇒ all nn−2(n − 1)! possible sequence of Union-operations of

that kind are equally likely

41 / 64

slide-77
SLIDE 77

The Method of Moments Example I Example II Example III Counterexample

Total costs in Union-Find-algorithms

Problem description

Total cost of algorithm QFW:

Average performance of QFW described by total costs:

◮ sum of cost of every merging step when merging the elements

  • f a set S of size n

◮ at beginning all elements are in different equivalence classes ◮ merge all elements into one equivalence class (containing all

elements of S)

◮ carrying out sequence of n − 1 Union-operations according to

merging rules under random spanning tree model

◮ ⇒ Xn: random variable depending only on size n of set S

42 / 64

slide-78
SLIDE 78

The Method of Moments Example I Example II Example III Counterexample

Total costs in Union-Find-algorithms

Problem description

Example of algorithm QFW:

b c d e f a

3 1 4 2 5

b c d e f a Union({c}, {e}) ⇒ Cost = 1

43 / 64

slide-79
SLIDE 79

The Method of Moments Example I Example II Example III Counterexample

Total costs in Union-Find-algorithms

Problem description

Example of algorithm QFW:

b c d e f a

3 1 4 2 5

b c d e f a Union({c}, {e}) ⇒ Cost = 1 Union({a}, {b}) ⇒ Cost = 1

43 / 64

slide-80
SLIDE 80

The Method of Moments Example I Example II Example III Counterexample

Total costs in Union-Find-algorithms

Problem description

Example of algorithm QFW:

b c d e f a

3 1 4 2 5

b c d e f a Union({c}, {e}) ⇒ Cost = 1 Union({a}, {b}) ⇒ Cost = 1 Union({c}, {d}) ⇒ Cost = 1

43 / 64

slide-81
SLIDE 81

The Method of Moments Example I Example II Example III Counterexample

Total costs in Union-Find-algorithms

Problem description

Example of algorithm QFW:

b c d e f a

3 1 4 2 5

b c d e f a Union({c}, {e}) ⇒ Cost = 1 Union({a}, {b}) ⇒ Cost = 1 Union({c}, {d}) ⇒ Cost = 1 Union({b}, {c}) ⇒ Cost = 2

43 / 64

slide-82
SLIDE 82

The Method of Moments Example I Example II Example III Counterexample

Total costs in Union-Find-algorithms

Problem description

Example of algorithm QFW:

b c d e f a

3 1 4 2 5

b c d e f a Union({c}, {e}) ⇒ Cost = 1 Union({a}, {b}) ⇒ Cost = 1 Union({c}, {d}) ⇒ Cost = 1 Union({b}, {c}) ⇒ Cost = 2 Union({b}, {b}) ⇒ Cost = 1

43 / 64

slide-83
SLIDE 83

The Method of Moments Example I Example II Example III Counterexample

Total costs in Union-Find-algorithms

Problem description

Example of algorithm QFW:

b c d e f a

3 1 4 2 5

b c d e f a Union({c}, {e}) ⇒ Cost = 1 Union({a}, {b}) ⇒ Cost = 1 Union({c}, {d}) ⇒ Cost = 1 Union({b}, {c}) ⇒ Cost = 2 Union({b}, {b}) ⇒ Cost = 1 Total costs = 6

43 / 64

slide-84
SLIDE 84

The Method of Moments Example I Example II Example III Counterexample

Total costs in Union-Find-algorithms

Results Theorem [Kuba and Pan, 2007]: The expectation E

  • Xn
  • f the

total costs of the Union-Find-algorithm under the random spanning tree model has for n → ∞ the following asymptotic expansion: E(Xn) = 1 πn log n + Cn + O(n

3 4 ),

where the constant C ≈ 0.6315is given as follows:

C = γ + 2 log 2 π +

  • n≥0

1 n + 1

  • e−(n+1)

Rn+2−Rn+1−

n

  • k=0

(k + 1)k+1 (k + 2)! Rn−k

  • − 1

π

  • ,

with Rn =

n−1

  • k=1

kk(n − k)n−k−1 k!(n − k)! min(k, n − k).

44 / 64

slide-85
SLIDE 85

The Method of Moments Example I Example II Example III Counterexample

Total costs in Union-Find-algorithms

Results Theorem [Kuba and Pan, 2007]: The suitably shifted and scaled r.v. Xn converges in distribution to a r.v. X, which can be characterized by its r-th integer moments: Xn − 1

πn log n − Cn

n

(d)

− − → X, with E(X r) = mr, where mr is given recursively as follows:

mr = Γ(r − 1) 2√πΓ(r − 1

2)

  • r1+r2+r3=r,

r2,r3<r

  • r

r1, r2, r3

  • mr2mr3Ir1,r2,r3,

for r ≥ 2,

with initial values m0 = 1 and m1 = 0 and

Ir1,r2,r3 = 1 1 π

  • x log x+(1−x) log(1−x)
  • +min(x, 1−x)

r1 xr2− 1

2 (1−x)r3− 3 2 dx.

45 / 64

slide-86
SLIDE 86

The Method of Moments Example I Example II Example III Counterexample

Total costs in Union-Find-algorithms

Proof idea

The reverse process: destroying a tree

◮ Start with a random spanning tree of size n ◮ Remove successively edges at random from remaining edges ◮ In every step split a connected component into two parts ◮ Cost of a cut is the size of the smaller part after the splitting

step

◮ Stop when all nodes are isolated

46 / 64

slide-87
SLIDE 87

The Method of Moments Example I Example II Example III Counterexample

Total costs in Union-Find-algorithms

Proof idea Example of destroying a tree:

b c d e f a

47 / 64

slide-88
SLIDE 88

The Method of Moments Example I Example II Example III Counterexample

Total costs in Union-Find-algorithms

Proof idea Example of destroying a tree:

b c d e f a

Cost = 1

47 / 64

slide-89
SLIDE 89

The Method of Moments Example I Example II Example III Counterexample

Total costs in Union-Find-algorithms

Proof idea Example of destroying a tree:

b c d e f a

Cost = 1 Cost = 2

47 / 64

slide-90
SLIDE 90

The Method of Moments Example I Example II Example III Counterexample

Total costs in Union-Find-algorithms

Proof idea Example of destroying a tree:

b c d e f a

Cost = 1 Cost = 2 Cost = 1

47 / 64

slide-91
SLIDE 91

The Method of Moments Example I Example II Example III Counterexample

Total costs in Union-Find-algorithms

Proof idea Example of destroying a tree:

b c d e f a

Cost = 1 Cost = 2 Cost = 1 Cost = 1

47 / 64

slide-92
SLIDE 92

The Method of Moments Example I Example II Example III Counterexample

Total costs in Union-Find-algorithms

Proof idea Example of destroying a tree:

b c d e f a

Cost = 1 Cost = 2 Cost = 1 Cost = 1 Cost = 1 Total costs = 6

47 / 64

slide-93
SLIDE 93

The Method of Moments Example I Example II Example III Counterexample

Total costs in Union-Find-algorithms

Proof idea

Recursive description of total costs Xn:

Distributional recurrence for rooted trees: Xn

(d)

= XSn + X ∗

n−Sn + tn,Sn

Sn: size of subtree containing root after removing random edge of randomly chosen labeled rooted tree of size n Toll function: tn,k = min(k, n − k) Sn is distributed as follows: P{Sn = k} = kTkTn−k (n − 1)Tn , with Tn := nn−1

n!

48 / 64

slide-94
SLIDE 94

The Method of Moments Example I Example II Example III Counterexample

Total costs in Union-Find-algorithms

Proof idea

Recurrence for r-th moments of Xn

Linear recurrence for µ[r]

n := E(X r n):

(n − 1)Tnµ[r]

n = n−1

  • k=1

kTkTn−k(µ[r]

k + µ[r] n−k) + R[r] n ,

where the inhomogeneous part R[r]

n

depends on the lower order moments µ[1]

n , . . . , µ[r−1] n

49 / 64

slide-95
SLIDE 95

The Method of Moments Example I Example II Example III Counterexample

Total costs in Union-Find-algorithms

Proof idea

Generating functions treatment

Linear differential equation: z(1 − T(z))C ′

r(z) − (1 + zT ′(z))Cr(z) = Rr(z),

where the inhomogeneous part depends on the g.f. C1(z), . . . , Cr(z) for lower moments Solution: Cr(z) = T(z) 1 − T(z) z Rr(t) tT(t)dt Asymptotic equivalents of r-th moments: “pumped out” inductively

50 / 64

slide-96
SLIDE 96

The Method of Moments Example I Example II Example III Counterexample

Total costs in Union-Find-algorithms

Remark

Problems of similar “nature”:

◮ Quicksort: number of comparisons ◮ Pathlengths in search tree models ◮ Wiener-index of certain tree models

Limiting distribution characterized by “complicated” moment’s sequence

51 / 64

slide-97
SLIDE 97

The Method of Moments Example I Example II Example III Counterexample

Counterexample

52 / 64

slide-98
SLIDE 98

The Method of Moments Example I Example II Example III Counterexample

Counterexample

Cutting down recursive trees

Cutting down procedure for rooted trees:

INPUT: tree T steps ← 0 while |T| > 1 do cut off an edge e of T T ← subtree containing the root steps ← steps +1 OUTPUT: steps Remove edges until root is isolated

53 / 64

slide-99
SLIDE 99

The Method of Moments Example I Example II Example III Counterexample

Counterexample

Cutting down recursive trees

An example of cutting a tree:

Size-11 tree destroyed in 5 steps.

54 / 64

slide-100
SLIDE 100

The Method of Moments Example I Example II Example III Counterexample

Counterexample

Cutting down recursive trees How many steps are done, until root is isolated?

Probability model:

◮ Randomized cutting down procedure:

Edges in tree chosen at random in each step.

◮ Random tree model for certain tree families.

  • R. v. Xn counts steps done to destroy size-n tree.

55 / 64

slide-101
SLIDE 101

The Method of Moments Example I Example II Example III Counterexample

Counterexample

Cutting down recursive trees

Why are the number of cuts to destroy the tree of interest?

◮ Strong connections to coalescent models ⇒ theoretical

physics, mathematical biology

◮ Cayley-trees: additive Marcus-Lushnikov process ◮ Recursive trees: Bolthausen-Sznitman coalescent ◮ Xn for recursive trees: number of collision events in the

coalescent model until there is just a single block

56 / 64

slide-102
SLIDE 102

The Method of Moments Example I Example II Example III Counterexample

Counterexample

Cutting down recursive trees

Apply cutting-down procedure to recursive trees:

◮ non-plane labelled rooted tree ◮ size-n tree labelled with labels 1, 2, . . . , n ◮ labels along path from root to arbitrary node v are increasing

sequence

Random recursive trees:

all (n − 1)! recursive trees of size n appear with equal probability

1 5 2 3

10

7 6 4 8

11

9

57 / 64

slide-103
SLIDE 103

The Method of Moments Example I Example II Example III Counterexample

Counterexample

Cutting down recursive trees

Idea: apply recursive approach:

P{Xn = m} =

n−1

  • k=1

pn,k P{Xk = m − 1}. pn,k : Probability, that subtree containing root has size k, if we cut

  • ff random edge in random size-n tree.

58 / 64

slide-104
SLIDE 104

The Method of Moments Example I Example II Example III Counterexample

Counterexample

Cutting down recursive trees

Idea: apply recursive approach:

P{Xn = m} =

n−1

  • k=1

pn,k P{Xk = m − 1}. pn,k : Probability, that subtree containing root has size k, if we cut

  • ff random edge in random size-n tree.

Attention:

◮ approach only applicable if randomness is preserved by cutting

  • ff random edge

◮ satisfied, e.g, by recursive trees, Cayley-trees, planted plane

trees, d-ary trees

◮ not satisfied, e.g., by Motzkin-trees, binary search trees

58 / 64

slide-105
SLIDE 105

The Method of Moments Example I Example II Example III Counterexample

Counterexample

Cutting down recursive trees

Cutting off random edge:

Planted plane trees: randomness preserved Motzkin trees: randomness not preserved

Planted plane trees

  • Motzkin trees
  • 59 / 64
slide-106
SLIDE 106

The Method of Moments Example I Example II Example III Counterexample

Counterexample

Cutting down recursive trees

Computations for recursive trees:

Splitting probability: size-n tree − → size-k tree: pn,k = n (n − 1)(n − k)(n − k + 1). Recurrence: P{Xn = m} =

n−1

  • k=1

n (n−1)(n−k)(n−k+1) P{Xk = m − 1}.

60 / 64

slide-107
SLIDE 107

The Method of Moments Example I Example II Example III Counterexample

Counterexample

Cutting down recursive trees

Computations for recursive trees:

Proper generating function: M(z, v) =

  • n≥1
  • 0≤m≤n

P{Xn = m}zn n vm. Differential equation: ∂ ∂z M(z, v) = 1 z − v

  • z − (1 − z) log
  • 1

1−z

M(z, v).

61 / 64

slide-108
SLIDE 108

The Method of Moments Example I Example II Example III Counterexample

Counterexample

Cutting down recursive trees

Computations for recursive trees:

Solution of DE: M(z, v) = z e

z

  • t=0

v

  • t−(1−t) log
  • 1

1−t

  • t
  • t−v
  • t−(1−t) log
  • 1

1−t

  • dt.

Try method of moments:

62 / 64

slide-109
SLIDE 109

The Method of Moments Example I Example II Example III Counterexample

Counterexample

Cutting down recursive trees

Computations for recursive trees:

Solution of DE: M(z, v) = z e

z

  • t=0

v

  • t−(1−t) log
  • 1

1−t

  • t
  • t−v
  • t−(1−t) log
  • 1

1−t

  • dt.

Try method of moments: r-th moments: E

  • X r

n

  • =

nr logr n + nr logr+1 n

  • (r + 1)Hr − rγ
  • + O
  • nr

logr+2 n

  • .

Scaling does not lead to a limiting distribution!

62 / 64

slide-110
SLIDE 110

The Method of Moments Example I Example II Example III Counterexample

Counterexample

Cutting down recursive trees

Computations for recursive trees:

r-th centered moments: E

  • Xn − E(Xn)

r ∼ (−1)r (r − 1)r nr logr+1 n, r ≥ 2. Also centering and scaling does not lead to a limiting distribution!

63 / 64

slide-111
SLIDE 111

The Method of Moments Example I Example II Example III Counterexample

Counterexample

Cutting down recursive trees

Computations for recursive trees:

r-th centered moments: E

  • Xn − E(Xn)

r ∼ (−1)r (r − 1)r nr logr+1 n, r ≥ 2. Also centering and scaling does not lead to a limiting distribution! Method of moments not applicable!

63 / 64

slide-112
SLIDE 112

The Method of Moments Example I Example II Example III Counterexample

Counterexample

Cutting down recursive trees

Theorem (Drmota, Iksanov, M¨

  • hle and R¨
  • sler, 2009)

The random variable Yn = Xn −

n log n − n log log n (log n)2 n (log n)2

converges in distribution to a stable random variable Y with characteristic function φY (λ) = E

  • eiλY

= eiλ log |λ|− π

2 |λ|.

The moments of the limiting distribution Y do not exist!

64 / 64