**Statistics****`****DiscreteDistributions****`**

This package gives you access to the most commonly used discrete statistical distributions. You can compute their densities, means, variances and other related properties. The distributions themselves are represented in the symbolic form name[

,

, ... ]. Functions such as Mean, which give properties of statistical distributions, take the symbolic representation of the distribution as an argument. The package ContinuousDistributions contains many continuous statistical distributions.

Statistical distributions from the package DiscreteDistributions.

Most of the common discrete statistical distributions can be understood by considering a sequence of "trials", each with two possible outcomes, say "success" and "failure".

The Bernoulli distributionBernoulliDistribution[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[n,p] 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[n,p] 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 terms in the series expansion of about are proportional to the probabilities of a discrete random variable following the logarithmic series distribution

LogSeriesDistribution[theta]. 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 geometric distributionGeometricDistribution[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[n,

,

] 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[n] represents an experiment with outcomes that occur with equal probabilities.

The Poisson distribution

PoissonDistribution[mu] describes the number of points in a unit interval, where points are distributed with uniform density

.

Functions of statistical distributions.

In this package distributions are represented in symbolic form. PDF[dist,x] evaluates the density at if is a numerical value, and otherwise leaves the function in symbolic form whenever possible. Similarly, CDF[

dist,x] gives the cumulative distribution and Mean[dist] gives the mean of the specified distribution. For a more complete description of the various functions of a statistical distribution, see the description of their continuous analogues in the section concerning the package Statistics`ContinuousDistributions`.

This loads the package.
In[1]:= **<<Statistics`DiscreteDistributions`**

Here is a symbolic representation of the binomial distribution for trials, each having probability

of success.
In[2]:= **bdist = BinomialDistribution[34, 0.3]**

Out[2]=

This is the mean of the distribution.
In[3]:= **Mean[bdist]**

Out[3]=

You can get the equation for the mean by using symbolic variables as arguments.
In[4]:= **Mean[BinomialDistribution[n, p]]**

Out[4]=

Here is the

quantile, which is equal to the median.
In[5]:= **Quantile[bdist, 0.5]**

Out[5]=

This gives the expected value of

with respect to the binomial distribution.
In[6]:= **ExpectedValue[x^3, bdist, x]**

Out[6]=

The elements of this matrix are pseudorandom numbers from the binomial distribution.
In[7]:= **RandomArray[bdist, {2, 3}]**

Out[7]=