Boost Users :
Subject: [Boost-users] [random] Bias in boost::random generators?
From: Tiago de Paula Peixoto (tiago_at_[hidden])
Date: 2009-05-23 05:03:59
-----BEGIN PGP SIGNED MESSAGE-----
I'm experiencing a bug with the boost::random library. Apparently, most
generators, together with uniform_int<>, produce heavily biased sequences.
I'm sending attached a small test program which generates several
random walks on a lattice, starting from the center, and counts how
many times a site has been visited. It uses both the boost::random
generators, and the tr1::random generators from GCC 4.3, and writes
the separate counts in the files "bcount" and "tcount", respectively.
A plot of the output with boost::random can be seen here:
There is an obvious tendency towards the (0,0) corner of the lattice...
With tr1::random, everything looks normal:
Not to mention I used the same generator (mt19937) with the same seed
value in both cases, which should have given the exact same sequence!
I obtain similar results with other generators, except with minstd_rand,
where the sequences from both libraries are the same. This lead me to
conclude that the problem is with the generators themselves, not with
More info on my end:
platform: x86_64 intel, GNU/Linux
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net