Greg M. Johnson wrote:
> Warp wrote:
>
>> 1812433253
>
> Fascinating. Makes me want to make up my own from now on.
>
> Is something like newrand()= mod (1000* sin( (0.5+0.5*newrand())*pi ) , 1)
>
> less "predictable? Can you think of something better?
yes.
weakpoints are that it takes longer to compute than a standard random
number generator but more importantly, is does not have a flat
distribution. It is not as bad as I expected (see attached greg1.png)
but not good enough. I think it is because if your number is close to 1,
the next will also be. And you can get there by accident, so that is
probably why there is that peak close to 1. Removing the pi from your
equation helps a lot. I don't feel like doing a more complete analysis now.
Post a reply to this message
Attachments:
Download 'greg1.png' (4 KB)
Download 'greg2.png' (5 KB)
Preview of image 'greg1.png'
Preview of image 'greg2.png'
|