國
立
交
通
大
學
應 用 數 學 系
碩 士 論 文
字典樹與基數樹之
二階保護點的數量
The Number of 2-Protected Nodes in
Tries and PATRICIA Tries
研 究 生 :余冠儒
指導教授 :符麥克 教授
字典樹與基數樹之二階保護點的數量
The Number of 2-Protected Nodes in
Tries and PATRICIA Tries
研 究 生 : 余冠儒 Student : Guan-Ru Yu
指導教授 : 符麥克
Advisor : Michael Fuchs
國
立
交
通
大
學
應 用 數 學 系
碩 士 論 文
A Thesis
Submitted to Department of Applied Mathematics
College of Science
National Chiao Tung University
in Partial Fulfillment of Requirements
for the Degree of Master
in Applied Mathematics
June 2014
Hsinchu, Taiwan
T
HE
N
UMBER OF
2-P
ROTECTED
N
ODES IN
T
RIES AND
PATRICIA T
RIES
Guan-Ru Yu
Department of Applied Mathematics,
National Chiao Tung University
摘 要
數位樹在電腦科學中的資料結構扮演極其重要的角色,而所謂的二階保 護點在近期則受到相當大的矚目。舉例來說,J. Gaither、Y. Homma、M. Sellke 以及 M. D. Ward 曾探討隨機的字典樹之二階保護點的數量進而求 出它的期望值之漸近展開式。不但如此,J. Gaither 與 M. D. Ward 更進一 步求出它的變異數之漸近展開式,並猜測它數量的分布會滿足中央極限定 理。 在這篇論文中,我們的主要目標是用符麥克、黃顯貴和 V. Zacharovas 三人所提出來一個有系統的方法來重新驗證(也可說是糾正)他們的結 果。經過運算,即便我們得到一個與他們截然不同的展開式,但我們的在 數值上與他們的結果卻是完全相同的。不但如此,我們更是證實了他們猜 想的中央極限定理。事實上,我們證明了一個更一般化的結果就是字典樹 之內點與二階保護點的二元中央極限定理。根據這個結果我們不但是證明 了 J. Gaither 與 M. D. Ward 的猜想,更是直接得知基數樹也會滿足中央 極限定理。最後,我們還算出基數樹之二階保護點數量的期望值及變異數 之漸近展開式。Preface
Digital trees are data structures which are of fundamental importance in Computer Science. Recently, so-called 2-protected nodes have attracted a lot of attention. For instance, J. Gaither, Y. Homma, M. Sellke, and M. D. Ward [6] derived an asymptotic expansion for the mean of the number of 2-protected nodes in random tries. Moreover, in [7], J. Gaither and M. D. Ward found an asymptotic expansion of the variance and conjectured a central limit theorem.
In this thesis, our main goal is to re-derive (and correct) their results by using a systematic method due to M. Fuchs, H.-K. Hwang, and V. Zacharovas [4]. The resulting expressions we obtain are quite different from the one in [6, 7], but numerically they of course coincide. Moreover, we prove the conjectured central limit theorem from [7]. In fact, we prove even a more general result, namely, a bivariate central limit theorem for the number of internal nodes and the number of 2-protected nodes in random tries. From this, not only the conjecture from [7] follows but we also obtain a central limit theorem for PATRICIA tries. Finally, we also derive asymptotic expansions of mean and variance for PATRICIA tries.
Next, we are going to give a short sketch of the structure of the thesis.
In Chapter1, we give the definition of the three main classes of digital trees. Moreover, we introduce the random model and survey results on the number of in-ternal nodes and number of 2-protected nodes in random tries. Finally, we explain the method from [4] which will be used in this thesis.
In Chapter2, we will give a summary of the main tools of this method which are Mellin transform and analytic depoissonization. Moreover, we will recall the recent notion of JS-admissibility which can be used to systematically check as-sumptions for analytic depoissonization.
In Chapter3, we will apply the method and tools from Chapter1and Chapter
2 to derive asymptotic expansions for mean and variance of the number of 2-protected nodes in random tries. An interesting aspect of our results is that they contain divergent series in the classical sense which however make sense if one appeals to the theory of Abel summability. We also show that our expressions (numerically) coincide with those from [6,7]. In the final section of this chapter, we will prove that the number of 2-protected nodes satisfies the claimed central
limit theorem.
Chapter 4 contains our results for PATRICIA tries. Here, the result for the mean follows from that of tries and the result for the variance follows from the same approach as used in Chapter 3. In order to keep the thesis short, we will however not repeat all the details, but only show the results.
In Chapter5, we prove that the number of internal nodes and the number of 2-protected nodes satisfy a bivariate central limit theorem. As mentioned above, this result entails that also the number of 2-protected nodes of PATRICIA tries satisfies a central limit theorem.
誌
謝
寫著致謝的同時,也將整個碩士生涯快速的瀏覽一遍。首
先我最要感謝指導教授 符麥克老師兩年來的栽培,亦師亦友
的師生關係在我做研究的路上給了我充分的空間,引導我對自
己的未來譜出不同以往的願景,讓我在學術上與生活上都留下
許多深刻且美好的體驗。同時,我也要感謝我的學長李忠逵,
扮演老師的角色從旁輔導,給與我許多應時的協助。
除此還要感謝乙組所有的同學,每每與你們聊天課業壓力
就拋諸腦後。我也要感謝新竹市召會的弟兄姊妹在我這兩年的
求學階段時常給我鼓勵,讓我感覺教會就像我第二個家。
最後,我要感謝我的家人提供我一個溫暖的窩,讓我在忙
碌的工作之餘可以沉澱情緒,謝謝爸爸、媽媽對我的疼愛和信
任,讓我可以全心專注在自己喜歡的事物上,您們的鼓勵與支
持是我向前的主要動力;謝謝我最親愛的妻子,在我忙於課業
不在妳身邊的時候,常讓妳獨自去產檢,委屈妳了。謝謝妳的
無怨無悔的付出與無條件的支持。
感謝神,為著祂難以形容的恩賜。
Contents
1 Introduction 1
1.1 Definition . . . 1
1.1.1 Digital search trees (DSTs) . . . 1
1.1.2 Tries . . . 2
1.1.3 PATRICIA tries . . . 2
1.2 Random model . . . 3
1.3 Size and the number of 2-protected nodes in tries . . . 4
1.3.1 Size of tries . . . 4
1.3.2 Number of 2-protected nodes in tries. . . 6
1.4 Additive shape parameters and main idea of the analysis . . . 7
2 Tools 12 2.1 Mellin transform . . . 12
2.1.1 Mellin transform and its inverse transform . . . 12
2.1.2 Direct mapping and converse mapping. . . 15
2.1.3 Some other properties . . . 18
2.2 Analytic de-Poissonization and JS-admissible functions . . . 18
3 The number of 2-protected nodes in tries 21 3.1 The mean of the number of 2-protected nodes in tries . . . 21
3.2 The variance of the number of 2-protected nodes in tries . . . 26
3.3 Central limit theorem (CLT) . . . 40
4 The number of 2-protected nodes in PATRICIA tries 42
5 A bivariate central limit theorem 48
Chapter 1
Introduction
When it comes to data storage and data search, digital trees are one of the most effective data structures in computer science. Some famous applications of digital trees are in searching, sorting, dynamic hashing, coding, polynomial factorization, regular languages, contention tree algorithms, automatically correcting words in texts, retrieving IP address and satellite data, internet routing and so on. Due to their numerous applications, many recent studies have been concerned with the analysis of digital trees.
1.1
Definition
Before we start with the main topic of this thesis, we will introduce the three main classes of digital trees, namely, digital search trees, tries and PATRICIA tries (in the binary case). What they have in common is that the data consists of n infinite {0, 1}-strings. From this data they are built recursively as described in the three subsections below.
1.1.1
Digital search trees (DSTs)
Put the first string into the root. As for the other strings, direct them to the left or right subtree according to whether the first bit is 0 or 1 respectively. Next, the subtrees are built recursively using the same rules, but the direction is based on the second bit, etc. For an example; see Figure1.1.
Remark 1. Digital search trees have the weak point that the cost of searching is very high since a comparison in every nodes is necessary.
Remark2. From a practical point of view, digital search trees are not very impor-tant due to the above weak point. However, they are of theoretical interest, since they are closely related to the Lempel-Ziv compression scheme.
R1 R2 R3 R4 R5 R6 0 1 1 0 1 R1 = 000001 · · · R2 = 000110 · · · R3 = 110111 · · · R4 = 011011 · · · R5 = 100001 · · · R6 = 111110 · · · R6 R4 R5 R2 R1 R3 0 1 0 1 0 R6 = 111110 · · · R5 = 100001 · · · R4 = 011011 · · · R3 = 110111 · · · R2 = 000110 · · · R1 = 000001 · · ·
Figure 1.1: Two digital search trees built from the same keys R1, . . . , R6 with
different order. The first tree is built from R1 to R6 and the second one is built
from R6 to R1, so different shapes arise from different orders.
1.1.2
Tries
If n = 0, then the trie is empty; if n = 1, then the trie is composed of a single node holding the input-string; if n > 1, then the trie contains three parts: a root (internal) node used to direct keys to the left or right (when the first bit of the string is 0 or 1, respectively), a left sub-trie of the root for keys whose first bits are 0 and a right sub-trie of the root for keys whose first bits are 1. The two subtrees are constructed recursively as tries (but using subsequent bits successively). For an example; see Figure1.2.
Remark 3. Tries resolve the problem of high search cost of digital search trees, but the space requirement of tries is larger than the one of digital search trees.
1.1.3
PATRICIA tries
PATRICIA (Practical Algorithm To Retrieve Information Coded In Alphanumeric) is a compact representation of a trie, where any node which is an only child is
R1 R2 R4 R5 R3 R6 0 1 0 1 0 1 0 1 0 1 0 R1 = 000001 · · · R2 = 000110 · · · R3 = 110111 · · · R4 = 011011 · · · R5 = 100001 · · · R6 = 111110 · · ·
Figure 1.2: A trie built from the keys R1, . . . , R6. The small circles represent the
internal nodes while the big circles are the external nodes which store the keys. Note that the form of a trie does not depend on the order of keys.
merged with its parent. For an example; see Figure1.3.
Remark 4. The large space requirement of tries is resolved by PATRICIA tries because of suppressing the creation of one-way branching. However, one disad-vantage of PATRICIA tries is a more complex implementation.
1.2
Random model
In probability theory, a sequence of random variables is called independent and identically distributed (iid) if each random variable has the same probability dis-tribution and all are mutually independent.
We call X1, X2, . . . a random string if X1, X2, . . . is an iid sequence of random
variables with P (Xn= 0) = p and P (Xn= 1) = q := 1−p. We also call a digital
tree a random digital tree of size n if it is constructed from n infinite {0, 1}-random strings. A simple classification of random digital trees is as follows: symmetric p = q = 12 and asymmetric p 6= q. Moreover, in the subsequent results, the later case will be further split according to whether log p/ log q is rational or not. Remark5. The above random model is too simplified for practical purposes. More realistic models have been proposed, but their analysis still remains complicated. Moreover, results for the above simple model normally hold for more general models as well. That is why most research has focused on the above simple model.
R1 R2 R4 R5 R3 R6 0 1 0 1 0 1 0 1 0 1 R1 = 000001 · · · R2 = 000110 · · · R3 = 110111 · · · R4 = 011011 · · · R5 = 100001 · · · R6 = 111110 · · ·
Figure 1.3: A compact represetation of the trie (from Figure1.2) where any node which is an only child was merged with its parent.
1.3
Size and the number of 2-protected nodes in tries
1.3.1
Size of tries
The size of a digital tree is defined to be the number of internal nodes. For exam-ple, it is clear that the size of a random PATRICIA trie which contains n strings is n − 1. On the other hand, the size of a random trie is a random variable.
We next give a brief history of the probabilistic analysis of the size of tries, where we mainly focus on asymptotic expansions of moments.
First, the mean was derived by Knuth in 1973; see [12].
As for the variance, it took 15 years until the first analysis was obtained inde-pendently by two group of researchers.
The first group consisted of P. Kirschenhofer and H. Prodinger who gave in 1991 a complicated analysis of the symmetric case (p = q = 1/2) with explicit expressions for involved constants and periodic functions; see [11].
Independently, P. Jacquet and M. Regnier analysed the general case (symmet-ric and asymmet(symmet-ric case) but without explicit expressions for involved constants and periodic functions; for their paper which appeared in 1988 see [9]. One year later, they found some partial results on explicit expressions of involved constants and periodic functions; see [15]. Moreover, we should mention that apart from the variance, also the limit law was derived in these two papers.
Recently, M. Fuchs, H. K. Hwang and V. Zacharovas [4] proposed a general framework for obtaining asymptotic expansions of mean and variance of so-called additive shape parameter in random tries with explicit expressions for periodic functions in the general case. Their results apply to the size and we will introduce
some of them. First, we need the following notation F [G](x) := 1 h X k∈Z\{0}
G(−1 + χk)e2kπix, if log plog q ∈ Q;
0, if log plog q ∈ Q,/ where χk= 2rkπilog p when log plog q = rl with (r, l) = 1.
Theorem 1. The mean of the size in tries satisfies E(Nn) n = 1 h +F [G (N ) 1 ](r log1/pn) + o(1), (1.1)
whereG(N )1 (s) = −(s + 1)Γ(s) and h = −p log p − q log q. Theorem 2. The variance of the size in tries satisfies
V(Nn) n = G(N )2 (−1) h +F [G (N ) 2 ](r log1/pn) + o(1), where G(N )2 (−1) =1 2− 1 h + 2 X j≥2 (−1)j(pj + qj) 1 − pj − qj − 1 h log p X j≥1 4rjπ2 sinh2rjπlog p2, if log p log q ∈ Q; 0, if log plog q ∈ Q/ and fork 6= 0 (when log plog q ∈ Q)
G(N )2 (−1 + χk) =χkΓ(−1 + χk) 1 −χk+ 3 21+χk − 1 h X j∈Z Γ(χj + 1)Γ(χk−j+ 1) − 2X j≥1 (−1)j(j + 1 + χ k)Γ(j + χk)(pj+1+ qj+1) (j + 1)!(j + 1)(1 − pj+1− qj+1) .
Remark 6. From the above results, we see that in the symmetric case (p = q = 1/2), the mean of the size is about 1.443n and the variance is about 0.846n. More-over, in both cases the periodic function has a very small amplitude.
1.3.2
Number of 2-protected nodes in tries
We start with the definition of 2-protected nodes in trees: they are nodes that have distance at least 2 from each leaf. In 2012, J. Gaither, Y. Homma, M. Sellke and M. D. Ward [9] derived an asymptotic expansion of the mean of the number of 2-protected nodes in random tries. Soon after, J. Gaither and M. D. Ward [15] derived an asymptotic expansion of the variance as well.
Theorem 3. The mean of the number of 2-protected nodes in tries satisfies E(Xn(T )) n = pq + 1 h − 1 +F [G (T ) 1 ](r log1/pn) + o(1),
whereG(T )1 (z) is a 1-periodic function.
Remark7. In [9], the above result was stated as E(Xn(T ))
n =
pq + 1
h − 1 + δ(log n) + O(1),
where δ(log n) is a small periodic function (possibly constant). Note that the error term is wrong and was corrected above.
Theorem 4. The variance of the number of 2-protected nodes in tries satisfies V(Xn(T )) n = c1+ c2 − c 2 3+ c4+F [G (T ) 2 ](r log1/pn) + o(1),
whereG(T )2 (z) is a 1-periodic function, c4is a constant (which is0 when log plog q ∈ Q)/
andc1,c2andc3 are given by
c1 = 1 h 2p3q(2p2− 2pq + 5p + 3) (p + 1)3 + 2pq3(2q2− 2pq + 5q + 3) (q + 1)3 + pq 2 − p2q2 4 − 2p p + 1 − 2q q + 1 + 1 2 + h − 2pq 1 − p (p + 1)2 − q (q + 1)2 ! , c2 = 2 h X j≥2 (−1)j (p j+ qj)2 1 − pj− qj pq + 1 − p 2q2(j − 1)j , c3 = pq + 1 h − 1.
Remark8. Again the above result was wrongly stated in [15] as V(Xn(T ))
n = c1+ c2− c
2
where δ1(log n) and δ2(log n) are periodic functions with average value zero.
Apart from the wrong error term, the authors also forgot to pull out the (non-zero) average value from −(δ2(log n))2.
Remark 9. From the above results, we obtain that in symmetric case (p = q = 1/2), the mean of the number of 2-protected nodes in tries is about 0.803n and the variance is about 0.934n.
1.4
Additive shape parameters and main idea of the
analysis
In this thesis, our main goal is the analysis of the number of 2-protected nodes in tries and PATRICIA tries. In fact, 2-protected nodes are just a special case of so-called additive shape parameters. In [4], the authors proposed a general method for the analysis of these shape parameters. We will explain the main ideas of this method in this section. We start with a precise definition of additive shape parameters.
Additive shape parameters of tries are parameters which can be computed re-cursively by computing the shape parameter for the subtrees, adding them up and adding a cost. More precisely, consider a random trie built from n infinite {0, 1}-strings and denote by Xnthe additive shape parameter. Then, by splitting the trie
(see Figure1.4), Xncan be described by
Xn d
= XIn + X
∗
n−In+ Tn, (n ≥ 2), (1.2)
where Xnhas the same distribution as Xn∗, Tn is some fixed sequence of random
variables representing the cost, (Xn), (Xn∗) and (In, Tn) are independent and Inis
the size of the left subtree. Note that by the definition of the trie πn,k = P (In= k) =
n k
pkqn−k,
or in other words, Inhas a binomial distribution with parameter n and p.
The method in [4] was devised for deriving asymptotic expansions of the mo-ments of Xn. The method proceeds in five steps. The first step is to take moments
on both sides of the distributional recurrence for Xn. This gives a recurrence of
the following type
an=
X
0≤k≤n
πn,k(ak+ an−k) + bn
X
InX
∗ n−In
X
n
splitting
Figure 1.4: Splitting the tree into three parts: root, left sub-tree and right sub-tree. The second step is poissonization. For this step, define
˜ f (z) := e−zX n an zn n!, ˜g(z) := e −zX n bn zn n!.
Note that ˜f (z) can be interpreted as an with n replaced by a Poisson random
variable N with parameter z, or more precisely, ˜
f (z) = E(aN).
Now, from the following computation ˜ f (z) : = e−zX n an n!z n = e−zX n X 0≤k≤n πn,k(ak+ an−k) n! z n + e−zX n bn n!z n = e−zX n X 0≤k≤n n kp kqn−ka k n! z n+ e−zX n X 0≤k≤n n kp kqn−ka n−k n! z n+ ˜g(z) = e−zX k≥0 X (n−k)≥0 pka k k! z k qn−k (n − k)!z n−k + e−z X (n−k)≥0 X k≥0 qn−kan−k (n − k)!z n−kp k k!z k+ ˜g(z) = e−zX k≥0 pka k k! z k X (n−k)≥0 qn−k (n − k)!z n−k + e−z X (n−k)≥0 qn−kan−k (n − k)!z n−kX k≥0 pk k!z k+ ˜g(z)
= e−zeqzX k≥0 pkak k! z k+ e−z epz X (n−k)≥0 qn−kan−k (n − k)!z n−k+ ˜g(z) = e−pzX k≥0 ak k!(pz) k+ e−qz X (n−k)≥0 an−k (n − k)!(qz) n−k+ ˜g(z) = ˜f (pz) + ˜f (qz) + ˜g(z), we get a functional equation
˜
f (z) = ˜f (pz) + ˜f (qz) + ˜g(z).
This functional equations describes the moments when n is replaced by N (this is the so-called Poisson model, whereas the original model is called the Bernoulli model).
The third step is doing Mellin transform on both sides of the above functional equation; for an introduction into Mellin transform see Section2.1. First, recall
M [ ˜f (z); s] := Z ∞ 0 ˜ f (z)zs−1ds. Then, we obtain M [ ˜f (z); s] =M [ ˜f (pz); s] +M [ ˜f (qz); s] +M [˜g(z); s] = p−sM [ ˜f (z); s] + q−sM [ ˜f (z); s] +M [˜g(z); s]. Solving forM [ ˜f (z)] yields
M [ ˜f (z); s] = M [˜g(z); s] 1 − p−s− q−s.
The fourth step is using inverse Mellin transform ˜ f (z) = 1 2πi Z ↑ M [ ef (z); s]z−sds = 1 2πi Z ↑ M [˜g(z); s]z−s 1 − p−s− q−sds,
and applying the converse mapping theorem from Section2.1.2to get an asymp-totic expansion of ˜f (z).
Finally, the fifth and last step is depoissonization which is based on the Poisson heuristic
˜
To make this step precise, we will use Cauchy’s integral formula an= n! 2πi I |z|=r z−n−1ezf (z)dz˜ and the saddle-point method; for details see Section2.2.
Finally, we mention that all the above steps can be merged via an = n! 2πi Z ↑ M [˜g(z); s] (1 − p−s− q−s)Γ(n + 1 − s)ds.
This integral is related to Newton sums and therefore Flajolet coined the term Poisson-Mellin-Newton cycle for the whole cycle we just described; see Figure
1.5.
The above five-step procedure is well-suited for obtaining asymptotics expan-sions of moments. So, for the variance, once could use it in order to first derive asymptotic expansions for mean and second moment and then use the definition of the variance
V(Xn) = E(Xn2) − (E(Xn))2.
Note, however, that for the examples from Section1.3, this leads to cancellations since mean and variance are both of linear order and thus (E(Xn))2is of quadratic
order. The cancellations are not easy treatable in many examples as was, e.g., shown by P. Kirschenhofer and H. Prodinger in [11].
A better approach to the variance is carefully defining a poissonized vari-ance in the Poisson model which already incorporates the above cancellations. P. Jacquet and M. Regnier used the following
˜
W (z) := ˜f2(z) − ˜f1(z)2
as poissonized variance. However, for the parameters from Section 1.3, this still leads to cancellations in Step 5 of the above procedure.
In a recent work by M. Fuchs, H.-K. Hwang and V. Zacharovas [8] it was pointed out that a better choice of the poissonized variance for the examples from Section1.3(or more general, for all shape parameters with linear mean and vari-ance) is the following function
˜
V (z) := ˜f2(z) − ˜f1(z)2− z ˜f1(z)2.
We will make use of this poissonized variance in our analysis of 2-protected nodes in tries and PATRICIA tries; see Chapter3and Chapter4.
a
n an = X 0≤k≤n πn,k(ak+ an−k) + bn ˜ f (z) = ˜f (pz) + ˜f (qz) + ˜g(z) M [ ˜f (z); s] = M [˜g(z); s] 1 − p−s− q−s ˜ f (z) = 1 2πi Z ↑ M [˜g(z); s]z−s 1 − p−s− q−sds an = n! 2πi I |z|=r z−n−1ezf (z)dz˜ Recurrence relationPoisson generating function Mellin transform Inverse Mellin transform Analytic de-Poissonization
Chapter 2
Tools
In the previous chapter, we have presented the methodology which we are going to apply in this thesis. Our methodology consisted of five steps, where we used Mellin transform in the third and fourth step and analytic de-Poissonization in the final step. The next two sections will be concerned with an introduction into these two tools, for more about Mellin transform see [2] and for more about analytic de-Poissonization see [4,10].
2.1
Mellin transform
Hjalmar Mellin (1854-1933) was a Finnish mathematician and functional theorist, he gave his name to the Mellin transform which is an integral transform that may be regarded as the multiplicative version of the two-sided Laplace transform.
Mellin transform is often used in number theory and the theory of asymptotic expansions, it is closely related to the Laplace transform and the Fourier trans-form, and the theory of the gamma function and other applied special functions.
In applications, the Mellin transform is widely used in computer science, es-pecially, in the analysis of algorithms because of its scale invariance property and inversion theorem which will be introduced below.
2.1.1
Mellin transform and its inverse transform
Informally, the Mellin transform of a function f (x) is M [f(x); s] = f∗
(s) := Z +∞
0
The domain of the Mellin transform turns out to be a vertical strip in the complex plane. Moreover, the Mellin transform has an inverse
f (x) = 1 2πi
Z c+i∞
c−i∞
f∗(s)x−sds.
In the sequel, we will use the notation hα, βi for the open strip of complex num-bers s = σ + it such that α < σ < β.
We now make the above precise.
Definition 1. Let f (x) be locally Lebesgue integrable over (0, +∞). The Mellin transform off (x) is defined by M [f(x); s] = f∗ (s) := Z +∞ 0 f (x)xs−1dx.
The largest open striphα, βi in which the integral converges is called the funda-mental strip.
The domain of the Mellin transform can be found with the following lemma. Lemma 1. If
f (x)x→0= O(x+ u), f (x) x→+∞= O(xv) withu > v, then f∗(s) exists in the strip h−u, −vi.
Proof. Because of the decompositionR0∞ = R01+R1∞ and from the assumptions f (x)xs−1 x→0= O(x+ u+σ−1) and f (x)xs−1 x→+∞= O(xv+σ−1), so, in order that both
integralsR01 andR1∞converge, u + σ − 1 must be greater than −1 and u + σ − 1 must be less than −1. Thus, −u < σ < −v.
Example 1. The function f (x) = e−xhas Mellin transform M [f(x); s] =Z +∞
0
e−xxs−1dx = Γ(s). (2.1) Moreover, we know that e−x x→0=+ 1 and e−x x→+∞= O(x−b) for any positive numberb. So, the fundamental strip of the Mellin transform is h0, +∞i.
Theorem 5. (Functional properties). Let f (x) be a function whose transform admits the fundamental striphα, βi. Let ρ be a nonzero real number and µ, ν be positive real numbers. Then we have the following relations:
F1 :M [f(µx); s] = µ−sf∗(s), s ∈ hα, βi; F2 :M [xνf (x); s] = f∗(s + ν), s ∈ hα − ν, β − νi; F3 :M [f(xρ); s] = 1 ρf ∗ (s ρ), s ∈ hρα, ρβi; F4 :M [f(x) log x; s] = d dsf ∗ (s), s ∈ hα, βi; F5 :M [ d dxf (x); s] = −(s − 1)f ∗ (s − 1), s ∈ hα∗+ 1, β∗+ 1i. Remark10. By linearity of the transform and F1, we also have
M [X k λkg(µkx); s] = X k λk µs k ! g∗(s),
whenever k ranges over a finite set of indices. Moreover, this formula can usually be extended to infinite sums with the dominating convergence theorem.
Example 2. Consider the function f (x) = e
−x
1 − e−x = e −x
+ e−2x+ e−3x+ · · · which is of the above form withg(x) := e−x. Thus,
f∗(s) = Z +∞ 0 ∞ X k=1 g(kx)xs−1dx = ∞ X k=1 k−s ! Z +∞ 0 g(x)xs−1dx = ζ(s)Γ(s).
Finally, we give the inversion theorem for the Mellin transform. Theorem 6. (Inversion).
(i) Letf (x) be integrable with fundamental strip hα, βi. If c is between α and β andf∗(c + it) is integrable, then the equality
1 2πi
Z c+i∞
c−i∞
hold almost everywhere. Moreover, iff (x) is continuous, then the equality holds everywhere on(0, +∞).
(ii) Letf (x) be locally integrable with fundamental strip hα, βi and be of bounded variation in a neighborhood ofx0. Then, for anyc between α and β,
lim T →∞ 1 2πi Z c+iT c−iT f∗(s)x−sds = f (x + 0) + f (x − 0) 2 .
2.1.2
Direct mapping and converse mapping
There is a very precise correspondence between the asymptotic expansion of a function at 0 (and ∞) and poles of its Mellin transform in a left (resp. right) half-plane.
Before we state this correspondence, we recall some notation. Let φ(s) be meromorphic with pole at s = s0. Recall that φ(s) admits near s = s0 a Laurent
expansion
φ(s) = X
k≥−r
ck(s − s0)k, (2.2)
where r > 0 is the order of the pole. Also recall that X
−r≤k≤−1
ck(s − s0)kis called
the principal part of the Laurent series.
Definition 2. (Singular expansion). Let φ(s) be meromorphic in Ω. A singular expansionE of φ(s) in Ω is a formal sum of all principal parts of all poles of φ(s) inΩ. When E is a singular expansion of φ(s) in Ω, we write
φ(s) E (s ∈ Ω). Example 3. For instance, we have
1 (s − 1)(s − 2)2 1 (s − 1)+ 2 + 3(s − 1) + 4(s − 1) 2+ · · · s=1 + 1 (s − 2)2 − 1 (s − 2)+ 1 − (s − 2) + · · · s=2 , (s ∈ C), because 1 (s − 1)(s − 2)2 s→1 = 1 (s − 1)+ 2 + 3(s − 1) + 4(s − 1) 2 + 5(s − 1)3+ · · · and 1 (s − 1)(s − 2)2 s→2 = 1 (s − 2)2 − 1 (s − 2)+ 1 − (s − 2) + (s − 2) 2 + · · · .
Example 4. (The Gamma function). Recall that the Mellin transform of the func-tione−xis the Gamma function
Γ(s) = Z +∞
0
e−xxs−1dx,
for<s > 0. We know that Γ(s) has poles at the points s = −m with m ∈ N ∪ {0} and we have Γ(s)s→−m∼ (−1) m m! 1 s + m, so that the Gamma function admits
Γ(s) ∞ X k=0 (−1)k k! 1 s + k (s ∈ C) (2.3) as singular expansion in C.
The function ex has a Taylor expansion at x = 0:
e−x= ∞ X k=0 (−1)k k! x k . (2.4)
There is a striking coincidence of coefficients in the Taylor expansion (2.4) of the original function e−x and in the singular expansion (2.3) of the transform Γ(s) expressed by the rule
xk 7→ 1 s + k. This is in fact a completely general phenomenon.
Theorem 7. (Direct mapping). Let f (x) have a transform f∗(s) with nonempty fundamental striphα, βi.
(i) Assume thatf (x) admits as x → 0+ an asymptotic expansion of the form
f (x) = X
(ζ,k)∈A
cζ,kxζ(log x)k+ O(xγ), (2.5)
where the ζ’s satisfy −γ < −ζ ≤ α and the k’s are nonnegative. Then f∗(s) is continuable to a meromorphic function in the strip h−γ, βi where it admits the singular expansion f∗(s) X (ζ,k)∈A cζ,k (−1)kk! (s + ζ)k+1 (s ∈ h−γ, βi).
(ii) Similarly, assume that f (x) admits as x → +∞ an asymptotic expansion of the form (2.5) where now β ≤ −ζ < −γ. Then f∗(s) is continuable to a meromorphic to a meromorphic function in the strip hα, −γi where it admits the singular expansion f∗(s) − X (ζ,k)∈A cζ,k (−1)kk! (s + ζ)k+1 (s ∈ hα, −γi).
Example 5. The function f (x) = (1 + x)−1 has h0, 1i as its fundamental strip. The following two expansion
1 1 + x s→0+ = ∞ X n=0 (−1)nxn and 1 1 + x s→+∞ = ∞ X n=1 (−1)n−1x−n translate into f∗(s) ∞ X n=0 (−1)n s + n (s ∈ h−∞, 1i) and f∗(s) − ∞ X n=1 (−1)n−1 s − n (s ∈ h0, +∞i) which is consistent with the known form,
f∗(s) = π sin πs X n∈Z (−1)n s + n (s ∈ C).
Under a set of mild conditions, a converse to the direct mapping theorem also holds: The singularities of a Mellin transform which is small enough towards ±i∞ encode the asymptotic properties of the original function.
Theorem 8. (Converse mapping). Let f (x) have a Mellin transform f∗(s) with nonempty fundamental striphα, βi.
(i) Assume that f∗(s) admits a meromorphic continuation to the strip hγ, βi for some γ < α with a finite number of poles there, and is analytic on <(s) = γ. Assume also that there exists a real numberη ∈ (α, β) such that
f∗(s) = O(|s|−r) with r > 1, (2.6) when |s| → ∞ in γ < <(s) < η. If f∗(s) admits the singular expansion for
s ∈ hγ, αi, f∗(s) X (ζ,k)∈A dζ,k 1 (s − ζ)k, (2.7)
then an asymptotic expansion off (x) at 0 is f (x) = X (ζ,k)∈A dζ,k (−1)k−1 (k − 1)!x −ζ (log x)k−1 + O(x−γ).
(ii) Similarly, assume that f∗(s) admits a meromorphic continuation to the strip hα, γi for some γ > β and is analytic on <(s) = γ. Assume also that the growth condition (2.6) holds inhη, γi for some η ∈ hα, βi. If f∗(s) admits the singular
expansion (2.7) for<(s) ∈ hη, γi, then an asymptotic expansion of f (x) at ∞ is f (x) = − X (ζ,k)∈A dζ,k (−1)k−1 (k − 1)!x −ζ (log x)k−1 + O(x−γ).
2.1.3
Some other properties
With the converse mapping theorem (Theorem 8), we obtain asymptotic expan-sions of f (x) at 0 and ∞ under the condition (2.6). Now, we explain that the condition can be modified such that the asymptotic expansions hold even in a suitable region in the complex plane.
Theorem 9. If we change the condition (2.6) in Theorem8into f∗(σ + it) = O(e−θ|t|) with − π < θ < π,
then the asymptotic expansions in Theorem8holds in the cone| arg(z)| ≤ θ. Such a result has the advantage that the asymptotic expansion for derivatives of f (z) can be obtained from that of f (z) by differentiation (see [14]).
Theorem 10 (Ritt). Let f (z) be an analytic function in the cone | arg(z)| ≤ θ, where−π < θ < φ. Assume that
f (z) = O(zα)
forz in the cone with α ∈ R. Then, in the slightly smaller cone | arg(z)| ≤ θ − with > 0, we have
f0(z) = O(zα−1).
2.2
Analytic de-Poissonization and JS-admissible
func-tions
In this section, we are going to describe the fifth step from the five-step procedure from Section 1.4. Recall that for this step, we have to find a justification of the
Poisson heuristic ˜ f (n) = e−nX j≥0 aj nj j! ∼ an. For this we need the following definition.
Definition 3. Let ˜f (z) be an entire function. Then we say that ˜f (z) is JS-admissible and write ˜f ∈ J S (or more precisely, ˜f ∈ J Sα,β , α, β ∈ R) if for some 0 < θ < π/2 and |z| ≥ 1 the following two conditions hold.
(I) (Polynomial growth inside a sector) Uniformly for | arg(z)| ≤ θ ˜
f (z) = O(|z|α log+|z|β) , (2.8)
wherelog+x := log(1 + x).
(O) (Exponential bound) Uniformly for θ ≤ | arg(z)| ≤ π
f (z) := ezf (z) = O˜ (1−ε)|z| , (2.9) for someε > 0.
Since the conditions of admissibility are strong, we can now indeed justify the Poisson heuristic.
Proposition 1. If ˜f ∈J Sα,β , thenansatisfies the asymptotic expansion
an = X 0≤j<2k ˜ f(j)(n) j! τj(n) + O n α−klogβn , (2.10) fork = 0, 1, . . . , where the τj’s are polynomials ofn of degree bj/2c given by
τj(n) = X 0≤l≤j j l (−n)l n! (n − j + 1)!, (j = 0, 1, . . .). Remark11. Note that we have the identity
an = X j≥0 ˜ f(j)(n) j! τj(n)
for every entire function ˜f (z); see [8]. It is the asymptotic nature (2.10) that requires more regularity conditions.
Due to Proposition 1, in order to carry out the fifth step, we only have to check JS-admissibility. Note, however, that ˜f (z) is only given via the functional equation
˜
f (z) = ˜f (pz) + ˜f (qz) + ˜g(z).
Checking that ˜f (z) is JS-admissible is reduced to checking the same for ˜g(z) because of the following result (the proof can be found in [4])
Proposition 2. Let ˜f and ˜g be entire functions satisfying ˜
f (z) = ˜f (pz) + ˜f (qz) + ˜g(z) withf (0) given. Then
˜
f ∈J S if and only if g ∈˜ J S
Remark12. Proposition2is a generalization of the following real-valued asymp-totic transfer (results of this type are often called master theorem in theoretical computer science) : if ˜ f (x) = ˜f (px) + ˜f (qx) + ˜g(x), where ˜ g(x) = O(xα(log+x)β+ 1) with α > 0, then ˜ f (x) = O(x), if α < 1; O(xα(log +x)β+1), if α = 1; O(xα(log +x)β), if α > 1.
Finally checking JS-admissibility of ˜g(z) is simple because of the following closure properties (for the proof see [8])
Proposition 3. Let m be a non-negative integer and α ∈ (0, 1). (i)zm, e−αz ∈J S .
(ii) If ˜f ∈J S , then P ˜f ∈J S for any polynomial P (z). (iii) If ˜f ∈J S , then ˜f (αz) ∈ J S .
(iv) If ˜f , ˜g ∈J S , then ˜f + ˜g ∈J S .
(v) If ˜f , ˜g ∈J S , then ˜f (αz), ˜g((1 − α)z) ∈J S . (vi) If ˜f ∈J S , then ˜f(m) ∈J S .
Chapter 3
The number of 2-protected nodes in
tries
Let Xn(T )be the number of 2-protected nodes in a random trie built from n records.
Then, we have, for n ≥ 2, Xn(T )=d
(
Xn−1(T ), when In = 1 or In= n − 1;
XI(T )n + Xn−I(T )∗n+ 1, otherwise, (3.1) where notation is as in Section 1.4 and initial conditions are X0(T ) = X1(T ) = 0. Note that this can be rewritten to (1.2) with
Tn =
(
0, when In = 1 or In= n − 1;
1, otherwise.
3.1
The mean of the number of 2-protected nodes in
tries
Let anbe the mean of the number of 2-protected nodes. Then, by taking moments
on both sides of (3.1), we obtain an= X 0≤k≤n n k pkqn−k(ak+ an−k) + 1 − npqn−1− npn−1q , (n ≥ 3).
Note that if we set bn = 0, when n = 0 or 1; 1 − 2pq, when n = 2; 1 − npqn−1− npn−1q, otherwise,
then, we have
an =
X
0≤k≤n
πn,k(ak+ an−k) + bn, (n ≥ 0).
Next, we denote by ˜f1(z) and ˜g1(z) the Poisson generating functions of anand
bn. Then, ˜ f1(z) = ˜f1(pz) + ˜f1(qz) + ˜g1(z), where ˜ g1(z) = e−z X n≥0 bn n!z n = e−zX n≥3 1 − npqn−1− npn−1q n! z n+ e−z1 − 2pq 2 z 2 = e−z X n≥3 1 n!z n−X n≥3 npqn−1 n! z n−X n≥3 npn−1q n! z n+ 1 − 2pq 2 z 2 ! = e−z X n≥0 zn n! − pz X (n−1)≥0 (qz)n−1 (n − 1)!− qz X (n−1)≥0 (pz)n−1 (n − 1)! − 1 + pqz 2 = e−z ez− pzeqz− qzepz − 1 + pqz2 = 1 − e−z+ pqz2e−z− pze−pz− qze−qz.
The third step is applying Mellin transform. Therefore, observe that from Remark12, we have
˜ f1(z) =
O(z1+ε), as z → ∞;
O(z2), as z → 0+,
where ε > 0. Hence the Mellin transform of ˜f1(z) exists in the strip h−2, −1i.
Applying Mellin transform yields
F1(T )(s) =M [ ˜f1(z); s] = G(T )1 (s) 1 − p−s− q−s, where G(T )1 (s) =M [˜g1(z); s] = Z +∞ 0 (1 − e−z)zs−1dz + Z +∞ 0 pqe−zzs+1dz − Z +∞ 0 pe−pzzsdz − Z +∞ 0 pe−pzzsdz
= −Γ(s) + pqΓ(s + 2) − p−sΓ(s + 1) − q−sΓ(s + 1) = Γ(s) −1 + pqs(s + 1) − p−ss − q−ss . Because ˜ g1(z) z→0+ = O(z2) and ˜g1(z) z→+∞ = O(z0),
we get that G(T )1 (s) has fundamental strip h−2, 0i. Plugging the expression for G(T )1 (s) into the one for F1(T )(s), we obtain
F1(T )(s) = G (T ) 1 (s) 1 − p−s− q−s (3.2) = Γ(s) (−1 + pqs(s + 1) − p −ss − q−ss) 1 − p−s− q−s .
In order to apply inverse Mellin transform, we have to understand the sin-gularities of F1(T )(s). Therefore, we need the following result on the zeros of 1 − p−s− q−s
; see [3].
Lemma 3.1.1. The roots of 1 − p−s− q−s are all simple and have the following
properties.
(i) There are no roots with<(s) < −1.
(ii) On the line<(s) = −1, the set of all roots is given by (
{−1}, if log plog q 6∈ Q; {−1 + χk : k ∈ Z}, if log plog q ∈ Q.
(iii) If<(s) > −1, then the roots are uniformly separated, i.e., there exists an > 0 such that for all roots s1ands2, we have that|s1− s2| ≥ ε. Moreover,
1−p−s−q−sis uniformly bounded away from zero for alls having a distance
of at leastε/2 to any root.
Now, recall that we know that G(T )1 (s) exists in the strip h−2, 0i. By the above lemma, all zeros of 1 − p−s − q−s generate simple poles and thus F(T )
1 (s) is
meromorphic in h−2, −1 + εi.
Let A = {λ1, λ2, . . .} be the simple poles of F (T )
1 (s) in −1 ≤ <(s) < −1 + ε.
We know that all poles come from zeros of 1 − p−s− q−s
. In order to compute the residue, we let
1
1 − p−s− q−s =
a s − λk
where a = lim s→λk s − λk 1 − p−s− q−s = lims→λ k 1 p−slog p + q−slog q = 1 p−λklog p + q−λklog q. Moreover, we have G(T )1 (s) = G(T )1 (λk) + G(T ) 0 1 (λk)(s − λk) + · · · .
This gives the following singularity expansion of F1(T )(s) F1(T )(s) X A G(T )1 (λk) p−λklog p + q−λklog q(s − λk) −1 .
Now, we can apply Theorem8. Note that assumption (2.6) of this theorem is satisfied due to the following well-known decay property of the Gamma function
|Γ(σ + it)| ∼√2π|t|σ−1/2e−π|t|/2. (3.3) Applying Theorem8yields
˜ f1(z) = − X A G(T )1 (λk) p−λklog p + q−λklog qz −λk + O(z1−ε).
We let B ⊆ A be the poles with <(s) = −1. Then, ˜ f1(z) = − X B G(T )1 (λk) p−λklog p + q−λklog qz −λk −X A\B G(T )1 (λ∗k) p−λ∗ klog p + q−λ ∗ klog q z−λ∗k+ O(z1−ε)
Because −<(λ∗k) < 1, we obtain |z−λ∗k| = o(z). Thus, by the dominated
conver-gence theorem ˜ f1(z) = − X B G(T )1 (λk) p−λklog p + q−λklog qz −λk+ o(z) = −G (T ) 1 (−1) p log p + q log qz − X B\{−1} G(T )1 (λk) p−λklog p + q−λklog qz −λk+ o(z), (3.4)
where G(T )1 (−1) = lim s→−1Γ(s) −1 + pqs(s + 1) − p −s s − q−ss = pq + 1 − h
with h = −p log p − q log q. Observe that due to (3.3), (3.4) holds also in a cone as explained in Section2.1.3.
Finally, we apply depoissonization. Therefore, note that by the explicit form of ˜g1(z) and Proposition3, we obtain that ˜g1(z) ∈ J S and by Proposition 2,
˜
f1(z) ∈J S as well. Thus, from Proposition1, we get the same result as already
stated in Section1.3.2,
Theorem 11. The mean of the number of 2-protected nodes in tries satisfies E(Xn(T )) n = pq + 1 − h h +F [G (T ) 1 ](r log1/pn) + o(1), (3.5)
where fork 6= 0 (when log plog q ∈ Q)
G(T )1 (−1 + χk) = Γ(−1 + χk)χk(χkpq − pq − 1).
Figure 3.1: A plot of (pq + 1 − h)/h which is the average value of the main term of E(Xn(T ))/n.
Remark 13. Comparing with Theorem 3, note that we also obtained an explicit expression of the periodic function. This periodic function can be used to compute c4 in Theorem 4. More precisely, the authors in [7] showed that c4 is the 0-th
Fourier coefficient ofF[G(T )1 ](r log1/pn)0
2
. Thus, our expression above yields c4 = − 2 h2 X j≥1 2rjπ2 log p sinh2rjπlog p2 p2q2 2rjπ log p 2 + p2q2 + 2pq + 1 ! .
Using Maple, we obtain for p = q = 1/2
c4 ≈ −6.8104084468540644133496087246209050829235209008368 · 10−10
which is very small.
Remark 14. For a plot of the average value of E(Xn(T ))/n see Figure 3.1. Note
that the average value becomes minimal if p = q = 1/2. This is intuitively clear because in the asymmetric case nodes with one-way branching (which are all 2-protected) become very likely.
3.2
The variance of the number of 2-protected nodes
in tries
We start by considering the second moment of Xn(T ). Therefore, we square and
take moments on the both sides of (3.1). This yields E((Xn(T ))2) = n X k=0 P (In = k) E(XI(T )n ) + E(X (T ) n−In) + E(Tn|In = k) 2 = n X k=0 πn,k E((X (T ) k ) 2 ) + E((Xn−k(T )) 2) + 1 − npqn−1− npn−1q + 2 n X k=0 πn,kE(Xk(T ))E(X (T ) n−k) + 2 n X k=0 πn,k E(X (T ) k ) + E(X (T ) n−k) E(Tn|In = k), (n ≥ 3). (3.6) Next, we let sn:= E((Xn(T ))2). Then,
sn = n X k=0 πn,k(sk+ sn−k) + bn+ 2 n X k=0 πn,kakan−k + 2 n X k=0 πn,k(ak+ an−k)E(Tn|In = k), (n ≥ 0). (3.7)
As before, the next step is poissonization. Let ˜f2(z) be the Poisson generating
functions of sn. Then,
˜
where ˜h2(z) is equal to 2e−zX n≥0 X 0≤k≤n πn,k(ak+ an−k)E(Tn|In= k) zn n! =2e−zX n≥3 X 0≤k≤n πn,k(ak+ an−k) − πn,1(a1+ an−1) − πn,n−1(an−1+ a1) ! zn n! + 2e−z X 0≤k≤2 π2,k(ak+ a2−k)E(Tn|I2 = k) z2 2! =2e−zX n≥3 X 0≤k≤n πn,k(ak+ an−k) zn n! − 2e −zX n≥3 (πn,1+ πn,n−1)(a1+ an−1) zn n! + 2e−z(π2,0+ π2,2)a2 z2 2! =2e−zX n≥2 X 0≤k≤n n k pkqn−k(ak+ an−k) zn n! − 2e−zX n≥3 (npqn−1+ npn−1q)(a1+ an−1) zn n! − 2e −z π2,1(a1+ a1) z2 2! =2e−zX n≥0 X 0≤k≤n pkqn−k(ak+ an−k) zn k!(n − k)! − 2e−zX n≥3 (pqn−1+ pn−1q)an−1 zn (n − 1)! =2e−zX n≥0 X 0≤k≤n ak (pz)k k! (qz)n−k (n − k)! + 2e −zX n≥0 X 0≤k≤n an−k (pz)k k! (qz)n−k (n − k)! − 2e−z X n−1≥2 pzan−1 (qz)n−1 (n − 1)!− 2e −z X n−1≥2 qzan−1 (pz)n−1 (n − 1)! =2e−zX k≥0 ak (pz)k k! X n≥k (qz)n−k (n − k)! + 2e −zX k≥0 ak (qz)k k! X n≥k (pz)n−k (n − k)! − 2e−zpz X n−1≥0 an−1 (qz)n−1 (n − 1)!− 2e −z qz X n−1≥0 an−1 (pz)n−1 (n − 1)! =2 ˜f1(pz) + 2 ˜f1(qz) − 2pze−pzf˜1(qz) − 2qze−qzf˜1(pz).
Recall the poissonized variance from Section2.2: ˜
VX(T )(z) := ˜f2(z) − ˜f1(z)2− z ˜f20(z) 2
which satisfies the functional equation ˜ VX(T )(z) = ˜VX(T )(pz) + ˜VX(T )(qz) + ˜VT(z) + ˜φ1(z) + ˜φ2(z), (3.8) where ˜VT(z) is given by ˜ g1(z) − ˜g1(z)2− z˜g10(z) 2 =˜g1(z) (1 − ˜g1(z)) − z˜g01(z) 2 = 1 − e−z+ pqz2e−z− pze−pz− qze−qz e−z− pqz2e−z + pze−pz + qze−qz − z e−z+ 2zpqe−z− pqz2e−z− pe−pz + p2ze−pz − qe−qz+ q2ze−qz2 and ˜φ1(z) is defined by ˜ h2(z) − 2˜g1(z) ˜f1(pz) + ˜f1(qz) − 2z˜g10(z)p ˜f10(pz) + q ˜f10(qz) =2 ˜f1(pz) + 2 ˜f1(qz) − 2pze−pzf˜1(qz) − 2qze−qzf˜1(pz) − 2 1 − e−z+ pqz2e−z − pze−pz − qze−qz ˜ f1(pz) + ˜f1(qz) − 2z e−z+ 2pqze−z− pqz2e−z− pe−pz+ p2ze−pz− qe−qz+ q2ze−qz ·p ˜f10(pz) + q ˜f10(qz) =2(e−z− pqz2e−z
+ pze−pz) ˜f1(pz) + 2(e−z− pqz2e−z+ qze−qz) ˜f1(qz)
− 2z e−z+ 2pqze−z− pqz2e−z− pe−pz+ p2ze−pz− qe−qz+ q2ze−qz ·p ˜f10(pz) + q ˜f10(qz). Finally, ˜ φ2(z) := pqz ˜f10(pz) − ˜f 0 1(qz) 2 .
Before we apply Mellin transform observe that from (3.4) and Ritt’s theorem, ˜
VT(z) + ˜φ1(z) + ˜φ2(z) = O(z), as z → ∞.
Thus, by Remark12, the Mellin transform of ˜VX(T )(z) exists in the strip h−2, −1i. Now, applying Mellin transform gives
1 − p−s− q−s M [ ˜V(T ) X (z); s] =M [ ˜VT(z); s] +M [˜φ1(z); s] +M [˜φ2(z); s]. We denote by G(T )2 (s) = Φ(s) + Φ1(s) + Φ2(s), where Φ(s) = M [ ˜VT(z); s], Φ1(s) =M [˜φ1(z); s] and Φ2(s) =M [˜φ2(z); s]. Then, F2(T )(s) = G (T ) 2 (s) 1 − p−s− q−s,
where
F2(T )(s) :=M [ ˜VX(T )(z); s].
We next discuss the fundamental strip of G(T )2 (s). First observe that ˜
VT(z), ˜φ1(z) =
O(z−b), as z → ∞;
O(z2), as z → 0+.
for arbitrary b > 0. Thus the fundamental strip of Φ(s) and Φ1(s) is h−2, ∞i. As
for Φ2(s), it was proved in [4] that this function has fundamental strip h−2, −1i
and is analytic on the line <(σ) = −1.
Next, we apply again Theorem8(that condition (2.6) is satisfied will become clear from the explicit expressions for G(T )2 (s) below). This yields
˜ VX(T )(z) = − G (T ) 2 (−1) p log p + q log qz − X B\{−1} G(T )2 (λk) p−λklog p + q−λklog qz −λk+ o(z).
Note that this again holds in some cone.
Finally, we apply the theory of JS-admissibility and obtain V(Xn(T )) n = G(T )2 (−1) h +F [G (T ) 2 ](r log1/pn) + o(1).
We conclude this section by computing an explicit expression for G(T )2 (s) = Φ(s) + Φ1(s) + Φ2(s)
at s = −1 + χk(note that only k = 0 makes sense in the case log plog q ∈ Q)/
First, we compute Φ(s): Φ(s) =M [ ˜VT(z); s] = Z +∞ 0 1 − e−z+ pqz2e−z− pze−pz − qze−qz·e−z− pqz2e−z + pze−pz+ qze−qzzs−1dz − Z +∞ 0 ˜ g10(z)2zsdz =Γ(s + 4) −2−s−4p2q2 + Γ(s + 3) 2p2q(1 + p)−s−3+ 2pq2(1 + q)−s−3 + Γ(s + 2) −3pq + 2−s−1pq − 2−s−2p−s− 2−s−2q−s + Γ(s + 1) p−s+ q−s− 2p(1 + p)−s−1− 2q(1 + q)−s−1 + Γ(s) 1 − 2−s − Z +∞ 0 ˜ g10(z)2zsdz,
whereR0+∞g˜10(z)2zsdz is given by Γ(s + 5) −2−s−5p2q2 − Γ(s + 4) 2−s−2p2q2+ 2p3q(1 + p)−s−4+ 2pq3(1 + q)−s−4 + Γ(s + 3)(2p2q + 4p3q)(1 + p)−s−3+ (2pq2+ 4pq3)(1 + q)−s−3 + 2p2q2+ 2−s−3(p1−s+ p1−s) − 2−s−2pq + 2−s−1p2q2 + Γ(s + 2)(2p2− 4p2q)(1 + p)−s−2 + (2q2− 4pq2)(1 + q)−s−2 − 2−s−1(p1−s+ q1−s) − 2p2q − 2pq2+ 2−spq + Γ(s + 1) 2pq + 2−1−s(1 + p1−s+ q1−s) − 2p(1 + p)−s−1− 2q(1 + q)−s−1 . (The reason why we do not plug the last integral into the above expression for Φ(s) will become clear below.) In particular, when s = −1 + χk, we obtain the
following result: if k 6= 0 Φ(−1 + χk) =Γ(3 + χk) −2−3−χkp2q2 + Γ(χk+ 2) 2p2q(1 + p)−2−χk+ 2pq2(1 + q)−2−χk + Γ(χk+ 1) −3pq + 2−χkpq − 2−1−χk + Γ(χk) 1 − 2p(1 + p)−χk − 2q(1 + q)−χk + Γ(χk− 1) 1 − 21−χk − Z +∞ 0 ˜ g10(z)2z−1+χkdz, and if k = 0 Φ(−1) = 2p 2q (1 + p)2 + 2pq2 (1 + q)2 − 2pq − p2q2 4 + 1 2− p log p − q log q + 2p log(1 + p) + 2q log(1 + q) − 2 log 2 −
Z +∞
0
˜
g10(z)2z−1dz. Next, we turn to Φ1(s) which is the Mellin transform of φ1(z). We first rewrite
φ1(z) before we compute its Mellin transform.
φ1(z) =2 e−z− pqz2e−z ˜ f1(pz) + ˜f1(qz) + 2pze−pzf˜1(pz) + 2qze−qzf˜1(qz) − 2z˜g10(z)p ˜f10(pz) + q ˜f10(qz) =2 e−z− pqz2e−z 1 2πi Z (−1−ε) G(T )1 (w)(p−w+ q−w) 1 − p−w− q−w z −w dw !
+ 2e−pz 1 2πi Z (−1−ε) G(T )1 (w)p−w+1 1 − p−w− q−wz −w+1 dw ! + 2e−qz 1 2πi Z (−1−ε) G(T )1 (w)q−w+1 1 − p−w− q−wz −w+1 dw ! − 2˜g10(z) 1 2πi Z (−1−ε) G(T )1 (w)(p−w+ q−w)(−w) 1 − p−w− q−w z −w dw ! .
Now, we shift the line of integration from −1 − ε to −∞. Note that G(T )1 (z) has poles at −2, −3, −4, · · · . We set K1(s) := −1 + pqs(s + 1) − p−ss − q−ss. Then,
by using the residue theorem, we have φ1(z) =2 e−z− pqz2e−z X `≥2 (−1)` `! K1(−`)(p`+ q`) 1 − p`− q` z ` + 2e−pzX `≥2 (−1)` `! K1(−`)p`+1 1 − p`− q`z `+1 + 2e−qzX `≥2 (−1)` `! K1(−`)q`+1 1 − p`− q`z `+1 − 2˜g10(z)X `≥2 (−1)` `! K1(−`)`(p`+ q`) 1 − p`− q` z ` =2X `≥2 (−1)` `! K1(−`) 1 − p`− q` e−z− pqz2e−z (p`+ q`)z`+ e−pz p`+1z`+1 + e−qzq`+1z`+1− ˜g10(z)`(p`+ q`)z`.
Thus, its Mellin transform becomes Φ1(s) =M [φ1(z); s] =2X `≥2 (−1)` `! K1(−`) 1 − p`− q` Z ∞ 0 e−z− pqz2e−z (p`+ q`)z` + e−pzp`+1z`+1+ e−qzq`+1z`+1− ˜g01(z)`(p`+ q`)z` zs−1dz =2X `≥2 (−1)` `! K1(−`) 1 − p`− q` (p`+ q`) Z ∞ 0 e−z− pqz2e−z zs+`−1dz + p`+1 Z ∞ 0 e−pzzs+`dz + q`+1 Z ∞ 0 e−qzzs+`dz − `(p`+ q`) Z ∞ 0 ˜ g10(z)zs+`−1dz
=2X `≥2 (−1)` `! K1(−`) 1 − p`− q` (p`+ q`) (Γ(s + `) − pqΓ(s + ` + 2)) + p−sΓ(s + ` + 1) + q−sΓ(s + ` + 1) − `(p`+ q`)2pqΓ(s + ` + 1) + Γ(s + `) − pqΓ(s + ` + 2) − p−`−s+1Γ(s + `) − q−`−s+1Γ(s + `) + p−`−s+1Γ(s + ` + 1) + q−`−s+1Γ(s + ` + 1) . So, when s = −1 + χk Φ1(−1 + χk) =2 X `≥2 (−1)` `! K1(−`) 1 − p`− q` pq(p`+ q`)(` − 1)Γ(χk+ ` + 1) + 1 − `(p`+ q`)(2pq + p−`+2+ q−`+2) Γ(χk+ `) + (p`+ q`)(1 − ` + p−`+2` + q−`+2`)Γ(χk+ ` − 1) . Remark15. The reader should note that the above series representation does not converge in the usual sense. However, convergence is granted if one uses Abel summability and indeed the Abel sum gives the correct result (an explanation for this will be given at the end of this section). Thus, from now on, convergence of series will always be understood to be in the sense of Abel summability.
Finally, we consider Φ2(s): Φ2(s) =M [φ2(z); s] =M [pqz ˜f10(pz) − ˜f10(qz)2; s] =pq 2πi Z (−12) M [ ˜f10(pz) − ˜f10(qz); w]M [z ˜f10(pz) − ˜f10(qz); s − w]dw =pq 2πi Z (−12) (1 − w)G(T )1 (w − 1) (p−w− q−w) 1 − p1−w − q1−w · (w − s)G (T ) 1 (s − w) (pw−s−1− qw−s−1) 1 − pw−s− qw−s dw,
so, we know that when s = −1 + χk
Φ2(−1 + χk) = pq 2πi Z (−12) (p−w− q−w) (pw− qw) (1 − p1−w − q1−w) (1 − p1+w− q1+w)(1 − w) · G(T )1 (w − 1)(1 + w − χk)G(T )1 (−1 − w + χk)dw
= 1 2πi Z (0)+ 1 1 − p1−w− q1−w + p1+w+ q1+w 1 − p1+w− q1+w (1 − w) · G(T )1 (w − 1)(1 + w − χk)G (T ) 1 (−1 − w + χk)dw = 1 2πi Z (0)+ 1 1 − p1−w− q1−w(1 − w)G (T ) 1 (w − 1) · (1 + w − χk)G (T ) 1 (−1 − w + χk)dw + 1 2πi Z (0)+ p1+w + q1+w 1 − p1+w− q1+w(1 − w)G (T ) 1 (w − 1) · (1 + w − χk)G (T ) 1 (−1 − w + χk)dw :=P1+ P2,
where P1 and P2 is the first term and second term of Φ2(−1 + χk), respectively,
and R(0)+ is the integral along the line <(w) = 0 with a small indentation to the
right at poles. In the sequel, we will mainly focus on the case log plog q ∈ Q. The irrational case is treated similarly.
By the change of variables w 7→ χk − w and then by moving the line of
integration to the right, we have P1 = 1 2πi Z (0)− (1 + w − χk)G (T ) 1 (−w − 1 + χk)(1 − w)G (T ) 1 (w − 1) 1 − p1+w− q1+w dw = − 1 h X j∈Z (χj − 1)G (T ) 1 (χj− 1)(−1 + χk−j)G (T ) 1 (−1 + χk−j) + 1 2πi Z (0)+ (1 + w − χk)G (T ) 1 (−w − 1 + χk)(1 − w)G (T ) 1 (w − 1) 1 − p1+w − q1+w dw.
The last integral equals 1 2πi Z (0)+ (1 + w − χk)G (T ) 1 (−w − 1 + χk)(1 − w)G (T ) 1 (w − 1)dw + P2. Note that 1 2πi Z (0)+ (1 + w − χk)G(T )1 (−w − 1 + χk)(1 − w)G(T )1 (w − 1)dw = Z ∞ 0 ˜ g10(z)2z−1+χkdz.
Combining these relations, we get Φ2(−1 + χk) =2P2− 1 h X j∈Z (χj − 1)G (T ) 1 (χj− 1)(−1 + χk−j)G (T ) 1 (−1 + χk−j) + Z ∞ 0 ˜ g10(z)2z−1+χkdz, where P2 = 1 2πi Z (0)+ p1+w+ q1+w 1 − p1+w− q1+w(1 − w)G (T ) 1 (w − 1) · (1 + w − χk)G(T )1 (−1 − w + χk)dw.
Now, we shift the line of integration of P2 from (0)+to ∞. Note that G (T ) 1 (−1 −
w + χk) has poles at w = 1 + χk, 2 + χk, 3 + χk, · · · and recall that K1(s) :=
−1 + pqs(s + 1) − p−ss − q−ss. Then, by using the residue theorem, we have
P2 = X `≥1 (−1)` `! p1+`+ q1+` 1 − p1+`− q1+`K1(` + χk− 1)K1(−1 − `)Γ(` + χk).
Now, we can return to G(T )2 (−1 + χk). Putting everything together yields that
G(T )2 (−1 + χk) for k 6= 0 is given by Φ(−1 + χk) + Φ1(−1 + χk) + Φ2(−1 + χk) =Γ(3 + χk) −2−3−χkp2q2 + Γ(χk+ 2) 2p2q(1 + p)−2−χk + 2pq2(1 + q)−2−χk + Γ(χk+ 1) −3pq + 2−χkpq − 2−1−χk + Γ(χk) 1 − 2p(1 + p)−χk− 2q(1 + q)−χk + Γ(χk− 1) 1 − 21−χk + 2X `≥2 (−1)` `! K1(−`) 1 − p`− q` pq(p`+ q`)(` − 1)Γ(χk+ ` + 1) + 1 − `(p`+ q`)(2pq + p−`+2+ q−`+2) Γ(χk+ `) + (p`+ q`)(1 − ` + p−`+2` + q−`+2`)Γ(χk+ ` − 1) + 2X `≥1 (−1)` `! p1+`+ q1+` 1 − p1+`− q1+`K1(` + χk− 1)K1(−1 − `)Γ(` + χk) − 1 h X j∈Z (χj− 1)G (T ) 1 (χj − 1)(−1 + χk−j)G (T ) 1 (−1 + χk−j),
and for k = 0, we obtain G(T )2 (−1) = 2p 2q (1 + p)2 + 2pq2 (1 + q)2 − 2pq − p2q2 4 + 2p log(1 + p) + 2q log(1 + q) +1 2 + h − 2 log 2 + 2 X `≥2 (−1)` K1(−`) 1 − p`− q` (p `+ q`) pq` − 3pq − p−`+2− q−`+2+ 1 − ` + p −`+2` + q−`+2` `(` − 1) +1 ` ! + 2X `≥1 (−1)` ` p1+` + q1+` 1 − p1+`− q1+`K1(` − 1)K1(−1 − `) − 1 h X j∈Z\{0} (χj − 1)G (T ) 1 (χj− 1)(−1 − χj)G (T ) 1 (−1 − χj) − 1 h(pq + 1 − h) 2 .
Finally, we further simplify the second last term of G(T )2 (−1) (which we call M∗). M∗ is equal to − 1 h X j∈Z\{0} (χj − 1)G (T ) 1 (χj− 1)(−1 + χ−j)G(T )1 (−1 − χj) = − 1 h X j∈Z\{0} (χj − 1)K1(χj − 1)(−1 − χj)K1(−1 − χj)Γ(χj− 1)Γ(−1 − χj).
We know that K1(χj− 1) = χj(pq(χj − 1) − 1) and K1(−1 − χj) = χj(pq(χj+
1) + 1), So we can rewrite the previous expression into −1
h X
j∈Z\{0}
(pq(χj − 1) − 1) χj(pq(χj + 1) + 1) Γ(χj+ 1)Γ(−χj).
Next, recall that Γ(1 − z)Γ(z) = π/ sin πz which yields −1 h X j∈Z\{0} π sin π(−χj) (pq(χj− 1) − 1) χj(pq(χj+ 1) + 1) =1 h X j∈Z\{0} πχj sin πχj (pq(χj − 1) − 1) (pq(χj+ 1) + 1) .
Finally, we substitute 2rjπilog p for χj, and obtain M∗ = − 1 h X j∈Z\{0} 2rjπ2 log p sinh2rjπlog p2 p2q2 2rjπ log p 2 + p2q2+ 2pq + 1 ! = − 2 h X j≥1 2rjπ2 log p sinh 2rjπ2 log p p 2q2 2rjπ log p 2 + p2q2+ 2pq + 1 ! . Overall, we have proved the following result,
Theorem 12. The variance of the number of 2-protected nodes in tries satisfies V(Xn(T )) n = G(T )2 (−1) h +F [G (T ) 2 ](r log1/pn) + o(1),
whereG(T )2 (−1 + χk) for k 6= 0 (when log plog q ∈ Q) is given by
Γ(3 + χk) −2−3−χkp2q2 + Γ(χk+ 2) 2p2q(1 + p)−2−χk + 2pq2(1 + q)−2−χk + Γ(χk+ 1) −3pq + 2−χkpq − 2−1−χk + Γ(χk) 1 − 2p(1 + p)−χk− 2q(1 + q)−χk + Γ(χk− 1) 1 − 21−χk + 2X `≥2 (−1)` `! K1(−`) 1 − p`− q` pq(p`+ q`)(` − 1)Γ(χk+ ` + 1) + 1 − `(p`+ q`)(2pq + p−`+2+ q−`+2) Γ(χk+ `) + (p`+ q`)(1 − ` + p−`+2` + q−`+2`)Γ(χk+ ` − 1) + 2X `≥1 (−1)` `! p1+`+ q1+` 1 − p1+`− q1+`K1(` + χk− 1)K1(−1 − `)Γ(` + χk) − 1 h X j∈Z (χj − 1)G (T ) 1 (χj− 1)(−1 + χk−j)G (T ) 1 (−1 + χk−j) andG(T )2 (−1) is given by 2p2q (1 + p)2 + 2pq2 (1 + q)2 − 2pq − p2q2 4 + 2p log(1 + p) + 2q log(1 + q) +1 2 + h − 2 log 2 + 2 X `≥2 (−1)` K1(−`) 1 − p`− q` (p `+ q`) pq` − 3pq
− p−`+2− q−`+2+ 1 − ` + p −`+2` + q−`+2` `(` − 1) +1 ` ! + 2X `≥1 (−1)` ` p1+`+ q1+` 1 − p1+`− q1+`K1(` − 1)K1(−1 − `) − 1 h(pq + 1 − h) 2 − 1 h log p X j≥1 4rjπ2 sinh2rjπlog p2 p2q2 2rjπ log p 2 + (pq + 1)2 ! , if log plog q ∈ Q; 0, if log plog q ∈ Q./ Remark 16. Comparing with Theorem 4, we obtained an explicit expression of the period function and our expression of G(T )2 (−1) is also different. Thus, we have G(T )2 (−1)/h = c1+ c2− c23+ c4and this identity can also be proved directly
(however, the computation is long). More precisely, we have (c1 + c2)h = 2p2q (1 + p)2 + 2pq2 (1 + q)2 − 2pq − p2q2 4 + 2p log(1 + p) + 2q log(1 + q) + 1 2+ h − 2 log 2 + 2 X `≥2 (−1)` K1(−`) 1 − p`− q` (p `+ q`) pq` − 3pq − p−`+2− q−`+2+1 − ` + p −`+2` + q−`+2` `(` − 1) + 1 ` ! + 2X `≥1 (−1)` ` p1+`+ q1+` 1 − p1+`− q1+`K1(` − 1)K1(−1 − `)).
Finally, we remark that if we consider the symmetric case (p = q = 1/2), our analysis will become much easier because ˜φ2(z) equals to 0. This yields the
following result with a somewhat different expression for the periodic function. Theorem 13. The variance of the number of 2-protected nodes in symmetric tries satisfies V(Xn(T )) n = G(T )2 (−1) log 2 +F [G (T ) 2 ](r log2n) + o(1),
where fork 6= 0 (when log plog q ∈ Q)
=−Γ(χk+ 4) 256 + Γ(χk+ 3) 3 128 + 2 · 3 −χk−3 − Γ(χk+ 2) · 3 16+ 2 · 3 −χk−2 − 1 2Γ(χk+ 1) − Γ(χk) − Γ(χk− 1) + 2X `≥2 (−1)` `! −1 + `(`+1)4 + 2−`+1` 1 − 2−`+1 · Γ(` + χk− 1) 2−`+1− 2−`+1` + ` + Γ(` + χk) 1 − 2−`` − `) + Γ(` + χk+ 1)2−`−1(` − 1) and fork = 0 G(T )2 (−1) = 905 3456 + 2 X `≥2 (−1)`−1 + `(`+1) 4 + 2 −`+1` 1 − 2−`+1 · 2−`−1(` − 1) + 2 −`+1 `(` − 1) + 1 − 2−`+1 ` − 1 + 1 ` − 2 −`− 1 .
Figure 3.2: Left is a plot of V(Xn(T ))/n for n = 1. . . 100; right is a plot of the
periodic function of the main term in the asymptotic expansion of V(Xn(T ))/n.
Remark17. The above result gives G(T )2 (−1)
which coincides with the result from Theorem 12and the one from [7]; see also Figure3.2.
Remark 18. We now give an explanation why Abel summability gives the cor-rect result in all the integral evaluations above. Therefore, consider the following integral 1 2πi Z (0)+ Γ(−w + 1)Γ(w) 1 − 2−w dw.
All of the above integrals are of a similar type (only more involved).
Observe that moving the line of integration to infinity yields the divergent series (with the usual notion of convergence)
X
`≥1
(−1)`−1
1 − 2−`. (3.9)
Thus, this step is not jusified. However, if we consider Abel summability then we have to replace the above integral by
1 2πi Z (0)+ Γ(−w + 1)Γ(w) 1 − 2−w x ωdw
with |x| < 1. Now, due to the appearance of xω which produces exponential decay, we are indeed allowed to move the line to infinity and obtain
X
`≥1
(−1)`−1
1 − 2−`x `.
Consequently, we have the identity 1 2πi Z (0)+ Γ(−w + 1)Γ(w) 1 − 2−w x ωdw =X `≥1 (−1)`−1 1 − 2−`x `.
Taking limits on both sides produces our original integral on the left-hand side and the Abel sum of (3.9) on the right-hand side. This yields our claimed result.
Note that alternatively one could move the line of integration of our original integral to −∞ (this only works in the symmetric case; in the asymmetric case the resulting expression would become much more complicated). Then, we obtain the convergent sum 1 2+ X `≥1 (−1)`−1 2`− 1 .
Thus, we have the interesting identiy 1 2+ X `≥1 (−1)`−1 2`− 1 = X `≥1 (−1)`−1 1 − 2−`
with a rapidly converging series on the left-hand side and a divergent series on the right-hand side (whose Abel sum equals the value on the left-hand side). We leave it as an exercise to the reader to prove this identity directly.
3.3
Central limit theorem (CLT)
In this section, we are going to prove a central limit theorem for the number of 2-protected nodes. We will use the tools from [5] which can be applied to the current problem. First, we have to show that the variance grows at least linearly for n large enough. For this purpose, we recall the following proposition from [5]. Proposition 4. Let fnbe a sequence satisfying a recurrence of the form
fn= n X j=0 n j pjqn−j(fj+ fn−j) + gn, (n ≥ 2),
withf0 = f1 = 0. Assume that gn is non-negative andgn0 > 0 for some n0 ≥ 2.
Then,fn= Ω(n).
From this proposition, we deduce the following lemma. Lemma 3.3.1. We have that V(Xn(T )) = Ω(n).
Proof. We first derive a recurrence for V(Xn(T )). Therefore, set
Mn(y) = E(e(X
(T ) n −an)y)
where andenotes the mean of X (T )
n . Then, from (1.2), we obtain
Mn(y) = n
X
k=0
πn,kMkMn−kE(e(Tn−an+ak+an−k)|In= k)
with n ≥ 2 and M0(y) = M1(y) = 1. Observe that
Taking derivatives on both side of the above recurrence yields σ2n= n X k=0 πn,k(σk2+ σ 2 n−k) + ηn, (n ≥ 2), where σ2 0 = σ12 = 0 and ηn= n X k=0 πn,kE((Tn− an+ ak+ an−k)2|In= k).
From the expression of ηn, we see that ηn ≥ 0 because of the square. Then, by
Proposition4, either V(Xn(T )) grows at least linearly or is identical to 0. The latter
case, however, cannot happen since Xn(T ) is easily seen to be not deterministic for
n ≥ 2.
Now, we can state the main result of this section (this result proves a conjecture from [7]). Theorem 14. We have, Xn(T )− E(Xn(T )) q V(Xn(T )) d −→ N (0, 1),
where−→ denotes convergence in distribution and N (0, 1) is the standard normald distribution.
Proof. This follows from the above lemma and our expansions for the mean and the variance from Section3.1and Section3.2by an application of the contraction method along the same lines as in the proof of Theorem 2 in [5] (note that the the-orem does not directly apply to the current situation due to dependency between Tnand In).
Chapter 4
The number of 2-protected nodes in
PATRICIA tries
Let Xn(P ) be the number of 2-protected nodes in a random PATRICIA trie built
from n records. Then, we have, for n ≥ 2, Xn(P ) =d Xn(P ), when In= 0 or n; Xn−1(P ), when In= 1 or n − 1; XI(P ) n + X (P )∗ n−In+ 1, otherwise, (4.1) where notation is as in Section 1.4 and initial conditions are X0(P ) = X1(P ) = 0. Again this can be rewritten to (1.2) with
Tn =
(
0, if In∈ {0, 1, n − 1, n};
1, otherwise. (4.2) We start with the mean. Note that we could in principle repeat the analysis of Section3.1. However, we do not have to do so due to the following relationship between 2-protected nodes in tries and PATRICIA tries via the number of internal nodes:
Xn(P )= Xn(T )− Nn+ n − 1. (4.3)
Thus, we obtain the result for PATRICIA tries from the result for tries (Section
3.1) and the known result for the number of internal nodes (Section1.3). E(Xn(P )) n = E(Xn(T )) n − E(Nn) n + 1 − 1 n (4.4)
=pq + 1 − h h +F [G (T ) 1 ](r log1/pn) + o(1) − 1 h −F [G (N ) 1 ](r log1/pn) − o(1) + 1 − 1 n =pq h +F [G (P ) 1 ](r log1/pn) + o(1), where G(P )1 (s) =G(T )1 (s) − G(N )1 (s) =Γ(s) −1 + pqs(s + 1) − p−ss − q−ss − Γ(s)(−s − 1) =Γ(s) s + pqs(s + 1) − p−ss − q−ss =Γ(s + 1) 1 − p−s− q−s+ pq(s + 1) .
This gives the following result,
Theorem 15. The mean of the number of 2-protected nodes in PATRICIA tries satisfies E(Xn(P )) n = pq h +F [G (P ) 1 ](r log1/pn) + o(1), (4.5)
where fork 6= 0 (when log plog q ∈ Q)
G(P )1 (−1 + χk) = pqΓ(χk+ 1).
Figure 4.1: A plot of pq/h which is the average value of the main term of E(Xn(P ))/n.