Computing and Information Technology Interactive Digital Educational Library

 

CITIDEL >
Planet Math Computer Science  >
Planet Math Computer Science Collection >

Please use this identifier to cite or link to this item: http://hdl.handle.net/10117/1200

Title: good hash table primes
Issue Date: 24-Feb-2004
Publisher: PlanetMath
Citation: http://planetmath.org/encyclopedia/GoodHashTablePrimes.html
Abstract: In the course of designing a good hashing configuration, it is helpful to have a list of prime numbers for the hash table size. The following is such a list. It has the properties that: ... each number in the list is prime (as you no doubt expected by now) ... each number is slightly less than twice the size of the previous ... each number is as far as possible from the nearest two powers of two ... Using primes for hash tables is a good idea because it minimizes clustering in the hashed table. Item (2) is nice because it is convenient for growing a hash table in the face of expanding data. Item (3) has, allegedly, been shown to yield especially good results in practice. And here is the list: ... lllc lwr & upr & \% err & prime ... & ... & 10.416667 & 53 ... & ... & 1.041667 & 97 ... & ... & 0.520833 & 193 ... & ... & 1.302083 & 389 ... & ... & 0.130208 & 769 ... & ... & 0.455729 & 1543 ... & ... & 0.227865 & 3079 ... & ... & 0.113932 & 6151 ... & ... & 0.008138 & 12289 ... & ... & 0.069173 & 24593 ... & ... & 0.010173 & 49157 ... & ... & 0.013224 & 98317 ... & ... & 0.002543 & 196613 ... & ... & 0.006358 & 393241 ... & ... & 0.000127 & 786433 ... & ... & 0.000318 & 1572869 ... & ... & 0.000350 & 3145739 ... & ... & 0.000207 & 6291469 ... & ... & 0.000040 & 12582917 ... & ... & 0.000075 & 25165843 ... & ... & 0.000010 & 50331653 ... & ... & 0.000023 & 100663319 ... & ... & 0.000009 & 201326611 ... & ... & 0.000001 & 402653189 ... & ... & 0.000011 & 805306457 ... & ... & 0.000000 & 1610612741 ... The columns are, in order, the lower bounding power of two, the upper bounding power of two, the relative deviation (in percent) of the prime number from the optimal middle of the first two, and finally the prime itself. Bon hash\'etite!
URI: http://www.citidel.org/handle/10117/1200
Appears in Collections:Planet Math Computer Science Collection

Files in This Item:

There are no files associated with this item.

All items in DSpace are protected by copyright, with all rights reserved.

 

Valid XHTML 1.0! DSpace Software Copyright © 2002-2006 MIT and Hewlett-Packard - Feedback