GeometricDistribution
✖
GeometricDistribution
Details

- The probability for value
in a geometric distribution is
for non-negative integers, and is zero otherwise. »
- GeometricDistribution[p] is the distribution of the number of failures in a sequence of trials with success probability p before a success occurs.
- GeometricDistribution allows p to be a dimensionless quantity. »
- GeometricDistribution can be used with such functions as Mean, CDF, and RandomVariate. »
Background & Context
- GeometricDistribution[p] represents a discrete statistical distribution defined at integer values
and parametrized by a non-negative real number
. The geometric distribution has a discrete probability density function (PDF) that is monotonically decreasing, with the parameter p determining the height and steepness of the PDF. The geometric distribution is sometimes referred to as the Furry distribution.
- The geometric distribution is sometimes said to be the discrete analog of the exponential distribution (ExponentialDistribution). It can be defined as the distribution that models the number of Bernoulli trials (i.e. number of trials of a variate having a BernoulliDistribution) needed to obtain a single success. The geometric distribution has been used to model a number of different phenomena across many fields, including the behavior of competing plant populations, dynamics of ticket control, particulars of congenital malformations, and estimation of animal abundance. Moreover, the geometric distribution has been used widely in reliability theory and is a staple in Markov chain models for meteorology, queueing theory, and applied stochastics.
- RandomVariate can be used to give one or more machine- or arbitrary-precision (the latter via the WorkingPrecision option) pseudorandom variates from a geometric distribution. Distributed[x,GeometricDistribution[p]], written more concisely as xGeometricDistribution[p], can be used to assert that a random variable x is distributed according to a geometric 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[GeometricDistribution[p],x] and CDF[GeometricDistribution[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 geometric distribution, EstimatedDistribution to estimate a geometric parametric distribution from given data, and FindDistributionParameters to fit data to a geometric distribution. ProbabilityPlot can be used to generate a plot of the CDF of given data against the CDF of a symbolic geometric distribution and QuantilePlot to generate a plot of the quantiles of given data against the quantiles of a symbolic geometric distribution.
- TransformedDistribution can be used to represent a transformed geometric 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 geometric distribution, and ProductDistribution can be used to compute a joint distribution with independent component distributions involving geometric distributions.
- GeometricDistribution is related to a number of other statistical distributions. For example, GeometricDistribution is a special case of the more general NegativeBinomialDistribution, in the sense that NegativeBinomialDistribution[1,p] has precisely the same PDF as GeometricDistribution[p] and that the sum of
is distributed according to NegativeBinomialDistribution[n,p], provided that XiGeometricDistribution[p] for all
. GeometricDistribution is also a transformation of PascalDistribution and can be viewed as a parameter mixture of PoissonDistribution with either GammaDistribution or ExponentialDistribution, in the sense that both ParameterMixtureDistribution[PoissonDistribution[μ],μGammaDistribution[1,(1-p)/p]] and ParameterMixtureDistribution[PoissonDistribution[μ],μ ExponentialDistribution[p/(1-p)]] are the same as GeometricDistribution[p]. GeometricDistribution is also related to WaringYuleDistribution, BinomialDistribution, PascalDistribution, and HypergeometricDistribution.
Examples
open allclose allBasic Examples (3)Summary of the most common use cases

https://wolfram.com/xid/0gft2k2kzr0q-ji0


https://wolfram.com/xid/0gft2k2kzr0q-kld

Cumulative distribution function:

https://wolfram.com/xid/0gft2k2kzr0q-u4twfg


https://wolfram.com/xid/0gft2k2kzr0q-jq0d54

Mean and variance of a geometric distribution:

https://wolfram.com/xid/0gft2k2kzr0q-rgs


https://wolfram.com/xid/0gft2k2kzr0q-qr4

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

https://wolfram.com/xid/0gft2k2kzr0q-58c5w
Compare its histogram to the PDF:

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

Distribution parameters estimation:

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

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

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

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


https://wolfram.com/xid/0gft2k2kzr0q-u154fu


https://wolfram.com/xid/0gft2k2kzr0q-hmd


https://wolfram.com/xid/0gft2k2kzr0q-lg1v3m


https://wolfram.com/xid/0gft2k2kzr0q-7p6uk7


https://wolfram.com/xid/0gft2k2kzr0q-vaxzx1


https://wolfram.com/xid/0gft2k2kzr0q-ocg


https://wolfram.com/xid/0gft2k2kzr0q-fe66wl


https://wolfram.com/xid/0gft2k2kzr0q-1cux9d

Different moments with closed forms as functions of parameters:

https://wolfram.com/xid/0gft2k2kzr0q-f4yfjm

https://wolfram.com/xid/0gft2k2kzr0q-xqhud7

Closed form for symbolic order:

https://wolfram.com/xid/0gft2k2kzr0q-r9augn


https://wolfram.com/xid/0gft2k2kzr0q-5udluv

Closed form for symbolic order:

https://wolfram.com/xid/0gft2k2kzr0q-zcfe0l


https://wolfram.com/xid/0gft2k2kzr0q-z5zkug

Closed form for symbolic order:

https://wolfram.com/xid/0gft2k2kzr0q-1dukik


https://wolfram.com/xid/0gft2k2kzr0q-kshtug


https://wolfram.com/xid/0gft2k2kzr0q-6p04jf


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

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

Use dimensionless Quantity to define GeometricDistribution:

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

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

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

A coin-tossing experiment consists of tossing a fair coin repeatedly until a tail results. Simulate the process:

https://wolfram.com/xid/0gft2k2kzr0q-dmxjan


https://wolfram.com/xid/0gft2k2kzr0q-dly4bn

Compute the probability that at least 4 coin tosses will be necessary:

https://wolfram.com/xid/0gft2k2kzr0q-ezvkpl

Compute the expected number of coin tosses:

https://wolfram.com/xid/0gft2k2kzr0q-bf3mbi

A person is standing by a road counting cars until he sees a red one, at which point he restarts the count. Simulate the counting process, assuming that 20% of the cars are red:

https://wolfram.com/xid/0gft2k2kzr0q-g6a1bd


https://wolfram.com/xid/0gft2k2kzr0q-by2mv4

Find the expected number of cars to come by before the count starts over:

https://wolfram.com/xid/0gft2k2kzr0q-dpolqs

Find the probability of counting 10 or more cars before a red one:

https://wolfram.com/xid/0gft2k2kzr0q-jrzgij

A student will take a test repeatedly until he or she passes it, each time succeeding with probability p. Find the probability that the student succeeds in attempts or less:

https://wolfram.com/xid/0gft2k2kzr0q-7w1l2


https://wolfram.com/xid/0gft2k2kzr0q-e3p97u

Given that the student passes the test in attempts or less, find the PDF:

https://wolfram.com/xid/0gft2k2kzr0q-ddk0ll


https://wolfram.com/xid/0gft2k2kzr0q-j2pnp7

A budget-priced lighter has 90% probability of lighting on any given attempt. Simulate the lighting process; the result indicates the number of failures before successful lighting:

https://wolfram.com/xid/0gft2k2kzr0q-ea62r3

Find the probability that the lighter lights in 3 trials or less:

https://wolfram.com/xid/0gft2k2kzr0q-hgn9ry

A cereal box contains one out of a set of different plastic animals. The animals are equally likely to occur, independently of what animals are in other boxes. Simulate the animal collection process, assuming there are 10 animals for 25 boxes:

https://wolfram.com/xid/0gft2k2kzr0q-c5i8i

After unique animals have been collected, the number of boxes needed to find a new unique animal among the remaining
follows a geometric distribution with parameter
. Find the expected number of boxes needed to get a new unique animal:

https://wolfram.com/xid/0gft2k2kzr0q-iz1qu4

Number of boxes before next unique animal:

https://wolfram.com/xid/0gft2k2kzr0q-zopx97

Find the expected number of boxes needed to collect 6 unique animals:

https://wolfram.com/xid/0gft2k2kzr0q-gc8k3n


https://wolfram.com/xid/0gft2k2kzr0q-tsln1

When a computer accesses memory, the desired data is in the cache with probability p. A cache miss occurs if the desired data is not in the cache. Find the probability of a cache miss on the memory access:

https://wolfram.com/xid/0gft2k2kzr0q-gldvrl

https://wolfram.com/xid/0gft2k2kzr0q-mnyvt4


https://wolfram.com/xid/0gft2k2kzr0q-zr4wi

Find the probability that the first cache miss occurs after the 4 memory access:

https://wolfram.com/xid/0gft2k2kzr0q-czy8yl

Find the average number of memory accesses before the first cache miss:

https://wolfram.com/xid/0gft2k2kzr0q-ng66kc

Simulate the number of cache hits before a cache miss occurs, assuming 20% of your data is in the cache:

https://wolfram.com/xid/0gft2k2kzr0q-ludhe

Assuming that access time is 10 ns for cache and 1000 ns for RAM, find the average access time:

https://wolfram.com/xid/0gft2k2kzr0q-d9o30


https://wolfram.com/xid/0gft2k2kzr0q-bi7eke

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

https://wolfram.com/xid/0gft2k2kzr0q-q7x2sx

https://wolfram.com/xid/0gft2k2kzr0q-gele6h


https://wolfram.com/xid/0gft2k2kzr0q-3npdyc

Find the probability that the packets will arrive in the correct order on the 20 try or sooner:

https://wolfram.com/xid/0gft2k2kzr0q-147rj6


https://wolfram.com/xid/0gft2k2kzr0q-j40ut0

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

https://wolfram.com/xid/0gft2k2kzr0q-u8v5uc


https://wolfram.com/xid/0gft2k2kzr0q-jx4mff

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

https://wolfram.com/xid/0gft2k2kzr0q-ml5t6n

A player bets amount in a casino with no betting limit in a game with chance of winning
. If he loses he doubles the bet, and if he wins he quits, hence the number of games played follows a geometric distribution, with expected number of games played represented as follows:

https://wolfram.com/xid/0gft2k2kzr0q-g5mubj

The cash reserve needed to win the game:

https://wolfram.com/xid/0gft2k2kzr0q-bp6rc6

The player always leaves the casino collecting the amount of the initial bet:

https://wolfram.com/xid/0gft2k2kzr0q-zq1b7

The cash reserve needed to execute the above strategy is finite only for strictly favorable games, where :

https://wolfram.com/xid/0gft2k2kzr0q-i5j0mw

In an optical communication system, transmitted light generates current at the receiver. The number of electrons follows the parametric mixture of Poisson distribution and other distributions, depending on the type of light. If the source uses coherent laser light of intensity , then the electron count distribution is Poisson:

https://wolfram.com/xid/0gft2k2kzr0q-ybo1iw

https://wolfram.com/xid/0gft2k2kzr0q-cpxco8


https://wolfram.com/xid/0gft2k2kzr0q-bj4sj8

https://wolfram.com/xid/0gft2k2kzr0q-yc78uu

Which is PoissonDistribution:

https://wolfram.com/xid/0gft2k2kzr0q-r45kgh

If the source uses thermal illumination, then the Poisson parameter follows ExponentialDistribution with parameter , and the electron count distribution is:

https://wolfram.com/xid/0gft2k2kzr0q-1clxib

These two distributions are distinguishable and allow you to determine the type of source:

https://wolfram.com/xid/0gft2k2kzr0q-6gb3ty

Find the sampling population expectation of the method of moment estimator for p:

https://wolfram.com/xid/0gft2k2kzr0q-hms01m


https://wolfram.com/xid/0gft2k2kzr0q-coeb6p

Find sampling population expectations for a few small sample sizes:

https://wolfram.com/xid/0gft2k2kzr0q-dqangn

Prove that these are positively biased:

https://wolfram.com/xid/0gft2k2kzr0q-dul6nu


https://wolfram.com/xid/0gft2k2kzr0q-cxg60z

Properties & Relations (8)Properties of the function, and connections to other functions
The geometric distribution has the memoryless property:

https://wolfram.com/xid/0gft2k2kzr0q-nvxqr


https://wolfram.com/xid/0gft2k2kzr0q-eb4h0n


https://wolfram.com/xid/0gft2k2kzr0q-4kndt8

The family of GeometricDistribution is closed under Min:

https://wolfram.com/xid/0gft2k2kzr0q-u3aq81

And for identically distributed variables:

https://wolfram.com/xid/0gft2k2kzr0q-ijb29j

Relationships to other distributions:

NegativeBinomialDistribution simplifies to geometric distribution:

https://wolfram.com/xid/0gft2k2kzr0q-n85


https://wolfram.com/xid/0gft2k2kzr0q-qrt


https://wolfram.com/xid/0gft2k2kzr0q-qbxhbd

Sum of independent geometric variables has NegativeBinomialDistribution:

https://wolfram.com/xid/0gft2k2kzr0q-wxqdle


https://wolfram.com/xid/0gft2k2kzr0q-0qr1o7


https://wolfram.com/xid/0gft2k2kzr0q-zate74


https://wolfram.com/xid/0gft2k2kzr0q-3tkp5x

Geometric distribution is a transformation of PascalDistribution:

https://wolfram.com/xid/0gft2k2kzr0q-dpa1tw

https://wolfram.com/xid/0gft2k2kzr0q-fmxi5t


https://wolfram.com/xid/0gft2k2kzr0q-mlh


https://wolfram.com/xid/0gft2k2kzr0q-utjy96

WaringYuleDistribution is a parameter mixture of geometric distribution and UniformDistribution:

https://wolfram.com/xid/0gft2k2kzr0q-d4hfra

https://wolfram.com/xid/0gft2k2kzr0q-lffbo


https://wolfram.com/xid/0gft2k2kzr0q-dtsdxi


https://wolfram.com/xid/0gft2k2kzr0q-5vhlm0

Geometric distribution is a parameter mixture of PoissonDistribution and GammaDistribution:

https://wolfram.com/xid/0gft2k2kzr0q-rbh64k

It is the same as the mixture with an ExponentialDistribution:

https://wolfram.com/xid/0gft2k2kzr0q-3ph7o2

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

https://wolfram.com/xid/0gft2k2kzr0q-prn


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

https://wolfram.com/xid/0gft2k2kzr0q-kpd

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