Analytic Combinatorics/Singularity Analysis

From testwiki
Jump to navigation Jump to search

Introduction

This article explains how to estimate the coefficients of generating functions involving logarithms and roots.

You first may need to familiarise yourself with:

Theorems

Standard Function Scale

Theorem from Flajolet and Odlyzko[1].

If:

f(z)=(1z)α(1zlog11z)γ(1zlog(1zlog11z))δ

where α{0,1,2,},γ,δ{1,2,} then:

[zn]f(z)nα1Γ(α)(logn)γ(loglogn)δ(as n)

Singularity Analysis

Theorem from Flajolet and Sedgewick[2].

If f(z) has a singularity at ζ and:

f(z)(1zζ)α(1zζlog11zζ)γ(1zζlog(1zζlog11zζ))δ(as zζ)

where α{0,1,2,},γ,δ{1,2,} then:

[zn]f(z)ζnnα1Γ(α)(logn)γ(loglogn)δ(as n)

The significance of the latter theorem is we only need an approximation of f(z).

Branch points

Before going into the proof, I will explain what it is about roots and logarithms that mean we have to treat them differently to meromorphic functions.

Polar coordinates

Complex numbers can be expressed in two forms: Cartesian coordinates (x+iy) or polar coordinates reiθ, where r is the distance from the origin or modulus and θ is the angle relative to the positive x axis or argument.

For complex functions f(z) of complex variables z we can draw a 3-dimensional graph where the x and y axes are the real and imaginary components respectively of the z variable and the z axis is either the the modulus or the argument of the function f(z).

For roots and logarithms, if we use the argument of the function for the z axis, we see a discontinuity that restricts where we can draw the contour when we want to integrate the function.

The gap you can see along the negative x axis is the discontinuity.

Root and logarithmic functions do not have poles about which we can do a Laurent expansion. Instead, we need to draw our contours to avoid these gaps or discontinuities. This is why in what follows we use contours with slits or wedges taken out of them.

Proof of standard function scale

Proof due to Sedgewick, Flajolet and Odlyzko[3]

The proof for the estimate of the coefficient of the first term.

By Cauchy's coefficient formula

[zn](1z)α(1zlog11z)γ(1zlog(1zlog11z))δ=12πiC(1z)α(1zlog11z)γ(1zlog(1zlog11z))δdzzn+1

where C is a circle centred at the origin.

It is possible to deform C without changing the value of the contour integral above.

We will deform C by putting a slit through it along the real axis from 1 to +.

We increase the radius of the circle to , which reduces its contribution to the integrand to 0.

Therefore, the contour integration around C above is equivalent to the contour integration around the contour which starts at Re(+), winds around 1 and ends at Re(+), which we will call H1n.

While we don't know much about the behaviour of the integral around the contour H1n, we do know about a similar contour H1 (the Hankel contour) which winds around the origin at a distance of 1.

We can calculate the integral around H1n by turning it into an integral around H1. Formally:

H1nf(z)dz=ψ1H1nf(ψ(ζ))ψ(ζ)dζ.[4]

Such that ψ1H1n=H1.


Informally this means we want to find a function ψ1(t) which turns the contour H1n into H1. Geometrically, we move the contour to the left by 1 and multiply it by n:

ψ1(t)=n(t1)

But, we still want the integrand around H1 to be equivalent to the integrand around H1n. We do this by dividing the variable by n and adding 1:

ψ(t)=1+tn

Therefore, we get the following substitution[5]:

12πiH1n(1z)α(1zlog11z)γ(1zlog(1zlog11z))δdzzn+1=12πiψ1H1n(1(1+tn))α(11+tnlog11(1+tn))γ(11+tnlog(11+tnlog11(1+tn)))δ1ndt(1+tn)n+1=na12πiH1(t)α(lognt)γ(log(11+tnlognt))δ(1+tn)nγδ1dt=na12πi(logn)γH1(t)α(1log(t)logn)γ(log(11+tnlognt))δ(1+tn)nγδ1dtna12πi(logn)γH1(t)α(log(11+tnlognt))δ(1+tn)nγδ1dt(as n)=na12πi(logn)γH1(t)α(log11+tn+loglognt)δ(1+tn)nγδ1dtna12πi(logn)γH1(t)α(loglognt)δ(1+tn)nγδ1dt(as n)=na12πi(logn)γ(loglogn)δH1(t)α(1loglog(t)loglogn)δ(1+tn)nγδ1dtna12πi(logn)γ(loglogn)δH1(t)α(1+tn)nγδ1dt(as n)

We have:

(1+tn)nγδ1et (as n)

and:

12πiH1(t)αetdt=1Γ(α)

Therefore,

12πiH1(t)α(1+tn)n1dt12πiH1(t)αetdt=1Γ(α)[6]

Putting it all together:

[zn](1z)α(1zlog11z)γ(1zlog(1zlog11z))δ=12πiC(1z)α(1zlog11z)γ(1zlog(1zlog11z))δdzzn+1=12πiH1n(1z)α(1zlog11z)γ(1zlog(1zlog11z))δdzzn+1=na12πi(logn)γ(loglogn)δH1(t)α(1+tn)n1dtna12πi(logn)γ(loglogn)δH1(t)αetdt=nα1Γ(α)(logn)γ(loglogn)δ

Singularity Analysis

Explanation and example from Flajolet and Sedgewick[7].

In the below

F(z)=(1z)α(1zlog11z)γ(1zlog(1zlog11z))δ(α{0,1,2,},γ,δ{1,2,})

Little o

We will be making use of the "little o" notation.

f(z)=o(g(z)) as zζ

which means

limzζf(z)g(z)=0

It also means for each ϵ>0 there exists δ>0 such that[8]

|zζ|δf(z)ϵg(z)

a fact we will use in the proof.

It is also useful to note

f(z)=g(z)+o(g(z))f(z)g(z)

Summary

For the generating function f(z):

  1. Find f(z)'s singularity ζ.
  2. Construct the Δ-domain at ζ.
  3. Check that f(z) is analytic in the Δ-domain.
  4. Create an approximation of f(z) near ζ of the form f(z)=F(zζ)+o(F(zζ)).
  5. The estimate of [(z/ζ)n]f(z)nα1Γ(α)(logn)γ(loglogn)δ or equivalently [zn]f(z)ζnnα1Γ(α)(logn)γ(loglogn)δ.

Details

To find the singularity, find the value of z for which the function equals [9].

As an example, we will use f(z)=ez/2z2/41z.

It has a singularity at z=1, because

e3/411=e3/40=e3/40=

The Δ-domain at 1 is a circle centred at the origin with radius R with a triangle cut out of it with one vertex at 1 and edges of angles ϕ and ϕ. See image below. We use this domain as it allows us to make a proof later.

For f(z) to be analytic in the Δ-domain:

f(z)=n=0an(zz0)n

for all z0 in the Δ-domain[10].

Our example is analytic in the Δ-domain because

  • ez/2z2/4 is an entire function (i.e. has no singularities), which means it is analytic everywhere.
  • 11z is analytic except for the slit along the real axis for z1.
  • The product of two analytic functions is an analytic function on the same domain[11]. Therefore, ez/2z2/41z is analytic on the entire complex domain, including the Δ-domain, except for the real axis z1.

We want an approximation of the form f(z)=F(zζ)+o(F(zζ))(zζ) (where in our example we set γ,δ=0 and ζ=1).

Normally, this will be in the form of a Taylor series expansion.

For our example, doing the Taylor Expansion near to 1:

ez/2z2/4=e3/4+e3/4(1z)+e3/44(1z)2+
11z=11z
ez/2z2/41z=e3/41z+e3/41z+e3/44(1z)32+

Therefore:

ez/2z2/41z=e3/41z+o(e3/41z)

Then [zn]f(z)nα1Γ(α)(logn)γ(loglogn)δ.

Therefore, in our example:

[zn]ez/2z2/41ze3/4πn

The proof of this comes from the fact that:

  1. [zn]f(z)=ζn[(z/ζn]f(z)
  2. [(z/ζ)n]f(z)=[(z/ζ)n]F(z/ζ)+[(z/ζ)n]o(F(z/ζ))
  3. the coefficients of the first term [(z/ζ)n]F(z/ζ)nα1Γ(α)(logn)γ(loglogn)δ, which we get from the standard function scale.
  4. and the coefficients of the second term [(z/ζ)n]o(F(z/ζ))=o(nα1(logn)γ(loglogn)δ) which we do in #Proof of error term. This is also the reason why we need to use the Δ-domain.

Proof of error term

Proof from Flajolet and Odlyzko[12], Flajolet and Sedgewick[13] and Pemantle and Wilson[14].

We get the estimate of the coefficient for the second term from Cauchy's coefficient formula:

[zn]o(F(z))=12iπγo(F(z))dzzn+1

where γ is any closed contour inside the Δ-domain. See the red line in the image below.

We split γ into four parts such that γ=γ1γ2γ3γ4.

γ1={z|z1|=1n,|arg(z1)|ϕ}
γ2={z|z1|1n,|z|r,|arg(z1)|=ϕ}
γ3={z|z|=r>1,|arg(z1)|ϕ}
γ4={z|z1|1n,|z|r,|arg(z1)|=ϕ}
12iπγo(F(z))dzzn+1=12iπγ1o(F(z))dzzn+1+12iπγ2o(F(z))dzzn+1+12iπγ3o(F(z))dzzn+1+12iπγ4o(F(z))dzzn+1

Contribution of γ1:

The maximum of F(z) on γ1 is when z=11n

o(F(z))ϵnα(logn)γ(log111n+loglogn)δ1(11n)γ+δϵnα(logn)γ(loglogn)δ(as n)

The maximum of 1zn+1 on γ1 is

1(11n)n+12e

The maximum of dz on γ1 is 2πn

12iπγ1o(F(z))dzzn+1ϵ2enα1(logn)γ(loglogn)δ=o(nα1(logn)γ(loglogn)δ)

Contribution of γ2 and γ4:

We parameterise the contour γ2 by converting z to polar form by z=1+tneiϕ, so that γ2 is a function of t from 1 to En. E is the positive solution to the equation |1+Eeiϕ|=r, so that the contour joins γ3:

γ2o(F(z))dzzn+11En|F(1+tneiϕ)|eiϕdtn(1+tneiϕ)n+1

But, remember that the little o relation only holds within a particular δ of 1. We know that log2nn tends to zero as n increases, and therefore, for any ϵ, we choose an n big enough so that log2nnδ. We split the integral above into two at log2n, so that tneiϕδ:

1En|F(1+tneiϕ)|eiϕdtn(1+tneiϕ)n+1=1log2nϵ|F(1+tneiϕ)|eiϕdtn(1+tneiϕ)n+1+log2nEnF(1+tneiϕ)eiϕdtn(1+tneiϕ)n+1

The first term in the sum:

1log2nϵ|F(1+tneiϕ)|eiϕdtn(1+tneiϕ)n+112iπ1ϵ|tneiϕ|α|lognteiϕ|γ|log(11+tneiϕlognteiϕ)|δ|1+tneiϕ|nγδ1eiϕdtn12iπϵ(eiϕn)α+1(logneiϕ)γ1|t|α|log(11+tneiϕlogneiϕ)|δ|1+tneiϕ|nγδ1dt12iπϵ(eiϕn)α+1(logneiϕ)γ(loglogneiϕ)δ1|t|α|1+tneiϕ|nγδ1dt(as n)
|1+eiϕtn|1+Re(eiϕtn)=1+tcosϕn[15] (where Re(x) is the real part of x).
1log2n|t|α|1+tneiϕ|nγδ1dt1|t|α|1+tneiϕ|nγδ1dt1|t|α(1+tcosϕn)nγδ1dt1taetcosϕdt(as n)

This converges to a constant L. Therefore:

12iπϵ(eiϕn)α+1(logneiϕ)γ(loglogneiϕ)δ1|t|α|1+tneiϕ|nγδ1dt=L2iπϵ(eiϕn)α+1(logneiϕ)γ(loglogneiϕ)δ=o(nα1(logn)γ(loglogn)δ)(n)

The second term in the sum:

log2nEnF(1+tneiϕ)eiϕdtn(1+tneiϕ)n+112iπ(eiϕn)α+1(logneiϕ)γ(loglogneiϕ)δlog2nEn|t|α(1+log2ncosϕn)nγδ1dt12iπ(eiϕn)α+1(logneiϕ)γ(loglogneiϕ)δlog2nEn|t|αelog2ncosϕdt12iπ(eiϕn)α+1(logneiϕ)γ(loglogneiϕ)δ|En|αnlogncosϕEn

nlogncosϕ grows faster with n than |En|α+1, so |En|α+1nlogncosϕ0 as n. Therefore:

12iπ(eiϕn)α+1(logneiϕ)γ(loglogneiϕ)δ|En|α+1nlogncosϕ=o(nα1(logn)γ(loglogn)δ)(n)

A similar argument applies to γ4.

Contribution of γ3:

By Cauchy's inequality

12iπγ3o(F(z))dzzn+1max|z|=rF(z)rn

meaning the contribution of the integral around γ3 is exponentially small as n and can be discarded.

Formula for multiple singularities

The above assumes only one singularity ζ. But, it can be generalised for functions with multiple singularities.

Template:Quote

Theorem from Flajolet and Sedgewick[16].

Assume f(z) is analytic on the disc |z|<ρ, has a finite number of singularities on the circle |z|=ρ and f(z) is analytic on the Δ-domain with multiple indents, one at each singularity.

If for each singularity ζi (for i=1,2,,r):

f(z)(1zζi)αi(1zζilog11zζi)γi(1zζilog(1zζilog11zζi))δi(as zζi)

then:

[zn]f(z)i=0rζinnαi1Γ(αi)(logn)γi(loglogn)δi(as n)

Notes

Template:Reflist

References

Template:BookCat

  1. Flajolet and Odlyzko 1990, pp. 14.
  2. Flajolet and Sedgewick 2009, pp. 393.
  3. Sedgewick, pp. 16. Flajolet and Sedgewick 2009, pp. 381. Flajolet and Odlyzko 1990, pp. 4-15.
  4. Lorenz 2011.
  5. For more details, see Flajolet and Odlyzko 1990, pp. 12-15.
  6. Sedgewick, pp. 10.
  7. Flajolet and Sedgewick 2009, pp. 392-395.
  8. Flajolet and Odlyzko 1990, pp. 8.
  9. This is a bit of an over-simplification. For further information, see Stroud 2003, pp. 863-867, 915 and w:Mathematical_singularity.
  10. Lang 1999, pp. 68-69.
  11. Lang 1999, pp. 69.
  12. Flajolet and Odlyzko 1990, pp. 7-9.
  13. Flajolet and Sedgewick 2009, pp. 390-392.
  14. Pemantle and Wilson 2013, pp. 59-60.
  15. w:Polar_coordinate_system#Converting_between_polar_and_Cartesian_coordinates.
  16. Flajolet and Sedgewick 2009, pp. 398.