[computer-go] Re: computer-go Digest, Vol 25, Issue 14, Message 7
Jacques Basaldúa
jacques at dybot.com
Fri Aug 18 13:43:08 PDT 2006
Hi:
I was assuming that random() in your source code is the typical
built-in function like rand() in <stdlib.h> or as in Borland's VC
& Delphi system libraries use this generator:
Procedure _RandInt;
begin
ASM
imul edx, dword[RandSeed], RandScale
inc edx
mov dword ptr [RandSeed], edx
mul edx
mov eax, edx
END
end;
All these generators do have cycle lengths below 2^32. Therefore, what
I was explaining applies to that case. In that case, any extraction
is determined by its predecessor. In terms of randomness making two
extractions or copying the same twice is the same.
Chaining two extractions of a 32-bit RNG does not produce a 64 bit RNG.
That's all I wanted to explain to anyone who thinks it could be a good
idea. Its a bad idea.
If you are using a Mersenne Twister, its ok, but its *not a 32-bit RNG*
even if you read 32 bits at a time. A Mersenne Twister stores 624 x 32 =
19968 bits. And you can do extractions of a single bit, 32, 128 or any
other size. A Mersenne Twister is, as I already said in my message,
the solution to this problem.
Excuse me if you all (all who answered) assume the RNG is a Mersenne
Twister, but maybe other readers, like myself, do not.
Jacques.
More information about the computer-go
mailing list