Random algorithm

Dave Cragg dave.cragg at lacscentre.co.uk
Wed Nov 12 20:26:20 EST 2008


> It would seem that resetting the randomSeed each time you use the  
> random function would only have a 1-in-4,570,422 chance of getting  
> the same seed as the previous run, no?

Yes, but the chances of having the same seed as any of teh previous  
runs becomes progressively larger. Is it not a bit like the shared  
birthdays in a classroom. It only takes 23 people gathered in a room  
to make the chance of two of them sharing a birthday more than 50%.

 From my probably poor calculation, I think if you ran your randomSeed  
algorithm about 2500 times, there would be a 50% chance that the same  
randomSeed had been chosen at least twice. (At 4000, I think the  
chance is over 80%) In many situations, I think a repeated sequence  
would be worse than a biased sequence.

A long time since I did this kind of thing, so apologies if I have  
this wrong.

Dave



More information about the use-livecode mailing list