Function random_binomial(long long int, double)

Function random_binomial(long long int, double)#

Function Documentation#

long long int random_binomial(long long int n, double p)

Returns a random draw (non-negative integer) from the Binomial distribution B(N,p).

Uses Normal and Poisson distribution approximations for large N.

Parameters:
  • n[in] number of trials

  • p[in] success probability

Returns:

The random number.