Binomial Distribution

The binomial distribution, also known as the Bernoulli distribution, models the number of successes in a fixed number of Bernoulli trials. A Bernoulli trial is an experiment with two possible outcomes, labeled 'success' and 'failure,' where the probability of success has a fixed value for all trials.

Definition

The binomial distribution has two parameters: the number of trials n and the probability of success p in each trial. The probability mass function (PMF) is given by:

P(X=k)=(nk)pk(1p)nk

The cumulative distribution function (CDF) is:

F(k;n,p)=i=0k(ni)pi(1p)ni

The domain of the binomial distribution is k{0,1,2,,n}. The parameters must satisfy nN and 0p1.

Applications

The binomial distribution arises whenever underlying events have two possible outcomes, and the probability of each outcome occurring remains constant. Common applications include:

  • The number of times heads or tails is obtained in a fixed number of coin tosses.

  • The number of defective elements found in a random sample of fixed size from a stable production process.

  • Estimating the size of an animal population by marking individuals and releasing them back into the wild.

Properties

The binomial distribution has several important statistical properties:

Statistical Properties
PropertyValue
Meannp
Variancenp(1p)
Skewness12pnp(1p)
Kurtosis16p(1p)np(1p)
Mediannp or np
Mode(n+1)p
Support{0,1,2,,n}
Entropy12log(2πenp(1p))

Relationships to Other Distributions

The binomial distribution is closely related to several other distributions:

The BinomialDistribution class

The binomial distribution is implemented by the BinomialDistribution class. It has two constructors. The first constructor takes one argument: the number of trials. The probability of success is assumed to be 0.5. The following constructs a binomial distribution for 10 trials:

C#
var binomial1 = new BinomialDistribution(10);

The second constructor takes two arguments. The first argument is once again the number of trials. The second argument is the probability of success of a trial. The probability must be between 0 and 1. The following constructs a binomial distribution with 10 trials and probability of success 0.4:

C#
var binomial2 = new BinomialDistribution(10, 0.4);

The BinomialDistribution class has two specific properties: NumberOfTrials returns the number of trials. ProbabilityOfSuccess returns the probability of success of a trial.

BinomialDistribution has one static (Shared in Visual Basic) method, Sample, which generates a random sample using a user-supplied uniform random number generator. It has two overloads, corresponding to each of the two constructors.

C#
var random = new Pcg32();
int sample1 = BinomialDistribution.Sample(random, 10);
int sample2 = BinomialDistribution.Sample(random, 10, 0.4);

The above example uses the Pcg32 class to generate uniform random numbers.

For details of the properties and methods common to all discrete probability distribution classes, see the topic on Discrete Probability Distributions.

References

  • "Introduction to Probability Models" by Sheldon M. Ross.

  • "Probability and Statistics" by Morris H. DeGroot and Mark J. Schervish.

See Also