This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Discrete Distributions

The functions described here are among the most commonly used discrete univariate statistical distributions. You can compute their densities, means, variances, and other related properties. The distributions themselves are represented in the symbolic form . Functions such as Mean, which give properties of statistical distributions, take the symbolic representation of the distribution as an argument. "Continuous Distributions" describes many continuous statistical distributions.
BernoulliDistribution[p]Bernoulli distribution with mean p
BetaBinomialDistribution[,,n]binomial distribution where the success probability is a BetaDistribution random variable
negative binomial distribution where the success probability is a BetaDistribution random variable
BinomialDistribution[n,p]binomial distribution for the number of successes that occur in n trials, where the probability of success in a trial is p
discrete uniform distribution over the integers from to
GeometricDistribution[p]geometric distribution for the number of trials before the first success, where the probability of success in a trial is p
hypergeometric distribution for the number of successes out of a sample of size n, from a population of size containing successes
LogSeriesDistribution[]logarithmic series distribution with parameter
NegativeBinomialDistribution[n,p]negative binomial distribution with parameters n and p
PoissonDistribution[]Poisson distribution with mean
ZipfDistribution[]Zipf distribution with parameter

Discrete statistical distributions.

Most of the common discrete statistical distributions can be understood by considering a sequence of trials, each with two possible outcomes, for example, success and failure.
The Bernoulli distribution BernoulliDistribution[p] is the probability distribution for a single trial in which success, corresponding to value 1, occurs with probability , and failure, corresponding to value 0, occurs with probability .
The binomial distribution BinomialDistribution is the distribution of the number of successes that occur in independent trials, where the probability of success in each trial is .
The negative binomial distribution NegativeBinomialDistribution for positive integer is the distribution of the number of failures that occur in a sequence of trials before successes have occurred, where the probability of success in each trial is . The distribution is defined for any positive , though the interpretation of as the number of successes and as the success probability no longer holds if is not an integer.
The beta binomial distribution BetaBinomialDistribution is a mixture of binomial and beta distributions. A BetaBinomialDistribution random variable follows a BinomialDistribution distribution, where the success probability is itself a random variable following the beta distribution BetaDistribution. The beta negative binomial distribution BetaNegativeBinomialDistribution is a similar mixture of the beta and negative binomial distributions.
The geometric distribution GeometricDistribution[p] is the distribution of the total number of trials before the first success occurs, where the probability of success in each trial is .
The hypergeometric distribution HypergeometricDistribution is used in place of the binomial distribution for experiments in which the trials correspond to sampling without replacement from a population of size with potential successes.
The discrete uniform distribution DiscreteUniformDistribution represents an experiment with multiple equally probable outcomes represented by integers through .
The Poisson distribution PoissonDistribution[] describes the number of events that occur in a given time period where is the average number of events per period.
The terms in the series expansion of about are proportional to the probabilities of a discrete random variable following the logarithmic series distribution LogSeriesDistribution[]. The distribution of the number of items of a product purchased by a buyer in a specified interval is sometimes modeled by this distribution.
The Zipf distribution ZipfDistribution[], sometimes referred to as the zeta distribution, was first used in linguistics and its use has been extended to model rare events.
PDF[dist,x]probability mass function at x
CDF[dist,x]cumulative distribution function at x
InverseCDF[dist,q]the largest integer x such that CDF is at most q
Quantile[dist,q]q^(th) quantile
StandardDeviation[dist]standard deviation
Skewness[dist]coefficient of skewness
Kurtosis[dist]coefficient of kurtosis
CharacteristicFunction[dist,t]characteristic function
Expectation[f[x],xDistributeddist]expectation of for x distributed according to dist
Quartiles[dist]list of the ^(th), ^(th), ^(th) quantiles for dist
InterquartileRange[dist]difference between the first and third quartiles
QuartileDeviation[dist]half the interquartile range
QuartileSkewness[dist]quartile-based skewness measure
RandomVariate[dist]pseudorandom number with specified distribution
RandomVariate[dist,dims]pseudorandom array with dimensionality dims, and elements from the specified distribution

Some functions of statistical distributions.

Distributions are represented in symbolic form. PDF evaluates the mass function at x if x is a numerical value, and otherwise leaves the function in symbolic form whenever possible. Similarly, CDF gives the cumulative distribution and Mean[dist] gives the mean of the specified distribution. The table above gives a sampling of some of the more common functions available for distributions. For a more complete description of these functions, see the description of their continuous analogues in "Continuous Distributions".
Here is a symbolic representation of the binomial distribution for 34 trials, each having probability 0.3 of success.
Click for copyable input
This is the mean of the distribution.
Click for copyable input
You can get the expression for the mean by using symbolic variables as arguments.
Click for copyable input
Here is the 50% quantile, which is equal to the median.
Click for copyable input
This gives the expected value of with respect to the binomial distribution.
Click for copyable input
The elements of this matrix are pseudorandom numbers from the binomial distribution.
Click for copyable input