View Single Post
  #2  
Old 11-23-2007, 12:44 AM
ncray ncray is offline
Senior Member
 
Join Date: Apr 2005
Location: Palo Alto, CA
Posts: 386
Default Re: Simple storage problem (math)

For the first 5 bits of the disc, map the integers to whether they are prime or not

integers: 1 2 3 4 5
is prime? 0 1 1 0 1

After that, you kill all multiples of 2, 3, and 5
1/2 of all integers are multiples of 2
1/2 of the integers are odd, and out of the odd integers, 1/3 are multiples of 3, so 1/6 of the remaining integers are odd multiples of 3
1/16 of all integers are multiples of 5 and not of 2 and 3

So we have thrown out 1/2 + 1/3 + 1/16 = 0.8958333 of all integers

Now map the remaining integers to whether they are prime or not
Integers:
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25...
Remaining integers after throwing out multiples of 2, 3, 5:
7 11 13 17 19 23 29 31 37 41 43 47 49
Is prime?
1 1 1 1 1 1 1 1 1 1 1 1 0

So we only need approximately (1-0.8958333) * 2.29*10^9 = 2.39*10^8 bits, which is easily less than 4.4*10^8.

So the first couple bits end up looking like:
0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0
.........|....................................
To the left of the | represents primality of 1, 2, 3, 4, 5
To the right represents primality of integers > 5 which are not multiples of 2, 3, 5.
Reply With Quote