The Number of
Symbol Comparisons in QuickSort & QuickSelect
- I. Overview ~~~ Philippe Flajolet
- II. Average-Case Analysis ~~~ Brigitte
Vallée
- III. Distributions ~~~ Jim Fill
Symbol Comparisons in QuickSort & QuickSelect I. Overview - - PowerPoint PPT Presentation
The Number of Symbol Comparisons in QuickSort & QuickSelect I. Overview ~~~ Philippe Flajolet II. Average-Case Analysis ~~~ Brigitte Valle III. Distributions ~~~ Jim Fill Wednesday, June 17, 2009 1 1.
Vallée
k-1 n-k P: pivot <P >P
4 Wednesday, June 17, 2009functions (GFs). Exchanges; Median-of-3, etc.
MGFs & moments, Martingales, Contraction Hoare; Knuth; Sedgewick [1960-1975] Hennequin, Régnier, Rösler [1989+] Fill & Janson [2000], Martinez...
5 Wednesday, June 17, 2009m m m < k? m > k? m = k?
P: pivot <P >P
6 Wednesday, June 17, 2009Various brands of QuickSelect:
7 Wednesday, June 17, 2009Average-case analyses Knuth et al [ca 1970]
8 Wednesday, June 17, 2009Distributional analyses
Mahmoud-Modarres-Smythe, Grübel, Rösler, Hwang-Tsai, et al. perpetuities: 1+U1+U1U2+U1U2U3+... i.i.d. unif. [0,1]
(fixed rank; fixed quantile)
Lent-Mahmoud, Prodinger, et al.
9 Wednesday, June 17, 2009Sedgewick @ AofA-02(?): “actual complexity matters!”
to compare with radix methods, hashing, etc.
11 Wednesday, June 17, 2009(u,v). a b a b b b... a b a a b a... coincidence=3; #comparisons=4. (γ) (β) Alphabet: Σ
12 Wednesday, June 17, 2009A Binary Search Tree: symbol comparisons
13 Wednesday, June 17, 2009It takes O(n.log n) symbol comparisons to “distinguish” n elements --- in probability, on average With high probability, the common prefix of any two words has length at most O(log n). Under a wide range of classical STRING (WORD) MODELS: Many many people in the audience...
14 Wednesday, June 17, 2009TRIES Sn=O(Kn.log(n))
Upper bounds
15 Wednesday, June 17, 2009source + density model.
source for QuickMin/Max & QuickRand Symbol comparisons
(cf also: Panholzer & Prodinger)
CONSTANTS? ~Cn.log(n)2 ~C’.n
16 Wednesday, June 17, 2009“A source models the way data (symbols) are produced.”
“La Source” by Ingres @ Musée d’Orsay
17 Wednesday, June 17, 2009the probability of starting with w
[Later] + “regularity” conditions: tameness
18 Wednesday, June 17, 2009Property: The Source is parameterized by [0,1]: to an infinite word w, there corresponds α such that M(α)=w. a b aa ab ba bb aba abb
1
19 Wednesday, June 17, 2009Notations:
1
pw pw- pw+ Pr(prefix<w) Pr(prefix=w) Pr(prefix>w) Fundamental constants of QuickStuffs will be all expressed in terms of fundamental probabilities aw bw
20 Wednesday, June 17, 2009Bernoulli sources such as 1/2, 1/6,1/3.
density f(x) or c.d.f F(x).
[Devroye 1986] [Vallée 2001; Clément-Fl-Vallée 2001]
21 Wednesday, June 17, 2009Fundamental intervals & triangles
1/2 1/6 1/3
22 Wednesday, June 17, 2009(Le Savant Cosinus)
23 Wednesday, June 17, 2009Average-case
➜ ➜QuickMin, QuickRand
2 1
QuickVal ☞ ☞
24 Wednesday, June 17, 2009QUICKVAL(α): is dual to QuickSelect
[corresponding to value v] is α.
<P >P v<P v=P v>P P: pivot
25 Wednesday, June 17, 2009Distribution Theorem: Assuming a suitable tameness condition, there exists a limiting distribution of the cost Sn/n of QuickQuant(α), which can be described explicitly
26 Wednesday, June 17, 2009