Geometric Distribution Calculator

Trials until first success.

Examples:
P(X = 5)
0.07203
Expected Value E[X]
3.3333
Std Deviation Οƒ
2.7889
P(X = k)
0.07203
12345678910111200.0750.150.2250.3

Probability Table

1: 0.3
2: 0.21
3: 0.147
4: 0.1029
5: 0.072
6: 0.0504
7: 0.0353
8: 0.0247
9: 0.0173
10: 0.0121
11: 0.0085
12: 0.0059
Geometric Distribution PMF
P(X=k)=(1βˆ’p)kβˆ’1β‹…p,k=1,2,3,…P(X = k) = (1-p)^{k-1} \cdot p, \quad k = 1, 2, 3, \ldots

What Is the Geometric Distribution?

The geometric distribution models the number of trials needed to achieve the first success in a sequence of independent Bernoulli trials, where each trial has the same probability of success. It answers questions like "How many times must I flip a coin until I get heads?" or "How many products must I inspect until I find a defect?"

The geometric distribution is the discrete analog of the exponential distribution and shares its memoryless property.

Two Conventions

There are two common definitions of the geometric distribution:

Convention 1: Number of Trials (k β‰₯ 1)

X = number of trials until the first success (including the successful trial)

P(X=k)=(1βˆ’p)kβˆ’1β‹…pfor k=1,2,3,…P(X = k) = (1-p)^{k-1} \cdot p \quad \text{for } k = 1, 2, 3, \ldots

  • Mean: E[X]=1pE[X] = \frac{1}{p}
  • Variance: Var(X)=1βˆ’pp2Var(X) = \frac{1-p}{p^2}

Convention 2: Number of Failures (k β‰₯ 0)

Y = number of failures before the first success

P(Y=k)=(1βˆ’p)kβ‹…pfor k=0,1,2,…P(Y = k) = (1-p)^k \cdot p \quad \text{for } k = 0, 1, 2, \ldots

  • Mean: E[Y]=1βˆ’ppE[Y] = \frac{1-p}{p}
  • Variance: Var(Y)=1βˆ’pp2Var(Y) = \frac{1-p}{p^2}

Note: Y=Xβˆ’1Y = X - 1, so the relationship between conventions is straightforward.

The Memoryless Property

Like the exponential distribution, the geometric distribution is memoryless:

P(X>m+n∣X>m)=P(X>n)P(X > m + n \mid X > m) = P(X > n)

If you've already failed mm times, your expected additional trials until success is the same as if you were starting fresh. Past failures don't influence future success.

Important: The geometric distribution is the only discrete distribution with this property.

Practical Applications

Quality Control

How many items must be inspected to find the first defective one? If the defect rate is 2% (p=0.02p = 0.02), on average you'd need to inspect 1/0.02=501/0.02 = 50 items.

Sales and Marketing

How many calls until the first sale? How many emails until a response? Geometric models help set expectations and measure performance.

Genetics

How many offspring until one inherits a particular trait? If the probability of inheritance is 0.25, expect about 4 offspring on average.

Games of Chance

How many lottery tickets until a win? How many spins until hitting a jackpot? (Though actual gambling involves more complex probabilities.)

Reliability Testing

How many stress tests until component failure? The geometric distribution applies when each test has independent failure probability.

Cumulative Probabilities

The CDF (probability of success within kk trials) is:

P(X≀k)=1βˆ’(1βˆ’p)kP(X \leq k) = 1 - (1-p)^k

The survival function (probability of no success in first kk trials) is:

P(X>k)=(1βˆ’p)kP(X > k) = (1-p)^k

Example Calculation

Problem: A basketball player makes free throws with 75% accuracy. What's the probability they make their first basket on exactly the third attempt?

Using convention 1 (trials until success):

  • p=0.75p = 0.75 (success probability)
  • k=3k = 3 (first success on third trial)

P(X=3)=(1βˆ’0.75)3βˆ’1β‹…0.75=(0.25)2β‹…0.75=0.0469P(X = 3) = (1-0.75)^{3-1} \cdot 0.75 = (0.25)^2 \cdot 0.75 = 0.0469

About 4.7% chance of missing twice then making the third.

Connection to Other Distributions

Negative Binomial

The negative binomial distribution generalizes the geometric distribution to count trials until rr successes (geometric is the special case r=1r = 1).

Exponential Distribution

The exponential distribution is the continuous-time analog. If events occur in continuous time at rate Ξ»\lambda, waiting time is exponential. If events occur in discrete trials with probability pp, waiting trials is geometric.

Binomial Distribution

The binomial distribution counts successes in a fixed number of trials, while geometric counts trials until the first success.

When Geometric Doesn't Apply

  • Non-constant probability: If pp changes over trials
  • Dependent trials: If outcomes influence each other
  • Multiple success types: When success isn't binary

Quantiles and Percentiles

The qq-th quantile (minimum kk such that P(X≀k)β‰₯qP(X \leq k) \geq q) is:

k=⌈ln⁑(1βˆ’q)ln⁑(1βˆ’p)βŒ‰k = \left\lceil \frac{\ln(1-q)}{\ln(1-p)} \right\rceil

This tells you how many trials to guarantee a given probability of success.

Related Calculations

Summary

The geometric distribution is the go-to model for counting independent trials until the first success. Its memoryless property means past failures don't affect future success probabilityβ€”each trial is a fresh start. Whether analyzing quality control, sales processes, or games of chance, the geometric distribution provides simple formulas for expected waiting times and success probabilities.