p <- 0.18
cat("P(X = 3) =", dgeom(3, prob = p), "\n")
cat("P(X <= 3) =", pgeom(3, prob = p), "\n")
cat("P(X >= 8) =", 1 - pgeom(7, prob = p), "\n")P(X = 3) = 0.09924624
P(X <= 3) = 0.5478782
P(X >= 8) = 0.2044141
Let \(X\) be the number of failures before the first success in independent Bernoulli trials with success probability \(p\). Then \(X\) follows a geometric distribution:
\[ X \sim \text{Geom}(p), \quad p \in (0,1), \quad X \in \{0,1,2,\dots\} \]
with probability mass function
\[ \text{P}(X = k) = (1-p)^k p, \quad k = 0,1,2,\dots \]
and cumulative distribution function
\[ \text{P}(X \le k) = 1 - (1-p)^{k+1}, \quad k = 0,1,2,\dots \]
Note on parameterization: this chapter uses the same definition as R’s dgeom and pgeom functions (failures before first success).
\[ \text{E}(X) = \frac{1-p}{p} \]
\[ \text{V}(X) = \frac{1-p}{p^2} \]
\[ M_X(t) = \frac{p}{1-(1-p)e^t}, \quad t < -\ln(1-p) \]
\[ \text{Mo}(X) = 0 \]
An exact integer median (smallest \(m\) with \(\text{P}(X \le m)\ge 0.5\)) is:
\[ \text{Med}(X)=\left\lceil \frac{\ln(0.5)}{\ln(1-p)} \right\rceil - 1 \]
\[ g_1 = \frac{2-p}{\sqrt{1-p}} \]
\[ g_2 = 9 + \frac{p^2}{1-p} \]
The corresponding excess kurtosis is \(6 + \frac{p^2}{1-p}\).
For observations \(x_1,\dots,x_n\) (failures before first success), the maximum-likelihood estimator is
\[ \hat p = \frac{1}{1+\bar x}. \]
The geometric distribution is memoryless:
\[ \text{P}(X \ge m+n \mid X \ge m)=\text{P}(X \ge n) \]
because \(\text{P}(X \ge k)=(1-p)^k\) and therefore
\[ \frac{\text{P}(X \ge m+n)}{\text{P}(X \ge m)}= \frac{(1-p)^{m+n}}{(1-p)^m}=(1-p)^n=\text{P}(X \ge n). \]
Among discrete distributions on \(\{0,1,2,\dots\}\), the geometric distribution is uniquely memoryless.
The geometric distribution is useful when the key quantity is “how many failed attempts occur before the first success”:
The Geometric Probabilities app is available in the handbook menu:
Distributions / Geometric ProbabilitiesIt is also accessible directly at:
A B2B team estimates that each qualified outreach attempt has success probability \(p = 0.18\) (booking a product demo). Let \(X\) be the number of unsuccessful attempts before the first booked demo.
We can evaluate the chance of obtaining a demo within the first four attempts:
\[ \text{P}(X \le 3) \]
For a direct PMF calculation, the probability of exactly 3 failures before first success is:
\[ \text{P}(X=3)=(1-p)^3p=(1-0.18)^3(0.18)\approx 0.0993 \]
P(X = 3) = 0.09924624
P(X <= 3) = 0.5478782
P(X >= 8) = 0.2044141
The second quantity, \(\text{P}(X \ge 8)\), is the probability of at least eight failures before the first success (a useful tail-risk indicator for workload planning).
You can reproduce this setup with the preconfigured app below:
In a diagnostic screening program, each test independently identifies a positive case with probability \(p=0.12\). Let \(X\) be the number of negative tests before the first positive result.
Two useful quantities are:
\[ \text{P}(X \le 4) \quad \text{and} \quad \text{P}(X \ge 10). \]
P(X <= 4) = 0.4722681
P(X >= 10) = 0.278501
Interpretation: the first value measures the chance of finding a positive case quickly (within five tests total), while the second quantifies the tail risk of long negative streaks before detection.