Probability distribution
 ;/math ;
In probability theory and statistics, the geometric distribution is either one of two discrete probability distributions:
These two different geometric distributions should not be confused with each other. Often, the name "shifted" geometric distribution is adopted for the former one (distribution of formula_28); however, to avoid ambiguity, it is considered wise to indicate which is intended, by mentioning the support explicitly.
The geometric distribution gives the probability that the first occurrence of success requires formula_33 independent trials, each with success probability formula_34. If the probability of success on each trial is formula_34, then the probability that the formula_33-th trial is the first success is
formula_37
for formula_38
The above form of the geometric distribution is used for modeling the number of trials up to and including the first success. By contrast, the following form of the geometric distribution is used for modeling the number of failures until the first success:
formula_39
for formula_40
The geometric distribution gets its name because its probabilities follow a geometric sequence. It is sometimes called the Furry distribution after Wendell H. Furry.210
Definition.
The geometric distribution is the discrete probability distribution that describes when the first success in an infinite sequence of independent and identically distributed Bernoulli trials occurs. Its probability mass function depends on its parameterization and support. When supported on formula_41, the probability mass function isformula_42where formula_43 is the number of trials and formula_34 is the probability of success in each trial.
The support may also be formula_45, defining formula_30. This alters the probability mass function intoformula_47where formula_48 is the number of failures before the first success.66
An alternative parameterization of the distribution gives the probability mass functionformula_49where formula_50 and formula_51.
An example of a geometric distribution arises from rolling a six-sided die until a "1" appears. Each roll is independent with a formula_52 chance of success. The number of rolls needed follows a geometric distribution with formula_53.
Properties.
Memorylessness.
The geometric distribution is the only memoryless discrete probability distribution. It is the discrete version of the same property found in the exponential distribution.228 The property asserts that the number of previously failed trials does not affect the number of future trials needed for a success. 
Because there are two definitions of the geometric distribution, there are also two definitions of memorylessness for discrete random variables. Expressed in terms of conditional probability, the two definitions areformula_54
andformula_55
where formula_56 and formula_57 are natural numbers, formula_28 is a geometrically distributed random variable defined over formula_41, and formula_60 is a geometrically distributed random variable defined over formula_45. Note that these definitions are not equivalent for discrete random variables; formula_60 does not satisfy the first equation and formula_28 does not satisfy the second. 
Moments and cumulants.
The expected value and variance of a geometrically distributed random variable formula_28 defined over formula_41 is261formula_66 With a geometrically distributed random variable formula_60 defined over formula_45, the expected value changes intoformula_69while the variance stays the same.
For example, when rolling a six-sided die until landing on a "1", the average number of rolls needed is formula_70 and the average number of failures is formula_71.
The moment generating function of the geometric distribution when defined over formula_72 and formula_45 respectively is114formula_74The moments for the number of failures before the first success are given by
 formula_75
where formula_76 is the polylogarithm function.
The cumulant generating function of the geometric distribution defined over formula_45 is216 formula_78The cumulants formula_79 satisfy the recursionformula_80where formula_81, when defined over formula_45.216
Proof of expected value.
Consider the expected value formula_83 of "X" as above, i.e. the average number of trials until a success. 
On the first trial, we either succeed with probability formula_34, or we fail with probability formula_85. 
If we fail the remaining mean number of trials until a success is identical to the original mean.
This follows from the fact that all trials are independent.
From this we get the formula:
 formula_86
which, if solved for formula_87, gives:
 formula_88
The expected number of failures formula_60 can be found from the linearity of expectation, formula_90. It can also be shown in the following way:
 formula_91
The interchange of summation and differentiation is justified by the fact that convergent power series converge uniformly on compact subsets of the set of points where they converge.
Summary statistics.
The mean of the geometric distribution is its expected value which is, as previously discussed in § Moments and cumulants, formula_92 or formula_15 when defined over formula_41 or formula_45 respectively.
The median of the geometric distribution is formula_96when defined over formula_41 and formula_98 when defined over formula_45.69
The mode of the geometric distribution is the first value in the support set. This is 1 when defined over formula_41 and 0 when defined over formula_45.69
The skewness of the geometric distribution is formula_20.115
The kurtosis of the geometric distribution is formula_103.115 The excess kurtosis of a distribution is the difference between its kurtosis and the kurtosis of a normal distribution, formula_104.217 Therefore, the excess kurtosis of the geometric distribution is formula_105. Since formula_106, the excess kurtosis is always positive so the distribution is leptokurtic.69 In other words, the tail of a geometric distribution decays faster than a Gaussian.217
Entropy and Fisher's Information.
Entropy (Geometric Distribution, Failures Before Success).
Entropy is a measure of uncertainty in a probability distribution. For the geometric distribution that models the number of failures before the first success, the probability mass function is:
formula_107
The entropy formula_108 for this distribution is defined as:
formula_109
The entropy increases as the probability formula_34 decreases, reflecting greater uncertainty as success becomes rarer.
Fisher's Information (Geometric Distribution, Failures Before Success).
Fisher information measures the amount of information that an observable random variable formula_28 carries about an unknown parameter formula_34. For the geometric distribution (failures before the first success), the Fisher information with respect to formula_34 is given by:
formula_114
Proof:
formula_116
formula_117
formula_119
formula_120
formula_121
Fisher information increases as formula_34 decreases, indicating that rarer successes provide more information about the parameter formula_34.
Entropy (Geometric Distribution, Trials Until Success).
For the geometric distribution modeling the number of trials until the first success, the probability mass function is:
formula_124
The entropy formula_108 for this distribution is given by:
formula_126
Entropy increases as formula_34 decreases, reflecting greater uncertainty as the probability of success in each trial becomes smaller.
Fisher's Information (Geometric Distribution, Trials Until Success).
Fisher information for the geometric distribution modeling the number of trials until the first success is given by:
formula_114
Proof:
formula_130
formula_131
formula_133
formula_134
formula_121
formula_140
formula_151
where "q" = 1 − "p", and similarly for the other digits, and, more generally, similarly for numeral systems with other bases than 10. When the base is 2, this shows that a geometrically distributed random variable can be written as a sum of independent random variables whose probability distributions are indecomposable.
formula_160
has a geometric distribution taking values in formula_45, with expected value "r"/(1 − "r").
Statistical inference.
The true parameter formula_34 of an unknown geometric distribution can be inferred through estimators and conjugate distributions.
Method of moments.
Provided they exist, the first formula_171 moments of a probability distribution can be estimated from a sample formula_172 using the formulaformula_173where formula_174 is the formula_175th sample moment and formula_176. Estimating formula_83 with formula_178 gives the sample mean, denoted formula_179. Substituting this estimate in the formula for the expected value of a geometric distribution and solving for formula_180 gives the estimators formula_181 and formula_182 when supported on formula_41 and formula_45 respectively. These estimators are biased since formula_185 as a result of Jensen's inequality. 
Maximum likelihood estimation.
The maximum likelihood estimator of formula_34 is the value that maximizes the likelihood function given a sample.308 By finding the zero of the derivative of the log-likelihood function when the distribution is defined over formula_41, the maximum likelihood estimator can be found to be formula_188, where formula_189 is the sample mean. If the domain is formula_45, then the estimator shifts to formula_191. As previously discussed in § Method of moments, these estimators are biased.
Regardless of the domain, the bias is equal to
 formula_192
which yields the bias-corrected maximum likelihood estimator,
 formula_193
Bayesian inference.
In Bayesian inference, the parameter formula_34 is a random variable from a prior distribution with a posterior distribution calculated using Bayes' theorem after observing samples.167 If a beta distribution is chosen as the prior distribution, then the posterior will also be a beta distribution and it is called the conjugate distribution. In particular, if a formula_195 prior is selected, then the posterior, after observing samples formula_196, isformula_197Alternatively, if the samples are in formula_45, the posterior distribution isformula_199Since the expected value of a formula_195 distribution is formula_201,145 as formula_202 and formula_203 approach zero, the posterior mean approaches its maximum likelihood estimate.
Random variate generation.
The geometric distribution can be generated experimentally from i.i.d. standard uniform random variables by finding the first such random variable to be less than or equal to formula_34. However, the number of random variables needed is also geometrically distributed and the algorithm slows as formula_34 decreases.498
Random generation can be done in constant time by truncating exponential random numbers. An exponential random variable formula_206 can become geometrically distributed with parameter formula_34 through formula_208. In turn, formula_206 can be generated from a standard uniform random variable formula_210 altering the formula into formula_211.
Applications.
The geometric distribution is used in many disciplines. In queueing theory, the M/M/1 queue has a steady state following a geometric distribution. In stochastic processes, the Yule Furry process is geometrically distributed. The distribution also arises when modeling the lifetime of a device in discrete contexts. It has also been used to fit data including modeling patients spreading COVID-19.
References.
 ;templatestyles src="Reflist/styles.css" / ;