Random numbers from the binomial distribution. Equivalent to R's rbinom().
For size * min(prob, 1 - prob) >= 30 (algorithm BTPE) the stream can depart from R's: R's final acceptance test has
two Stirling corrections with the wrong sign, and here the signs are right (setSeed(439); rbinom(1, 10000, 0.5) is
4879, R 5023). Below 30 (inversion) the stream is R's.
Parameters
n: number
Number of values to generate (fractions are truncated, as in R).
Random numbers from the binomial distribution. Equivalent to R's
rbinom().For
size * min(prob, 1 - prob) >= 30(algorithm BTPE) the stream can depart from R's: R's final acceptance test has two Stirling corrections with the wrong sign, and here the signs are right (setSeed(439); rbinom(1, 10000, 0.5)is 4879, R 5023). Below 30 (inversion) the stream is R's.