Book contents

STATHARBOR ANALYTICS · INTRODUCTION TO STATISTICS · CHAPTER 16

Discrete Distributions

This chapter explores common discrete probability distributions, their properties and applications. Understanding these distributions is essential for modelling count data, rare events and for constructing exact tests. We cover the binomial, geometric, negative binomial, Poisson and hypergeometric distributions, with examples and exercises.

Binomial Distribution

The binomial distribution models the number of successes in nn independent Bernoulli trials with success probability pp. The probability mass function (pmf) is P(X=k)=(nk)pk(1−p)n−k,k=0,1,…,n.P(X=k) = \binom{n}{k} p^k (1-p)^{n-k}, \quad k = 0,1,\dots,n. The expectation and variance are E(X)=np\mathrm{E}(X) = np and Var(X)=np(1−p)\mathrm{Var}(X) = np(1-p). For large nn, XX is approximately normal with mean npnp and variance np(1−p)np(1-p). The binomial is widely used in quality control, epidemiology and survey sampling.

Example: Number of Defective Items

Suppose a factory produces parts and each part has a 2% chance of being defective. If we inspect 100 parts, what is the probability of finding at most two defects? Using R:

pbinom(2, size = 100, prob = 0.02)

In Python, use scipy.stats.binom.cdf(2, 100, 0.02).

Geometric and Negative Binomial Distributions

The geometric distribution models the number of trials until the first success. Its pmf is P(X=k)=(1−p)k−1pP(X=k) = (1-p)^{k-1}p for k=1,2,…k=1,2,\dots and E(X)=1/p\mathrm{E}(X) = 1/p, Var(X)=(1−p)/p2\mathrm{Var}(X) = (1-p)/p^2. The negative binomial distribution generalises this to the number of trials until rr successes. It has pmf P(X=k)=(k−1r−1)pr(1−p)k−r,k=r,r+1,….P(X=k) = \binom{k-1}{r-1} p^r (1-p)^{k-r}, \quad k = r,r+1,\dots. The expectation and variance are E(X)=r/p\mathrm{E}(X) = r/p and Var(X)=r(1−p)/p2\mathrm{Var}(X) = r(1-p)/p^2.

Poisson Distribution

The Poisson distribution arises as the limit of the binomial when nn is large and pp is small such that λ=np\lambda = np remains fixed. Its pmf is P(X=k)=λke−λk!,k=0,1,2,….P(X=k) = \frac{\lambda^k e^{-\lambda}}{k!}, \quad k=0,1,2,\dots. The mean and variance are both λ\lambda. The Poisson distribution is used to model counts of rare events in time or space, such as number of phone calls per minute or mutations per gene.

Example: Calls to a Call Centre

If calls arrive at a call centre at an average rate of 3 per minute, what is the probability of receiving exactly five calls in a minute? Use Python:

from scipy.stats import poisson
poisson.pmf(5, mu=3)

Hypergeometric Distribution

The hypergeometric distribution models sampling without replacement. Suppose a population contains NN items of which KK are successes. If we draw nn items, the probability of kk successes is P(X=k)=(Kk)(N−Kn−k)(Nn),k=max(0,n−(N−K)),…,min(n,K).P(X=k) = \frac{\binom{K}{k}\binom{N-K}{n-k}}{\binom{N}{n}}, \quad k = \max(0,n-(N-K)),\dots,\min(n,K). The mean is nK/Nn K/N and the variance is nKNN−KNN−nN−1n \frac{K}{N}\frac{N-K}{N}\frac{N-n}{N-1}. The hypergeometric distribution is used in quality control and Fisher’s exact test.

Exercises

Practice

  1. A multiple–choice test has 10 questions, each with 4 options. If a student guesses on all questions, what is the probability of exactly 3 correct answers? Compute the probability and simulate 1,000 attempts in R/Python/Julia to verify.

  2. Derive the mean and variance of the geometric distribution. Verify your formulae using simulation.

  3. In a factory, a machine produces defective items with probability 0.01. What is the probability the third defective item occurs on the 20th item inspected? Compute using the negative binomial pmf.

  4. In a lot of 50 items, 5 are defective. If you sample 10 items without replacement, what is the probability of finding exactly 2 defective items? Use the hypergeometric distribution and confirm by simulation.

References