Minimum Memory Requirements
- From: "James Dow Allen" <jdallen2000@xxxxxxxxx>
- Date: 18 Aug 2005 01:31:20 -0700
Suppose we wish to store K elements in a table.
For simplicity suppose that we need to produce
only a single bit (Yes/No for existence); the
table entries have no stored attributes.
Let L denote the inverse density of the elements
in their keying space. For example, when storing
200,000 9-digit social security numbers
L = 10^9 / 200000 = 5000
We assume L is large.
Let S denote the inverse density of false positives.
For all techniques except Bloom filter, we assume
a reliable table, ie. S = infinity.
How much memory is needed for the table?
For a Bloom filter memory
1.5 K * (log S) bits
For a hash table
1.2 K * (log K + log L + O(1)) bits
For a bit map
K * L bits
Theoretical minimum
K * (log L + 1.44) bits
Hashtable/Bitmap combination
1.1 * K * (log L + 3) bits
In this accounting, logs are to base 2, constants
which appear are just good approximations. I show
a O(1) term with hash tables: this can be made
quite close to zero but will be 32 bits or more for
most off-the-shelf hash routines.
The theoretical minimum is for elements randomly
distributed in their keying space. This minimum
can be approached with various methods, or even
exceeded when the distribution is non-random.
Is this all well known? I've not seen this summary
elsewhere, but I've not looked much.
Many in this newsgroup should be able to reproduce
the formulae above, but I'll elucidate further
if there's interest.
James Dow Allen (email jamesdowallen at gmail.com)
.
- Follow-Ups:
- Re: Minimum Memory Requirements
- From: Paul E. Black
- Re: Minimum Memory Requirements
- Prev by Date: Re: separating context-free languages by regular languages
- Next by Date: Distance in Denotational Semantics?
- Previous by thread: Re: separating context-free languages by regular languages
- Next by thread: Re: Minimum Memory Requirements
- Index(es):
Relevant Pages
|