Markdown Editor

Probability Distributions Reference Sheet Template (Statistics, R and Python)

Distributions reference: 16 discrete and continuous distributions with pmf/pdf, support, mean, variance and uses, a relationship map, R d/p/q/r and scipy.stats equivalents with parameterisation traps, verified lookups and a which-distribution self-test

AcademicFullNIST/SEMATECH e-Handbook 1.3.6; R stats and SciPy documentation; Student (1908); Weibull (1951)statsdistributionssheetmath

How to use: Use it when choosing a model for a variable or looking up probabilities and critical values. Start from the decision diagram, learn each distribution's story before its formula, and run the lookup code in both languages. The main pitfall is parameterisation: scipy scale is 1/rate, R's geometric counts failures while scipy's counts trials, and discrete upper tails need x minus 1.

Preview

Probability Distributions Reference Sheet: [Your course or data set]

A reference sheet for the probability distributions that appear in introductory and intermediate statistics: Bernoulli, binomial, Poisson, geometric, negative binomial, hypergeometric, uniform, normal, exponential, gamma, beta, lognormal, Weibull, t, chi-square and F. For each one it gives the story behind it, the pmf or pdf in KaTeX, the support, the parameters, the mean and variance, and typical uses, followed by a map of how the distributions are related and a side-by-side table of R and Python (scipy.stats) functions with the parameterisation traps that cause most wrong answers. It is for students who need a single page to revise from, thesis writers choosing a model for their outcome, and analysts who switch between R and Python. It speeds up learning by attaching each formula to a concrete story, by showing the distributions as one connected family, and by making you practise lookups with fading worked examples and a "which distribution?" self-test. Every lookup value on this sheet was produced by running the code shown. The worked examples use fictional data; replace them with your own. Source basis: standard distribution theory, the NIST/SEMATECH e-Handbook of Statistical Methods (chapter 1.3.6), and the R stats and SciPy documentation.

Document control

FieldValue
Course or project[STAT 201 Probability and Inference]
Learner or analyst[Your name]
Data setFictional: Harbour City Library returns, Brightwell Bakery loaves, Lakemoor University exam scores
Software and versionsR 4.5.1 (stats); Python 3.14 with scipy 1.18.1 and numpy 2.5.4
DateYYYY-MM-DD
Version[0.1]

The idea in one paragraph

A probability distribution is a model of how a random quantity behaves: which values it can take (its support) and how likely each value or range is. Discrete distributions give a probability to each count through a probability mass function (pmf); continuous distributions spread probability over an interval through a probability density function (pdf), and probabilities are areas under the curve. Every named distribution comes from a simple story: "count successes in a fixed number of independent tries" gives the binomial, "count rare events in a fixed window" gives the Poisson, "add up many small independent effects" gives the normal, "wait for the next event in a memoryless process" gives the exponential. Pick the distribution whose story matches how your data were generated, check its support against your data, and then use software to look up probabilities and quantiles. The four lookup questions are always the same: the probability of exactly a value (d), the probability up to a value (p), the value with a given probability below it (q), and random draws (r).

Choosing a distribution

Structure aligned with the NIST/SEMATECH e-Handbook catalogue of distributions (chapter 1.3.6), reorganised by the question a learner asks about their data; wording and examples are original.

My path for [my variable]: [Measurements, positive, right-skewed, log looks normal: lognormal].

Discrete distributions

Notation: pp is the success probability, q=1−pq = 1 - p, nn the number of trials, λ\lambda a rate or mean count, and (nx)\binom{n}{x} the number of combinations (see academic/stats-probability-basics).

DistributionStorySupportParametersMeanVarianceTypical uses
BernoulliOne trial: success (1) or failure (0)0, 1pppppqpqA single yes/no outcome; building block of the others
BinomialSuccesses in nn independent trials with the same pp0, 1, ..., nnn,pn, pnpnpnpqnpqPass counts, defect counts in a batch, survey yes counts
PoissonCount of independent rare events in a fixed window0, 1, 2, ...λ>0\lambda > 0λ\lambdaλ\lambdaArrivals per hour, typos per page, library returns per day
GeometricTrials until (and including) the first success1, 2, 3, ...pp1/p1/pq/p2q/p^2Attempts until a pass, calls until a sale
Negative binomialFailures before the rr-th success; or an overdispersed count0, 1, 2, ...r,pr, p (or mean μ\mu, size kk)rq/prq/p (or μ\mu)rq/p2rq/p^2 (or μ+μ2/k\mu + \mu^2/k)Counts with variance above the mean (see academic/stats-count-regression)
HypergeometricSuccesses in nn draws without replacement from NN items with KK successesmax(0, n+K−N) to min(n, K)N,K,nN, K, nnK/NnK/NnKNN−KNN−nN−1n \frac{K}{N}\frac{N-K}{N}\frac{N-n}{N-1}Audit samples, Fisher's exact test, quality inspection of a small lot

Probability mass functions

Bernoulli: P(X=x)=px(1−p)1−x,x∈{0,1}\text{Bernoulli: } P(X = x) = p^x (1-p)^{1-x}, \quad x \in \{0, 1\}
Binomial: P(X=x)=(nx)px(1−p)n−x\text{Binomial: } P(X = x) = \binom{n}{x} p^x (1-p)^{n-x}
Poisson: P(X=x)=e−λλxx!\text{Poisson: } P(X = x) = \frac{e^{-\lambda} \lambda^x}{x!}
Geometric (trials): P(X=x)=(1−p)x−1p,x=1,2,…\text{Geometric (trials): } P(X = x) = (1-p)^{x-1} p, \quad x = 1, 2, \dots
Negative binomial (failures): P(X=x)=(x+r−1x)pr(1−p)x,x=0,1,…\text{Negative binomial (failures): } P(X = x) = \binom{x + r - 1}{x} p^r (1-p)^x, \quad x = 0, 1, \dots
Hypergeometric: P(X=x)=(Kx)(N−Kn−x)(Nn)\text{Hypergeometric: } P(X = x) = \frac{\binom{K}{x}\binom{N-K}{n-x}}{\binom{N}{n}}

Picture: the Poisson as a limit of the binomial. The chart compares Binomial(30, 0.1) with Poisson(3), which has the same mean of 3. With many trials and a small success probability, the two are nearly the same, which is why rare-event counts are modelled as Poisson. The probabilities were computed with dpois(0:10, 3) and dbinom(0:10, 30, 0.1) in R (identical to scipy to four decimals).

Continuous distributions

Notation: μ\mu and σ\sigma are a mean and standard deviation, λ\lambda a rate, α\alpha a shape, β\beta a rate (for the gamma) or a second shape (for the beta), ν\nu or kk degrees of freedom df, and Γ(⋅)\Gamma(\cdot) the gamma function, with Γ(m)=(m−1)!\Gamma(m) = (m-1)! for whole numbers.

DistributionStorySupportParametersMeanVarianceTypical uses
UniformEvery value in an interval equally likely[a,b][a, b]a<ba < b(a+b)/2(a+b)/2(b−a)2/12(b-a)^2/12Rounding error, random start times, simulation input
NormalSum of many small independent effectsall real numbersμ,σ>0\mu, \sigma > 0μ\muσ2\sigma^2Measurement error, heights, sample means (via the CLT)
ExponentialWaiting time to the next event at a constant rate (memoryless)x≥0x \ge 0rate λ\lambda1/λ1/\lambda1/λ21/\lambda^2Time between arrivals, service times
GammaWaiting time to the α\alpha-th event; flexible positive skewx>0x > 0shape α\alpha, rate β\betaα/β\alpha/\betaα/β2\alpha/\beta^2Rainfall, insurance claims, total service time
BetaA probability or proportion that is itself uncertain[0,1][0, 1]shapes α,β\alpha, \betaαα+β\frac{\alpha}{\alpha+\beta}αβ(α+β)2(α+β+1)\frac{\alpha\beta}{(\alpha+\beta)^2(\alpha+\beta+1)}Proportions, Bayesian prior for pp
LognormalProduct of many small positive effects; log is normalx>0x > 0μ,σ\mu, \sigma of the logeμ+σ2/2e^{\mu + \sigma^2/2}(eσ2−1)e2μ+σ2(e^{\sigma^2}-1)e^{2\mu+\sigma^2}Incomes, reaction times, concentrations
WeibullLifetime with a failure rate that rises, falls or stays flatx≥0x \ge 0shape kk, scale λ\lambdaλ Γ(1+1/k)\lambda\,\Gamma(1+1/k)λ2[Γ(1+2/k)−Γ(1+1/k)2]\lambda^2[\Gamma(1+2/k) - \Gamma(1+1/k)^2]Reliability, equipment lifetimes, wind speed
tStandardised mean when σ\sigma is estimatedall real numbersdf ν\nu0 (for ν>1\nu > 1)ν/(ν−2)\nu/(\nu-2) (for ν>2\nu > 2)t-tests, CIs for means, regression coefficients
Chi-squareSum of kk squared standard normalsx≥0x \ge 0df kkkk2k2kVariance tests, goodness of fit, contingency tables
FRatio of two independent chi-squares, each divided by its dfx≥0x \ge 0df d1,d2d_1, d_2d2d2−2\frac{d_2}{d_2-2} (for d2>2d_2 > 2)2d22(d1+d2−2)d1(d2−2)2(d2−4)\frac{2d_2^2(d_1+d_2-2)}{d_1(d_2-2)^2(d_2-4)} (for d2>4d_2 > 4)ANOVA, comparing variances, regression F-test

Probability density functions

Uniform: f(x)=1b−a,a≤x≤b\text{Uniform: } f(x) = \frac{1}{b-a}, \quad a \le x \le b
Normal: f(x)=1σ2πexp⁡ ⁣(−(x−μ)22σ2)\text{Normal: } f(x) = \frac{1}{\sigma\sqrt{2\pi}} \exp\!\left(-\frac{(x-\mu)^2}{2\sigma^2}\right)
Exponential: f(x)=λe−λx,P(X>x)=e−λx\text{Exponential: } f(x) = \lambda e^{-\lambda x}, \qquad P(X > x) = e^{-\lambda x}
Gamma: f(x)=βαΓ(α)xα−1e−βx\text{Gamma: } f(x) = \frac{\beta^{\alpha}}{\Gamma(\alpha)} x^{\alpha - 1} e^{-\beta x}
Beta: f(x)=xα−1(1−x)β−1B(α,β),B(α,β)=Γ(α)Γ(β)Γ(α+β)\text{Beta: } f(x) = \frac{x^{\alpha-1}(1-x)^{\beta-1}}{B(\alpha, \beta)}, \qquad B(\alpha, \beta) = \frac{\Gamma(\alpha)\Gamma(\beta)}{\Gamma(\alpha+\beta)}
Lognormal: f(x)=1xσ2πexp⁡ ⁣(−(ln⁡x−μ)22σ2)\text{Lognormal: } f(x) = \frac{1}{x\sigma\sqrt{2\pi}} \exp\!\left(-\frac{(\ln x - \mu)^2}{2\sigma^2}\right)
Weibull: f(x)=kλ(xλ)k−1e−(x/λ)k\text{Weibull: } f(x) = \frac{k}{\lambda}\left(\frac{x}{\lambda}\right)^{k-1} e^{-(x/\lambda)^k}
t: f(t)=Γ ⁣(ν+12)νπ Γ ⁣(ν2)(1+t2ν)−ν+12\text{t: } f(t) = \frac{\Gamma\!\left(\frac{\nu+1}{2}\right)}{\sqrt{\nu\pi}\,\Gamma\!\left(\frac{\nu}{2}\right)} \left(1 + \frac{t^2}{\nu}\right)^{-\frac{\nu+1}{2}}
Chi-square: f(x)=xk/2−1e−x/22k/2 Γ(k/2)\text{Chi-square: } f(x) = \frac{x^{k/2 - 1} e^{-x/2}}{2^{k/2}\,\Gamma(k/2)}
F: f(x)=1B ⁣(d12,d22)(d1d2)d1/2xd1/2−1(1+d1d2x)−d1+d22\text{F: } f(x) = \frac{1}{B\!\left(\frac{d_1}{2}, \frac{d_2}{2}\right)} \left(\frac{d_1}{d_2}\right)^{d_1/2} x^{d_1/2 - 1} \left(1 + \frac{d_1}{d_2}x\right)^{-\frac{d_1+d_2}{2}}

You rarely compute these densities by hand. What matters is recognising the shape (symmetric or skewed, bounded or not), knowing the mean and variance, and asking software for areas.

Relationships between distributions

The distributions are one family, not a list. Knowing the links lets you rebuild a forgotten formula and explains why tests use the t, chi-square and F distributions at all.

The most useful links in practice:

  • Binomial to Poisson: when nn is large and pp small, Binomial(n,p)≈Poisson(np)\text{Binomial}(n, p) \approx \text{Poisson}(np) (see the chart above).
  • Binomial and Poisson to normal: a common rule of thumb (not a theorem) is that with np≥10np \ge 10 and n(1−p)≥10n(1-p) \ge 10, or λ≥10\lambda \ge 10 or so, a normal curve with the same mean and variance is a reasonable approximation (some textbooks use 5 instead of 10; the closer pp is to 0 or 1, the larger nn must be); this is the basis of the z-test for proportions (see academic/stats-proportion-tests).
  • Normal to t, chi-square and F: the t distribution appears when σ\sigma is replaced by the sample SD, the chi-square when squared standardised values are summed, and the F as a ratio of two variance estimates. This is why t-tests, chi-square tests and ANOVA use them (see academic/stats-sampling-distributions).
  • Exponential and Poisson: if events arrive as a Poisson process with rate λ\lambda, the waiting time between events is exponential with the same rate. Counts and waits are two views of one process.

R and Python functions

R uses a prefix system: d density or mass, p cumulative probability P(X≤x)P(X \le x), q quantile, r random draws. scipy.stats uses methods on a distribution object: .pmf or .pdf, .cdf, .ppf (quantile), .sf (survival function P(X>x)=1−P(X > x) = 1 - cdf), .isf (inverse survival) and .rvs (draws; prefer numpy.random.default_rng(seed) for reproducible simulation).

DistributionR (d, p, q, r stem)scipy.statsParameterisation trap
Bernoullidbinom(x, 1, p)bernoulli(p)None
Binomialdbinom(x, size, prob)binom(n, p)None
Poissondpois(x, lambda)poisson(mu)scipy calls the mean mu
Geometricdgeom(x, prob)geom(p)R counts failures before the first success (starts at 0); scipy counts trials (starts at 1). dgeom(2, p) equals geom.pmf(3, p).
Negative binomialdnbinom(x, size, prob) or dnbinom(x, size, mu = m)nbinom(n, p)Both count failures. R allows the mean form size, mu; scipy needs n = size and p = size / (size + mu).
Hypergeometricdhyper(x, m, n, k): m successes, n failures, k drawshypergeom(M, n, N): M total, n successes, N drawsThe letters mean different things. R's n is the number of failures; scipy's n is the number of successes.
Uniformdunif(x, min, max)uniform(loc, scale)scipy: loc = a, scale = b - a (not b)
Normaldnorm(x, mean, sd)norm(loc, scale)Both use the SD, not the variance
Exponentialdexp(x, rate)expon(scale)scipy scale = 1 / rate
Gammadgamma(x, shape, rate) (or scale =)gamma(a, scale)scipy scale = 1 / rate; R's third positional argument is the rate
Betadbeta(x, shape1, shape2)beta(a, b)None
Lognormaldlnorm(x, meanlog, sdlog)lognorm(s, scale)scipy s = sdlog, scale = exp(meanlog)
Weibulldweibull(x, shape, scale)weibull_min(c, scale)scipy calls the shape c
tdt(x, df)t(df)None
Chi-squaredchisq(x, df)chi2(df)None
Fdf(x, df1, df2)f(dfn, dfd)In R, df is also a common variable name; df() is the F density

Upper tails: in R add lower.tail = FALSE to a p or q function; in scipy use .sf or .isf. For a discrete variable, "at least 6" is "more than 5", so the upper-tail call uses 5, not 6.

Worked example A (fully solved): late returns at Harbour City Library

Question. Harbour City Library (fictional) receives late book returns at an average of 3 per hour, and returns arrive independently. What is the probability of 6 or more late returns in a given hour?

Step 1: choose the distribution. Counts of independent events in a fixed window with a known average rate: Poisson with λ=3\lambda = 3. Check: the support (0, 1, 2, ...) matches a count, and there is no fixed upper limit.

Step 2: write the event. P(X≥6)=1−P(X≤5)P(X \ge 6) = 1 - P(X \le 5).

Step 3: by hand (optional check).

P(X≤5)=e−3(1+3+92+276+8124+243120)=0.04979×18.4≈0.9161P(X \le 5) = e^{-3}\left(1 + 3 + \frac{9}{2} + \frac{27}{6} + \frac{81}{24} + \frac{243}{120}\right) = 0.04979 \times 18.4 \approx 0.9161

so P(X≥6)≈0.0839P(X \ge 6) \approx 0.0839.

Step 4: software. R ppois(5, 3, lower.tail = FALSE) and scipy poisson.sf(5, 3) both give 0.0839 (see the verification output below). Both use 5, because X≥6X \ge 6 is the same event as X>5X > 5.

Step 5: interpret. About 8% of hours, or roughly one hour in twelve, will see 6 or more late returns. If the library adds a second person to the returns desk only to cope with hours of 6 or more late returns, it should expect to need that help in about one hour in twelve, assuming the rate really is constant across the day (it often is not: check the assumption against hourly data).

Worked example B (half solved): underbaked loaves at Brightwell Bakery

Question. At Brightwell Bakery (fictional), each loaf is underbaked with probability 0.05, independently. A quality check takes 10 loaves. Find (a) the probability that exactly 1 is underbaked and (b) the probability that 2 or more are underbaked.

Step 1: choose the distribution. A fixed number of independent trials with the same success probability: [ ] with n=[ ]n = [\ ] and p=[ ]p = [\ ].

Step 2: write the events. (a) P(X=1)P(X = 1). (b) P(X≥2)=1−P(X≤[ ])P(X \ge 2) = 1 - P(X \le [\ ]).

Step 3: by hand for (a).

P(X=1)=(101)(0.05)1(0.95)9=10×0.05×[  ]≈[  ]P(X = 1) = \binom{10}{1}(0.05)^1(0.95)^{9} = 10 \times 0.05 \times [\ \ ] \approx [\ \ ]

Step 4: software. R: dbinom(1, 10, 0.05) gives 0.3151 and pbinom(1, 10, 0.05) gives 0.9139. So (b) is [ ]. The scipy equivalents are binom.pmf([ ], 10, 0.05) and binom.sf([ ], 10, 0.05).

Step 5: interpret. If the bakery's process is in control, a batch of 10 with 2 or more underbaked loaves will occur in about [ ] of checks, so seeing it [ ].

Exercise C (unsolved): exam scores and waiting times

  1. Scores on a Lakemoor University (fictional) statistics exam are approximately normal with mean 65 and SD 10. What proportion of students score above 80? What score marks the 90th percentile?
  2. Waiting time in the Brightwell Bakery queue is exponential with a mean of 4 minutes. What is the probability a customer waits more than 6 minutes? Write the scipy call carefully.
  3. A cart at Harbour City Library holds 20 returned books, 5 of them damaged. A volunteer picks 4 at random without replacement. What is the probability that exactly 1 is damaged? Write both the R and scipy calls.

Lookup verification code

R (base R only)

# Worked lookups (fictional settings)
# 1 Binomial: 10 loaves, P(defect) = 0.05; P(X = 1), P(X <= 1)
cat(sprintf("dbinom(1, 10, 0.05) = %.4f\n", dbinom(1, 10, 0.05)))
cat(sprintf("pbinom(1, 10, 0.05) = %.4f\n", pbinom(1, 10, 0.05)))
# 2 Poisson: library late returns, mean 3 per hour; P(X >= 6)
cat(sprintf("1 - ppois(5, 3) = %.4f\n", 1 - ppois(5, 3)))
cat(sprintf("ppois(5, 3, lower.tail = FALSE) = %.4f\n", ppois(5, 3, lower.tail = FALSE)))
# 3 Normal: exam scores N(65, 10^2); P(X > 80) and 90th percentile
cat(sprintf("pnorm(80, 65, 10, lower.tail = FALSE) = %.4f\n", pnorm(80, 65, 10, lower.tail = FALSE)))
cat(sprintf("qnorm(0.90, 65, 10) = %.4f\n", qnorm(0.90, 65, 10)))
cat(sprintf("qnorm(0.975) = %.4f\n", qnorm(0.975)))
# 4 Exponential: waiting time, rate 0.25 per minute (mean 4); P(T > 6)
cat(sprintf("pexp(6, rate = 0.25, lower.tail = FALSE) = %.4f\n", pexp(6, rate = 0.25, lower.tail = FALSE)))
# 5 t, chi-square, F critical values
cat(sprintf("qt(0.975, df = 9) = %.4f\n", qt(0.975, df = 9)))
cat(sprintf("qchisq(0.95, df = 3) = %.4f\n", qchisq(0.95, df = 3)))
cat(sprintf("qf(0.95, df1 = 2, df2 = 27) = %.4f\n", qf(0.95, 2, 27)))
# 6 Geometric: P(first success on trial 3), p = 0.2 (R counts failures)
cat(sprintf("dgeom(2, 0.2) = %.4f\n", dgeom(2, 0.2)))
# 7 Negative binomial: mean 4, size 2 (overdispersed counts); P(X = 0)
cat(sprintf("dnbinom(0, size = 2, mu = 4) = %.4f\n", dnbinom(0, size = 2, mu = 4)))
# 8 Hypergeometric: 20 books, 5 damaged, draw 4; P(exactly 1 damaged)
cat(sprintf("dhyper(1, m = 5, n = 15, k = 4) = %.4f\n", dhyper(1, 5, 15, 4)))
# 9 Gamma shape 2 rate 0.5; Beta(2, 5); Lognormal meanlog 1 sdlog 0.5
cat(sprintf("pgamma(6, shape = 2, rate = 0.5) = %.4f\n", pgamma(6, shape = 2, rate = 0.5)))
cat(sprintf("pbeta(0.3, 2, 5) = %.4f\n", pbeta(0.3, 2, 5)))
cat(sprintf("plnorm(4, meanlog = 1, sdlog = 0.5) = %.4f\n", plnorm(4, 1, 0.5)))
cat(sprintf("punif(0.3, 0, 2) = %.4f\n", punif(0.3, 0, 2)))
cat(sprintf("pweibull(3, shape = 1.5, scale = 4) = %.4f\n", pweibull(3, 1.5, 4)))
set.seed(2026); x <- rpois(5, 3); cat("rpois(5, 3) with seed 2026:", x, "\n")
dbinom(1, 10, 0.05) = 0.3151
pbinom(1, 10, 0.05) = 0.9139
1 - ppois(5, 3) = 0.0839
ppois(5, 3, lower.tail = FALSE) = 0.0839
pnorm(80, 65, 10, lower.tail = FALSE) = 0.0668
qnorm(0.90, 65, 10) = 77.8155
qnorm(0.975) = 1.9600
pexp(6, rate = 0.25, lower.tail = FALSE) = 0.2231
qt(0.975, df = 9) = 2.2622
qchisq(0.95, df = 3) = 7.8147
qf(0.95, df1 = 2, df2 = 27) = 3.3541
dgeom(2, 0.2) = 0.1280
dnbinom(0, size = 2, mu = 4) = 0.1111
dhyper(1, m = 5, n = 15, k = 4) = 0.4696
pgamma(6, shape = 2, rate = 0.5) = 0.8009
pbeta(0.3, 2, 5) = 0.5798
plnorm(4, meanlog = 1, sdlog = 0.5) = 0.7801
punif(0.3, 0, 2) = 0.1500
pweibull(3, shape = 1.5, scale = 4) = 0.4777
rpois(5, 3) with seed 2026: 4 3 1 2 3

Python (scipy.stats)

from scipy import stats
import numpy as np
print(f"binom.pmf(1, 10, 0.05) = {stats.binom.pmf(1, 10, 0.05):.4f}")
print(f"binom.cdf(1, 10, 0.05) = {stats.binom.cdf(1, 10, 0.05):.4f}")
print(f"poisson.sf(5, 3) = {stats.poisson.sf(5, 3):.4f}")
print(f"norm.sf(80, 65, 10) = {stats.norm.sf(80, loc=65, scale=10):.4f}")
print(f"norm.ppf(0.90, 65, 10) = {stats.norm.ppf(0.90, loc=65, scale=10):.4f}")
print(f"norm.ppf(0.975) = {stats.norm.ppf(0.975):.4f}")
print(f"expon.sf(6, scale=4) = {stats.expon.sf(6, scale=1/0.25):.4f}")
print(f"t.ppf(0.975, 9) = {stats.t.ppf(0.975, 9):.4f}")
print(f"chi2.ppf(0.95, 3) = {stats.chi2.ppf(0.95, 3):.4f}")
print(f"f.ppf(0.95, 2, 27) = {stats.f.ppf(0.95, 2, 27):.4f}")
print(f"geom.pmf(3, 0.2) = {stats.geom.pmf(3, 0.2):.4f}")
size, mu = 2, 4
p = size / (size + mu)
print(f"nbinom.pmf(0, n=2, p={p:.4f}) = {stats.nbinom.pmf(0, size, p):.4f}")
print(f"hypergeom.pmf(1, M=20, n=5, N=4) = {stats.hypergeom.pmf(1, 20, 5, 4):.4f}")
print(f"gamma.cdf(6, a=2, scale=2) = {stats.gamma.cdf(6, a=2, scale=1/0.5):.4f}")
print(f"beta.cdf(0.3, 2, 5) = {stats.beta.cdf(0.3, 2, 5):.4f}")
print(f"lognorm.cdf(4, s=0.5, scale=e^1) = {stats.lognorm.cdf(4, s=0.5, scale=np.exp(1)):.4f}")
print(f"uniform.cdf(0.3, loc=0, scale=2) = {stats.uniform.cdf(0.3, loc=0, scale=2):.4f}")
print(f"weibull_min.cdf(3, c=1.5, scale=4) = {stats.weibull_min.cdf(3, 1.5, scale=4):.4f}")
rng = np.random.default_rng(2026); print("rng.poisson(3, 5) with seed 2026:", rng.poisson(3, 5))
binom.pmf(1, 10, 0.05) = 0.3151
binom.cdf(1, 10, 0.05) = 0.9139
poisson.sf(5, 3) = 0.0839
norm.sf(80, 65, 10) = 0.0668
norm.ppf(0.90, 65, 10) = 77.8155
norm.ppf(0.975) = 1.9600
expon.sf(6, scale=4) = 0.2231
t.ppf(0.975, 9) = 2.2622
chi2.ppf(0.95, 3) = 7.8147
f.ppf(0.95, 2, 27) = 3.3541
geom.pmf(3, 0.2) = 0.1280
nbinom.pmf(0, n=2, p=0.3333) = 0.1111
hypergeom.pmf(1, M=20, n=5, N=4) = 0.4696
gamma.cdf(6, a=2, scale=2) = 0.8009
beta.cdf(0.3, 2, 5) = 0.5798
lognorm.cdf(4, s=0.5, scale=e^1) = 0.7801
uniform.cdf(0.3, loc=0, scale=2) = 0.1500
weibull_min.cdf(3, c=1.5, scale=4) = 0.4777
rng.poisson(3, 5) with seed 2026: [3 3 6 3 3]

What the output teaches.

  • Every exact lookup agrees to four decimals between R and Python once the parameterisation is translated: pexp(6, rate = 0.25) matches expon.sf(6, scale=4), dgeom(2, 0.2) matches geom.pmf(3, 0.2), and dnbinom(0, size = 2, mu = 4) matches nbinom.pmf(0, 2, 1/3).
  • The random draws differ (4 3 1 2 3 in R, 3 3 6 3 3 in Python) even with the same seed, because R and numpy use different generators. Seeds make each language reproducible, not the two languages identical.
  • The critical values you will meet in tests are here too: 1.96 for a two-sided 95% z interval, 2.2622 for a t interval with df = 9, 7.8147 for a chi-square test with df = 3, and 3.3541 for an F-test with df = 2 and 27.

Common mistakes and misconceptions

Wrong statementCorrect statement
"The normal pdf at 80 is 0.0130, so the probability of scoring exactly 80 is 0.0130."A density is not a probability. For a continuous variable, P(X=80)=0P(X = 80) = 0; ask for an area such as P(79.5<X<80.5)P(79.5 < X < 80.5).
"P(X ≥ 6) for a Poisson is 1 - ppois(6, 3)."That gives P(X>6)=P(X≥7)P(X > 6) = P(X \ge 7). For discrete variables use 1 - ppois(5, 3) or ppois(5, 3, lower.tail = FALSE).
"expon(6) in scipy is the exponential with rate 6."After any shape parameters, the next positional argument of a scipy distribution is loc; expon has no shape parameter, so expon(6) shifts the start to 6 (its mean becomes 7). Use expon(scale=1/6) for rate 6.
"R's dgeom and scipy's geom.pmf give the same answer for the same x."R counts failures (from 0), scipy counts trials (from 1). Shift x by one.
"The normal is the default for any data."Choose by the data-generating story and the support. Counts, proportions, waiting times and incomes usually need another distribution or a transformation.
"Poisson data must have variance equal to the mean."That is the model's assumption, not a guarantee. Real counts are often overdispersed; then a negative binomial fits better.
"The t distribution is for small samples, the normal for large ones."The t arises whenever σ\sigma is estimated from the data, whatever the sample size. It approaches the normal as df grows, so the choice matters less for large n.
"rnorm(10, 5, 4) draws from a normal with variance 4."R's third argument is the SD, so the variance is 16. The same holds for scipy's scale.

Self-test: which distribution?

  1. Each of 25 students passes a quiz independently with probability 0.8. X = number who pass. Name the distribution, and give its mean and variance.
  2. X = number of help-desk emails the library receives in one hour, averaging 2 per hour. Name the distribution and give the R and scipy calls for P(X≥4)P(X \ge 4), with the value.
  3. X = time in minutes until the next customer walks into the bakery, arrivals at a constant average rate.
  4. A cart holds 30 books, 8 of them overdue. Six books are picked without replacement. X = number overdue.
  5. A student retakes a driving test until passing, with a 0.6 chance of passing each attempt. X = number of attempts. Which R function would you use, and what value of x do you pass for "passes on the 2nd attempt"?
  6. A test statistic is the ratio of two independent variance estimates from normal samples. Which distribution does it follow under the null hypothesis?

My notes and next steps

TopicConfidence 1-5What still confuses meNext action and date
Example: Discrete upper tails2Which number to pass for "at least"Redo Example A in both languages, YYYY-MM-DD
Choosing a distribution from a story[ ][ ][ ]
Continuous distributions and areas[ ][ ][ ]
t, chi-square, F and their df[ ][ ][ ]
R vs scipy parameterisation[ ][ ][ ]

Distributions my course uses that are not on this sheet: [List them and add rows above].

Mistakes to copy into my error log (academic/stats-error-log): [Mistake, why it happened, the fix].

Sources and further reading

Based on standard distribution theory and the NIST/SEMATECH e-Handbook, with function names and parameterisations checked against the R and SciPy documentation and by running the code above.

  • NIST/SEMATECH e-Handbook of Statistical Methods, section 1.3.6 Probability Distributions, https://www.itl.nist.gov/div898/handbook/ (accessed 2026-10-25). Public domain.
  • R Core Team (2025). R: A Language and Environment for Statistical Computing, version 4.5.1, package stats (help pages for Distributions, NegBinomial, Geometric, Hypergeometric).
  • Virtanen, P., et al. (2020). SciPy 1.0: fundamental algorithms for scientific computing in Python. Nature Methods, 17(3), 261–272. (Documentation for scipy.stats consulted for version 1.18.1.)
  • Student (1908). The probable error of a mean. Biometrika, 6(1), 1–25. (Origin of the t distribution; Student was W. S. Gosset.)
  • Weibull, W. (1951). A statistical distribution function of wide applicability. Journal of Applied Mechanics, 18(3), 293–297.
  • Dunlosky, J., Rawson, K. A., Marsh, E. J., Nathan, M. J., and Willingham, D. T. (2013). Improving students' learning with effective learning techniques. Psychological Science in the Public Interest, 14(1), 4–58. (Interleaved practice in the self-test.)
  • Further reading (by name only): de Smith, M. J. (2024). Statistical Analysis Handbook (2024 edition, StatsRef); Diez, D. M., Çetinkaya-Rundel, M., and Barr, C. D., OpenIntro Statistics (CC BY-SA).

Answer key

Example B (gaps). Binomial with n=10n = 10, p=0.05p = 0.05. (b) P(X≥2)=1−P(X≤1)P(X \ge 2) = 1 - P(X \le 1). By hand: (0.95)9≈0.6302(0.95)^9 \approx 0.6302, so P(X=1)=10×0.05×0.6302≈0.3151P(X = 1) = 10 \times 0.05 \times 0.6302 \approx 0.3151. (b) is 1−0.9139=0.08611 - 0.9139 = 0.0861. scipy: binom.pmf(1, 10, 0.05) and binom.sf(1, 10, 0.05). About 9% of checks would show 2 or more underbaked loaves even when the process is in control, so one such batch is not strong evidence of a problem; a run of them would be.

Exercise C.

  1. Normal(65, 10): P(X>80)=0.0668P(X > 80) = 0.0668 (pnorm(80, 65, 10, lower.tail = FALSE), norm.sf(80, 65, 10)), so about 6.7% of students. 90th percentile: 77.8 (qnorm(0.90, 65, 10) gives 77.8155).
  2. Exponential with mean 4, so rate 0.25: P(T>6)=e−0.25×6=e−1.5≈0.2231P(T > 6) = e^{-0.25 \times 6} = e^{-1.5} \approx 0.2231. scipy: expon.sf(6, scale=4). Writing expon.sf(6, 0.25) would set loc = 0.25, a different distribution.
  3. Hypergeometric: (51)(153)/(204)=5×455/4845≈0.4696\binom{5}{1}\binom{15}{3}/\binom{20}{4} = 5 \times 455 / 4845 \approx 0.4696. R dhyper(1, 5, 15, 4); scipy hypergeom.pmf(1, 20, 5, 4).

Self-test.

  1. Binomial(25, 0.8): mean 25×0.8=2025 \times 0.8 = 20, variance 25×0.8×0.2=425 \times 0.8 \times 0.2 = 4.
  2. Poisson(2). R ppois(3, 2, lower.tail = FALSE), scipy poisson.sf(3, 2); both give 0.1429 (checked by running both).
  3. Exponential (a constant rate of arrivals means memoryless waiting times).
  4. Hypergeometric with N=30N = 30, K=8K = 8, n=6n = 6 (without replacement from a small population).
  5. Geometric with p=0.6p = 0.6. R counts failures, so "passes on the 2nd attempt" is one failure: dgeom(1, 0.6) =0.4×0.6=0.24= 0.4 \times 0.6 = 0.24. In scipy it would be geom.pmf(2, 0.6).
  6. F distribution with df equal to the two variance estimates' df.

Revision history

VersionDateAuthorChange
0.1YYYY-MM-DD[Your name]First version from template
[0.2]YYYY-MM-DD[Your name][Added distributions used in my course]

Related templates