Skip to content

GeometricDistribution ​

The Geometric distribution: the number of failures before the first success, with success probability pp.

GeometricDistribution(p)an inert distribution object — carries pp, unevaluated. PDF, CDF, Mean, Variance and RandomVariate all read it.
Typed signatures
TypePackageApplies
(real<0..1>) -> distributionstatisticsalways

Domain: Statistics

Details
  • Wolfram's own convention: support is the nonnegative integers 0,1,2,…0, 1, 2, \ldots (failures before the first success), not 1,2,…1, 2, \ldots.
  • PDF(k)=p(1−p)kPDF(k) = p(1-p)^k — no support check outside the nonnegative integers (a documented divergence, same policy as unclamped PDFs elsewhere in this package).
  • CDF(x)=1−(1−p)⌊x⌋+1CDF(x) = 1 - (1-p)^{\lfloor x\rfloor + 1}, clamped to 00 below x=0x=0.
  • Mean=(1−p)/pMean = (1-p)/p, Variance=(1−p)/p2Variance = (1-p)/p^2, both exact.
  • RandomVariate samples via inverse transform: ⌊log⁡U/log⁡(1−p)⌋\lfloor \log U / \log(1-p) \rfloor.

Examples

Basic #
live ↗
InPDF⁡(GeometricDistribution(14),2)\operatorname{PDF}(\mathrm{GeometricDistribution}(\frac{1}{4}), 2)Out964\frac{9}{64}
live ↗
InCDF⁡(GeometricDistribution(14),2)\operatorname{CDF}(\mathrm{GeometricDistribution}(\frac{1}{4}), 2)Out3764\frac{37}{64}
live ↗
Inmean(GeometricDistribution(14))\mathrm{mean}(\mathrm{GeometricDistribution}(\frac{1}{4}))Out33
live ↗
InVariance(GeometricDistribution(14))\mathrm{Variance}(\mathrm{GeometricDistribution}(\frac{1}{4}))Out1212

The least kk with CDF(k)≥1/2CDF(k) \ge 1/2

live ↗
Inmedian(GeometricDistribution(110))\mathrm{median}(\mathrm{GeometricDistribution}(\frac{1}{10}))Out66
About
Examples5
Checked againstWolfram Language 1 agree

See also: BernoulliDistribution, NegativeBinomialDistribution, PDF, CDF, RandomVariate