Anda di halaman 1dari 60

ANALYTIC COMBINATORICS

Analytic

Combinatorics

Philippe Flajolet and


Robert Sedgewick

http://ac.cs.princeton.edu

PART TWO

7. Applications of
Singularity Analysis

Analytic combinatorics overview

A. SYMBOLIC METHOD

1. OGFs

2. EGFs

3. MGFs

B. COMPLEX ASYMPTOTICS

SYMBOLIC METHOD

specification

4. Rational & Meromorphic

5. Applications of R&M

6. Singularity Analysis

7. Applications of SA

8. Saddle point

Analytic

Combinatorics

Philippe Flajolet and


Robert Sedgewick

GF

equation

ANALYTIC COMBINATORICS

Analytic

Combinatorics

Philippe Flajolet and


Robert Sedgewick

http://ac.cs.princeton.edu

PART TWO

7. Applications of Singularity Analysis

• Simple varieties of trees

• Labelled sets

• Mappings

• Tree-like classes

II.7a.SAapps.Sets

Transfer theorem for invertible tree classes


[from Lecture 6]

Theorem. If a simple variety of trees F = Z [ x or ★] SEQ^(F)


is A-invertible where the GF satisfies F(z) = z<j>(F(z)) and
is the positive real root of 0(A) = A0'(A) then

4>'(X ) n N- 3/2

and F(z) ~ A - ^2<j>(X)/<p"(X)^ -zcf>'(\)

Important note: Singularity analysis gives both


•Coefficient asymptotics.

•Asymptotic estimate of GF near dominant singularity.

applications

general trees

binary trees

unary-binary dd

Cayley trees

[and many, many more...]

Example 1: Rooted ordered trees


Q. How many trees with N nodes?

How many trees with N nodes?

Symbolic method

Combinatorial class
Construction

OCF equation

Quadratic equation
Classic next steps
Binomial theorem

Extract coefficients

Stirling's approximation
Simplify

C, the class of all trees


C = • x SEQ(G) *

"a tree is a node and


a sequence of trees"

G(z) = z(1 + C(z) + C(z) 2 + G(z) 3 + .

G(z) — G(z) 2 = z

, 1 + v / Wi

C(z) =- - -

1 - G(z)
~ exp(2Nln(2N) - 2N + In v / 4irN - 2(Nln(N) - N + In v'lirN))

calculations

omitted

Gs= 14

Example 1: Rooted ordered trees

G, the class of rooted


ordered trees

G = Z x SEQ(G))

> f

C(z)

z
1 - C(Z)

simple variety
of trees

> r

C N ~ -i-4 n N 3 / 2

4v^

Theorem. If a simple variety of trees F = Z [ x or ★] SECMF)


is A-invertible where the GF satisfies F(z) — z0(/-(z)) and
is the positive real root of 0(A) = A0'(A) then

0'(A ) N N~ 3 / 2

sfi^rWW)

0(U)

0 »

1 - u

O^F

O^F

1 _ A

1 - A “ (1 - A) 2

A = 1/2

0(A) = 2
0'(A)=4
0"(A) = 16
6

Example 2: Binary trees

How many binary trees with N nodes?

Ti = 2

/■

<1

x*x

Tb = 5

Example 2: Binary trees

B, the class of binary trees


B = *x(E + B)x(E + B)

Expecting B = • + • x SEQo,2(B)? Stay tuned

> f

B(z) = z( 1 + B(z)) 2

simple variety
of trees

> f

[z n ]B(z) ~ -^4 n N 3 / 2

A/ 71

Theorem. If a simple variety of trees F = Z [ x or ★] SECMF)


is A-invertible where the GF satisfies F(z) = z<p(F(z)) and
is the positive real root of 0(A) = A0'(A) then

V2tt0"(A)/0(A)

0'(A) N N- 3 / 2

0(U) = (1 +U) 2

0» = 2(1 +u)
0 » = 2

(1+A) 2

2A(1 + A)

A = 1
0(A) = 4
0'(A) = 4
0"(A)=2

8
Example 3: Unary-binary trees

Q. How many unary-binary trees with N nodes?

M b=2

degrees of all nodes 0, 1, or 2

Ma= 4

HA A

M 5 =9
Example 3: Unary-binary trees

Asymptotics

M, the class of all


unary-binary trees

M = Z x S£Qo,i, 2 (M)

> r

M(z) = z( 1 + M(z) + M(z) 2 )

simple variety
of trees

> f

Mn

3 N n -3/2

r-sj

Theorem. If a simple variety of trees F = Z [ x or ★] SECMF)


is A-invertible where the GF satisfies F(z) — z0(F(z)) and
is the positive real root of 0(A) = A0'(A) then

0'(A ) N N~ 3 / 2

sfi^rWW)

<t>{u) = 1 + u + u 2

0'(u) = 1+2u 1 + A + A 2 = A + 2A

0 » = 2

A = 1
0(A) = 3
0'(A) = 3
0"(A)=2

10

Example 4: Cayley trees

Q. How many different labelled rooted unordered trees of size N ?

< -24 ways to label

◄-1 2 ways to label

< -24 ways to label

4 ways to label

T 4 = 64

A. N N ~ ] . (See EGF lecture.)

Example 4: Cayley trees (exact, from EGF lecture)

Class

ECF
C, the class of labelled rooted unordered trees

c ( z ) = 5Z

cec

Cn

N> 0

Example
6 2 11

Construction C = Z*(SET(C)) <—

"a tree is a root connected to a set of trees"

EGF equation C(z) = ze C ^

Extract coefficients i u ,,

by Lagrange inversion [z ]C(z) = [i/ ]( , )

with f(u) = u/e“ N u / e

Lagrange Inversion Theorem.

If a CF g(z ) = ^g„z n satisfies the equation z= f{g (z))

n — i f i / u \ n

with f(0) = 0 and f ' (0) * 0 then gn = ~[u n

C N = N![z n ]C(z) =(n^) /

1 r /# N-ii p uN

N n ~ 1

“ N [U Je

N!

12
Example 4: Cayley trees

C, the class of all labelled rooted


unordered trees

C = Z ★ SET ( C )

> f

C(z) = ze c

simple variety
of trees

[z N ]C(z) — ^_ e N N 3 / 2

V2ti

Theorem. If a simple variety of trees F = Z [ x or ★] SECMF)


is A-invertible where the CF satisfies F(z) = z0(F(z)) and
is the positive real root of 0(A) = A0'(A) then

0'(A ) N N- 3 / 2

v /2ji0"(A)/0(A)

0(u) = e u
0» = e u
0"(u) = e"

Ae A

A = 1
0(A) = e
0'(A) = e
0"(A) = e
13

Aside: Stirling's formula via Cayley tree enumeration

Exact, via Lagrange inversion

Approximate, via singularity analysis

Example 4: Cayley trees

Theorem. If a simple variety of trees F = Z [ x or *] SEQ$(F)


isA-invertible where the GF satisfies F(z) = z0(F(z)) and
is the positive real root of </>(A) = A<//(A) then

( W) ~

cj>(u) = e u

<P'(u) = e" e x = Ae A

<p"(u) = e u

A = 1

<t>( A) = e

^'(A) = e
0"(A)= e

Theorem.

N\ ~ a/2tiN( —) N *
Stirling's formula

14

ANALYTIC COMBINATORICS

Analytic

Combinatorics

Philippe Flajolet and


Robert Sedgewick

http://ac.cs.princeton.edu

PART TWO

7. Applications of Singularity Analysis

• Simple varieties of trees

• Labelled sets

• Mappings

• Tree-like classes

II.7a.SAapps.Sets
ANALYTIC COMBINATORICS

PART TWO

Analytic

Combinatorics

Philippe Flajolet and


Robert Sedgewick

7. Applications of Singularity Analysis

Simple varieties of trees


Labelled sets

Mappings
Tree-like classes

CAMBRIDGE

http://ac.cs.princeton.edu

II.7a.SAapps.Sets

Transfer theorem for exp-log labelled set classes

[from Lecture 6]

Theorem. Asymptotics of exp-log labelled sets.

Suppose that a labelled set class F = SETco(G) is exp-log(cx, |3, p)

1 1

with G(z) ~ a log- - —h ft . Then F(z ) ~

v 7 1 -z/p v 7 V 1 -z/p ]

and

[z N ]F(z)
A A

77"

r(a ) K p

(-) N

1 —a

Corollary. The expected number of C-components


in a random F-object of size N is ~cx In N.

and is concentrated there

17

Example 5: Cycles in permutations

Q. How many permutations of N elements?

Q. How many cycles in a random permutation of N elements?

Pi= 1

avg. # cycles: 1

©©©

Ps = 6

avg. # cycles: 1 .8333

Pa-24
avg. # cycles: 2.08333

18

Example 5: Cycles in permutations

P, the class of all permutations


P = SET(CYC(Z))

> f

P(z) = exp (In y—^ )

exp-log

> f

[z N ]P(z) ~ 1

# permutations: ~ N\
avg # cycles: ~lnN

cy\ r?)

Theorem. Asymptotics of exp-log labelled sets.

Suppose that a labelled set class F = SET<t>(G) is exp-log(a, P, p)

with G(z) ~ a log

1 1
+ ft . Then F(z) ~ e^(

1 -z/p

1 - z/p

)“
and

r(a) V

( 7 ) N

1 —a

In

a log --— + p

^ - z/p

for a = 1, p = 0, and p = 1

Corollary. The expected number of G-components


in a random F-object of size N is ~cx In N.

and is concentrated there

Example 6: Cycles in derangements

Q. How many derangements of N elements?


Q. How many cycles in a random derangement of N elements?

D i = 0

avg. # cycles: 0

Db= 2

avg. # cycles: 1

D 4 =9

avg. # cycles: 1.33333

20

Example 6: Cycles in derangements

D, the class of all derangements


D = SET(CYC > 0 (Z))

> f

D(z) = exp (In y/yQ))

exp-log

> f

[z n ]D(z) ~ ^35

# derangements: ~ N\/e
avg # cycles: ~ In N

Theorem. Asymptotics of exp-log labelled sets.

Suppose that a labelled set class F = SET<t>(G) is exp-log(a, P, p)

1 1
with G(z) ~ a log - - — I- /3 . Then F(z) ~ e d (
and

1 -z/p

1 -z/p

In

1 'j

y— ;(2)= a log i _ r / - + ^

z/p

for ct = 1, (5 = -1, and p = 1

Corollary. The expected number of G-components


in a random F-object of size N is ~cx In N.

and is concentrated there

21

Example 6: Cycles in generalized derangements

D, the class of all permutations


having no cycles of length W], W 2 , ... Wt

D = SET(CYC * wi (Z))

D(z) = exp(ln
rWl

1 — z Wt

rW t

w t

[z n ]D(z) = exp(-

exp-log

Wt

W t

In

1 -z
for a = 1, f3
and p = 1

1 = a log

1 -z/p

Wi

1
w t

# derangements: ~ N!/e 1 / VVl+ "' +1 / VVt


avg # cycles: ~ In N

22

Example 7: 2-regular graphs

Q. How many labelled 2-regular graphs of N elements?

undirected graphs with


all nodes degree 2

Q. How many components in a random 2-regular graph of N elements?

1 way to label 3 ways t0 | a bel

fe = 1 r 4 = 3

1 2 ways to label

Rs = 12

60 ways to label

360 ways to label


1 0 ways to label

105 ways to label

Re = 70

avg. # components:

(1 -60 + 2 ■ 1 0)/70 = 1.143

R? = 465

avg. # components:

(1 -360 + 2 • 1 05)/465 = 1.226

23

Example 7: 2-regular graphs

R, the class of 2-regular graphs

R = SET(UCYC> 2 (Z))

z z

, x ,1, 1 - - X

K z) = exp — In-

v ; PV 2 1 -z 2 4’

exp-log
[z n ]R(z)

-3/4

V 71N

e -3/4

# 2-regular graphs: ~ N\ _

-InN

avg # components:

Analytic

Combinatorics

page 1 BB
page 449

Theorem. Asymptotics of exp-log labelled sets.

Suppose that a labelled set class F = SET<t>(G) is exp-log(cx, 3, p)

with G(z) ~ a log

1 - zip

+ /3 . Then F[z) ~ e ;3 (

1 - zip
Y

and

[z n ]F(z)

,1

—-(-) N'~ a

r(a)V

C(z) ~ a log --— + (3

1 -z/p

for a = 1 /2, (3 = 3/4, and p = 1

Corollary. The expected number of G-components


in a random F-object of size N is ~a In N.

and is concentrated there

ANALYTIC COMBINATORICS

PART TWO
Analytic

Combinatorics

Philippe Flajolet and


Robert Sedgewick

7. Applications of Singularity Analysis

Simple varieties of trees


Labelled sets

Mappings
Tree-like classes

CAMBRIDGE

http://ac.cs.princeton.edu

II.7a.SAapps.Sets

ANALYTIC COMBINATORICS

PART TWO

Analytic

Combinatorics

Philippe Flajolet and


Robert Sedgewick

7. Applications of Singularity Analysis

4^nple varieties of trees


Labelled sets
Mappings

Tree-like classes

CAMBRIDGE
http://ac.cs.princeton.edu

II.7a.SAapps.Sets

Example 7: Mappings

[from Lecture 2]

Def. A mapping is a function from the set of integers from 1 to N onto itself.

Example

1 2 3 4 5 6 7 8 9 10 11 12 IB 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
32 33 34 35 36 37
9 12 29 33 5 20 30 37 26 20 13 8 2 33 29 2 35 37 33 9 35 21 18 2 25 1 20 33 23 18
29 5 5 9 11 5 11

27

Mappings

[from Lecture 2]

Q. How many mappings of length N ?

M 2 = 4

(inn

12 3 to to to

113 ^

121 Q

122 y r

133 A ^

2 2 3 O
3 2 3

n; ©0

2 11

212 /rCX

2 3 2 tob

3 11 b

3 3 ! X

3 3 2 LJ

112 Q

1 3 1 Q

221 Y

2 3 3 O

3 13 f

322 n

Hi A

Mb = 27

A. N N , by correspondence with A/-words, but internal structure is of interest.

28

oaO

Mapping EGFs

[from Lecture 2]

Combinatorial class

C, the class of Cayley trees < - labelled, rooted, unordered


Construction

C = Z * (557(C)) * — "a tree is a root connected to a set of trees"

EGF equation

C(z) = ze c ^

Combinatorial class

Y, the class of mapping components

Construction

y = CVC(C) < — "a mapping component is a cycle of trees"

EGF equation

V(Z) - ln 1 - C(z)

Combinatorial class

M, the class of mappings

Construction

M = SET(CYC(C)) < — "a mapping is a set of components"

1 1

ECF equation M(z) = exp(ln -—-) = -——

v 1 — C(z) 7 1 — C(z)

29

Example 4: Cayley trees

[from earlier in this lecture]

Theorem. If a simple variety of trees F = Z [ x or ★] SECMF)


is A-invertible where the CF satisfies F(z) = z0(F(z)) and
is the positive real root of 0(A) = A0'(A) then
0'(A ) N N- 3 / 2

v /2ji0"(A)/0(A)

and F(z) ~ A - ^20(A)/0"(A)0 - z0'(A)

0(A) = e
0'(A) = e
0"(A) = e

0(u) = e 1
0'(u) = e 1
0» = e 1

e A = Ae A

30

Cycles of Cayley trees

Y, the class of cycles of trees


(mapping components)

Y = CYC(C)

Y(z) — In

1 - C(z)
lln—-—

2 1 — ez

— In \fl

standard scale

[z n ]Y(z)

2 N

# cycles of trees: N\

2 N

71

2N

1 10 21 10 291231

from previous slide

C(z) ~ 1 — — ez

Stirling

N\ ~ V2kN( k — ) N

31
Mappings

M, the class of all mappings


M = SET ( Y )

\ • f \

• i | , /

>

A i i L

y(z)

r N

n n /

for ce = 1 /2, (3 = - In a/ 2, and p = 1 /e

32
Mappings overview

Example 4: Cayley trees

Theorem. If a simple variety of trees F = Z t x or *] SEQ»(F)


is A-invertible where the CF satisfies F(z) = z<t>(F{z)) and
is the positive real root of 0(A) = A0'(A) then

(VlfM-

4‘W N-

I and f{z) ~ A - Cycles of Cayley trees

0 ( 0 ) = e"
0'(o) = e u
0"(o) = e u

Cayley trees: simple variety

f Asymptotics j

Y, the class of cycles of trees


(mapping components)

Y(z) = In

1 10 21 10 291231
from previous slide

Mappings

# cycles of trees: ~ f.— ~ J —N

Components: standard scale

Mappings: exp-log

33

Mapping parameters

Q. How many components in a random mapping of length N ?

Q. How many nodes on cycles in a random mapping of length N ?


i

Mi = 1

1 2

1 1
2 2

2 1

00

/W 2 = 4

avg. # components: 1.25


avg. # nodes on cycles: 1.5

123 000

113 ^

121 O'

122 Y 0

1 3 3 T U

2 2 3 O

3 2 3

Hi ©

2 12 *0

2 3 2 v>

311 v

3 3 2 6

112 Q

131 Q
2 2 1 y

2 3 3 O

3 13 f

3 2 2 6

333

Mb = 27

avg. # components: 38/27 = 1.407


avg. # nodes on cycles: 51 /27 = 1.889

34

CXX£)

Components in mappings

M, the class of all mappings


M = SET( Y)

> f

M(z) = e Y ^

y(z) ~ 1 In 1 -In Vl

2 1 — ez

exp-log

N\[z n }M(z) ~ A/!

,/V

y/2nN
n n /

avg # components:

In N

X'

• i

2 / ...

^ •

>- A

v<

/X

r-’^i \

f ‘

VTX

r * ^
• -•'V

«■

Theorem. Asymptotics of exp-log labelled sets.

Suppose that a labelled set class F = SET®(C) is exp-log(a, |5, p)


with C(z) ~ a log - - —I- y3 . Then F(z) ~ '

and

1 -z/p

1 - z/p

Y(z)

-T^(-) N '~°
r(a) V

-ln-
2 1

ez

ct log

+ 0

for

1 - z/p

= 1 /2,0 = — ln\/2, and p = 1/e

Corollary. The expected number of G-components


in a random F-object of size N is ~a In N.
and is concentrated there

35

Nodes on cycles in mappings

Combinatorial class

Parameter

Construction

BGF

Expected # nodes on cycles

M, the class of mappings


the number of nodes on cycles (tree roots)
M = SET (CYC (uC))

/W(z, u) = exp (in -- - ) = --

V 1 — uC(z )/ 1 — u

N! '.Nl 9 ..M N!
)| u=1

N N j du

[Z]

uC( z )
C(z)

N Nl (1 — C(z)) 2

N! N 1 1

~ —-[z j-

N N l J 2 1 - ez
1 N!e N

nN/2

page 462

C(z) ~ 1 — \/2Vl — ez

C(z) 1 1

(1 — C(z)) 2 2 1 — ez

Stirling

N! ~ V2n N(—) N

predicted: 1 2.5
actual: 9

36
ANALYTIC COMBINATORICS

PART TWO

Analytic

Combinatorics

Philippe Flajolet and


Robert Sedgewick

7. Applications of Singularity Analysis

4^nple varieties of trees


Labelled sets
Mappings

Tree-like classes

CAMBRIDGE

http://ac.cs.princeton.edu

II.7a.SAapps.Sets

ANALYTIC COMBINATORICS

PART TWO

Analytic

Combinatorics

Philippe Flajolet and


Robert Sedgewick

7. Applications of Singularity Analysis

• Simple varieties of trees

• Labelled sets

• Mappings

• Tree-like classes

CAMBRIDGE

http://ac.cs.princeton.edu

II.7a.SAapps.Sets

Schema example 4: Implicit tree-like classes

Definition. A combinatorial class whose enumeration GF satisfies F(z) = <£(z, F(z))


is said to
be an implicit tree-like class with characteristic function G.

unlabelled case: number of structures is [z N }F(z)

F = CONSTRUCTS, F)

where CONSTRUCT is an arbitrary


composition of+, x, and SEQ

labelled case: number of structures is N\[z n ]F(z)


F = CONSTRUCTS, F)-

Analytic

Combinatorics

Philippe Hjjolct and


Robert Sedgewick

page 467

F(z) = (z, F(z))

\
immediate via
symbolic transfer

where CONSTRUCT is an arbitrary


composition of+, ★, SEQ, SET, and CYC

Example: Simple varieties of trees <T(z, w) = z<f>(w )

F(z) = z<j>(F{z))

39

Smooth-implicit-function tree-like classes

smooth implicit function : A technical condition that enables us to unify the


analysis of tree-like classes.

Definition. Smooth-implicit-function tree-like classes.

A tree-like class F = CONSTRUCT(F) with enumerating GF F(z) = 0(z, F(z )) is said


to be
smooth-implicit(r, s) if its characteristic function <£(z, w) satisfies the
following conditions:

• 0(z, w) is analytic at 0 and in a domain |z|< R and \w\< S for some R, S >0.

• [z N w k \<P(z, w) > 0 and >0 for some N and some k> 2, with <I>(0, 0) =*= 0.

There exist positive reals r < R and s < S such that (r, s) = s and <I> w (r, s) =
1

Example: "phylogenetic trees" Construction


[details to follow]

L = Z + SET> 2(L)

OGF equation L(z) = z + e L ^ - 1 - L(z)

Characteristic function $(z, w) = z — 1 + e w — w

(z, w) = w

O W (Z, W) = 1

"characteristic system
Characteristic system

z + e w — 1 — w — w
e w - 1 =1

solution

r= 2ln 2 — 1
s = In 2

phylogenetic trees are smooth-implicit(2ln 2 - 1, In 2)

Transfer theorem for implicit tree-like classes

Theorem. Asymptotics of implicit tree-like classes.

Suppose that F is an implicit tree-like class with characteristic function 4>(z, w)


and
aperiodic and smooth-implicit(r, s) GF F(z) = 0(z, F(z)), so that 4>(r, s) = s and
<fr w (r, s) = 1.
Then F(z) converges at z = r where it has a square-root singularity with

2r$Ar, s)
& ww (r , s)

Example: binary trees


(alternate)

Construction

B = • + • x SEQo, 2 ( B )

B(z) =z + zB{z) 2

s = 1/2
r= 1/4

OGF equation

Characteristic function
4>(z, w) — z + w
z + w 2 = w

$ z (z, w) = 1
4> w (z, w) = 2 w
$mv(z, w)=2
a — 2

Characteristic system

2w — 1

Coefficient asyptotics [z N ]6(z) ~ —4 n N 3/2

\/K

41

Example 8. Bracketings

Def. A bracketing of N items is a tree with N leaves and no unary nodes

Analytic

Combinatorics

page 69

Applications

•Parenthesizations.
•Series-parallel networks.
•Schroder’s 2nd problem

42

Example 8: Bracketings
Q. How many bracketings with N leaves?

= 1 5 2 = 1

A\

X^ \

5b = 3

All nodes of degree 0 (leaves) or >1 (internal nodes)

size: number of leaves

x^ *X*

54 = 1 1

43

Example 8: Bracketings

Q. How many parenthesizations of N items?

Si= 1

(a b)

5z= 1

(a b c)

((a b) c) (a (b c))

5b = 3
((a

(((a b)

(abed)

b) c d) (a (b c) d) ((a b) c d)

((a (b c)) d)

c) d) (((a b) c) d)

(a C(b c) d))

((a b) (c d))

((a b c) d) (a (b c d))

5 4 = 1 1

Example 8: Bracketings

Three additional equivalent structures.

and-or conjunctive
propositions

aA((bvc)AdA(evf)vg)A(hv(i a j)vk )a (1 vm)

series-parallel networks

<D—0>

—®—

45
Example 8: Bracketings

S, the class of all brat


S = Z + SEQ >i(

5(z) = z +

1 - 5(z)

- 1 - 5(z)

Theorem. Asymptotics of implicit tree-like classes.

Suppose that F is an implicit tree-like class with characteristic function <I>(z,


w) and
aperiodic and smooth-implicittr, s) CF F(z) = 4>(z, F(z)), so that <f>(r, s) = sand
<J>i»(r, s) = 1.
Then F(z) converges at z= r where it has a square-root singularity with

“ fiiv5\v

F(z) ~ s - aV'l -z/r and([ z N ]F(z) ~ (y)”AT

(where q =
2r$ z (r,s)

, s)

[z N ]S(z)

[ details left for exercise ]

Y 8s/2n K r
with r — 3 — 2 V 2

46

Example 9. Labelled hierarchies (phylogenetic trees)

Def. A labelled hierarchy of N items is a tree with N labelled leaves and no unary
nodes

Applications

•Classification.

•Evolution of genetically related organisms.


•Schroder’s 4th problem

Analytic

Combinatorics
page 1 28

47

Example 9. Labelled hierarchies (phylogenetic trees)

Q. How many different labelled hierarchies of N nodes?

U = 26

48

Example 9. Labelled hierarchies (phylogenetic trees)

L, the class of labelled hierarchies

L = Z + SET> 2 (L)

> f

L(z ) — z + e i( ' z ' ) — 1 — L(z)

implicit

tree-like

Theorem. Asymptotics of implicit tree-like classes.

Suppose that F is an implicit tree-like class with characteristic function <t>(z,


w) and
aperiodic and smooth-implicit(r, s) GF F(z) = 4>(z, F(z)), so that Mr, s) = sand <J
> w (r, s) = 1.
Then F(z) converges at z= r where it has a square-root singularity with

f(z) ~ s „ V.

z + e w — 1 — w — w
e w - 1 = 1

f = 2 In 2 — 1
s = In 2

with r = 2 In 2 — 1

<£>(z, w) = z — 1 + e w — w

&z(z, W) = 1

$ w (z, w) = e w - 1
$ wvv (z, w) = e w

$ z (r,s) = 1

$mv(r,s) = 2

a — \/2 In 2 — 1

49

ANALYTIC COMBINATORICS

PART TWO

Analytic
Combinatorics

Philippe Flajolet and


Robert Sedgewick

7. Applications of Singularity Analysis

• Simple varieties of trees

• Labelled sets

• Mappings

• Tree-like classes

CAMBRIDGE

http://ac.cs.princeton.edu

II.7a.SAapps.Sets

ANALYTIC COMBINATORICS

Analytic

Combinatorics

Philippe Flajolet and


Robert Sedgewick

http://ac.cs.princeton.edu

PART TWO

7. Applications of Singularity Analysis

^Set scherga^>

• Simple varieties of trees

• Mappings

• Tree-like classes

• Summary
II.7e.SAapps.Summary

Singularity analysis: examples of applications

construction generating function coefficient asymptotics

rooted ordered trees

G = Z x SEQ(G )

C(Z) =1-C(Z)

'a n N 3 ' 2

40E

binary trees

B = • x (E + B) x (E + B)

B = • + • x SEQo, 2 ( B )

e(z) = z(i +e(z) 2 )

B(z) — z + zB(z) 2 )

1 4 N N } / 2

v n

unary-binary trees

M = • x SEQo,i, 2 ( M )

M(z) = z( 1 + M(z) + M(z) 2 )

' _3 n N- } ' 2

V 471 / 3

Cayley trees

C = Z ★ SET(C )

C(z) = ze C( ' z ' )

N\ L e N N~V 2 = N n -’

y/2/K

mapping components
K = CYC(C )

K<Z) - hl 1 - C(z)

~N!— - J—N n

2N V 2N

mappings

M = SET(K )

M(z) = e K(z) = , _' c( z)

e N

~ /V! _~ /V

V2^N

2-regular graphs

R = SET( UCYC>2 (Z))

„-z/2-z 2 /4

e -3/4

~ /V! _

VnN

labelled hierarchies

L = Z + SET> 2 ( L )

L(z) = z + e L ^ — 1 — L(z)

yjl 111 2 - 1 N!

2\/tiN 3 (2 In2 — 1 ) N

52
"If you can specify it, you can analyze it"

Singularity analysis is an effective approach for analytic transfer from GF


equations
to coefficient asymptotics for classes with CFs that are not meromorphic.

Schema can unify the analysis for entire families of classes.

schema

technical condition

construction

coefficient asymptotics

Labelled set

exp-log

F = SET(G)

^0 i N
( )
r(cOV

Simple variety
of trees

invertible

F = Z x SEQ( F)

F = Z ★ SEQ( F)

’(Vn - 3 / 2

y/an p

Context-free

irreducible

Family of (+, x)
constructs

L_ (Vn - 3 / 2

y/ait p
Implicit tree-like

smooth implicit
function

F = CONSTRUCT (F)

a ^C) N N~V 2

2 r '

Next: GFs with no singularities.

53

ANALYTIC COMBINATORICS

Analytic

Combinatorics

Philippe Flajolet and


Robert Sedgewick

http://ac.cs.princeton.edu

PART TWO

7. Applications of Singularity Analysis

^Set scherga^>

• Simple varieties of trees

• Mappings

• Tree-like classes

• Summary
II.7e.SAapps.Summary

ANALYTIC COMBINATORICS

Analytic

Combinatorics

Philippe Flajolet and


Robert Sedgewick

http://ac.cs.princeton.edu

PART TWO

7. Applications of Singularity Analysis

^Set scherga^>

• Simple varieties of trees

• Mappings

• Tree-like classes

• Exercises

II.7f.SAapps.Exercises

Web Exercise VII.1

Bracketings (Schroder's 2nd problem)

Analytic

Combinatorics

Philippe Flajolet and


Robert Sedgewick

Web Exercise VII. 1 . Use the tree-like schema to develop an


asymptotic expression for the number of bracketings with N leaves
(see Example 1.1 5 on page 69 and Note VII.19 on page 474).

56

Assignments

1. Read pages 439-540 (Applications of Singularity Analysis) in text.

Usual caveat: Try to get a feeling for what's there, not understand every detail.

2. Write up a solutions to Web Exercise VII.1.

3. Programming exercise.

Program VII.1 . Do r- and 0-plots of the GF for bracketings


(see Web Exercise VII.1).

Analytic

Combinatorics

Philippe Flajolet and


Robert Sedgewick

57

ANALYTIC COMBINATORICS

Analytic

Combinatorics

Philippe Flajolet and


Robert Sedgewick

http://ac.cs.princeton.edu
PART TWO

7. Applications of Singularity Analysis

^Set scherga^>

• Simple varieties of trees

• Mappings

• Tree-like classes

• Exercises

II.7f.SAapps.Exercises

ANALYTIC COMBINATORICS

Analytic

Combinatorics

Philippe Flajolet and


Robert Sedgewick

http://ac.cs.princeton.edu

PART TWO

7. Applications of
Singularity Analysis

Anda mungkin juga menyukai