Navigation

Samples are drawn from a Binomial distribution with specified
parameters, n trials and p probability of success where
n an integer > 0 and p is in the interval [0,1]. (n may be
input as a float, but it is truncated to an integer in use)

Parameters :

n : float (but truncated to an integer)

parameter, > 0.

p : float

parameter, >= 0 and <=1.

size : {tuple, int}

Output shape. If the given shape is, e.g., (m,n,k), then
m*n*k samples are drawn.

where is the number of trials, is the probability
of success, and is the number of successes.

When estimating the standard error of a proportion in a population by
using a random sample, the normal distribution works well unless the
product p*n <=5, where p = population proportion estimate, and n =
number of samples, in which case the binomial distribution is used
instead. For example, a sample of 15 people shows 4 who are left
handed, and 11 who are right handed. Then p = 4/15 = 27%. 0.27*15 = 4,
so the binomial distribution should be used in this case.