Study and Productivity

How to Work with the Beta, Gamma, Geometric and Negative Binomial Distributions

A student guide to four common distributions: what each one models, how to read the PDF, PMF and CDF, quantiles, moments and the usual parameter traps.

Saizul Amin
Saizul Amin3 Nov 2026 · 4 min read
How to Work with the Beta, Gamma, Geometric and Negative Binomial Distributions

How to Work with the Beta, Gamma, Geometric and Negative Binomial Distributions

Introductory statistics courses spend weeks on the normal and binomial distributions, then suddenly ask about waiting times, proportions and repeated trials. Four distributions cover most of those questions: the beta, the gamma, the geometric and the negative binomial. Each has its own parameters and, more annoyingly, more than one convention for those parameters. This guide explains what each one models, how to calculate probabilities by hand or with a table, and where students usually slip. You can check every number below in the free distribution explorer for beta, gamma, geometric and negative binomial.

Pick the distribution from the story

Start with the question, not the formula.

  • Beta(α, β) describes a quantity between 0 and 1, such as a proportion, a success rate or a probability you are uncertain about. It is the standard prior for a binomial proportion in Bayesian work.
  • Gamma(k, θ) describes a positive, right-skewed quantity such as a waiting time until the k-th event, rainfall totals or insurance claims. With k = 1 it becomes the exponential distribution; with θ = 2 and k = ν/2 it becomes chi-square with ν degrees of freedom.
  • Geometric(p) counts how long you wait for the first success in independent trials with success probability p.
  • Negative binomial(r, p) counts how long you wait for the r-th success. It is also the usual model for overdispersed counts, where the variance is larger than the mean.

Check the parameter convention first

Most wrong answers come from a convention mismatch, not from bad arithmetic. The gamma distribution is written with a scale θ in many textbooks and with a rate β = 1/θ in others; the mean is kθ or k/β. The geometric distribution can count trials (1, 2, 3, ...) or failures before the first success (0, 1, 2, ...). The negative binomial can count failures before the r-th success or total trials. The explorer lets you switch between trials and failures, and it always prints the mean so you can confirm you are using the same version as your textbook.

The formulas you need

Beta density: f(x) = x^(α−1)(1−x)^(β−1) / B(α, β) for 0 < x < 1, with mean α/(α+β) and variance αβ / ((α+β)²(α+β+1)). The CDF is the regularized incomplete beta function I_x(α, β).

Gamma density: f(x) = x^(k−1) e^(−x/θ) / (Γ(k) θ^k) for x > 0, with mean kθ and variance kθ². The CDF is the regularized lower incomplete gamma function P(k, x/θ).

Geometric, trials version: P(X = n) = (1−p)^(n−1) p and P(X ≤ n) = 1 − (1−p)^n, mean 1/p, variance (1−p)/p².

Negative binomial, failures version: P(K = k) = C(k+r−1, k) p^r (1−p)^k, mean r(1−p)/p, variance r(1−p)/p².

Worked examples

Beta. For Beta(2, 5) the mean is 2/7 ≈ 0.286. The probability that X is at most 0.5 is I_0.5(2, 5). A handy identity turns this into a binomial sum: it equals the probability that a Binomial(6, 0.5) variable is at least 2, which is 1 − 7/64 = 57/64 = 0.890625.

Gamma. For Gamma(k = 2, θ = 1), integer shape lets you use the Poisson link: P(X ≤ 2) = 1 − e^(−2)(1 + 2) = 1 − 3e^(−2) ≈ 0.594.

Geometric. A free throw goes in with p = 0.2. The chance that the first success is on the third attempt is 0.8² × 0.2 = 0.128, and the chance it takes at most three attempts is 1 − 0.8³ = 0.488. On average you need 1/0.2 = 5 attempts. The median is 4, because three attempts reach only 0.488 while four reach 0.5904.

Negative binomial. With r = 3 and p = 0.5, the probability of exactly two failures before the third success is C(4, 2) × 0.5³ × 0.5² = 6/32 = 0.1875. Adding k = 0, 1 and 2 gives 0.125 + 0.1875 + 0.1875 = 0.5.

Reading the chart

For continuous distributions the shaded area under the curve is the probability; the height of the density is not a probability and can exceed 1 (Beta(0.5, 0.5) is infinite at both ends). For discrete distributions each stem is a probability, and "at least 4" includes 4 itself. That inclusive boundary is the second most common slip after the convention mix-up.

Using quantiles

The inverse CDF answers questions such as "how many attempts cover 90 % of cases?" For a discrete distribution the answer is the smallest whole number whose CDF reaches the target, so it can overshoot the target probability noticeably. For a continuous one the inverse is exact. When you report a quantile, quote the probability alongside it.

Practising

The practice tab generates fresh problems with random parameters, checks your typed answer (decimals, fractions or percentages) and shows the working when you ask for it. Work a few by hand first, then compare.

Limits

The explorer covers four families; it does not fit parameters to your data, and it does not replace a full statistics package for maximum-likelihood estimation or goodness-of-fit tests. Results are computed in double precision, so probabilities far out in a tail (below about 1e-15) are not reliable. Always confirm which parameter convention your course uses before you copy an answer.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages