I like Terry's idea.
Let's say the 5000 numbers are: {1,2,...,5000}

For every 200 numbers you choose, create a 5000 bit string .. which
corresponds to 625 bytes
which is infact less than the 800 bytes you would require to store the
200 numbers as ints.
You don't store the 200 numbers explicitly, only these 5000bit
bitstrings.

To analyze a particular subset, read in its bitstring. To check k,
calculate it's offset in the bitstring
and check if its 0 or 1. This is constant time operation.

I actually liked Kevin's original idea of using prime numbers and
coming up with a single hash value. But yeah, there are practical
limitations with that. You don't really need them all to be prime, u
just need them to be co-prime.

Reply via email to