Random algorithm

Dave Cragg dave.cragg at lacscentre.co.uk
Mon Nov 17 16:58:11 EST 2008


On 17 Nov 2008, at 16:04, Richard Gaskin wrote:

> Dave Cragg wrote:
> ...
> > The two scripts  measure the number of repeated sequences that are
> > generated by the two methods. The first method has yet to produce a
> > repeated sequence here.
> ...
> > METHOD 1 (no resetting)
>
> Bingo.  The psuedo-random algo used in Rev is pretty good as it is.

I'm not sure if you can safely draw that conclusion. (Although I've no  
reason to think it isn't pretty good.) My example script sliced the  
25000 random numbers into sets of 5 and found no repeats among the  
sets. It's possible there were repeating sequences that crossed the  
"set boundaries".

Looking at the responses to my last mail, I'm not sure if I made my  
point clearly. (It wouldn't be the first time.) I was just wanting to  
point out the danger of repeatedly resetting the randomSeed with a  
random number (or any other technique that involves a risk of  
repeating the randomSeed value). The scripts I posted were to  
demonstrate a probably unwanted outcome that, although entirely  
predictable, is not always obvious.

Cheers
Dave



More information about the use-livecode mailing list