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.
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}\)
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.
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.
| 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 |
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.
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.