Author: Dieter Buerssner
Date: 10:57:07 09/04/03
Go up one level in this thread
On September 03, 2003 at 22:59:17, Tom Likens wrote: >On September 03, 2003 at 16:28:14, Dieter Buerssner wrote: > >>On September 03, 2003 at 13:43:13, Tom Likens wrote: >> >>>Getting the hamming distance in pseudo-code for N random numbers: >>> >>>1. Generate a random number (index=M) >>> >>>2. Compare it to the 0 ... M-1 valid random numbers alread saved >>> >>> if (popcnt64(new_rand64 ^ array[0..M-1]) >= MIN_HAM) then OK >>> >>>3. If valid, save it into slot M >>> If not valid (hamming distance is too small) goto 1 BTW. This can give an infinite loop. >>>4. Repeat until you have N random numbers >> >>They aren't random anymore, after you filtered them like that. >You're correct of course, the set of numbers generated with the above >algorithm is no longer pseudo-random and I should have been more precise >in my wording. I hope, I didn't sound too pedantic. It was just meant as a side note. I assumed, you were already aware of it. The main point of my posting was, to give a reference to that earlier discussion. I tried different PRNGs (including Mersenne twister) of different quality, and could not see any change (besides noise) in some test suites. Regards, Dieter
This page took 0.02 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.