Definition
X∼Geo(p) counts the number of Bernoulli trials until the first success, where each trial is independent with success probability p.
PMF
P(X=n)=(1−p)n−1p,n=1,2,3,…
Why this formula? To have X=n:
- First n−1 trials must fail: probability (1−p)n−1
- Trial n succeeds: probability p
Range
X∈{1,2,3,…} (positive integers, starting at 1)
Expectation
E[X]=∑n=1∞n⋅(1−p)n−1p
Using ∑n=1∞nrn−1=(1−r)21 for ∣r∣<1:
E[X]=p⋅p21=p1
Intuition: If success has probability p, on average you need 1/p trials.
Example
For a fair coin (p=0.5), expected number of flips until heads is E[X]=2.
If p=0.1, expected trials until success is E[X]=10.
Variance
Var(X)=p21−p
Derivation: Using E[X2]=p22−p, we get Var(X)=E[X2]−E[X]2=p22−p−p21=p21−p.
Memoryless Property
The geometric distribution is the only discrete distribution that is memoryless:
P(X>m+n∣X>m)=P(X>n)
Interpretation: If you’ve already waited m trials without success, the probability of waiting at least n more trials is the same as starting fresh.
Proof
P(X>n)=(1−p)n
P(X>m+n∣X>m)=P(X>m)P(X>m+n)=(1−p)m(1−p)m+n=(1−p)n=P(X>n)
Example
Flip a coin until heads appears. If you’ve flipped 10 tails already, the probability of flipping at least 5 more is the same as if you just started fresh. The coin has no memory.
CDF
F(n)=P(X≤n)=1−(1−p)n
This is the probability of at least one success in n trials.
Examples
Example 1: Coin Flips
Flip a fair coin until heads. X∼Geo(0.5).
- P(X=1)=0.5
- P(X=2)=0.5×0.5=0.25
- P(X=3)=0.52×0.5=0.125
- E[X]=2
Example 2: Bit Generation
Generate random bits until the first 1, where each bit is 1 with probability p=0.3.
E[X]=0.31≈3.33
P(X≤5)=1−(0.7)5=1−0.168=0.832
Example 3: Network Packets
A network sends packets until acknowledgment received. Packet loss rate is 5%.
Expected packets sent until acknowledgment:
E[X]=0.951≈1.053
Alternative Convention
Some textbooks define geometric distribution starting at 0:
Y=X−1∼Geo0(p)
This counts failures before first success. Then Y∈{0,1,2,…} with:
E[Y]=p1−p,Var(Y)=p21−p
Always check which convention is being used.
Relation to Other Distributions
- Bernoulli: Each trial is Bernoulli(p)
- Binomial: Counts successes in n trials; geometric counts trials until first success
- Negative Binomial: Counts trials until rth success; geometric is the special case r=1
Summary
| Property | Value |
|---|
| PMF | P(X=n)=(1−p)n−1p |
| Range | {1,2,3,…} |
| Mean | p1 |
| Variance | p21−p |
| Memoryless | P(X>m+n∣X>m)=P(X>n) |
| CDF | F(n)=1−(1−p)n |