[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: question on hash for objects such as tables and functions
- From: Francisco Olarte <folarte@...>
- Date: Tue, 26 May 2020 21:22:23 +0200
Philippe:
On Tue, May 26, 2020 at 9:15 PM Philippe Verdy <verdyp@gmail.com> wrote:
> Le mar. 26 mai 2020 à 20:57, Francisco Olarte <folarte@peoplecall.com> a écrit :
>> On Tue, May 26, 2020 at 3:46 AM Philippe Verdy <verdyp@gmail.com> wrote:
>> > A table size for 16 elements: 2^4-1=15 is Mersenne, but is a multiple of 3 and 5, so collisions occur for objects whose differences of addresses is frequently a multiple of 3 or 5 (e.g. allocating many objects with size 10, or 12 or 20).
>> > A table size for 32 elements: 2^5-1=31 is Mersenne, but is prime (no problem here).
>> > A table size for 64 elements: 2^6-1=63 is Mersenne, but is a multiple of 3, so collisions occur for objects whose differences of addresses is frequently a multiple of 3 (e.g. allocating many objects with size 12)
>> > A table size for 128 elements: 2^7-1=127 is Mersenne, but is prime (no problem here).
>> > A table size for 512 elements: 2^9-1=511 is Mersenne, but is a multiple of 3.
>> > A table size with 256 elements: 2^8-1=255 is Mersennen but is a multiple of 5
>> 4,6,9,8 are not primes and are even, their mersennes must all be divisible by 3.
> That's what I said, but there are some missing words at end of the sentence.
Know, you listed some factors ( with a possible typo in 511, maybe you
misstyped 73, as its blatanbtly obvious 511 is not a multiple of 3). I
did not discuss this. I just pointed they cannot be primes. as
2^78346215547238692438756439874329587435987254432654269854367958432675834678259346789543267984532678945362784539546372893452789645328976453296783452785-1
can't either.
> You are misreading what I wrote.
I may have.
> I've *explicitly* said 4,6,9,7 are not primes,
Well, seven is a prime. Ad 2^7-1 too, IIRC correctly. Have you misstyped 8?
....
>I listed them jsut to show that the searh for good primes will not be long for an 8-bit multiplier.
You did not have to list them, given there are only 256 8 bit
numbers, it will never be a long search.
Francisco Olarte.