<s>
Double	B-Algorithm
hashing	I-Algorithm
is	O
a	O
computer	B-General_Concept
programming	I-General_Concept
technique	O
used	O
in	O
conjunction	O
with	O
open	B-Algorithm
addressing	I-Algorithm
in	O
hash	B-Algorithm
tables	I-Algorithm
to	O
resolve	O
hash	B-Algorithm
collisions	I-Algorithm
,	O
by	O
using	O
a	O
secondary	O
hash	B-Error_Name
of	O
the	O
key	O
as	O
an	O
offset	O
when	O
a	O
collision	O
occurs	O
.	O
</s>
<s>
Double	B-Algorithm
hashing	I-Algorithm
with	O
open	B-Algorithm
addressing	I-Algorithm
is	O
a	O
classical	O
data	O
structure	O
on	O
a	O
table	O
.	O
</s>
<s>
The	O
double	B-Algorithm
hashing	I-Algorithm
technique	O
uses	O
one	O
hash	B-Error_Name
value	I-Error_Name
as	O
an	O
index	O
into	O
the	O
table	O
and	O
then	O
repeatedly	O
steps	O
forward	O
an	O
interval	O
until	O
the	O
desired	O
value	O
is	O
located	O
,	O
an	O
empty	O
location	O
is	O
reached	O
,	O
or	O
the	O
entire	O
table	O
has	O
been	O
searched	O
;	O
but	O
this	O
interval	O
is	O
set	O
by	O
a	O
second	O
,	O
independent	O
hash	B-Error_Name
function	I-Error_Name
.	O
</s>
<s>
Unlike	O
the	O
alternative	O
collision-resolution	O
methods	O
of	O
linear	B-Algorithm
probing	I-Algorithm
and	O
quadratic	B-Algorithm
probing	I-Algorithm
,	O
the	O
interval	O
depends	O
on	O
the	O
data	O
,	O
so	O
that	O
values	O
mapping	O
to	O
the	O
same	O
location	O
have	O
different	O
bucket	O
sequences	O
;	O
this	O
minimizes	O
repeated	O
collisions	O
and	O
the	O
effects	O
of	O
clustering	O
.	O
</s>
<s>
Given	O
two	O
random	O
,	O
uniform	O
,	O
and	O
independent	O
hash	B-Error_Name
functions	I-Error_Name
and	O
,	O
the	O
th	O
location	O
in	O
the	O
bucket	O
sequence	O
for	O
value	O
in	O
a	O
hash	B-Algorithm
table	I-Algorithm
of	O
buckets	O
is	O
:	O
</s>
<s>
Generally	O
,	O
and	O
are	O
selected	O
from	O
a	O
set	O
of	O
universal	B-Algorithm
hash	I-Algorithm
functions	I-Algorithm
;	O
is	O
selected	O
to	O
have	O
a	O
range	O
of	O
and	O
to	O
have	O
a	O
range	O
of	O
.	O
</s>
<s>
Double	B-Algorithm
hashing	I-Algorithm
approximates	O
a	O
random	O
distribution	O
;	O
more	O
precisely	O
,	O
pair-wise	O
independent	O
hash	B-Error_Name
functions	I-Error_Name
yield	O
a	O
probability	O
of	O
that	O
any	O
pair	O
of	O
keys	O
will	O
follow	O
the	O
same	O
bucket	O
sequence	O
.	O
</s>
<s>
The	O
secondary	O
hash	B-Error_Name
function	I-Error_Name
should	O
have	O
several	O
characteristics	O
:	O
</s>
<s>
That	O
is	O
,	O
start	O
by	O
randomly	O
,	O
uniformly	O
and	O
independently	O
selecting	O
two	O
universal	B-Algorithm
hash	I-Algorithm
functions	I-Algorithm
and	O
to	O
build	O
a	O
double	B-Algorithm
hashing	I-Algorithm
table	O
.	O
</s>
<s>
All	O
elements	O
are	O
put	O
in	O
by	O
double	B-Algorithm
hashing	I-Algorithm
using	O
and	O
.	O
</s>
<s>
Given	O
a	O
key	O
,	O
the	O
-st	O
hash	B-Error_Name
location	O
is	O
computed	O
by	O
:	O
</s>
<s>
showed	O
the	O
expected	O
number	O
of	O
probes	O
for	O
an	O
unsuccessful	O
search	O
in	O
,	O
still	O
using	O
these	O
initially	O
chosen	O
hash	B-Error_Name
functions	I-Error_Name
,	O
is	O
regardless	O
of	O
the	O
distribution	O
of	O
the	O
inputs	O
.	O
</s>
<s>
Pair-wise	O
independence	O
of	O
the	O
hash	B-Error_Name
functions	I-Error_Name
suffices	O
.	O
</s>
<s>
Like	O
all	O
other	O
forms	O
of	O
open	B-Algorithm
addressing	I-Algorithm
,	O
double	B-Algorithm
hashing	I-Algorithm
becomes	O
linear	O
as	O
the	O
hash	B-Algorithm
table	I-Algorithm
approaches	O
maximum	O
capacity	O
.	O
</s>
<s>
Eventually	O
,	O
rehashing	B-Algorithm
to	O
a	O
larger	O
size	O
will	O
be	O
necessary	O
,	O
as	O
with	O
all	O
other	O
open	B-Algorithm
addressing	I-Algorithm
schemes	O
.	O
</s>
<s>
Peter	O
Dillinger	O
's	O
PhD	O
thesis	O
points	O
out	O
that	O
double	B-Algorithm
hashing	I-Algorithm
produces	O
unwanted	O
equivalent	O
hash	B-Error_Name
functions	I-Error_Name
when	O
the	O
hash	B-Error_Name
functions	I-Error_Name
are	O
treated	O
as	O
a	O
set	O
,	O
as	O
in	O
Bloom	B-Algorithm
filters	I-Algorithm
:	O
If	O
and	O
,	O
then	O
and	O
the	O
sets	O
of	O
hashes	B-Error_Name
are	O
identical	O
.	O
</s>
<s>
There	O
are	O
additionally	O
a	O
significant	O
number	O
of	O
mostly-overlapping	O
hash	B-Error_Name
sets	O
;	O
if	O
and	O
,	O
then	O
,	O
and	O
comparing	O
additional	O
hash	B-Error_Name
values	I-Error_Name
(	O
expanding	O
the	O
range	O
of	O
)	O
is	O
of	O
no	O
help	O
.	O
</s>
<s>
Adding	O
a	O
quadratic	O
term	O
(	O
a	O
triangular	O
number	O
)	O
or	O
even	O
(	O
triple	O
hashing	O
)	O
to	O
the	O
hash	B-Error_Name
function	I-Error_Name
improves	O
the	O
hash	B-Error_Name
function	I-Error_Name
somewhat	O
but	O
does	O
not	O
fix	O
this	O
problem	O
;	O
if	O
:	O
</s>
<s>
Adding	O
a	O
cubic	O
term	O
or	O
(	O
a	O
tetrahedral	O
number	O
)	O
,	O
does	O
solve	O
the	O
problem	O
,	O
a	O
technique	O
known	O
as	O
enhanced	O
double	B-Algorithm
hashing	I-Algorithm
.	O
</s>
<s>
This	O
can	O
be	O
computed	O
efficiently	O
by	O
forward	B-Algorithm
differencing	I-Algorithm
:	O
</s>
<s>
In	O
addition	O
to	O
rectifying	O
the	O
collision	O
problem	O
,	O
enhanced	O
double	B-Algorithm
hashing	I-Algorithm
also	O
removes	O
double-hashing	O
'	O
s	O
numerical	O
restrictions	O
on	O
'	O
s	O
properties	O
,	O
allowing	O
a	O
hash	B-Error_Name
function	I-Error_Name
similar	O
in	O
property	O
to	O
(	O
but	O
still	O
independent	O
of	O
)	O
to	O
be	O
used	O
.	O
</s>
