E
Eric Sosman
Eric said:[...] Note,
too, that an AND simply discards bits from the hash value;
if you engage in a more complex "folding" operation to let
all the bits participate, the cycle count starts creeping up
toward that of the division.
Real hash functions don't require folding.
Are you saying that a "real" hash function is one whose
high-order bits are irrelevant and can be discarded without
degrading the performance of the hash? If so, it's easy to
see that the only "real" hash functions are constant, yielding
the same output for all inputs (retain the low-order N bits
and consider the behavior as N->0).
Real hash functions (in my notion of "real," not yours)
put useful information in all their output bits.
[...] More generally, if you choose a table
of size T, the skip distances Si should be relatively prime to
T but need not be prime. The attraction of a prime T is that
it's easy to find Si that are relatively prime to it!
Easy but costly. To find small primes for skip values [...]
You don't need to "find" anything. If T is prime, all
numbers in [2,T-1] are relatively prime to it.
I don't know what kind of thing you want to hash, where the index and
stored hash is not dominated by the actual raw data that you are
hashing in the first place.
Consider a large number of large objects, each with half a
dozen keys by which you might want to locate it. Put each object
in six hash tables without wasting a ton of storage and without
making duplicate copies that need to be kept in synch. (And this
time, try not to overlook the phrase "open-addressed table.")
[...] And there's
where the interesting part comes in: For the same expenditure of
storage, you could have a pointers-only table with twice as many
entries,
Huh? In a chained hash solution, [...]
Again, I draw your attention to the phrase "open-addressed
table."
[...] or half the "load factor" for the same number of stored
items. Search and insertion times rise steeply at high load
factors (in ways that depend on the algorithms), so the potential
reduction in probe count might make up for the increased number
of item comparisons per probe.
You must be smoking pot. [...]
I bow to your obviously superior experience of mind-altering
substances, and thank you for this insight into the sources of
your social skills.