On Wed, Aug 11, 2010 at 7:43 PM, Tim Vandermeersch
<[email protected]> wrote:
> Hi,
>
> While reading some material on Monte Carlo simulations I came across a
> simple method to test a random number generator. You can generate N
> numbers and plot them in 2D by using one random number as x coordinate
> and another as y. For a good random generator the scatter plot will
> look random. However, OBRandom does not do very well. The plot from
> OBRandom looks like the text book example of a bad random number
> generator. The points lie on a small number of lines as can be seen in
> the images linked below.

I noticed this too a while ago. I was generating crystal structures
from random fractional coordinates, and all the atoms lined up in
parallel planes within the fractional cell. I quickly switched back to
the stdlib implementation :-)

> I haven't tested rand() but since this
> depends on the system used, this is not really a portable solution.

I've always wondered why OBRandom exists -- I would assume that the
built in standard random number generators would be decent on each
platform? Is it common to rewrite random number generators? Perhaps we
should take a look at the common implementations with the same test
and then just use stdlib if they're ok. My guess is that if a C
implementation uses a bad random number generator, it's probably not
good to use for any sort of computation...

Dave

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
OpenBabel-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbabel-devel

Reply via email to