arxiv: v1 [math.pr] 31 Jan 2012

Similar documents
Appendix to Quicksort Asymptotics

An Introduction to Randomized Algorithms

Analysis of the Expected Number of Bit Comparisons Required by Quickselect

Convergence of random variables. (telegram style notes) P.J.C. Spreij

Sequences, Mathematical Induction, and Recursion. CSE 2353 Discrete Computational Structures Spring 2018

Chapter 3. Strong convergence. 3.1 Definition of almost sure convergence

Rates of Convergence for Quicksort

62. Power series Definition 16. (Power series) Given a sequence {c n }, the series. c n x n = c 0 + c 1 x + c 2 x 2 + c 3 x 3 +

Partial match queries: a limit process

Infinite Sequences and Series

7.1 Convergence of sequences of random variables

NEW FAST CONVERGENT SEQUENCES OF EULER-MASCHERONI TYPE

MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.265/15.070J Fall 2013 Lecture 21 11/27/2013

Law of the sum of Bernoulli random variables

(A sequence also can be thought of as the list of function values attained for a function f :ℵ X, where f (n) = x n for n 1.) x 1 x N +k x N +4 x 3

Singular Continuous Measures by Michael Pejic 5/14/10

Definition 4.2. (a) A sequence {x n } in a Banach space X is a basis for X if. unique scalars a n (x) such that x = n. a n (x) x n. (4.

Chapter 6 Infinite Series

6.3 Testing Series With Positive Terms

Journal of Multivariate Analysis. Superefficient estimation of the marginals by exploiting knowledge on the copula

INFINITE SEQUENCES AND SERIES

Notes 19 : Martingale CLT

MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.436J/15.085J Fall 2008 Lecture 19 11/17/2008 LAWS OF LARGE NUMBERS II THE STRONG LAW OF LARGE NUMBERS

Advanced Stochastic Processes.

Lecture 19: Convergence

Distribution of Random Samples & Limit theorems

Sequences of Definite Integrals, Factorials and Double Factorials

Sequences and Series of Functions

Riesz-Fischer Sequences and Lower Frame Bounds

7.1 Convergence of sequences of random variables

ON POINTWISE BINOMIAL APPROXIMATION

4. Partial Sums and the Central Limit Theorem

Math 61CM - Solutions to homework 3

Random Models. Tusheng Zhang. February 14, 2013

Lecture 7: Properties of Random Samples

On Binary Search Tree Recursions with Monomials as Toll Functions

Introduction to Extreme Value Theory Laurens de Haan, ISM Japan, Erasmus University Rotterdam, NL University of Lisbon, PT

Chapter 8. Euler s Gamma function

Chapter 8. Euler s Gamma function

CSE 1400 Applied Discrete Mathematics Number Theory and Proofs

Entropy and Ergodic Theory Lecture 5: Joint typicality and conditional AEP

17. Joint distributions of extreme order statistics Lehmann 5.1; Ferguson 15

On Generalized Fibonacci Numbers

January 25, 2017 INTRODUCTION TO MATHEMATICAL STATISTICS

Recurrence Relations

Lecture 2. The Lovász Local Lemma

CHAPTER 10 INFINITE SEQUENCES AND SERIES

IIT JAM Mathematical Statistics (MS) 2006 SECTION A

The Gamma function Michael Taylor. Abstract. This material is excerpted from 18 and Appendix J of [T].

The log-behavior of n p(n) and n p(n)/n

Seunghee Ye Ma 8: Week 5 Oct 28

MAT1026 Calculus II Basic Convergence Tests for Series

Random Walks on Discrete and Continuous Circles. by Jeffrey S. Rosenthal School of Mathematics, University of Minnesota, Minneapolis, MN, U.S.A.

Assignment 5: Solutions

Mathematics review for CSCI 303 Spring Department of Computer Science College of William & Mary Robert Michael Lewis

STAT Homework 1 - Solutions

1 Convergence in Probability and the Weak Law of Large Numbers

Solutions to HW Assignment 1

Product measures, Tonelli s and Fubini s theorems For use in MAT3400/4400, autumn 2014 Nadia S. Larsen. Version of 13 October 2014.

EE 4TM4: Digital Communications II Probability Theory

Random Matrices with Blocks of Intermediate Scale Strongly Correlated Band Matrices

Advanced Analysis. Min Yan Department of Mathematics Hong Kong University of Science and Technology

Section 11.8: Power Series

Discrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 22

Hoggatt and King [lo] defined a complete sequence of natural numbers

Lecture Notes for Analysis Class

Roger Apéry's proof that zeta(3) is irrational

Recursive Algorithms. Recurrences. Recursive Algorithms Analysis

IRRATIONALITY MEASURES, IRRATIONALITY BASES, AND A THEOREM OF JARNÍK 1. INTRODUCTION

Math 525: Lecture 5. January 18, 2018

CS284A: Representations and Algorithms in Molecular Biology

Ma 530 Infinite Series I

Basics of Probability Theory (for Theory of Computation courses)

Read carefully the instructions on the answer book and make sure that the particulars required are entered on each answer book.

sin(n) + 2 cos(2n) n 3/2 3 sin(n) 2cos(2n) n 3/2 a n =

If a subset E of R contains no open interval, is it of zero measure? For instance, is the set of irrationals in [0, 1] is of measure zero?

We are mainly going to be concerned with power series in x, such as. (x)} converges - that is, lims N n

Math Solutions to homework 6

CHAPTER 1 SEQUENCES AND INFINITE SERIES

Lecture 8: Convergence of transformations and law of large numbers

A constructive analysis of convex-valued demand correspondence for weakly uniformly rotund and monotonic preference

Comparison Study of Series Approximation. and Convergence between Chebyshev. and Legendre Series

Notes 27 : Brownian motion: path properties

Math 25 Solutions to practice problems

Random assignment with integer costs

Metric Space Properties

Solution to Chapter 2 Analytical Exercises

Math 113 Exam 3 Practice

Optimally Sparse SVMs

Regression with an Evaporating Logarithmic Trend

Chapter 7 Isoperimetric problem

Dirichlet s Theorem on Arithmetic Progressions

2.2. Central limit theorem.

Topic 9: Sampling Distributions of Estimators

ECE 330:541, Stochastic Signals and Systems Lecture Notes on Limit Theorems from Probability Fall 2002

Disjoint Systems. Abstract

Chapter IV Integration Theory

Lecture 23: Minimal sufficiency

Probability 2 - Notes 10. Lemma. If X is a random variable and g(x) 0 for all x in the support of f X, then P(g(X) 1) E[g(X)].

1 = δ2 (0, ), Y Y n nδ. , T n = Y Y n n. ( U n,k + X ) ( f U n,k + Y ) n 2n f U n,k + θ Y ) 2 E X1 2 X1

Transcription:

EXACT L 2 -DISTANCE FROM THE LIMIT FOR QUICKSORT KEY COMPARISONS EXTENDED ABSTRACT) arxiv:20.6445v [math.pr] 3 Ja 202 PATRICK BINDJEME JAMES ALLEN FILL Abstract Usigarecursiveapproach, weobtaiasimpleexactexpressioforthel 2 -distacefrom the limit i Régier s [5] classical limit theorem for the umber of key comparisos required by QuickSort. A previous study by Fill ad Jaso [] usig a similar approach foud that the d 2-distace is of order betwee log ad /2, ad aother by Neiiger ad Ruschedorf [4] foud that the Zolotarev ζ 3-distace is of exact order log. Our expressio reveals that the L 2 -distace is asymptotically equivalet to 2 l) /2.. Itroductio, review of related literature, ad summary We cosider Hoare s [3] QuickSort sortig algorithm applied to a ifiite stream of iid idepedet ad idetically distributed) uiform radom variables U,U 2,... QuickSortchoosesthe first key U as the pivot, compareseach of the other keys to it, ad the proceeds recursively to sort both the keys smaller tha the pivot ad those larger tha it. If, for example, the iitial roud of comparisos fids U 2 < U, the U 2 is used as the pivot i the recursive call to the algorithm that sorts the keys smaller tha U because it is the first elemet i the sequece U,U 2,... which is smaller tha U. I a atural ad obvious way, a realizatio requirig ifiite time) of the algorithm produces a ifiite rooted biary search tree which with probability oe has the completeess property that each ode has two child-odes. Essetially the same algorithm ca of course be applied to the trucated sequece U,U 2,...,U for ay fiite, where the recursio eds by declarig that a list of size 0 or is alreadysorted. Let K deote the umber of key comparisosrequired by QuickSort to sort U,U 2,...,U. The, with the way we have set thigs up, all the radom variables K are defied o a commo probability space, ad K is odecreasig i. Ideed, K K is simply the cost of isertig U ito the usual fiite) biary search tree formed from U,...,U. I this framework, Régier [5] used martigale techiques to establish the followig L p -limit theorem; she also proved almost sure covergece. We let µ : EK. Date: Jauary 26, 202. Research supported by the Acheso J. Duca Fud for the Advacemet of Research i Statistics.

2 PATRICK BINDJEME JAMES ALLEN FILL Theorem. Régier [5]). There exists a radom variable T satisfyig for every fiite p. Y : K µ L p T Rösler [6] characterized the distributio of Régier s limitig T as the uique fixed poit of a certai distributioal trasformatio, but he also described explicitly how to costruct a radom variable havig the same distributio as T. We will describe his explicit costructio i equivalet terms, but first we eed two paragraphs of otatio. The odes of the complete ifiite biary search tree are labeled i the atural biary way: the root gets a empty label writte ε here, the left respectively, right) child is labeled 0 resp., ), the left child of ode 0 is labeled 00, etc. We write Θ : 0 k< {0,} k for the set of all such labels. If V θ deotes the key iserted at odeθ Θ, let L θ resp.,r θ ) deote the largestkeysmallertha V θ resp., smallest key larger tha V θ ) iserted at ay acestor of θ, with the exceptios L θ : 0 ad R θ : if the specified acestor keys do ot exist. Further, for each ode θ, defie.) φ θ : R θ L θ, U θ : φ θ0 /φ θ, G θ : φ θ CU θ ) φ θ 2φ θ lφ θ +2φ θ0 lφ θ0 +2φ θ lφ θ, where for 0 < x < we defie.2) Cx) : +2xlx+2 x)l x). Let p <. The d p -metric is the metric o the space of all probability distributios with fiite pth absolute momet defied by d p F,F 2 ) : if X X 2 p, wherewetaketheifimum ofl p -distacesoverallpairsofradomvariablesx ad X 2 defied o the same probability space) with respective margial distributios F ad F 2. By the d p -distace betwee two radom variables we mea the d p - distace betwee their distributios. We are ow prepared to state Rösler s mai result. Note: Here ad later results have bee adjusted slightly as ecessary to utilize the same deomiator + rather tha ) that Régier used. Theorem.2 Rösler[6]). For ay fiite p, the ifiite series Y j0 θ j G θ coverges i L p, ad the sequece Y K µ )/) coverges i the d p -metric to Y. Of course it follows from Theorems..2 that T ad Y have the same distributio. The purpose of the preset exteded abstract is to show that i fact T Y ad to provide a simple explicit expressio for the L 2 -distace betwee Y ad Y valid for every ; this is doe i Theorem.4 below. We are aware of oly two previous studies of the rate of covergece of Y to Y, ad both of those cocer certai distaces betwee distributios rather tha betwee radom variables. The first study, by Fill ad Jaso [], provides upper ad lower bouds o d p Y,Y) for geeral p; we choose to focus here o d 2. Theorem.3 Fill ad Jaso []). There is a costat c > 0 such that for ay we have c l d 2 Y,Y) < 2 /2.

EXACT L 2 -DISTANCE FOR QUICKSORT KEY COMPARISONS 3 To our kowledge, the gap betwee the rates log)/ ad /2 has ot bee arrowed. Neiiger ad Ruschedorff [4] used the Zolotarev ζ 3 -metric ad foud that the correct rate i that metric is log, but their techiques are ot sufficietly sharp to obtai ζ 3 Y,Y) c l for some costat c. I our mai Theorem.4, proved usig the same recursive approach as i Fill ad Jaso [], we fid ot oly the lead-order asymptotics for the L 2 -distace Y Y 2, but i factaexactexpressioforgeeral. It isiterestigtootethat therate /2 log) /2 forl 2 -covergeceislargerevethatheupper-boudrate of /2 for d 2 -covergece from Theorem.3. Theorem.4 mai theorem). For 0 we have Y Y 2 2 ) 2H ++ 6 ) 4 k k 2 2 l +O ), where H : j is the th harmoic umber ad the asymptotic expressio holds as. The remaider of this exteded abstract is devoted to a proof of Theorem.4, which is completed i Sectio 5. 2. Prelimiaries I this sectio we provide recursive represetatios of Y for geeral ) ad Y that will be useful i provig Theorem.4. Our first propositio cocers the limit Y ad gives a sample-poitwise extesio of the very well kow [6] distributioal idetity satisfied by Y. Recall the otatio.) ad the defiitio of Y i Theorem.2 as the ifiite series j0 θ j G θ i L 2. Propositio 2.. There exist radom variables F θ ad H θ for θ Θ such that i) the joit distributios of G θ : θ Θ), of F θ : θ Θ), ad of H θ : θ Θ) agree; ii) F θ : θ Θ) ad H θ : θ Θ) are idepedet; iii) the series 2.) Y 0) : F θ ad Y ) : coverge i L 2 ; iv) the radom variables Y 0) ad Y ) are idepedet, each with the same distributio as Y, ad 2.2) Y CU)+UY 0) +UY ). Here U : U, with U : U, ad C is defied at.2). Proof. Recall from.) that G θ φ θ 2φ θ lφ θ +2φ θ0 lφ θ0 +2φ θ lφ θ. For θ Θ, defie the radom variable ϕ θ respectively, ψ θ ) by H θ ϕ θ : φ 0θ /U resp., ψ θ : φ θ /U).

4 PATRICK BINDJEME JAMES ALLEN FILL The U ad ϕ θ are idepedet resp., U ad ψ θ are idepedet), ϕ θ ad ψ θ each have the same distributio as φ θ, ad where G 0θ UF θ ad G θ UH θ, F θ : ϕ θ 2ϕ θ lϕ θ +2ϕ θ0 lϕ θ0 +2ϕ θ lϕ θ, H θ : ψ θ 2ψ θ lψ θ +2ψ θ0 lψ θ0 +2ψ θ lψ θ. The propositio follows easily from the clear equality of joit laws ad the fact that Y LF θ : θ Θ) LG θ : θ Θ) LH θ : θ Θ), G θ G ε + G 0θ + CU)+U F θ +U CU)+UY 0) +UY ). We ext proceed to provide a aalogue [amely, 2.4)] of 2.2) for each Y, rather tha Y, but first we eed a little more otatio. Give 0 x < y, let U xy ) be the subsequece of U ) that falls i x,y). The radom variable K x,y) is defied to be the radom) umber of key comparisos used to sort U xy,...,uxy usig QuickSort. The distributio of K x,y) of course does ot deped o x,y). We ow defie the radom variable H θ G θ 2.3) Y,θ : [K νθ )L θ,r θ ) µ νθ )]/[ν θ )+], with the ceterig here motivated by the fact that µ νθ ) is the coditioal expectatio of K νθ )L θ,r θ ) give ν θ ),L θ,r θ ). The for we have 2.4) Y C ν 0 )+)+ ν 0)+ Y,0 + ν )+ Y,, where, as i [2], for i we defie C i) : +µ i +µ i µ ). We ote for future referece that the classical divide-ad-coquer recurrece for µ asserts precisely that 2.5) for. C i) 0 i

EXACT L 2 -DISTANCE FOR QUICKSORT KEY COMPARISONS 5 It follows from 2.2) ad 2.4) that for we have [ [ ] ν0 )+ Y Y Y,0 UY ]+ 0) ν )+ Y, UY ) [ ] + C ν 0 )+) CU) 2.6) : W +W 2 +W 3. CoditioallygiveU adν 0 ), theradomvariablesw adw 2 areidepedet, each with vaishig mea, ad W 3 is costat. Hece E[Y Y) 2 U,ν 0 )] E[W 2 U,ν 0)]+E[W 2 2 U,ν 0)]+W 2 3 ad thus, takig expectatios ad usig symmetry, for we have 2.7) a 2 : EY Y) 2 EW 2 +EW 2 2 +EW 2 3 2EW 2 +EW 2 3. Note that 2.8) a 2 0 EY 2 : 7 2 3 π2 for example, [2]). 3. Aalysis of EW 2 I this sectio we aalyze EW 2, producig the followig result. Recall the defiitio of at 2.8). Propositio 3.. Let. For W defied as at 2.6), we have EW 2 ) 2 k +) 2 a 2 k + For that, we first prove the followig two lemmas. Lemma 3.2. For ay, we have [ ν0 ) 2 )+ 2] E Y,0 Y 0)) Lemma 3.3. For ay, we have [ ν0 ) 2 )+ 2] E U Y 0)) 6). ) 2 k + a 2 k. 6). Proof of Lemma 3.2. There is a probabilistic copy Y Y ) of the stochastic process Y ) such that Y,0 Y ν 0) ad Y ad Y 0) are idepedet of U,ν 0 )). This implies [ ν0 ) [ 2 ν0 )+ 2] E Y,0 Y 0)) ) ] 2 )+ E Yν Y0)) 2 0).

6 PATRICK BINDJEME JAMES ALLEN FILL By coditioig o ν 0 ), which is uiformly distributed o {0,..., }, we get [ ν0 ) [ 2 ν0 )+ 2] E Y,0 Y 0)) ) ] 2 )+ E a 2 ν 0) ) 2 k + a 2 k. Proof of Lemma 3.3. Coditioally give ν 0 ) ad Y 0), we have that U is distributed as the order statistic of rak ν 0 ) + from a sample of size from the uiform0,) distributio, amely, Betaν 0 )+, ν 0 )), with expectatio [ν 0 )+]/) ad variace [ν 0 )+) ν 0 ))]/[) 2 +2)]. So, usig also the idepedece of ν 0 ) ad Y 0), we fid [ ν0 ) 2 )+ 2] E U Y 0)) [ ν0 )+) ν 0 )) E ) 2 Y 0)) ] [ ] 2 ν0 )+) ν 0 )) E +2) ) 2 +2) ) 2 +2) 6). k +) k) Proof of Propositio 3.. We have [ ] 2 EW 2 ν0 )+ E Y,0 UY 0) [ ν0 )+ E Y,0 Y 0)) ν0 )+ + [ ν0 ) 2 )+ 2] E Y,0 Y 0)) [ ν0 ) ] 2 )+ +E U Y 0) ) 2 [ ν0 )+ +2E ) 2 +2) 6 )+2) ] 2 U )Y 0) Y,0 Y 0)) ] ν 0 )+ U )Y 0). The result follows from Lemmas 3.2 3.3, ad the fact that, coditioally give ν 0 ),Y,0,Y 0) ), the radom variable U is distributed Betaν 0 )+, ν 0 )), so that the last expectatio i the precedig equatio vaishes. 4. Aalysis of EW 2 3 I this sectio we aalyze EW 2 3, producig the followig result.

EXACT L 2 -DISTANCE FOR QUICKSORT KEY COMPARISONS 7 Propositio 4.. For ay we have b 2 : EW2 3 σ2 7 3 + 4 3 ) +2 H 2) + 4 3) 2H, where H j is the th harmoic umber ad H 2) : j 2 is the th harmoic umber of the secod order. For that, we first prove the followig two lemmas. Lemma 4.2. For ay k we have D,k) : Bk, k +) where B is the beta fuctio. Lemma 4.3. For ay we have 0 t k t) k lt)dt H k H, E[C ν 0 )+)CU)] E[C ν 0 )+)] 2. Proof of Lemma 4.2. The result ca be proved for each fixed by backwards iductio o k ad itegratio by parts, but we give a simpler proof. Recall the defiig expressio Bα,β) 0 t α t) β dt for the beta fuctio whe α,β > 0. Differetiatig with respect to α gives 0 t α t) β lt)dt Bα,β)[ψα) ψα+β)], where ψ is the classical digamma fuctio, i.e., the logarithmic derivative of the gamma fuctio. But it is well kow that ψj) H j for positive itegers j, so the lemma follows by settig α k ad β k +. Proof of Lemma 4.3. We kow that ν 0 )+ uif{,2,...,} ad that, coditioally give ν 0 ), the radom variable U has the Betaν 0 ) +, ν 0 )) distributio. So from Lemma 4.2, repeated use of 2.5), ad the very well kow ad easily derived explicit expressio µ 2)H 4, 0,

8 PATRICK BINDJEME JAMES ALLEN FILL we have E[C ν 0 )+)CU)] C j) Bj, j +) 0 t j t) j Ct)dt j C j)[+2 H j + j H )+2 H j+ H )] ) ) ) as desired. C j)[2jh j +2 j +)H j+ ] C j)[2jh j 4j )+2 j +)H j 4 j)] C j)[µ j +µ j ] ) C j)[µ j +µ j µ ] C j) 2 E[C ν 0 )+)] 2, Proof of Propositio 4.. It follows from Lemma 4.3 that ] 2 [ b 2 E C ν 0 )+) CU) ) 2 E[C ν 0 )+)] 2 2 ECU) 2 ) 2 E[C ν 0 )+)] 2. ) E[C ν 0 )+)CU)]+ECU) 2 Kowig that ECU) 2 /3, ad from the proof of Lemma A.5 i [2] that E[C ν 0 )+)] 2 ) 7 3 + 2 ) ) 4 3 + 2 + 2) H 4 3 3 H, we have as claimed. b 2 σ2 7 3 + 4 3 ) +2 H 2) 4 + 3) 2H, 5. A closed form for a 2 I this fial sectio we complete the proof of Theorem.4, for which we eed oe more lemma. Lemma 5.. For H 2) j 2, the th harmoic umber of the secod order, we have H 2) j )H 2) H for ay oegative iteger.

EXACT L 2 -DISTANCE FOR QUICKSORT KEY COMPARISONS 9 The lemma is well kow ad easily proved. Proof of mai Theorem.4. For we have from the decompositio 2.7) ad Propositios 3. ad 4. that a 2 2 ) 2 k +) 2 a 2 k + σ2 +2 3 ) 7 3 + 4 3 ) +2 H 2) + 4 3) 2H, ad we recall from 2.8) that a 2 0 σ2. Settig x : ) 2 a 2, we have x 0 ad x 2 x k +c for, with c : σ2 3 +2)) 7 3 )2 + 4 3 +2))H2) + 4 3 H. This is a stadard divide-ad-coquer recurrece relatio for x, with solutio [ ] x ) kc k k )c k +, 0. kk +) k After straightforward computatio ivolvig the idetity i Lemma 5., oe fids a 2 ) 2H ++ 6 ) + 7+4H 2) as claimed. ) 2H ++ 6 ) 4 Refereces k k 2 2 l ) +O, [] James Alle Fill ad Svate Jaso. Quicksort asymptotics. J. Algorithms, 44):4 28, 2002. Aalysis of algorithms. [2] James Alle Fill ad Svate Jaso. Quicksort Asymptotics : Appedix. Upublished, Available from http://www.ams.jhu.edu/~fill/, 2004. [3] C. A. R. Hoare. Quicksort. Comput. J., 5:0 5, 962. [4] Ralph Neiiger ad Ludger Rüschedorf. Rates of covergece for Quicksort. J. Algorithms, 44):5 62, 2002. Aalysis of algorithms. [5] M. Régier. A limitig distributio of Quicksort. RAIRO Iformatique Théorique et Applicatios, 23:335 343, 989. [6] U. Rösler. A limit theorem for Quicksort. RAIRO Iformatique Théorique et Applicatios, 25:85 00, 99. Departmet of Applied Mathematics ad Statistics, The Johs Hopkis Uiversity, 34th ad Charles Streets, Baltimore, MD 228-2682 USA E-mail address: bidjeme@ams.jhu.edu ad jimfill@jhu.edu