The Power of Simple Tabulation Hashing

  • Authors:
  • Mihai Pǎtraşcu;Mikkel Thorup

  • Affiliations:
  • AT&T Labs---Research;AT&T Labs---Research

  • Venue:
  • Journal of the ACM (JACM)
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

Randomized algorithms are often enjoyed for their simplicity, but the hash functions used to yield the desired theoretical guarantees are often neither simple nor practical. Here we show that the simplest possible tabulation hashing provides unexpectedly strong guarantees. The scheme itself dates back to Zobrist in 1970 who used it for game playing programs. Keys are viewed as consisting of c characters. We initialize c tables H1, ..., Hc mapping characters to random hash codes. A key x = (x1, ..., xc) is hashed to H1[x1] ⊕ ⋯ ⊕ Hc[xc], where ⊕ denotes bit-wise exclusive-or. While this scheme is not even 4-independent, we show that it provides many of the guarantees that are normally obtained via higher independence, for example, Chernoff-type concentration, min-wise hashing for estimating set intersection, and cuckoo hashing.