|
spot
2.3.3.dev
|
Compute pseudo-random integer value between 0 and n included, following a binomial distribution with probability p. More...
#include <spot/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 with 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.13