## Discrete Probability Distributions | Extreme Optimization Numerical Libraries for .NET Professional |

All classes that implement discrete probability distributions inherit from the DiscreteDistribution class. This class defines methods and properties common to all discrete probability distributions.

Discrete probability distributions arise from counting events whose occurrence is in some way probabilistic. One parameter specifies the probabilistic element of the setup. The remaining parameters specify specific details about the setup.

Each distribution object has one or more properties corresponding to the distribution parameters. These properties are read-only.

Each distribution object has one or more properties that return the parameters of the distribution.

In addition, each distribution defines properties that describe the main traits of the distribution. The Mean property returns the mean of the distribution.

The StandardDeviation property returns the standard deviation of the distribution. The Variance property returns the variance. The Skewness property returns the skewness of the distribution, and the Kurtosis property returns the kurtosis supplement of the distribution.

Associated with each distribution are a number of functions that are commonly used in statistical calculations. The probability function gives the probability that a random sample from the distribution takes on a specific value. It is implemented by the Probability method. This method takes one argument: the value for which the probability is requested. There is an Probability that takes two arguments, and returns the total probability that a sample falls within the interval specified by the arguments. The lower bound is inclusive. The upper bound is exclusive. This means that passing the same value for both parameters returns 0.

The distribution function, often called the cumulative distribution function (CDF), gives the probability that a sample or sample from the distribution has a value less than or equal to its argument. It is implemented by the DistributionFunction method.

One of the principal applications of probability distributions is the generation of random numbers that follow a certain distribution. The discrete distribution classes provide a series of methods to make this happen.

The Sample
method returns a single random sample from the distribution. It has overloads
as both static (Shared in Visual Basic) and instance methods. The instance method
has only one parameter: the random number generator that will be used to
generate the uniform random number(s) used in the calculation of the sample.
It is of type System

Each class also defines one or more static overloads, one each for each constructor. The first argument is always the random number generator, as above. Additional arguments correspond to the arguments of each constructor. This makes it possible to generate random samples for any distribution without first constructing a distribution object.

The Sample method generates a large number of random samples at once. The first argument is once again the uniform random number generator. The samples are returned as an integer array. The array must be supplied as the second argument. Two additional argument may be provided, which supply the start index and the length of a segment in the array where the samples are to be copied.

Copyright Â© 2004-2021,
Extreme Optimization. All rights reserved.

*Extreme Optimization,* *Complexity made simple*, *M#*, and *M
Sharp* are trademarks of ExoAnalytics Inc.

*Microsoft*, *Visual C#, Visual Basic, Visual Studio*, *Visual
Studio.NET*, and the *Optimized for Visual Studio* logo

are
registered trademarks of Microsoft Corporation.