Skip to content
Part IA Easter Term

Negative Binomial, Hypergeometric, and Discrete Uniform

Negative Binomial Distribution

Definition

XNegBin(r,p)X \sim \text{NegBin}(r, p) counts the number of Bernoulli trials until the rrth success.

PMF

P(X=n)=(n1r1)(1p)nrpr,n=r,r+1,r+2,P(X = n) = \binom{n-1}{r-1} (1-p)^{n-r} p^r, \quad n = r, r+1, r+2, \ldots

Why this formula?

  • Trial nn must be a success (the rrth one)
  • Exactly r1r-1 successes in the first n1n-1 trials: (n1r1)\binom{n-1}{r-1} ways
  • nrn - r failures, rr successes

Range

X{r,r+1,r+2,}X \in \{r, r+1, r+2, \ldots\}

Expectation and Variance

E[X]=rpE[X] = \frac{r}{p}

Var(X)=r(1p)p2\text{Var}(X) = \frac{r(1-p)}{p^2}

Relation to Geometric

Geo(p)=NegBin(1,p)\text{Geo}(p) = \text{NegBin}(1, p)

The geometric counts trials until the first success.

Example: Coin Flips

Flip a fair coin until the third heads. XNegBin(3,0.5)X \sim \text{NegBin}(3, 0.5).

E[X]=30.5=6E[X] = \frac{3}{0.5} = 6

P(X=5)=(42)(0.5)2(0.5)3=6×132=316P(X = 5) = \binom{4}{2} (0.5)^2 (0.5)^3 = 6 \times \frac{1}{32} = \frac{3}{16}

Hypergeometric Distribution

Definition

XHyp(N,n,m)X \sim \text{Hyp}(N, n, m) counts the number of successes when drawing nn items without replacement from a population of NN containing exactly mm successes.

PMF

P(X=i)=(mi)(Nmni)(Nn),i=max(0,nN+m),,min(m,n)P(X = i) = \frac{\binom{m}{i} \binom{N-m}{n-i}}{\binom{N}{n}}, \quad i = \max(0, n-N+m), \ldots, \min(m, n)

Why this formula?

  • Choose ii successes from mm: (mi)\binom{m}{i}
  • Choose nin-i failures from NmN-m: (Nmni)\binom{N-m}{n-i}
  • Divide by total ways to choose nn from NN: (Nn)\binom{N}{n}

Range

X ranges from max(0,n(Nm))\max(0, n - (N-m)) to min(n,m)\min(n, m).

Expectation

E[X]=nmNE[X] = \frac{nm}{N}

Variance

Var(X)=nmN(1mN)NnN1\text{Var}(X) = \frac{nm}{N}\left(1 - \frac{m}{N}\right)\frac{N-n}{N-1}

The factor NnN1\frac{N-n}{N-1} is the finite population correction.

Example: Quality Control

A batch of 20 components contains 5 defective. Select 4 at random. What is the probability exactly 2 are defective?

XHyp(20,4,5)X \sim \text{Hyp}(20, 4, 5)

P(X=2)=(52)(152)(204)=10×1054845=105048450.217P(X = 2) = \frac{\binom{5}{2} \binom{15}{2}}{\binom{20}{4}} = \frac{10 \times 105}{4845} = \frac{1050}{4845} \approx 0.217

Example: Card Hands

Deal 5 cards from a 52-card deck. Probability of exactly 2 hearts?

There are 13 hearts in the deck.

P(X=2)=(132)(393)(525)P(X = 2) = \frac{\binom{13}{2} \binom{39}{3}}{\binom{52}{5}}

Comparison with Binomial

PropertyBinomialHypergeometric
SamplingWith replacementWithout replacement
TrialsIndependentDependent
UsageLarge populationFinite population
Approximation-Binomial when n/Nn/N small

When NnN \gg n: Hyp(N,n,m)Bin(n,m/N)\text{Hyp}(N, n, m) \approx \text{Bin}(n, m/N)

Discrete Uniform Distribution

Definition

XUnif{1,2,,N}X \sim \text{Unif}\{1, 2, \ldots, N\} takes each integer from 1 to N with equal probability.

PMF

P(X=k)=1N,k{1,2,,N}P(X = k) = \frac{1}{N}, \quad k \in \{1, 2, \ldots, N\}

Parameters

Some versions use {a,a+1,,b}\{a, a+1, \ldots, b\} with N=ba+1N = b - a + 1.

Expectation

E[X]=N+12E[X] = \frac{N + 1}{2}

Variance

Var(X)=N2112\text{Var}(X) = \frac{N^2 - 1}{12}

Example: Die Roll

A fair die: XUnif{1,2,3,4,5,6}X \sim \text{Unif}\{1, 2, 3, 4, 5, 6\}.

E[X]=72,Var(X)=3512E[X] = \frac{7}{2}, \quad \text{Var}(X) = \frac{35}{12}

Example: Random Digit

A random digit from 0 to 9: XUnif{0,1,,9}X \sim \text{Unif}\{0, 1, \ldots, 9\}.

E[X]=92=4.5E[X] = \frac{9}{2} = 4.5

Example: Tank Problem

In the tank estimation problem, captured serial numbers are assumed to come from Unif{1,2,,N}\text{Unif}\{1, 2, \ldots, N\}, where we want to estimate the unknown NN.

Summary Table

DistributionPMFMeanVariance
NegBin(r,pr,p)(n1r1)(1p)nrpr\binom{n-1}{r-1}(1-p)^{n-r}p^rr/pr/pr(1p)/p2r(1-p)/p^2
Hyp(N,n,mN,n,m)(mi)(Nmni)(Nn)\frac{\binom{m}{i}\binom{N-m}{n-i}}{\binom{N}{n}}nm/Nnm/NnmN(1mN)NnN1\frac{nm}{N}(1-\frac{m}{N})\frac{N-n}{N-1}
Unif{1,,N}\{1,\ldots,N\}1/N1/N(N+1)/2(N+1)/2(N21)/12(N^2-1)/12