universidad de la república, uruguay dedicated to …aofa2013.lsi.upc.edu/slides/viola.pdf50 years...

90

Upload: lephuc

Post on 08-Mar-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

50 years of Linear Probing Hashing

Alfredo Viola

Universidad de la República, Uruguay

AofA 2013Dedicated to Philippe Flajolet

Page 2: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

The problem.

The table has m places to hash (park) from 0 to m� 1, and nelements (cars).

Each element is given a hash value (preferred parking lot).

If place is empty, then the element is stored there.

Otherwise, looks sequentially for an empty place.

If no empty place up to the end of the table, the search followsat location 0.

Several R.V. to study, mainly related with cost of individualsearches and total construction cost.

Very important special case: Parking Problem.

In parking the car is lost if no empty place up to the end.

Main R.V. is the number of lost cars.

Important variant: each location can hold up to b (or k) cars.

Page 3: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

A discrete parking problem: Example

Example: 8 parking lots, 8 carsParking sequence: 3, 6, 3, 8, 6, 7, 4, 5

1 2 3 4 5 6 7 8

⇒ 2 cars are unsuccessful

5 / 37

Page 4: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

A discrete parking problem: Example

Example: 8 parking lots, 8 carsParking sequence: 3, 6, 3, 8, 6, 7, 4, 5

1 2 3 4 5 6 7 8

⇒ 2 cars are unsuccessful

5 / 37

Page 5: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

A discrete parking problem: Example

Example: 8 parking lots, 8 carsParking sequence: 3, 6, 3, 8, 6, 7, 4, 5

1 2 3 4 5 6 7 8

⇒ 2 cars are unsuccessful

5 / 37

Page 6: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

A discrete parking problem: Example

Example: 8 parking lots, 8 carsParking sequence: 3, 6, 3, 8, 6, 7, 4, 5

1 2 3 4 5 6 7 8

⇒ 2 cars are unsuccessful

5 / 37

Page 7: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

A discrete parking problem: Example

Example: 8 parking lots, 8 carsParking sequence: 3, 6, 3, 8, 6, 7, 4, 5

1 2 3 4 5 6 7 8

⇒ 2 cars are unsuccessful

5 / 37

Page 8: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

A discrete parking problem: Example

Example: 8 parking lots, 8 carsParking sequence: 3, 6, 3, 8, 6, 7, 4, 5

1 2 3 4 5 6 7 8

⇒ 2 cars are unsuccessful

5 / 37

Page 9: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

A discrete parking problem: Example

Example: 8 parking lots, 8 carsParking sequence: 3, 6, 3, 8, 6, 7, 4, 5

1 2 3 4 5 6 7 8

⇒ 2 cars are unsuccessful

5 / 37

Page 10: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

A discrete parking problem: Example

Example: 8 parking lots, 8 carsParking sequence: 3, 6, 3, 8, 6, 7, 4, 5

1 2 3 4 5 6 7 8

⇒ 2 cars are unsuccessful

5 / 37

Page 11: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

A discrete parking problem: Example

Example: 8 parking lots, 8 carsParking sequence: 3, 6, 3, 8, 6, 7, 4, 5

1 2 3 4 5 6 7 8

⇒ 2 cars are unsuccessful

5 / 37

Page 12: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

A discrete parking problem: Example

Example: 8 parking lots, 8 carsParking sequence: 3, 6, 3, 8, 6, 7, 4, 5

1 2 3 4 5 6 7 8

⇒ 2 cars are unsuccessful

5 / 37

Page 13: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

A discrete parking problem: Example

Example: 8 parking lots, 8 carsParking sequence: 3, 6, 3, 8, 6, 7, 4, 5

1 2 3 4 5 6 7 8

⇒ 2 cars are unsuccessful

5 / 37

Page 14: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

A discrete parking problem: Example

Example: 8 parking lots, 8 carsParking sequence: 3, 6, 3, 8, 6, 7, 4, 5

1 2 3 4 5 6 7 8

⇒ 2 cars are unsuccessful

5 / 37

Page 15: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

A discrete parking problem: Example

Example: 8 parking lots, 8 carsParking sequence: 3, 6, 3, 8, 6, 7, 4, 5

1 2 3 4 5 6 7 8

⇒ 2 cars are unsuccessful

5 / 37

Page 16: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

A discrete parking problem: Example

Example: 8 parking lots, 8 carsParking sequence: 3, 6, 3, 8, 6, 7, 4, 5

1 2 3 4 5 6 7 8

⇒ 2 cars are unsuccessful

5 / 37

Page 17: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

A discrete parking problem: Example

Example: 8 parking lots, 8 carsParking sequence: 3, 6, 3, 8, 6, 7, 4, 5

1 2 3 4 5 6 7 8

⇒ 2 cars are unsuccessful

5 / 37

Page 18: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

A discrete parking problem: Example

Example: 8 parking lots, 8 carsParking sequence: 3, 6, 3, 8, 6, 7, 4, 5

1 2 3 4 5 6 7 8

⇒ 2 cars are unsuccessful

5 / 37

Page 19: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

A discrete parking problem: Example

Example: 8 parking lots, 8 carsParking sequence: 3, 6, 3, 8, 6, 7, 4, 5

1 2 3 4 5 6 7 8

⇒ 2 cars are unsuccessful

5 / 37

Page 20: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

Further research: Bucket parking scheme

Bucket parking scheme

Blake and Konheim [1976]:

Each parking lots can hold up to r carsRelated to analysis of bucket hashing algorithms

r

32 / 37

Page 21: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

Further research: Bucket parking scheme

Bucket parking scheme

Blake and Konheim [1976]:

Each parking lots can hold up to r carsRelated to analysis of bucket hashing algorithms

r

32 / 37

Page 22: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

Further research: Bucket parking scheme

Bucket parking scheme

Blake and Konheim [1976]:

Each parking lots can hold up to r carsRelated to analysis of bucket hashing algorithms

r

32 / 37

Page 23: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

Further research: Bucket parking scheme

Bucket parking scheme

Blake and Konheim [1976]:

Each parking lots can hold up to r carsRelated to analysis of bucket hashing algorithms

r

32 / 37

Page 24: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

Further research: Bucket parking scheme

Bucket parking scheme

Blake and Konheim [1976]:

Each parking lots can hold up to r carsRelated to analysis of bucket hashing algorithms

r

32 / 37

Page 25: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

Further research: Bucket parking scheme

Bucket parking scheme

Blake and Konheim [1976]:

Each parking lots can hold up to r carsRelated to analysis of bucket hashing algorithms

r

32 / 37

Page 26: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

Further research: Bucket parking scheme

Bucket parking scheme

Blake and Konheim [1976]:

Each parking lots can hold up to r carsRelated to analysis of bucket hashing algorithms

r

32 / 37

Page 27: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

Further research: Bucket parking scheme

Bucket parking scheme

Blake and Konheim [1976]:

Each parking lots can hold up to r carsRelated to analysis of bucket hashing algorithms

r

32 / 37

Page 28: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

Further research: Bucket parking scheme

Bucket parking scheme

Blake and Konheim [1976]:

Each parking lots can hold up to r carsRelated to analysis of bucket hashing algorithms

r

32 / 37

Page 29: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

A discrete parking problem Limiting distribution results Analysis Further research

Further research: Bucket parking scheme

Bucket parking scheme

Blake and Konheim [1976]:

Each parking lots can hold up to r carsRelated to analysis of bucket hashing algorithms

r

32 / 37

Page 30: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Linear Probing Hashing.

Page 31: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

The mathematical beauty of Linear Probing!

Page 32: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Some personal motivations ...

Simplest collision resolution strategy for open addressing[Peterson 1957].

Works well for tables that are not too full.

Because of primary clustering, its performance deteriorateswhen the load factor is high.

Its analysis leads to nontrivial and interesting mathematicalproblems. There are connections with tree inversions, treepath lenghts, graph connectivity, area under excursion, etc.

Equivalent formulation in terms of the parking problem.

First problem that D. Knuth analyzed [Knuth 1962] withbucket size 1, and motivated the collection "The Art of

Computer Programming".

The analysis for general bucket size b presents very interestingchallenges. For example, can symbolic methods be used?

Page 33: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

... and a box full of surprises ...

The study of parking sequences and their deep relations withother problems in both discrete and continuous mathematicshas been carried out by di�erent research communities inparallel and with little communication among them.

Several related problems have been studied by experts inprobability, combinatorics and computer sciences.

The methodological techniques to study these problems arevery diverse, and cover a wide range of research areas.

As it is said in [Chassaing and Flajolet 2003], a systematichistorical approach to the problem is very di�cult.

I will concentrate on the contributions made by people fromour community as well as some related work that have inspiredtheir research.

Page 34: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

1962: Summer work by Don Knuth ...

Page 35: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

First published paper.

Page 36: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Historical note on �rst published paper.

Page 37: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Original results.

Let a hash table with m positions and n inserted elements.

Let Pm;n the probability of the last position being empty.Pm;n =

�1� n

m

�.

Let Cm;n the R.V. for the number of successful searches of arandom element.

E [Cm;n] =12 (1 +Q0((m;n� 1)).

E [Cm;�m] = 12

�1 + 1

1��

�with 0 � � < 1.

E [Cn;n] =p

�n8 +O(1) (proved on may 20, 1965).

Let Um;n the R.V. for the number of unsuccessful searches ofa random element.

E [Um;n] =12 (1 +Q1((m;n� 1)).

E [Um;�m] = 12

�1 + 1

(1��)2

�with 0 � � < 1.

The Ramanujan Q function is the special case Q0(n; n) of

Qr(m;n) =nX

k=0

k + r

k

!nk

mn:

Page 38: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

... question by Ramanujan to Hardy in 1913.

Page 39: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

The problem ....

Page 40: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

... and the Ramanujan's Q function into play!

Page 41: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Methodology . . .

Page 42: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

. . . and more methodology!

Page 43: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Collision Resolution Strategies.

In open addressing, when two keys collide, either one of themmay stay in that location, while the other one keeps probing.

First-Come-First-Served (standard).Each collision is resolved in favor of the �rst record thatprobed the location.

Last-Come-First-Served [Poblete and Munro 1989].Each collision is resolved in favor of the incoming record.

Robin Hood [Celis, Larson and Munro 1985].Each collision is resolved in favor of the record that is furtheraway from its home location.

Page 44: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Original proposal of Robin Hood.

"Analysis of a �le addressing method"

[Schay and Spruth 1962].

Modi�cation of the algorithm proposed by Peterson in 1957.

This is the Robin Hood strategy !

Expected value of search cost does not change, as alreadynoted by D. Knuth in his original note.

They do an analysis based on a Poisson approximation, and

�nd E [Cm;�m] = 12

�1 + 1

1���with 0 � � < 1.

Page 45: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Two models to analyze the problem.

Exact �lling model.A �xed number of keys n, are distributed among m locations,and all mn possible arrangements are equally likely to occur.

Poisson model.Each location receives a number of keys that is Poissondistributed with parameter b�, and is independent of thenumber of keys going elsewhere. This implies that the totalnumber of keys, N , is itself a Poisson distributed randomvariable with parameter b�m:

Pr[N = n] =e�b�m(b�m)n

n!:

Page 46: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Poisson Transform.

Results in one model can be transfered into the other modelby the Poisson Transform:

Pm[fm;n; b�] =Xn�0

Pr[N = n]fm;n = e�b�mXn�0

(b�m)n

n!fm;n:

Inversion Theorem:[Gonnet and Munro 1984]

If Pm[fm;n; b�] =Xk�0

am;k(bm�)k then fm;n =Xk�0

am;knk

(bm)k:

The Poisson model is an approximation of the exact �llingmodel when n;m!1 with n=m = b� with 0 � � < 1.

Page 47: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Diagonal Poisson Transform.,

[Munro, Poblete, Viola 1997]

Let a hash table of size m, with n+ 1 keys, and let P be aproperty for � (chosen uniformily at random).Let fm;n be the result of applying a linear operator (e.g. anexpected value) to the probability generating function of P .

fm;n =Xi�0

Pr[� 2 cluster of size i+ 1] fi+2;i

=Xi�0

�n

i

�(m� i� 2)n�i�1(m� n� 2)(i+ 2)i

mnfi+2;i:

Then Pm[fm;n;�] = D2[fn+2;n;�] with

Dc[fn;�] = (1� �)Xn�0

e�(n+c)�((n+ c)�)n

n!fn:

Page 48: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Combinatorial interpretation.

Any Linear Probing Hash table can be seen as a sequence ofalmost full tables (a subtable with all but the last bucket full).

Example: [3-3],[4-4],[5-5],[6-2].

This interpretation can be nicely handled by AnalyticCombinatorics, since for example, it implies that it is enoughto study almost full tables, and then use the sequence

construction.

Page 49: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Distribution of individual displacements.

� Complementary probabilistic andcombinatorial approaches.

� [Janson 2005, Viola 2005].

Let P�� (z) be the probability generating function for the

displacement of a random element wth 0 � � < 1 and� 2 fFCFS;RHg. Then, with T (x) = zeT (x) the treefunction,

PFCFS� (z) =

(1� T (z�e��))2 (1� �)2

2�(1� z):

PRH� (z) =

1� �

ez� � e�

ze� � ez�:

LCFS is much more challenging and [Janson 2005] presentsan exact expression.

Exact results follow by depoissonization.

Page 50: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Parking sequences, acyclic maps, priority queues.

� [Seitz 2009] surveys some of these relations.� [Gilbey and Kalikow 1999]: priority queues.� Presents generalizations of the parking problem.� Distributional analysis of the over�ow.� Analysis of the over�ow in parking with buckets.

g(m;n; k): the number of defective parking functions ofdefect k.

Let G(z; u; v) =Xm�0

Xn�0

Xd�0

g(m;n; k)zn

n! umvd.

ThenG(z; u; v) =

1� T (zu)zv�

1� T (zu)z

� �1� u

v ezv� :

[Cameron, Johannsen, Prellberg and Schweitzer 2008].

In [Viola 2005] parking is used as a subproblem for RH.

Page 51: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Parking problem: limit distributions[Panholzer 2008]

� Studies PrfXm;n = kg = g(m;n;k)mn .

� Limit distributions for Xm;n. Nine regionsdepending on growth of m;n.

n � m: Xm;nL�!X� with PrfX = 0g = 1 (degenerated law).

n � �m; 0 < � < 1: Xm;nL�!X�, discrete limit law.p

m � � := m� n � m: �mXm;n

L�!X

(d)= EXP(2).

� := m� n � �pm;� > 0: 1p

mXm;n

L�!X

(d)= LINEXP(2,�).

0 � � := m� n �pm: 1p

mXm;n

L�!X

(d)= RAYLEIGH(2).

0 � � := n�m �pn:

Xm;n+m�npn

Xm;nL�!X

(d)= RAY(2).

� := n�m � �pn; � > 0:

Xm;n+m�npn

Xm;nL�!X�

(d)= LE(2,�).

pn � � := n�m � n: �

m(Xm;n +m� n) L�!X(d)= EXP(2).

n � �m; � > 1: (Xm;n +m� n) L�!X�, discrete limit law.

m � n: Xm;nL�!X� with PrfX = 0g = 0 (degenerated law).

Page 52: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Total displacement (box full of surprises!).

Page 53: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA
Page 54: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

4 Analytic CombinatoricsTwo basic principles 7! \dictionaries"SYMBOLIC METHODSGenerating functions7! z11z+ z2 + z3 + 2 z4 + 2 z5 + 4 z6 + 5 z7 + 9 z8 + � � �Analytic functions and singularities

10

Page 55: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

CONSTRUCTIONSDictionary (I)F 7! ffng 7! f(z) =Xn fn znn! :11� f = 1 + f + f2 + f3 + � � �exp(f) = 1 + f + 12!f2 + 13!f3 + � � �A[B 7! A(z)+B(z)A�B 7! A(z)�B(z)SeqA 7! 11�A(z)SetA 7! exp(A(z))CycleA 7! log 11�A(z)11

Page 56: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

COMPLEX ASYMPTOTICSDictionary (II)Point of regularity. f(z) � f(z0) + f 0(z0)(z � z0)exp(z)2.521.510.5

0

2

1

0

-1

-2Point of singularity. :9 ddzf(z)��z0(1� z)� 7! n��1�(�)�p1� z 7! n�3=2 � (1� z)3=2 7! n�5=200-0.2-0.4-0.6-0.8-1-1.2-1.40

0.6

0.4

0.2

0

-0.2

-0.4

-0.6

0 0.50-0.5-1-1.5-2-2.50

2

1

0

-1

-212

Page 57: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Permutations: (1� z)�10.8

0.9

1

1.1

1.2

x

-0.2-0.1

00.1

0.2

y

-30

-20

-10

0

10

20

30

Trees: 1�p1� z

0.60.811.21.4x

-0.4

-0.2

0

0.2

0.4

y

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

13

Page 58: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Distributional analysis (almost full tables)� Record construction cost = total displacementFn(q) = n�1Xk=0�n� 1k �Fk(q)(1 + q + � � �+ qk)Fn�1�k(q):� q{Calculus Xn qn2z2The construction cost is worst-case quadratic

17

Page 59: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Lemma. The generating functions associated with momentsfr(z) = U @rqF (z; q) satisfy a linear ODE that involves T (z).zf1 = 12 T 3(1� T )2 ;zf2 = 112 T 4(24� 11T + 2T 2)(1� T )5Theorem. [Full tables, exact form of moments]E[dn;n] = n2 (Q(n)� 1)E[d2n;n] = n12(5n2 + 4n� 1� 8n Q(n)):Q(n) := 1+ n� 1n + (n� 1)(n� 2)n2 + (n� 1)(n� 2)(n� 3)n3 + � � �Theorem. [Full tables, asymptotic form of moments]E[dn;n] = p2�4 n3=2 � 23n+ p2�48 n1=2 � 2135 +O(n�1);Var[dn;n] = 10� 3�24 n3 + 16� 3�144 n2 + p2�135 n3=2 � � � �Knuth (1962-3); Flajolet-Poblete-Viola (1997); Knuth (1997)20

Page 60: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

6 Limit distributionA method of \pumping" moments| Start from nonlinear combinatorial decomposition (BGF)�[F (z; q)] = 0| Apply derivatives U@rq to get rth moment.| Expect linear operator L withLfr = �r[f0; f1; : : : ; fr�1]| Solve exactly and/or or asymptotically (singularities)Method used on� Quicksort, Hennequin 1989: 100 moments; nonGaussian law� Path length in trees, Takacs 1990+� Area below walks, Louchard 1984� In situ permutation, Knuth 1972, Prodinger et aliiPath length in Cayley trees: F (z; q)� zeF (qz;q) = 021

Page 61: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Moment problemA classical theorem: if the \Moment generating function"M(z) =Xr �r zrr!has nonzero radius of convergence, then the law is uniquelydetermined by its moments.A corollary: Convergence of moments implies convergence ofdistributionsExample. w(x) = e�x, �r � r! =) M(z) = 11�zTheorem. For almost full tables, convergence to the Airydistribution,Prf dn;n�1(n=2)3=2 � xg ! PrfX � xg (n!1);where X is Airy distributed. E[Xr] = � �(�12 )�(3r�12 ) r.Xr�0rwrr! = � �2=3(w)��1=3(w)��(w) = 1� (4�2 � 1)� w24�+ (4�2 � 1)(4�2 � 9)2! � w24�2� (4�2 � 1)(4�2 � 9)(4�2 � 25)3! � w24�3 + � � � :24

Page 62: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

The Airy density (area under excursions).

[Louchard 1984],[Takács 1991]

The constants k satisfy

The density !(x) has been calculated in [Takács 1991].

The constants ��k are the zeros of the Airy function Ai(z).

Page 63: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

7 Sparse tablesA table with m cells and n elements has g = m� n \gaps".SparseTable := <Full> * ... * <Full>(---- g times ----)Bivariate GF is: (F (z; q))gThe analysis can be \recycled"Theorem. For �-sparse tables, � = nm , mean and variance:E[dm;n] = n2 (Q0(m;n� 1) � 1);E[d2m;n] = n12 �(m� n)3 + (n + 3)(m � n)2 + (8n + 1)(m � n) + 5n2 + 4n� 1�((m� n)3 + 4(m � n)2 + (6n + 3)(m � n) + 8n)Q0(m;n� 1)� :Q0(m;n) := 1+ n� 1m + (n � 1)(n� 2)m2 + (n� 1)(n� 2)(n� 3)m3 + � � �E[dm;n] = �2(1� �)n� �2(1� �)3 +O(n�1);Var[dm;n] = 6�� 6�2 + 4�3 � �412(1� �)4 n� � � �Flajolet-Poblete-Viola (1997); Knuth (1997)26

Page 64: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

The limit distributionTheorem. A Gaussian law.Proof. Integral of large powers by saddle point[zn](F (z; q))m�n = 12i� I (F (z; q))m�n dzzn+10

1e-05

8e-06

6e-06

4e-06

2e-06

0

y

0

10

5

0

-5

-10

x

020151050-5-10Plus continuity theorem for characteristic functions q = ei�Corollary. Works for large assemblies!E.g. [Mahmoud] Distribution sorts with O(n) buckets.27

Page 65: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Linear Probing and random graphs (I).

Page 66: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Mails exchanged with Don Knuth.

Date: Mon, 29 Sep 1997 13:15:21 -0700 (PDT). . .To: [email protected]: note from Don Knuth

Dear Ph, Ordinarily I am not happy to receive email, but in thiscase it was very touching to learn that you had decided to dedicatesuch a nice paper to me, just after I had (secretly) decided todedicate reference [22] to you!

But I haven't time to study it in detail now, as I'm working 150%time on the new edition of Volume 3.... . .. . .. . .Best regards, Don

Page 67: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Combinatorial approach to Linear Probing.

Page 68: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Combinatorial Analysis (FPV).

Page 69: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Solution to the fundamental recurrence (Knuth).

Page 70: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Conclusions (Knuth).

Page 71: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Properties of the parking function Fn(q).

� Several combinatorial relationsbetween very importantcombinatorial problems.[Kreweras 1980]

Page 72: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Parking, random graphs and random trees.

[Spencer 1997].

BFS traversal of a random graph with vertices {0, 1, . . . , n}.

Induces a queue (Qk(� ))1�k�n and a spanning tree � .

BFS induces a parking sequence (Ak(� ))1�k�n.

Ex: (Ak(� )) = ff6; 8g; f2; 3g; �; f7g; f1; 4g; f5g; f9g; �; �g.xk(� ) = jAk(� )j. Ex: (xk(� )) = f2; 2; 0; 1; 2; 1; 1; 0; 0g.yk(� ) = x1(� ) + x2(� ) + : : :+ xk(� )� k + 1, size of queue(Q(� )) before step k. Ex: (yk(� )) = f2; 3; 2; 2; 3; 3; 3; 2; 1g.y1(� ) + : : : yn(� )� n is the total displacement. Ex: 12.

BFS induces a random walk excursion. Ex: b.

Page 73: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Parking sequences and random graphs.

� Cn;k: # connectedgraphs with n verticesand n+ k � 1 edges.� Dn+1;n: RV for totaldisplacement in parking

with n cars.

Theorem:Cn;k

Cn;0= E

h�Dn;n�1

k

�i.

Sketch: How may graphs give the same � with this BFS?

Graph has the edges of � plus some of the (y1(� )� 1)+: : :+ (y1(� )� 1) edges joining parked car with collisions.

Cn+1;k =X�

�y1(�)+:::+y1(�)�nk

�= E

h�Dn+1;n

k

�i(n+ 1)n�1.

(n+ 1)n�1 is both the number of parking functions with ncars and labelled trees with n+ 1 nodes.

Page 74: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Back to Knuth (1997).

P.g.f. for the total displacement in parking with n cars:

Fn(q)

Fn(1):

Moreover

E

" Dn+1;n

k

!#=

1

k!

F(k)n (1)

Fn(1);

and

F (1 + q) =Xk�0

1

k!F(k)n (1)qk:

� So, if Fn(q) enumerates total displacements in parkingwith n cars, then Fn(1 + q) enumerates connectedgraphs with n+ 1 nodes discriminated by their excess! .

Page 75: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Inversions in Cayley trees.

[Gessel and Wang 1979]

The inversions are f4; 3g; f4; 2g; f6; 2g, and f6; 5g.Bijection with parking problem. Same functional equation.

BFS starting at 1, visiting the greatest unvisited node �rst.

How many graphs share the same spanning tree?: Inversions!

� In(t): # of inversions of a tree rooted at 1.

� Cn(t) = tn�1In(1 + t).

Page 76: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Parking sequences, random excursions, . . .

[Spencer 1997].

(Ak(� )) = ff6; 8g; f2; 3g; �; f7g; f1; 4g; f5g; f9g; �; �g.xk(� ) = jAk(� )j. Ex: (xk(� )) = f2; 2; 0; 1; 2; 1; 1; 0; 0g.yk(� ) = x1(� ) + x2(� ) + : : :+ xk(� )� k + 1, size of queue(A(� )) before step k. Ex: (yk(� )) = f2; 3; 2; 2; 3; 3; 3; 2; 1g.There are n!

x1!:::xn!parkings seqs. associated to (y1; : : : ; yk),

with probability proportional toQni=1

e�1

xi!, (n Po(1) i.i.d.).

Poisson R.W. with y0 = 0, steps xi � 1, conditioned to bepositive on time 1; 2; : : : ; n and zero on time n+ 1.

Page 77: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

. . . and the ine�able Brownian excursion!

(xk(� ))0�k�n are Po(1) i.i.d. conditioned as above.

Corresponding unlabelled tree � is a Galton-Watson tree withPo(1) progeny, constrained to have n+ 1 nodes, and xk is theprogeny of kth node visited by the BFS.

It is known that�ybntcp

n

�0�t�1

L�!(e(t))0�t�1, ( L�! denotes

convergence in law) with (e(t)) the Brownian excursion.

As a consequenceDn+1;n

npn

L�!

R 10 e(t)dt:

maxk ykpn

L�!m = max

0�t�1e(t):

[Chassaing and Marckert 2001].� Convergence of moments. Coupling

labeled trees-empirical processesusing parking functions.

Alternative probabilistic proof to [Flajolet, Poblete, Viola1998] for the convergence of moments towards moments ofthe Airy law.

Page 78: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

More asymptotic distributions: new cases.

[Janson 2001]

Four di�erent methods used in the proof!There is a phase transition around m� n � p

m.Let Um;n the average cost of an unsuccessful search beginningat a random cell h (averaged over h). Then

Page 79: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

"Monkey Saddle" as the ALGO project's logo.

Page 80: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Distribution of lengths of parking blocks.

[Pittel 1985].� Table with ` = m� n empty places.

� Bm;`k length of kth largest cluster.

� When `=m! � with � > 0 then

Bm;`1 =

2 logm�3 log logm+�m

2(��1�log �) ; where �m

converges weakly to an extreme-value distribution.

Moreover, from [Chassaing and Louchard 2002] we haveTheorem: For n;m jointly to +1,

1 ifpm = o(`); B

m;`1 =m L

�! 0;2 if ` = o(

pm); B

m;`1 =m L

�! 1:

Phase transition occurs when ` = �(pm).

Largest block reaches O(m) afterpm cars arrive at the

critical region. So, we have a coalescence phenomena.

Studied with the help of Brownian motion theory.

Page 81: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Size of the �rst created cluster.

[Chassaing and Louchard 2002].

Rm;n, size of the cluster of the �rst arrived car.

Pr[Rm;n = k] =�n�1k�1

� (k+1)k�1(m�k�1)n�k�1(m�n�1)mn�1 .

Pr[Rm;n = k] � (k + 1)k�1 e��(k+1)�k�1

(k�1)! (1� �), (0 < � < 1).

Pr[Rm;n = k] = 1mf

��; km

�+O(m�3=2); m� n = �

pm,

where f is the density of N2

�2+N2 (N standard Gaussian), with

f (�; x) = �2�x

�1=2(1� x)�3=2exp�� �2x

2(1�x)�1]0;1[(x).

In other words, when m� n = �pm then Rm;n

mL�!:

N2

�2+N2 .

Limit cases: Rm;n

mP�!0 (�!1) and Rm;n

mP�!1 (�! 0).

Page 82: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Distribution of the length of the clusters.

Bm;`k length of the kth largest cluster and Bm;` =

�Bm;`k

�k�1

.

Let e(t) the normalized Brownian excursion.

Let �e(x) = e(x)� �x� sup0�y�x(e(y)� �y).

B(�) = (Bk(�))k�1 decreasing widths of �e(x) excusrions.

Theorem: If lim p̀m

= � > 0, then Bm;l

mL�!B(�).

As a consequence, from [Pavlov 1977] in random forest (andits relation with the parking problem),

Joint distribution of B(�) out of reach.

Page 83: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Asymptotic distributions of block lenghts.

Page 84: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Size-biased permutations R(�).R(�) constructed from B(�).

1 Choose R1(�) with Pr(R1(�) = Bk(�)jB(�)) = Bk(�).2 Same for Rk(�) but with the terms that did not appear before.

� R(�) appears in the �-valuedfragmentation process derived fromthe continuum random tree (CRT) inthe standard additive coalescence.

� [Aldous and Pitman 1998].

Let Rm;` =�Rm;`k

�k�1

, the sequence of block sizes ordered by

date of birth, and Rk(�) =Rm;`

k

m with ` = n�m = d�pme.Theorem: If lim p̀

m= � > 0, then Rm;l

mL�!R(�).

Page 85: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Coalescence: emergence of a giant block.Up to now parking frozen at �xed �: n(�) = m� b�pmc.To understand coalescence: understand the dependencebetween parking schemes at times n(�1) < : : : < n(�k).Joint distribution: (size(�), initial position(�))��0 of eachblock.Coalescence in the discrete model, translates into coalescencein the continuous model at the limit.Two constructions of the additive coalescent.[Aldous and Pitman 1998] CRT as a limit of a discretemodel of coalescence-fragmentation process that starts with arandom unrooted labelled tree (reverse of process of deletingedges at random).

� [ Bertoin 2000] based on xcursions of thefamily of stochastic processes (�e)��0.

� [Chassaing and Louchard 2002] prove thatasymptotically parking schemes lead to thisconstruction of the additive coalescent.

Page 86: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Parking schemes and Pavlov's forests.

Page 87: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Parking with buckets: distribution of over�ow.

Let gb(m;n; d) the number of parking functions of defect d,with buckets of size b.

Let Gb(z; u; v) =Xm�0

Xn�0

Xd�0

gb(m;n; d)zn

n! umvd.

Then [Seitz 2009]

Gb(z; u; v) =

1

1� uvkezv

! b�1Yj=1

�1� b

zvT (!ju

1b z

b )

b�1Yj=1

�1� b

zT (!ju

1b z

b )

� :

Let wm;b�;k be the probability of having k cars going toover�ow in a b�-full table with m buckets of size b and � < 1,and m(b�; z) =

Pk�0wm;b�;kz

k.

Then [Viola 2010]

m(b�; z) =

�b(1� �)(z � 1)

zb � eb�(z�1)

� Qb�1j=1

�z � T (!j�e��)

�Qb�1j=1

�1� T (!j�e��)

� +O��bm

�:

Page 88: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Linear Probing with Buckets: bucket occupancy.

Let Td(b�) be the probability that a given bucket has morethan d empty places, when n;m!1, 0 � n=bm = � < 1.

From [Viola 2010], inspired in [Blake and Konheim 1977]:

Theorem

Td(b�) = b(1� �)[ud]

Qb�1i=1

�1� uT (!i�e��)

�Qb�1j=1

�1� T (!j�e��)

� ; 0 � d � b� 1;

where T is the Tree function and ! is a b-th root of unity.

The sequence Tk;d;b = k![�k]Td(�); 0 � d < b is sequence EISA124453 Neil Sloane's Encyclopedia of Integer Sequences.

Page 89: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Linear Probing and Paking problem with Buckets.

From [Viola 2010], following [Viola and Poblete 1998] andthe pioneering work by [Blake and Konheim 1977]:

Theorem

Let m;b� be the random variable for the cost of searching a

random element in a b�-full table with m buckets of size b and

� < 1, using the Robin Hood linear probing hashing algorithm, and

let m(b�; z) be its probability generating function. Then

m(b�; z) =z

b

b�1Xd=0

Cm

�b�; e

2�idb z1=b

� b�1Xp=0

�e2�idb z1=b

��p;with

Cm(b�; z) =b(1� �)(1� eb�(z�1))

b��zb � eb�(z�1)

�Qb�1j=1

�z � T (rj�e��)

�Qb�1j=1

�1� T (rj�e��)

� :

Page 90: Universidad de la República, Uruguay Dedicated to …aofa2013.lsi.upc.edu/slides/Viola.pdf50 years of Linear Probing Hashing Alfredo Viola Universidad de la República, Uruguay AofA

Some �nal considerations.

Problem with a very rich history.

Paradigm of a problem that nicely integrates analytical,combinatorial and probabilistic approaches.

This integration (together with the use of symbolic methods!)has allowed the understanding of deep relations with otherimportant problem.

Problem that it is continuously evolving, and new importantresults are still to come.

Some ongoing work:

Total displacement with buckets. Relation with other problemsas for b=1?

FCFS with buckets.

Study more properties of sequence Td(b�) and �nd otherapplications.

Number of movements in deletion algorithm.

Worst case Robin Hood.