A Characterization of the Set of Fixed Points of the Quicksort Transformation

James Allen Fill^{1} Department of Mathematical Sciences The Johns Hopkins University 34th and Charles Streets Baltimore, MD 21218-2682 USA

            jimfill@jhu.edu and http://www.mts.jhu.edu/~fill/

and

Svante Janson Department of Mathematics Uppsala University P. O. Box 480 S-751 06 Uppsala, SWEDEN

       svante.janson@math.uu.se and http://www.math.uu.se/~svante/

ABSTRACT

The limiting distribution μ of the normalized number of key comparisons required by the Quicksort sorting algorithm is known to be the unique fixed point of a certain distributional transformation T —unique, that is, subject to the constraints of zero mean and finite variance. We show that a distribution is a fixed point of T if and only if it is the convolution of μ with a Cauchy distribution of arbitrary center and scale. In particular, therefore, μ is the unique fixed point of T having zero mean.

AMS 2000 subject classifications. Primary 68W40; secondary 60E05, 60E10, 68P10. Key words and phrases. Quicksort, fixed point, characteristic function, smoothing transformation, domain of attraction, coupling, integral equation.

Submitted May 19, 2000; accepted in final form May 26, 2000.

1Research supported by NSF grant DMS–9803780, and by the Acheson J. Duncan Fund for the Advancement of Research in Statistics.

1 Introduction, motivation, and summary

Let M denote the class of all probability measures (distributions) on the real line. This paper concerns the transformation T defined on M by letting T ν be the distribution of

UZ + (1 − U)Z^{∗} + g(U),

where U, Z, and Z^{∗} are independent, with Z ∼ ν, Z^{∗} ∼ ν, and U ∼ unif(0, 1), and where

g(u) := 2u ln u + 2(1 − u) ln(1 − u) + 1. (1.1)

Of course, T can be regarded as a transformation on the class of characteristic functions ψ of elements of M. With this interpretation, T takes the form

(T ψ)(t) = E[ψ(Ut) ψ((1 − U)t) exp[itg(U)]] = ∫_{u=0}^{1}ψ(ut) ψ((1 − u)t) e^{itg(u)} du, t ∈ R.

It is well known [7] that (i) among distributions with zero mean and finite variance, T has a unique fixed point, call it μ; and (ii) if C_{n} denotes the random number of key comparisons required by the algorithm Quicksort to sort a file of n records, then the distribution of (C_{n} − EC_{n})/n converges weakly to μ.

There are other fixed points. For example, it has been noted frequently in the literature that the location family generated by μ is a family of fixed points. But there are many more fixed points, as we now describe. Define the Cauchy(m, σ) distribution (where m ∈ R and σ ≥ 0) to be the distribution of m + σC, where C has the standard Cauchy distribution with density x ↦ [π(1 + x^{2})]^{−1}, x ∈ R; equivalently, Cauchy(m, σ) is the distribution with characteristic function e^{imt−σ|t|}. [In particular, the Cauchy(m, 0) distribution is unit mass at m.] Now let F denote the class of all fixed points of T, and let C denote the class of convolutions of μ with a Cauchy distribution. Using characteristic functions it is easy to check that C ⊆ F, and that all of the distributions in C are distinct. In this paper we will prove that, conversely, F ⊆ C, and thereby establish the following main result.

Theorem 1.1. The class F equals C. That is, a measure ν is a fixed point of the Quicksort transformation T if and only if it is the convolution of the limiting Quicksort measure μ with a Cauchy distribution of arbitrary center m and scale σ. In particular, F is in one-to-one correspondence with the set {(m, σ) : m ∈ R, σ ≥ 0}.

The following corollary is immediate and strengthens Rösler’s [7] characterization of μ as the unique element of F having zero mean and finite variance.

Corollary 1.2. The limiting Quicksort measure μ is the unique fixed point of the Quicksort transformation T having finite expectation equal to 0.

The present paper can be motivated in two ways. First, the authors are writing a series of papers refining and extending Rösler’s [7] probabilistic analysis of Quicksort. No closed-form expressions are known for any of the standard functionals (e.g., characteristic function, distribution function, density function) associated with μ; information to be obtained about μ must be read from the fixed-point identity it satisfies. We were curious as to what extent additional known information about μ, such as the fact that it has everywhere finite moment generating function, must be brought to bear. As one example, it is believed that the continuous Lebesgue density f (treated in [3]) for μ decays at least exponentially quickly to 0 at ±∞, cf. [5]. But we now know from Theorem 1.1 that there can be no proof for this conjecture that solely makes use of the information that μ ∈ F.

Second, we view the present paper as a pilot study of fixed points for a class of distributional transformations on the line. In the more general setting, we would be given (the joint distribution of) a sequence (A_{i} : i ≥ 0) of random variables and would define a transformation T on M by letting T ν be the distribution of A_{0} + ∑_{i=1}^{∞} A_{i}Z_{i}, where Z_{1}, Z_{2}, … are independent random variables with distribution ν. [To ensure welldefinedness, one might (for example) require that (almost surely) A_{i} ≠ 0 for only finitely many values of i.] For probability measures ν on [0, ∞), rather than on R, and with the additional restrictions that A_{0} = 0 and A_{i} ≥ 0 for all i ≥ 1, such transformations are called generalized smoothing transformations. These have been thoroughly studied by Durrett and Liggett [2], Guivarc’h [4], and Liu [6], and by other authors; consult the three papers we have cited here for further bibliographic references. Generalized smoothing transformations have applications to interacting particle systems, branching processes and branching random walk, random set constructions, and statistical turbulence theory. The arguments used to characterize the set of fixed points for generalized smoothing transformations make heavy use of Laplace transforms; unfortunately, these arguments do not carry over readily to distributions on the line. Other authors (see, e.g., [8] [9] [10]) have treated fixed points of transformations of measures ν on the whole line as discussed above, but not without finiteness conditions on the moments of ν.

We now outline our proof of Theorem 1.1. Let ψ be the characteristic function of a given ν ∈ F, and let r(t) := ψ(t) − 1, t ∈ R. In Section 2 we establish and solve (in a certain sense) an integral equation satisfied by r. In Section 3 we then use the method of successive substitutions to derive asymptotic information about r(t) as t ↓ 0, showing first that r(t) = O(t^{2/3}), next that r(t) = βt + o(t) for some β = −σ + im ∈ C with σ ≥ 0, and finally that r(t) = βt + O(t^{2}) . In Section 4 we use this information to argue that there exist random variables Z_{1} ∼ ν, Z_{2} ∼ μ, and C ∼ Cauchy(m, σ) such that Z_{1} = Z_{2} + C. We finish the proof by showing that one can take Z_{2} and C to be independent, whence ν ∈ C.

Remark 1.3. Neither the proof in [7] of uniqueness of the fixed point μ among distributions with zero mean and finite variance nor any of the proofs in the present paper rely on any properties of the function g beyond zero mean and finite variance.

2 An integral equation

Let ψ denote the characteristic function of a given ν ∈ F. Since ψ(−t) ≡ \overline{ψ(t)}, we shall only need to consider ψ(t) for t ≥ 0. For notational convenience, define

r(t) := ψ(t) − 1, t ≥ 0.

Rearranging the fixed-point integral equation (T ψ)(t) ≡ ψ(t), we obtain the following result.

Lemma 2.1. The function r satisfies the integral equation

r(t) = 2 ∫_{u=0}^{1}r(ut) du + b(t), t ≥ 0,

where

b(t) := ∫_{u=0}^{1}r(ut) r((1 − u)t) du + it ∫_{u=0}^{1}[ψ(ut) ψ((1 − u)t) − 1] g(u) du + a(t) (2.1)

with

|a(t) := ∫_{u=0}^{1}ψ(ut) ψ((1 − u)t) [e^{itg(u)} − 1 − itg(u)] du| ≤ \frac{1}{2}Eg^{2}(U)t^{2} = (\frac{7}{6} − \frac{1}{9}π^{2})t^{2}. (2.2)

Note that r and b are continuous on [0, ∞), with r(0) = 0 = b(0). Regarding b as “known”, the integral equation in Lemma 2.1 is easily “solved” for r:

Proposition 2.2. For some constant c ∈ C, we have

\frac{r(t)}{t} = c − 2 ∫_{v=t}^{1} \frac{b(v)}{v^{2}} dv + \frac{b(t)}{t}, t > 0.

Proof. Setting h(t) := t[r(t) − b(t)], Lemma 2.1 implies

h(t) = 2 ∫_{v=0}^{t}[\frac{h(v)}{v} + b(v)] dv, t > 0.

Thus h is continuously differentiable on (0, ∞) and satisfies the differential equation

h′(t) = \frac{2}{t}h(t) + 2b(t)

there. This is an easy differential equation to solve for h, and we find that

h(t) = ct^{2} − 2t^{2} ∫_{v=t}^{1} \frac{b(v)}{v^{2}} dv, t > 0,

for some c ∈ C. After rearrangement, the proposition is proved.

3 Behavior of r near 0

We now proceed in stages, using Proposition 2.2 as our basic tool, to get ever more information about the behavior of r (especially near 0).

Lemma 3.1. Let ψ ≡ 1 + r denote the characteristic function of a given ν ∈ F. Then there exists a constant C < ∞ such that

|r(t)| ≤ Ct^{2/3} for all t ≥ 0.

Proof. Let

M(t) := max{|r(s)| : 0 ≤ s ≤ t} ≤ 2, t ≥ 0.

From (2.1) and (2.2), we see immediately that, for 0 < t ≤ 1,

|b(t)| ≤ M^{2}(t) + O(t).

Therefore, for 0 < t < 1, Proposition 2.2 yields

|r(t)| ≤ M^{2}(t) + 2t ∫_{v=t}^{1} \frac{M^{2}(v)}{v^{2}} dv + ϵ(t) = M^{2}(t) + 2 ∫_{u=t}^{1}M^{2}(t/u) du + ϵ(t),

where

ϵ(t) = O (t log (\frac{1}{t})) + O(t) = O(t^{2/3}).

Consequently, again for 0 < t < 1 (but then trivially for all t ≥ 0),

M(t) ≤ M^{2}(t) + 2 ∫_{u=0}^{1}M^{2}(t/u) du + O(t^{2/3}).

Fix 0 < a < 1; later in the proof we shall see that a = 1/8 suffices for our purposes. Since M(t) → 0 as t → 0, we can choose t_{0} > 0 such that M(t_{0}) ≤ a. Then, for 0 ≤ t ≤ t_{0},

M(t) ≤ M^{2}(t) + 2 ∫_{u=0}^{t/t_{0}}M^{2}(t/u) du + 2 ∫_{u=t/t_{0}}^{1}M^{2}(t/u) du + O(t^{2/3})
≤ aM(t) + 8\frac{t}{t_{0}} + 2a ∫_{u=t/t_{0}}^{1}M(t/u) du + O(t^{2/3})

and thus

M(t) ≤ \frac{2a}{1 − a} ∫_{u=0}^{1}M(t/u) du + O(t^{2/3}).

Since M is bounded, this is trivially true also for t > t_{0}. Summarizing, for some constant C̃ < ∞ we have, with U ∼ unif(0, 1),

M(t) ≤ \frac{2a}{1 − a}EM(t/U) + C̃t^{2/3}, t ≥ 0. (3.1)

Now fix the value of a to be any number in (0, 1/7), say a = 1/8. Then a straightforward induction [substituting (3.2) into (3.1) for the induction step] shows that for any nonnegative integer n we have, for all t ≥ 0,

M(t) ≤ (\frac{2a}{1 − a})^{n} E M (\frac{t}{U_{1} … U_{n}} ) + \frac{1 − a}{1 − 7a}C̃t^{2/3}. (3.2)

Recalling that M is bounded and letting n → ∞, we obtain the desired conclusion, with C := \frac{1−a}{1−7a} C̃.

Lemma 3.2. Let ψ ≡ 1 + r denote the characteristic function of a given ν ∈ F, and define b by (2.1). Then

r(t) = (c − 2J)t + o(t) as t ↓ 0,

where J is the absolutely convergent integral

J := ∫_{v=0}^{1} \frac{b(v)}{v^{2}} dv. (3.3)

Proof. Combining (2.1)–(2.2) and Lemma 3.1, we obtain

|b(t)| ≤ O(t^{4/3}) + O(t^{1+(2/3)}) + O(t^{2}) = O(t^{4/3}).

Thus the integral J converges absolutely, and from Proposition 2.2 we obtain the desired conclusion about r.

Lemma 3.2 is all we will need in the next section, but the following refinement follows readily and takes us as far as we can go with the method of successive substitutions.

Corollary 3.3. Let ψ denote the characteristic function of a given ν ∈ F. Then there exists a constant β = im − σ ∈ C with m ∈ R and σ ≥ 0 such that

ψ(t) = 1 + βt + O(t^{2}) as t ↓ 0.

Proof. Combining (2.1)–(2.2) and Lemma 3.2, we readily obtain b(t) = O(t^{2}). Therefore, by Proposition 2.2,

ψ(t) − 1 = r(t) = (c − 2J)t + 2t ∫_{v=0}^{t} \frac{b(v)}{v^{2}} dv + b(t) = βt + O(t^{2}),

with β = im − σ := c − 2J. Since |ψ(t)| ≤ 1 for all t, we must have σ ≥ 0.

4 Proof of the main theorem

4.1 Further preliminaries

In Sections 4.1–4.2 we complete the proof of our main Theorem 1.1. To do this, we begin with a key result that any characteristic function with expansion as in Corollary 3.3 [more generally, we allow the remainder term there to be simply o(t)] is in the domain of attraction of (iterates of) the “homogeneous” analogue T_{0} of T. (Here ⟹ denotes weak convergence of probability measures.)

Theorem 4.1. Let ψ be any characteristic function satisfying

ψ(t) = 1 + βt + o(t) = 1 + imt − σt + o(t) as t ↓ 0 (4.1)

for some β = im−σ ∈ C, with m ∈ R and σ ≥ 0. Let ν be the corresponding probability measure. Then

T_{0}^{n}ν ⟹ Cauchy(m, σ),

where T_{0} is the homogeneous analogue of the Quicksort transformation T mapping distributions as follows (in obvious notation):

T_{0} : Z ↦ UZ + (1 − U)Z^{∗}. (4.2)

Proof. Let Z_{1}, Z_{2}, …; U_{1}, U_{2}, … be independent random variables, with every Z_{i} ∼ ν and every U_{j} ∼ unif(0, 1). Then, using the definition of T_{0} repeatedly,

W_{n} := ∑_{i=1}^{2^{n}} V_{i}^{(n)}Z_{i} ∼ T_{0}^{n}ν, n ≥ 0,

where we define the random variables V_{i}^{(n)} as follows. Using U_{1} in the obvious fashion, split the unit interval into intervals of lengths U_{1} and 1−U_{1}. Now using U_{2} and U_{3}, split the first interval into subintervals of lengths U_{1}U_{2} and U_{1}(1−U_{2}) and the second interval into subintervals of lengths (1−U_{1})U_{3} and (1−U_{1})(1−U_{3}). Continue in this way (using U_{1}, …, U_{2^{n}−1}) until the unit interval has been divided overall into 2^{n} subintervals. Call their lengths, from left to right, V_{1}^{(n)}, …, V_{2^{n}}^{(n)}.

Let L_{n} := max(V_{1}^{(n)}, …, V_{2^{n}}^{(n)}). We show that L_{n} converges in probability to 0 as n → ∞. Luckily, the complicated dependence structure of the variables V_{i}^{(n)} does not come into play; the only observation we need is that that each V_{i}^{(n)} marginally has the same distribution as U_{1} ⋯ U_{n}. Indeed, abbreviate V_{1}^{(n)} as V_{n}; briefly put, we derive a Chernoff’s bound for ln(1/V_{n}) and then simply use subadditivity. To spell things out, let x > 0 be fixed and let t ≥ 0. Then

P(V_{n} ≥ e^{−x}) ≤ e^{tx}EV_{n}^{t} = e^{tx} ∏_{j=1}^{n} EU_{j}^{t} = e^{tx}(1 + t)^{−n} = exp[−(n ln(1 + t) − xt)].

Choosing the optimal t = \frac{n}{x} − 1 (valid for n ≥ x), this yields

P(V_{n} ≥ e^{−x}) ≤ exp[−(n ln(n/x) − n + x)] = exp[−(n(ln n − ln(ex)) + x)]

and thus

P(L_{n} ≥ e^{−x}) ≤ 2^{n} exp[−(n(ln n − ln(ex)) + x)] = exp[−(n(ln n − ln(2ex)) + x)] → 0

as n → ∞.

Since L_{n} converges in probability to 0, we can therefore choose ϵ_{n} → 0 so that P(L_{n} > ϵ_{n}) → 0. To prove the theorem, it then suffices to prove

W̃_{n} := 1(L_{n} ≤ ϵ_{n})W_{n} ⟹ Cauchy(m, σ).

For this, we note that the characteristic function ϕ_{n} of W̃_{n} is given for t ∈ R by

ϕ_{n}(t) = P(L_{n} > ϵ_{n}) + E [1(L_{n} ≤ ϵ_{n}) ∏_{i=1}^{2^{n}} ψ(V_{i}^{(n)}t)] . (4.3)

We will show that ϕ_{n}(t) converges to e^{βt} = e^{imt−σt} for each fixed t ≥ 0, and [since, further, ϕ_{n}(−t) ≡ \overline{ϕ_{n}(t)}] this will complete the proof of the lemma.

Indeed, we need only consider the second term in (4.3). For that, the calculus estimates outlined in the proof of the lemma preceding Theorem 7.1.2 in [1] demonstrate that, when L_{n} ≤ ϵ_{n},

∏_{i=1}^{2^{n}} ψ(V_{i}^{(n)}t) = (1 + D_{n})e^{βt}

for complex random variables D_{n} (depending on our fixed choice of t ≥ 0) satisfying |D_{n}| ≤ δ_{n} for a deterministic sequence δ_{n} [ ≡ δ(ϵ_{n}t)] → 0 [with δ(s) → 0 as s → 0]. [Leaving out the error estimates, the argument is

log [∏_{i=1}^{2^{n}} ψ(V_{i}^{(n)}t)] ≈ ∑_{i=1}^{2^{n}} (ψ(V_{i}^{(n)}t) − 1)

≈ ∑_{i=1}^{2^{n}} βV_{i}^{(n)}t = βt.  ]

It now follows easily that ϕ_{n}(t) → e^{βt}, as desired.

Both the next lemma and its immediate corollary (Lemma 4.3) will be used in our proof of Theorem 1.1.

Lemma 4.2. Let ν_{i} ∈ F, i = 1, 2. Suppose that (Z_{1}, Z_{2}) is a coupling of ν_{1} and ν_{2} such that the characteristic function of Z_{1} − Z_{2} satisfies (4.1). Then there exists a coupling (Z̃_{1}, Z̃_{2}) of ν_{1} and ν_{2} such that Z̃_{1} − Z̃_{2} ∼ Cauchy(m, σ).

Proof. Extend T to a transformation T_{2} on the class M_{2} of probability measures on R^{2} by mapping the distribution ξ ∈ M_{2} of (X, Y) to the distribution T_{2}ξ of

(UX + (1 − U)X^{∗} + g(U), UY + (1 − U)Y^{∗} + g(U)),

where U, (X, Y), and (X^{∗}, Y^{∗}) are independent, with (X, Y) ∼ ξ, (X^{∗}, Y^{∗}) ∼ ξ, and U ∼ unif(0, 1), and where g is given by (1.1). (Note that we use the same uniform U for the Y s as for the Xs!) Of course, T_{2} maps the marginal distributions ξ_{1}(·) = ξ(· × R) of X and ξ_{2}(·) = ξ(R × ·) of Y into T ξ_{1} and T ξ_{2}, respectively; more importantly for our purposes, it maps the distribution, call it ξ̂, of X − Y into the distribution T_{0}ξ̂, with T_{0} defined at (4.2).

Now let ν ∈ M_{2} have marginals ν_{i}, i = 1, 2. Then (T_{2}^{n}ν)_{n≥1} has constant marginals (ν_{1}, ν_{2}) as n varies and so is a tight sequence. We then can find a weakly convergent subsequence, say,

T_{2}^{n_{k}}ν ⟹ ν^{∞} ∈ M_{2};

of course, the limit ν^{∞} again has marginals ν_{i}, i = 1, 2. Moreover,

T_{0}^{n_{k}} ν̂ = T̂_{2}^{n_{k}}ν ⟹ ν̂^{∞}.

But, by supposition, the characteristic function of ν̂ satisfies (4.1), so Theorem 4.1 implies that ν̂^{∞} is Cauchy(m, σ). Thus ν^{∞} ∈ M_{2} supplies the desired coupling.

Lemma 4.3. Let ν_{i} ∈ F, i = 1, 2. Suppose that (Z_{1}, Z_{2}) is a coupling of ν_{1} and ν_{2} such that Z_{1} − Z_{2} has zero mean and finite variance. Then ν_{1} = ν_{2}.

4.2 The proof

We now complete the proof of Theorem 1.1.

Proof. As discussed in Section 1, it is simple to check that C ⊆ F (and that the elements of C are all distinct).

Conversely, given ν ∈ F, let Z_{1} ∼ ν_{1} := ν and Z_{2} ∼ ν_{2} := μ be independent random variables (on some probability space); recall that μ is the limiting Quicksort measure, with zero mean and finite variance. Write ψ_{i}, i = 1, 2, for the characteristic functions corresponding respectively to ν_{i}, i = 1, 2. By Lemma 3.2 (or see Corollary 3.3), ψ_{1} satisfies (4.1) [for some (m, σ)]. Of course, ψ_{2} satisfies (4.1) with β taken to be 0, so the characteristic function t ↦ ψ_{1}(t)ψ_{2}(−t) of Z_{1} − Z_{2} satisfies (4.1) for the same (m, σ) as for ψ_{1}. Applying Lemma 4.2, there exists a coupling (Z̃_{1}, Z̃_{2}) of ν_{1} and ν_{2} such that C := Z̃_{1} − Z̃_{2} ∼ Cauchy(m, σ). Without loss of generality (by building a suitable product space), we may assume the existence of a random variable Y ∼ μ on the same probability space as Z̃_{1} and Z̃_{2} such that Y and C are independent.

We know that the distribution ν_{1} of Z̃_{1} = Z̃_{2} + C is a fixed point of T. But so is the distribution ν′_{1} ∈ C of Z := Y + C. By Lemma 4.3 applied to (Z̃_{1}, Z), ν = ν_{1} = ν′_{1} ∈ C, as desired.

Acknowledgment. We thank Persi Diaconis for pointing us to the literature on the smoothing transformation.

References

[1] Chung, K. L. A Course in Probability Theory. Second edition. Academic Press, New York, 1974.

[2] Durrett, R. and Liggett, T. M. Fixed points of the smoothing transformation. Z. Wahrsch. Verw. Gebiete 64 (1983), 275–301.

[3] Fill, J. A. and Janson, S. Smoothness and decay properties of the limiting Quicksort density function. Refereed article, to apppear in a book edited by D. Gardy and A. Mokkadem, published in 2000 by Birkhäuser, and based on the Colloquium on Mathematics and Computer Science: Algorithms, Trees, Combinatorics and Probabilities (University of Versailles–St. Quentin, Versailles, France, September, 2000). Preprint available from http://www.mts.jhu.edu/~fill/ or

    http://www.math.uu.se/~svante/.

[4] Guivarc’h, Y. Sur une extension de la notion de loi semi-stable. Ann. Inst. H. Poincaré Probab. Statist. 26 (1990), 261–285.

[5] Knessl, C. and Szpankowski, W. Quicksort algorithm again revisited. Discrete Math. Theor. Comput. Sci. 3 (1999), 43–64.

[6] Liu, Q. Fixed points of a generalized smoothing transformation and applications to the branching random walk. Adv. in Appl. Probab. 30 (1998), 85–112.

[7] Rösler, U. A limit theorem for ‘Quicksort’. RAIRO Inform. Théor. Appl. 25 (1991), 85–100.

[8] Rösler, U. A fixed point theorem for distributions. Stochastic Process. Appl. 42 (1992), 195–214.

[9] Rösler, U. The analysis of stochastic divide and conquer algorithms. Algorithmica (1999), to appear.

[10] Rösler, U. and Rüschendorf, L. The contraction method for recursive algorithms. Algorithmica (1999), to appear.