Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: 64-Bit random numbers

Author: martin fierz

Date: 08:31:18 10/29/03

Go up one level in this thread


On October 29, 2003 at 09:32:37, Gerd Isenberg wrote:

>On October 29, 2003 at 07:00:56, martin fierz wrote:
>
>>On October 28, 2003 at 15:01:40, Gerd Isenberg wrote:
>>
>>>On October 28, 2003 at 14:50:35, Martin Schreiber wrote:
>>>
>>>>Hi,
>>>>
>>>>For my hash tables I need 64 bit random numbers, but I don't know the source
>>>>code.
>>>>I use Dev-C++.
>>>>Can anybody help me?
>>>>
>>>>Martin
>>>
>>>This simple one works quite well
>>>
>>>UINT32 HashRand32()
>>>{
>>>    static UINT32 r = 0;
>>>    return (r = 1664525L*r + 1013904223L);
>>>}
>>>
>>>...
>>>hashval = HashRand32();
>>>hashval = (hashval << 32) | HashRand32();
>>
>>i use a similar concatenation of random numbers generated with the C rand()
>>function.
>>
>>i have never believed all the stuff about "bad" or "good" random numbers for
>>hashing purposes (of course, for other things it's different...). i also don't
>>believe this "hamming distance" stuff. i'd be very surprised if any of this made
>>any difference in practice. has anybody ever tested this?
>>
>>cheers
>>  martin
>
>
>Hi Martin,
>
>i'm not an expert in pseudo random number generators.
>I never tried C-rand() so far, because it may vary from system to system and i
>want deterministic numbers independent from compiler or os. I looked for min and
>average hamming distance, but i have no idea whether a min hamming distance of
>let say 16 does necessarily imply higher collision rate as 30.
>I store the whole 64 bit signature inside my hash structure - and even look for
>validity of the stored move.
>
>Cheers,
>Gerd

hi gerd,

there was once a discussion about hamming distance and good random numbers, and
IIRC there was also a "good" function for getting one's random numbers. i
compared that with mine, which was supposed to be "bad" and couldn't find any
difference in practice... that's why i don't believe this stuff any more!

cheers
  martin



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.