BinomialDistribution
✖
BinomialDistribution
represents a binomial distribution with n trials and success probability p.
Details

- The probability for value
in a binomial distribution is
for integers from 0 to n. »
- BinomialDistribution allows n to be any non-negative integer.
- BinomialDistribution allows n and p to be dimensionless quantities. »
- BinomialDistribution can be used with such functions as Mean, CDF, and RandomVariate. »
Background & Context
- BinomialDistribution[n,p] represents a discrete statistical distribution defined at integer values
and parametrized by a non-negative real number p,
. The binomial distribution has a discrete probability density function (PDF) that is unimodal, with its peak occurring at the mean
. The parameters n and p determine the height, horizontal location, and skewness of the PDF.
- The study of the binomial distribution dates back to the early eighteenth century to the work of James Bernoulli, thus making it one of the oldest distributions to be studied. The binomial distribution is designed to model the action of flipping n (fair or unfair) coins that are independent and equal and are sampled independently and sequentially with replacement. Traditionally, p is thought of as the probability with which the experiment "succeeds", whereas
is the probability of "failure". In the coin flip analogy, the value
corresponds to flipping a fair coin.
- Despite being defined very simply, the binomial distribution serves as the basis for a number of more complicated mathematical concepts. For example, the binomial distribution can be thought of as the distribution of successes resulting from a finite n-stage Bernoulli process of having probability of success p (i.e. a discrete-time stochastic process consisting of a finite sequence of random variables, each of which is independent and identically distributed (i.i.d.) according to BernoulliDistribution[p]). Similarly, the binomial distribution is the slice distribution (SliceDistribution) of a binomial process (BinomialProcess), a discrete-time, discrete-state stochastic process consisting of a finite sequence of i.i.d. random variables following a binomial distribution, the time between which follows a geometric distribution (GeometricDistribution). Moreover, many real-world scenarios can be modeled as binomial processes, e.g. the probability of rolling a particular value among n (fair or unfair) dice. Surprising connections between the binomial distribution have also been discovered in the study of emigration patterns and in certain queueing models.
- RandomVariate can be used to give one or more machine- or arbitrary-precision (the latter via the WorkingPrecision option) pseudorandom variates from a binomial distribution. Distributed[x,BinomialDistribution[n,p]], written more concisely as xBinomialDistribution[n,p], can be used to assert that a random variable x is distributed according to a binomial distribution. Such an assertion can then be used in functions such as Probability, NProbability, Expectation, and NExpectation.
- The probability density and cumulative distribution functions may be given using PDF[BinomialDistribution[n,p],x] and CDF[BinomialDistribution[n,p],x]. The mean, median, variance, raw moments, and central moments may be computed using Mean, Median, Variance, Moment, and CentralMoment, respectively. These quantities can be visualized using DiscretePlot.
- DistributionFitTest can be used to test if a given dataset is consistent with a binomial distribution, EstimatedDistribution to estimate a binomial parametric distribution from given data, and FindDistributionParameters to fit data to a binomial distribution. ProbabilityPlot can be used to generate a plot of the CDF of given data against the CDF of a symbolic binomial distribution and QuantilePlot to generate a plot of the quantiles of given data against the quantiles of a symbolic binomial distribution.
- TransformedDistribution can be used to represent a transformed binomial distribution, CensoredDistribution to represent the distribution of values censored between upper and lower values, and TruncatedDistribution to represent the distribution of values truncated between upper and lower values. CopulaDistribution can be used to build higher-dimensional distributions that contain a binomial distribution, and ProductDistribution can be used to compute a joint distribution with independent component distributions involving binomial distributions.
- BinomialDistribution is related to a number of other statistical distributions. For example, BinomialDistribution[1,p] is precisely the same as BernoulliDistribution[p] on the values
and
, and the sum of n independent variables distributed according to BernoulliDistribution[p] is distributed according to BinomialDistribution[n,p]. Similarly, BinomialDistribution[t,p] has the same PDF as BinomialProcess[p][t], a property due to the fact that BinomialDistribution[t,p] is precisely SliceDistribution[BinomialProcess[p],t]. BinomialDistribution[n,p] is also the limiting distribution for several distributions. In particular, BinomialDistribution[n,p] converges to NormalDistribution[μ,σ] for fixed p as n tends to Infinity where
and
and converges to a discretized PoissonDistribution[p] as n tends to Infinity and p tends to 0, while HypergeometricDistribution[n,p] limits to BinomialDistribution[n,p] as p tends to Infinity. BinomialDistribution is a two-variable case of MultinomialDistribution, is a constituent piece of BetaBinomialDistribution, and has a natural relationship with NegativeBinomialDistribution.
Examples
open allclose allBasic Examples (3)Summary of the most common use cases

https://wolfram.com/xid/0fq82x77j5qca-kthgq3


https://wolfram.com/xid/0fq82x77j5qca-29lskq


https://wolfram.com/xid/0fq82x77j5qca-c430rl

Cumulative distribution function:

https://wolfram.com/xid/0fq82x77j5qca-2eg4b5


https://wolfram.com/xid/0fq82x77j5qca-cu5jd


https://wolfram.com/xid/0fq82x77j5qca-b49um2

Mean and variance of a binomial distribution:

https://wolfram.com/xid/0fq82x77j5qca-bnddbo


https://wolfram.com/xid/0fq82x77j5qca-tl

Scope (8)Survey of the scope of standard use cases
Generate a sample of pseudorandom numbers from a binomial distribution:

https://wolfram.com/xid/0fq82x77j5qca-qhtk5j
Compare its histogram to the PDF:

https://wolfram.com/xid/0fq82x77j5qca-03mwaz

Distribution parameters estimation:

https://wolfram.com/xid/0fq82x77j5qca-45b7g2
Estimate the distribution parameters from sample data:

https://wolfram.com/xid/0fq82x77j5qca-epi747

Compare a density histogram of the sample with the PDF of the estimated distribution:

https://wolfram.com/xid/0fq82x77j5qca-f8ui5o


https://wolfram.com/xid/0fq82x77j5qca-h3ftee


https://wolfram.com/xid/0fq82x77j5qca-o4i

The distribution is symmetric for :

https://wolfram.com/xid/0fq82x77j5qca-24ludx

The distribution becomes symmetric for large n:

https://wolfram.com/xid/0fq82x77j5qca-xq0tpy


https://wolfram.com/xid/0fq82x77j5qca-endwia


https://wolfram.com/xid/0fq82x77j5qca-sgw

The limiting value is the value of kurtosis of the standard NormalDistribution:

https://wolfram.com/xid/0fq82x77j5qca-td3gwe

Different moments with closed forms as functions of parameters:

https://wolfram.com/xid/0fq82x77j5qca-js043h

https://wolfram.com/xid/0fq82x77j5qca-rx074o


https://wolfram.com/xid/0fq82x77j5qca-pknsqa


https://wolfram.com/xid/0fq82x77j5qca-zg9ct4

Closed form for symbolic order:

https://wolfram.com/xid/0fq82x77j5qca-ofiod8


https://wolfram.com/xid/0fq82x77j5qca-9gzmth


https://wolfram.com/xid/0fq82x77j5qca-3i5duu


https://wolfram.com/xid/0fq82x77j5qca-wps3qa


https://wolfram.com/xid/0fq82x77j5qca-f5db4g

https://wolfram.com/xid/0fq82x77j5qca-bzwvpb

Use dimensionless Quantity to define BinomialDistribution:

https://wolfram.com/xid/0fq82x77j5qca-d70hxe

Applications (12)Sample problems that can be solved with this function
CDF of BinomialDistribution is an example of a right-continuous function:

https://wolfram.com/xid/0fq82x77j5qca-5w2lx5


https://wolfram.com/xid/0fq82x77j5qca-oaa0aw

A basketball player has a free-throw percentage of 0.75. Simulate 10 free throws:

https://wolfram.com/xid/0fq82x77j5qca-de5214

Find the probability that the player hits 2 out of 3 free throws in a game:

https://wolfram.com/xid/0fq82x77j5qca-cjgi7a

Find the probability that the player hits the last 2 of 5 free throws:

https://wolfram.com/xid/0fq82x77j5qca-won9rl

Find the expected number of hits in a game with n free throws:

https://wolfram.com/xid/0fq82x77j5qca-flklo3

A baseball player is a 0.300 hitter. Simulate 5 at bats:

https://wolfram.com/xid/0fq82x77j5qca-c2d8m9

Find the expected number of hits if the player comes to bat 3 times:

https://wolfram.com/xid/0fq82x77j5qca-pnem9

A drug has proven to be effective in 30% of cases. Find the probability it is effective in at least 3 of 4 patients:

https://wolfram.com/xid/0fq82x77j5qca-c5l4w4

Find the expected number of successes when applied to 500 cases:

https://wolfram.com/xid/0fq82x77j5qca-j6sril

The number of heads in n flips with a fair coin can be modeled with BinomialDistribution:

https://wolfram.com/xid/0fq82x77j5qca-crzwal
Show the distribution of heads for 100 coin flips:

https://wolfram.com/xid/0fq82x77j5qca-g0i3tf

Compute the probability that there are between 60 and 80 heads in 100 coin flips:

https://wolfram.com/xid/0fq82x77j5qca-l2bj9o


https://wolfram.com/xid/0fq82x77j5qca-g1rmnr

Now, suppose that for an unfair coin the probability of heads is 0.6:

https://wolfram.com/xid/0fq82x77j5qca-ej0iut
The distribution and the corresponding probabilities have changed:

https://wolfram.com/xid/0fq82x77j5qca-osg5fr


https://wolfram.com/xid/0fq82x77j5qca-bb3fr1

A machine produces parts, with 1 in 10 defective:

https://wolfram.com/xid/0fq82x77j5qca-bm0g5g
Compute the probability that at most 1 of 5 parts is defective:

https://wolfram.com/xid/0fq82x77j5qca-i8osh9


https://wolfram.com/xid/0fq82x77j5qca-gjx6h5

An airplane engine fails with probability p; compute the probability that no more than 2 of 4 fail:

https://wolfram.com/xid/0fq82x77j5qca-bf8j1o

Compute the probability that no more than 1 of 2 fails:

https://wolfram.com/xid/0fq82x77j5qca-6e1zy

Decide when the choice of four engines is better than two engines:

https://wolfram.com/xid/0fq82x77j5qca-g1mg7p


https://wolfram.com/xid/0fq82x77j5qca-tfivd2

A system uses triple redundancy with three microprocessors and is designed to operate as long as one processor is still functional. The probability that a microprocessor is still functional after seconds is
. Find the probability that the system is still operating after
seconds:

https://wolfram.com/xid/0fq82x77j5qca-b8pgvo

With mean time to failure for each processor , find out when the system functions with a probability of less than 99%:

https://wolfram.com/xid/0fq82x77j5qca-fdvw9


https://wolfram.com/xid/0fq82x77j5qca-i9vego

Gary Kasparov, chess champion, plays in a tournament simultaneously against 100 amateurs. It has been estimated that he loses about 1% of such games. Find the probability of losing 0, 2, 5, and 10 games:

https://wolfram.com/xid/0fq82x77j5qca-exxan6

Use a Poisson approximation to compute the same probabilities:

https://wolfram.com/xid/0fq82x77j5qca-ofq9td

Perform the same computation when he is playing 5 games, but with stronger opposition so that his loss probability is 10% instead:

https://wolfram.com/xid/0fq82x77j5qca-hrfua1

In this case the Poisson approximation is less accurate:

https://wolfram.com/xid/0fq82x77j5qca-h7mmok

A packet consisting of a string of n symbols is transmitted over a noisy channel. Each symbol has probability of incorrect transmission. Find n such that the probability of incorrect packet transmission is less than
:

https://wolfram.com/xid/0fq82x77j5qca-fmz6qt


https://wolfram.com/xid/0fq82x77j5qca-jz0tak

Compute the same limit using a Poisson approximation:

https://wolfram.com/xid/0fq82x77j5qca-ip91ew


https://wolfram.com/xid/0fq82x77j5qca-dnm3t6

Find the probability that out of n customers need a service if each uses it with probability p:

https://wolfram.com/xid/0fq82x77j5qca-fyr2q3

Compute the probability that more than (capacity) simultaneous service requests are made:

https://wolfram.com/xid/0fq82x77j5qca-sri99

Compute the probability of getting service if and
for different capacities
:

https://wolfram.com/xid/0fq82x77j5qca-i6glbw

Find the smallest capacity that provides a 99.9% probability of getting service:

https://wolfram.com/xid/0fq82x77j5qca-iw9quo


https://wolfram.com/xid/0fq82x77j5qca-edaido

Two players roll dice. If the total of both numbers is less than 10, the second player is paid 4 cents; otherwise the first player is paid 9 cents. Is the game fair?:

https://wolfram.com/xid/0fq82x77j5qca-d6irro

The game is not fair, since mean scores per game are not equal:

https://wolfram.com/xid/0fq82x77j5qca-mnec0

Find the probability that after n games the player at the disadvantage scores more:

https://wolfram.com/xid/0fq82x77j5qca-k0z9ks

The probability exhibits oscillations:

https://wolfram.com/xid/0fq82x77j5qca-3sihy

The maximum of probability is attained at :

https://wolfram.com/xid/0fq82x77j5qca-dcwvci

Properties & Relations (9)Properties of the function, and connections to other functions
Binomial distribution is closed under addition:

https://wolfram.com/xid/0fq82x77j5qca-w5wpz3

BinomialDistribution[n,p] converges to a normal distribution as :

https://wolfram.com/xid/0fq82x77j5qca-cjcacn


https://wolfram.com/xid/0fq82x77j5qca-ikcny4

Relationships to other distributions:

BinomialDistribution with is equivalent to BernoulliDistribution:

https://wolfram.com/xid/0fq82x77j5qca-b6e1c


https://wolfram.com/xid/0fq82x77j5qca-b6jbet

The sum of n independent variables with BernoulliDistribution is binomial distributed:

https://wolfram.com/xid/0fq82x77j5qca-vvfb5

BinomialDistribution is the infinite population limit of HypergeometricDistribution:

https://wolfram.com/xid/0fq82x77j5qca-nl7h3e


https://wolfram.com/xid/0fq82x77j5qca-oa2801


https://wolfram.com/xid/0fq82x77j5qca-gy61in

BinomialDistribution approaches the PoissonDistribution for large n and small p:

https://wolfram.com/xid/0fq82x77j5qca-q3knhu


https://wolfram.com/xid/0fq82x77j5qca-hm4l51


https://wolfram.com/xid/0fq82x77j5qca-nxf44y

A marginal of bivariate multinomial distribution is a binomial distribution:

https://wolfram.com/xid/0fq82x77j5qca-bkxzn3

Confirm by comparing probability mass functions:

https://wolfram.com/xid/0fq82x77j5qca-iocwx


https://wolfram.com/xid/0fq82x77j5qca-cqyy27


https://wolfram.com/xid/0fq82x77j5qca-q1ac0i

BetaBinomialDistribution is a mixture of BinomialDistribution and BetaDistribution:

https://wolfram.com/xid/0fq82x77j5qca-6a4ms5

Possible Issues (3)Common pitfalls and unexpected behavior
BinomialDistribution is not defined when p is not between zero and one:

https://wolfram.com/xid/0fq82x77j5qca-q9t


BinomialDistribution is not defined when n is not a positive integer:

https://wolfram.com/xid/0fq82x77j5qca-ewl


Substitution of invalid parameters into symbolic outputs gives results that are not meaningful:

https://wolfram.com/xid/0fq82x77j5qca-m6k

Neat Examples (1)Surprising or curious use cases
Construct a polynomial approximation of on the interval from 0 to 1 following Bernstein:

https://wolfram.com/xid/0fq82x77j5qca-ho5oos
Approximation of is constructed as the expectation of
, where
is a binomial random variate with parameters
and
so that the mean of
equals
:

https://wolfram.com/xid/0fq82x77j5qca-b61upn
Plot the original function and its approximations:

https://wolfram.com/xid/0fq82x77j5qca-npmvs4

Wolfram Research (2007), BinomialDistribution, Wolfram Language function, https://reference.wolfram.com/language/ref/BinomialDistribution.html (updated 2016).
Text
Wolfram Research (2007), BinomialDistribution, Wolfram Language function, https://reference.wolfram.com/language/ref/BinomialDistribution.html (updated 2016).
Wolfram Research (2007), BinomialDistribution, Wolfram Language function, https://reference.wolfram.com/language/ref/BinomialDistribution.html (updated 2016).
CMS
Wolfram Language. 2007. "BinomialDistribution." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/BinomialDistribution.html.
Wolfram Language. 2007. "BinomialDistribution." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/BinomialDistribution.html.
APA
Wolfram Language. (2007). BinomialDistribution. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BinomialDistribution.html
Wolfram Language. (2007). BinomialDistribution. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BinomialDistribution.html
BibTeX
@misc{reference.wolfram_2025_binomialdistribution, author="Wolfram Research", title="{BinomialDistribution}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/BinomialDistribution.html}", note=[Accessed: 23-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_binomialdistribution, organization={Wolfram Research}, title={BinomialDistribution}, year={2016}, url={https://reference.wolfram.com/language/ref/BinomialDistribution.html}, note=[Accessed: 23-April-2025
]}