# PascalDistribution

PascalDistribution[n,p]

represents a Pascal distribution with parameters n and p.

# Details

- The probability for value in a Pascal distribution is for , and is zero otherwise.
- PascalDistribution[n,p] gives the distribution of the number of trials with nonzero success probability p before n successes occur.
- PascalDistribution allows n to be any positive integer and p any positive real number less than or equal to 1.
- PascalDistribution allows n and p to be dimensionless quantities. »
- PascalDistribution can be used with such functions as Mean, CDF, and RandomVariate.

# Background & Context

- PascalDistribution[n,p] represents a discrete statistical distribution defined for integer values and determined by an integer parameter n () and a real parameter p () that represent the number of successes of an experiment and its probability of success, respectively. The Pascal distribution has a probability density function (PDF) that is discrete and unimodal. The Pascal distribution is one of a number of distributions that fit under the heading of "negative binomial distributions," though it should not be confused with "the" negative binomial distribution (NegativeBinomialDistribution).
- The Pascal distribution is one of the earliest studied probability distributions, with its roots dating back to the work of Blaise Pascal in the 1670s. Classically, the Pascal distribution (when viewed as a specific case of the family of negative binomial distributions) can be realized as an urn model illustrating the number of draws of a marble from an urn required to procure n marbles of a certain color, given that the draws are mutually independent with p probability of success. Since its inception, the distribution has been realized as an integer-n case of NegativeBinomialDistribution[n,p], and so many of its applications (e.g. in accident statistics and telecommunications) arise because of its inclusion in the family of negative binomial distributions. Other applications of the distribution include the modeling of population statistics, psychological data, quality control, and queueing theory.
- RandomVariate can be used to give one or more machine- or arbitrary-precision (the latter via the WorkingPrecision option) pseudorandom variates from a Pascal distribution. Distributed[x,PascalDistribution[n,p]], written more concisely as xPascalDistribution[n,p], can be used to assert that a random variable x is distributed according to a Pascal 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[PascalDistribution[n,p],x] and CDF[PascalDistribution[n,p],x], though one should note that there is no closed-form expression for its PDF. 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 Pascal distribution, EstimatedDistribution to estimate a Pascal parametric distribution from given data, and FindDistributionParameters to fit data to a Pascal distribution. ProbabilityPlot can be used to generate a plot of the CDF of given data against the CDF of a symbolic Pascal distribution and QuantilePlot to generate a plot of the quantiles of given data against the quantiles of a symbolic Pascal distribution.
- TransformedDistribution can be used to represent a transformed Pascal 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 Pascal distribution, and ProductDistribution can be used to compute a joint distribution with independent component distributions involving Pascal distributions.
- PascalDistribution is related to a number of other statistical distributions. As mentioned above, it is a member of the family of negative binomial distributions and hence is qualitatively related to NegativeBinomialDistribution (also known as Pólya distribution for noninteger n). GeometricDistribution is a transformation (TransformedDistribution) of PascalDistribution in that the CDF of the variate u-1 is precisely that of GeometricDistribution[p] whenever uPascalDistribution[1,p]. PascalDistribution is also a transformation of NegativeBinomialDistribution, while the PDF of PascalDistribution[n,p] converges to that of NormalDistribution[μ,σ] as n→∞ for μ and σ the mean (Mean) and standard deviation (StandardDeviation), respectively, of PascalDistribution[n,p]. PascalDistribution is also related to PoissonDistribution, PoissonConsulDistribution, BinomialDistribution, NegativeBinomialDistribution, MultinomialDistribution, and NegativeMultinomialDistribution.

# Examples

open allclose all## Scope (8)

Generate a sample of pseudorandom numbers from a Pascal distribution:

Compare its histogram to the PDF:

Distribution parameters estimation:

Estimate the distribution parameters from sample data:

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

In the limit the distribution becomes more symmetric:

The limiting value for large n is the kurtosis of standard NormalDistribution:

Different moments with closed forms as functions of parameters:

Closed form for symbolic order:

Use dimensionless Quantity to define PascalDistribution:

## Applications (7)

The CDF of PascalDistribution is an example of a right-continuous function:

The number of fair coin flips before 3 heads:

Plot the distribution of the number of flips:

Find the probability of getting 3 heads in no more than 6 flips:

Find the average number of flips before getting 3 heads:

Simulate the number of coin flips before getting 3 heads:

A coin was flipped 10 times and the head occurred at the 10 flip. Find the probability of such an event if the coin is fair:

Assuming the coin may not be fair, find the most likely value for p:

A basketball player shoots free throws until he hits 4 of them. His probability of scoring in any one of them is 0.7. Simulate the process:

Find the average number of throws until 4 hits:

Find the probability that the player needs exactly 4 shots:

Assume the probability of fouling for each minute interval is 0.1 independently. Simulate the fouling process for 30 minutes:

A basketball player fouls out after 6 fouls. Find the expected playing time until foul out:

A data stream containing 4 data paclets is repeatedly sent without order information. Find the distribution of the number of tries until the data stream arrives with all the paclets in the right order for the second time:

Find the probability that paclets will arrive the second time in the correct order on the 20 try or sooner:

Find the average number of tries until the second ordered data stream:

Simulate the number of tries until the second ordered data stream:

Messages are being broadcast through two channels, with equal success rates. Find the probability that no more than 5 broadcasts will be needed to ensure that each channel has received at least 3 messages:

## Properties & Relations (5)

PascalDistribution[n,p] converges to a normal distribution when :

Sum of variates from Pascal distribution is a Pascal distribution:

Relationships to other distributions:

GeometricDistribution is a transformation of Pascal distribution:

NegativeBinomialDistribution and Pascal distribution differ by a shift: