• 沒有找到結果。

Singularity Analysis

1

log 2

k∈Z\{0}

Γ(χk) s + 1− χk

.

From [54], we have that the gamma function admits a bound

|Γ(σ + it)| = O(

|t|σ−1/2e−π|t|/2)

, as|t| → ∞.

Thus, we can apply Theorem3.3.8. This plus the result from depoissonization in (3.6) yields

E(Pn) = ˜f (n) = n log2n + n ( γ

log 2 +1

2 + P (log2n) )

+ o(n), where P (t) is a 1-periodic function with the Fourier expansion given by

P (t) =

k∈Z\{0}

Γ(−χk) log 2 e2kπit.

With the mean of the external path length of symmetric tries solved, let us turn our attention back to the internal path length of symmetric DSTs.

Apart from the Rice method, P. Flajolet and B. Richmond proposed another method to handle such problems in [66]. The Flajolet-Richmond method is a combination of the Euler transform, the Mellin transform and the singularity analysis. Before we explain their approach, we introduce singularity analysis.

3.4 Singularity Analysis

It has been recognized for a long time that generating function’s dominant singularities (the ones with smallest modulus) contains a great deal of infor-mation on the coefficients. Therefore, studying the singularities of generating function may give us how the number of objects which the generating func-tion is counting will behave in the long term. Although the idea has been recognized a long time ago, there was no systematical research about this subject until P. Flajolet and A. M. Odlyzko constructed the theory of singu-larity analysis [64]. Nowadays, singusingu-larity analysis is one the the most often

used techniques in the analysis of algorithms. Here, we will briefly explain how to apply this method. For a more comprehensive introduction to the whole theory, see [70].

Many combinatorial counting problems with a solution an depending on n and satisfying certain recursion relation can be solved by introducing the generating function

f (z) =

n≥0

anzn. Then, the desired result can be retrieved by

an = [zn]f (z).

There are many methods to retrieve the coefficient. A method which is much more productive than elementary real analysis techniques is to use the Cauchy’s coefficient formula:

[zn]f (z) = 1 2πi

γ

f (z) zn+1dz.

As an example, we use f (z) = (1− z)−α with α > 0 to illustrate the idea.

We choose the contour γ at a distance 1/n from the singularity z = 1.

Then, by using the change of variables z = 1 + t/n, we get that dz = dtn, (1− z)−α = nα(−t)−α and

1 zn+1

n→∞

−−−→ e−t. This gives us (for a rigorous proof, see [70])

[zn](1− z)−α∼ ganα−1, where ga:= 1 2πi

H

e−t(−t)−αdt,

with H being the Hankel contour. We recall the Hankel’s integral represen-tation of Γ(α):

1

Γ(α) = 1 2πi

H

e−t(−t)−αdt.

Thus,

[zn](1− z)−α nα−1 Γ(α).

Utilizing the same idea for logarithmic factors with singularities at 1, we get the following theorem.

Theorem 3.4.1. Let α be an arbitrary complex number in

C\Z≤0 and β ∈ R.

The coefficient of zn in the function of the form

f (z) = (1− z)−α (1

z log 1 1− z

)β

admits for large n a full asymptotic expansion in descending power of log n, fn ≡ [zn]f (z)∼ nα−1

Remark 2. In many situations, the location of the dominating singularity will not be at 1. However, we can easily shift the location of the dominating singularity to 1 and then apply Theorem3.4.1. Suppose that

f (z) =

Example 3.4.2. Planted trees, sometimes also called Catalan trees, are

rooted trees where each node has an arbitrary number of children and subtrees have a natural left-to-right-order. Let fn be the number of planted trees with n nodes and f (z) =

n≥0fnzn. It is well known that f (z) = 1−√

1− 4z

2 .

By Theorem

3.4.1, we get

[zn]f (z) = 4n[zn]f

Theorem 3.4.1 gives us a way to derive asymptotic expansions of the coefficients of generating functions satisfying a certain form. However, gen-erating functions do not always admit such an elegant expression in practical cases. For general use, we usually expand the generating function f (z) near the dominant singularity in the form

f (z) = g(z) +O(h(z)) or f(z) = g(z) + o(h(z)),

where ˜h(z) is a function of the above form and g(z) is written as a linear combination of functions of the above form. What is required at this stage is a way to extract coefficients of error terms. For this purpose, assumptions on h(z) are necessary.

One such assumption is to assume that h(z) is analytic in the complex plane slit at the half line R≥1. In fact, weaker conditions suffice: any do-main whose boundary makes an acute angle with the half line appears to be suitable.

Definition 3.4.3. Given two number ϕ, R with R > 1 and 0 < ϕ <

π2, the open domain ∆(ϕ, R) is defined as

∆(ϕ, R) ={z : |z| < R, z ̸= 1, | arg(z − 1)| > ϕ}.

A domain is a ∆-domain at 1 if it is a ∆(ϕ, R) for some R and ϕ. For a complex number ζ ̸= 0, a ∆-domain at ζ is the image by the mapping z 7→ ζz of a ∆-domain at 1. A function is ∆-analytic if it is analytic in some ∆-domain.

With the definitions of ∆-domain and ∆-analytic, we may now introduce the transfer theorem for the error terms.

Theorem 3.4.4. Let α, β be arbitrary real numbers, α, β

∈ R and let f(z) be a function that is ∆-analytic.

(i) Assume that f (z) satisfies in the intersection of a neighborhood of 1 with its ∆-domain the condition

f (z) =O (

(1− z)−α (

log 1 1− z

)β) .

Then, one has

[zn]f (z) =O(nα−1(log n)β).

(ii) Assume that f (z) satisfies in the intersection of a neighborhood of 1 with its ∆-domain the condition

f (z) = o (

(1− z)−α (

log 1 1− z

)β) . Then, one has

[zn]f (z) = o(nα−1(log n)β).

Example 3.4.5. We let f

n be the number of labeled 2-regular graphs with n vertices and f (z) =

n≥0 fn

n!zn be the exponential generating function of fn. Then, by symbolic combinatorics (for more details, see [70]), we get

f (z) = exp(2z−z4 2)

1− z . Expanding the numerator around z = 1, we have f (z) = e−3/4(1− z)−1/2+O(

(1− z)1/2) . Now, an application of Theorem

3.4.1

and Theorem

3.4.4

yields

fn

n! = [zn]f (z) = e−3/4

√nπ +O(n−3/2).

In Example3.1.2, we derived the asymptotic expression of the total path length of symmetric DSTs via the Rice method. Now, as promised in the previous sections, we display how the Flajolet-Richmond approach works by deriving the asymptotic expression of the total path length of symmetric DSTs again.

Example 3.4.6. (Flajolet-Richmond approach for the total path length of

DSTs)

As in Example

3.1.2, we let S

n be the mean of the total path length of symmetric DSTs built on n strings. We also let A(z) :=

nSnzn. Now, we apply the Flajolet-Richmond approach to derive the asymptotic expression of Sn by the following steps:

(1) Euler Transform. We apply the Euler transform on A(z) by letting

A(s) =ˆ 1

s + 1A ( 1

s + 1 )

. Then, from (3.2), we get

(s + 1) ˆA(s) = 4 ˆA(2s) + s−2. (3.10)

(2) Normalization. We denote by ¯

A(s) = ˆA/Q(−s), where Q(−s) is de-fined in Step 2 of Example

3.1.2. Dividing both sides of (3.10) by

Q(−2s), we get

A(s) = 4 ¯¯ A(2s) + 1

s2Q(−2s). (3.11)

(3) Mellin Transform. By applying Mellin transform on (3.11) and the

results in [68], for ℜ(ω) > 2, we have M [ ¯A; ω] = GE(ω)

1− 22−ω, where

GE(ω) = Q(2ω−2)

Q(1) Γ(ω)Γ(1− ω).

Then, the inverse Mellin transform yields as s→ 0 A(s) =s¯ −2log2 1

s + 1 s2

(1 2− α

)

+ 1

log 2

k∈Z\{0}

GE(2 + χk)s−2−χk+O(|s|−1), (3.12)

where α is defined as in Example

3.1.2

and χk = 2kπi/ log 2.

(4) Asymptotic for the Ordinary Generating Function. We multiply

both sides of (3.12) by Q(−2s) and reverse the Euler transform by

A(z) = 1 z

Aˆ

(1− z z

) .

From the fact that Q(−2s) = 1 + O(|s|), we get

A(z) = z

(1− z)2 log2 z

1− z + z (1− z)2

(1 2 − α

)

+ ∑

k∈Z\{0}

GE(2 + χk) log 2

z1+χk

(1− z)2+χk +O(|1 − z|−1). (3.13)

(5) Singularity Analysis. Now, we handle the terms in (3.13)

individu-ally. First,

By Theorem

3.4.1, we get that

[zn] z

By substituting them back into (3.13), we get Sn=n log2n + n

Note that the asymptotic expression coincides with (3.3) which was derived by the Rice method.