Geometric Distribution Calculator

Compute exact probabilities for the number of trials until first success. Visualize the probability mass function, calculate cumulative probabilities, and explore the memoryless property — essential for quality control, sports analytics, and reliability engineering.

? Fair coin (p=0.5, k=2)
? Die roll (p=1/6, k=4)
? Rare event (p=0.1, k=7)
⚙️ Quality check (p=0.25, k=3)
⭐ High success (p=0.8, k=1)
Privacy first: All calculations run locally in your browser. No data is transmitted or stored.
Distribution Metrics
P(X = k) :
P(X ≤ k) (CDF) :
P(X > k) (tail) :
Mean (μ = 1/p) :
Variance (σ² = (1-p)/p²) :
Standard deviation :
Geometric PMF: P(X = k)
Selected k (highlighted)

Understanding the Geometric Distribution

The geometric distribution models the number of independent Bernoulli trials needed to achieve the first success. Each trial has constant success probability \(p\) (with \(0 < p \le 1\)). It is widely used in reliability (time to failure), sports (number of shots until first goal), and queueing theory. Its memoryless property makes it the discrete counterpart of the exponential distribution.

Probability Mass Function (PMF):

\(P(X = k) = (1-p)^{k-1} p \quad , \quad k = 1, 2, 3, \dots\)

Cumulative Distribution Function (CDF): \(P(X \le k) = 1 - (1-p)^k\)

Mean \(E[X] = \frac{1}{p}\), Variance \(Var(X) = \frac{1-p}{p^2}\)

Key Properties & Real‑World Relevance

  • Memoryless property: \(P(X > m+n \mid X > m) = P(X > n)\). The future is independent of the past – perfect for “waiting time” processes.
  • Applications: Modeling number of calls until a successful connection, number of defective inspections until finding a non‑defective unit, lottery attempts, and even streak analysis in sports.
  • Relation to Negative Binomial: The geometric distribution is a special case of the negative binomial (r=1).
  • Shape behavior: For large p (e.g., p>0.5), the PMF is strictly decreasing. For small p, it decays slowly.
Case Study: Quality Assurance in Manufacturing

A factory produces electronic components with a defect rate of 5% (p = 0.95 for success = non‑defective). The geometric distribution answers: “What is the probability that the first non‑defective component is found on the 3rd inspection?” Using our calculator with p=0.95, k=3 returns P(X=3) ≈ 0.002375. More important: the expected number of inspections to find a non‑defective unit is 1/0.95 ≈ 1.053. This guides inventory and quality control planning.

Derivation & Step-by-Step Calculation

To compute P(X = k), you need k-1 consecutive failures followed by one success. Since trials are independent: \((1-p)^{k-1} p\). The CDF sums PMF terms, leading to the closed form \(1 - (1-p)^k\). Our calculator implements these exact formulas with double‑precision floating point to guarantee high accuracy even for extreme probabilities.

How to Use This Geometric Distribution Tool

  1. Set the success probability \(p\) (between 0 and 1). Use the slider or direct input.
  2. Enter the trial number \(k\) (positive integer) for which you want exact probability.
  3. Adjust “Max trials in chart” to view the PMF for a wider or narrower range (up to 50 trials).
  4. Instantly see P(X=k), P(X≤k), mean, variance, and standard deviation.
  5. The interactive bar chart updates dynamically – the bar corresponding to your chosen k turns red for quick identification.
  6. Use preset examples to explore different scenarios like fair coin tosses or rare events.

Geometric Distribution Properties Table (Examples)

Success probability (p) k (trial) P(X = k) P(X ≤ k) Mean (1/p) Interpretation
0.5 1 0.5000 0.5000 2.0 Even chance first success immediately
0.5 3 0.1250 0.8750 2.0 Likely success within first 3 tosses
0.2 5 0.0819 0.6723 5.0 Moderate waiting time
0.9 2 0.0900 0.9900 1.111 Almost sure success within 2 trials

The Memoryless Property Explained

For the geometric distribution, the probability of needing additional t trials given that you have already failed m times is identical to the original distribution. Formally: \(P(X > m + t \mid X > m) = P(X > t) = (1-p)^t\). This unique property makes it ideal for modeling “waiting times” where the process resets. It’s why engineers use geometric models for system lifetime when failures occur randomly without aging.

Frequently Asked Questions

The binomial distribution counts successes in a fixed number of trials. The geometric distribution counts the number of trials needed to achieve the first success. Both rely on independent Bernoulli trials.

Yes, if p=1 then the first trial is always a success: P(X=1)=1, mean=1, variance=0. Our calculator handles that boundary case.

The PMF decays exponentially. For small p, large k still has non‑negligible probability. The calculator uses numerically stable formulas, and the chart range can be extended up to 50 trials.

Because the probability of additional failures does not depend on how many failures have already occurred. It’s like starting over – no “memory” of past trials.

Results are computed with double-precision arithmetic, providing approximately 15 decimal digits of accuracy. For extremely small p (e.g., 0.001) and large k, results are reliable down to machine epsilon limits.

Advanced Insights: Geometric vs. Exponential & Common Pitfalls

Connection to the exponential distribution: If we scale the geometric distribution and let \(p \to 0\) while keeping the expected value constant, the geometric converges to the exponential distribution. This explains why waiting times for rare events often follow an exponential decay – a cornerstone of survival analysis and queuing theory.

Numerical verification of memorylessness: Choose p=0.3, then P(X > 5) = (0.7)^5 ≈ 0.16807. Now P(X > 5+3 | X > 5) = P(X > 3) = (0.7)^3 ≈ 0.343. The ratio matches exactly (0.16807/0.16807? Actually conditional probability = P(X>8)/P(X>5) = 0.7^8/0.7^5 = 0.7^3). Use our calculator to verify these tail probabilities – a perfect classroom demonstration.

Common misinterpretation: Some textbooks define the geometric distribution as the number of failures before the first success (support k = 0,1,2,...). Our calculator uses the “number of trials” variant (k ≥ 1). If you need the failures variant, simply subtract 1 from k. For example, P(2 failures before first success) = P(X=3) with our calculator. This is clearly explained to avoid confusion.

Expert tip – using the calculator for decision making: In A/B testing, the geometric distribution helps estimate the number of visitors needed to observe a conversion. By setting p = baseline conversion rate, marketing teams can compute quantiles (e.g., median waiting time = ceil(-log(2)/log(1-p))). Although our calculator does not directly output quantiles, you can adjust k iteratively until CDF reaches 0.5 – an intuitive way to grasp variability.

Authority & Academic Backing – This geometric distribution calculator implements formulas validated by standard statistical references: Johnson, N.L., Kemp, A.W., & Kotz, S. (2005). "Univariate Discrete Distributions"; and Weisstein, E.W. "Geometric Distribution" (MathWorld). Peer‑reviewed methodology, used in educational curricula and reliability engineering. Last editorial review: May 2026, GetZenQuery tech Team.