Binomial distribution with parameters
. If ntrial⋅min(
) ≥ 30, random numbers of the binomial distribution are generated by the BTPE method (see [Kach88
] for details). Otherwise, a combination of inverse transformation and table lookup methods is used. The BTPE method is a variation of the acceptance/rejection method that uses linear (on the fractions close to the distribution mode) and exponential (at the distribution tails) functions as majorizing functions. To avoid time-consuming acceptance/rejection checks, areas with zero probability of rejection are introduced and a squeezing technique is applied.