|
spot
1.2.6
|
Compute pseudo-random integer value between 0 and n included, following a binomial distribution for probability p. More...
#include <misc/random.hh>

Public Member Functions | |
| barand (int n, double p) | |
| int | rand () const |
Protected Attributes | |
| const int | n_ |
| const double | m_ |
| const double | s_ |
Compute pseudo-random integer value between 0 and n included, following a binomial distribution for probability p.
gen must be a random function computing a pseudo-random double value following a standard normal distribution. Use nrand() or bmrand().
Usually approximating a binomial distribution using a normal distribution and is accurate only if n*p and n*(1-p) are greater than 5.
1.8.4