Contents / Probability / Random Variables and Discrete Distributions
Chapter 2
Random Variables and Discrete Distributions
Random variables, PMFs, expected value, binomial, Poisson, and geometric distributions.
Introduction
Probability theory, as the previous chapter left it, is a calculus of events: subsets of a sample space, combined with unions, intersections and complements. That language is exact but it is not portable. The event "three heads in five flips" and the event "three defectives in a lot of five" are different subsets of different sample spaces, yet they carry the same probability for the same reason, and nothing in the language of events says so.
The device that makes the similarity visible is the random variable. Instead of working with the outcomes themselves we work with a number attached to each outcome — a count, a waiting time, a payout — and we study the pattern of probabilities that number inherits. Two experiments with nothing physical in common can then turn out to have the same distribution, and one calculation serves both.
This chapter builds that machinery and then stocks it. We define random variables, mass functions and distribution functions precisely; we define expectation and variance from the definition and prove the algebra they obey — including linearity of expectation, which is the single most useful fact in the chapter and which holds whether or not the variables are independent. Then we derive the standard discrete families: the binomial from a counting argument, the Poisson as a limit of the binomial, the geometric from the waiting-time picture, and the negative binomial and hypergeometric as the two most common variations. The final section is a decision guide, because in practice the hard part is almost never the arithmetic — it is recognising which family the problem belongs to.
Everything here is a prerequisite for the rest of the subject, and for statistical inference beyond it. A confidence interval is a statement about the distribution of an estimator; a -value is a tail probability under an assumed distribution. Neither means anything until "distribution" does.
2.1Random Variables, Mass Functions, and Distribution Functions
The word "variable" is a small lie: a random variable does not vary, and it is not a variable in the algebraic sense. It is a function.
Definition 2.1 (Random variable). Let be a probability space. A random variable is a function
such that for every the set is an event (that is, it belongs to , so it has a probability).
is discrete if its range is finite or countably infinite.
The measurability condition in the definition is there so that questions like "what is the probability that is at most ? " have answers. For a discrete random variable on a finite sample space it is automatic, and we will not fuss over it again; but it is worth seeing once, because it is the reason the definition is a definition and not merely a description.
Intuition. Think of the sample space as a bag of tickets, one ticket per possible outcome. A random variable is a rule that reads a number off each ticket. You draw a ticket at random; the number you read is the value of . The randomness lives entirely in which ticket you drew — the rule itself is fixed and deterministic.
This is why " " is shorthand for a set of outcomes: it means "the ticket you drew is one of the tickets with a printed on it".
Notation. abbreviates the event , and its probability. Likewise , , . Capital letters denote random variables, lower-case letters the particular values they might take; the distinction is worth preserving, because is a function of while is not a number at all.
Example 2.2 (Two coin flips). Toss a fair coin twice and let be the number of heads. Write explicitly as a function on the sample space, and find the probability of each value.
Solution.
- The sample space is , each outcome with probability .
- As a function, , , . The range is , so is discrete.
- The event is , which has probability . Similarly .
- Notice that collapses two distinct outcomes into one value. That is the whole point: we no longer care which flip was the head.
The probability mass function
Listing the probability of each value is the complete description of a discrete random variable, and it deserves a name.
Definition 2.3 (Probability mass function). The probability mass function (pmf) of a discrete random variable is the function
Its support is the set , which is finite or countable.
Not every function of is a pmf. Two conditions decide it, and they are exactly the conditions the axioms of probability force.
Theorem 2.4 (Characterisation of a pmf). A function that is nonzero on at most countably many points is the pmf of some discrete random variable if and only if
Proof. () If then by nonnegativity of . The events are pairwise disjoint and their union is the certain event, so countable additivity gives .
() Conversely, given such a , take with ; this is a legitimate probability measure precisely because the values are nonnegative and sum to . Let be the identity map . Then .∎
The "if and only if" is doing real work. It says that a pmf carries all the probabilistic information about — we never need to go back to — and it gives a two-line test for whether a proposed formula is legitimate. That test is also how you solve for an unknown constant.
Example 2.5 (Finding a normalising constant). Let for and otherwise. For which is this a pmf, and what is ?
Solution.
- Nonnegativity forces .
- Summing the geometric series, .
- So the total mass is , and it equals exactly when .
- For the tail, .
- Sanity check: and , and ✓.
The cumulative distribution function
The pmf answers "what is the chance of exactly this value?". A great many questions are instead about accumulated probability, and those are read off a second function.
Definition 2.6 (Cumulative distribution function). The cumulative distribution function (cdf) of a random variable is
For a discrete , .
Proposition 2.7 (Properties of a cdf). For any random variable , the function satisfies
- is non-decreasing;
- and ;
- is right-continuous: .
Moreover, for a discrete the jump of at equals :
Proof. (1) If then , and probability is monotone on nested events.
(2) The events increase to as and decrease to as ; continuity of along monotone sequences of events gives the two limits.
(3) Right-continuity is the same continuity property applied to ; the intersection is because the inequality is non-strict.
For the jump, , and the union is the increasing limit whose probability is the left-hand limit of .∎
So the pmf and the cdf are two encodings of the same object: the cdf is the running total of the pmf, and the pmf is the size of the cdf's jumps. For a discrete variable the cdf is a staircase — flat between the support points, jumping at each of them by exactly that point's probability.
Pitfall. For a discrete variable and are different, and the difference is exactly . Reading off a cdf table gives , not , whenever is integer-valued. This is the single most common arithmetic slip in binomial and Poisson work, and it disappears only for continuous variables, where individual points have probability zero. Write the complement rule out in full whenever you use it:
2.2Expectation, Variance, and Linearity
A pmf is a complete description, but it is rarely a usable summary: nobody quotes eleven numbers to describe the outcome of ten coin flips. Two numbers do most of the work — a centre and a spread.
Definition 2.9 (Expected value). Let be discrete with support and pmf . The expected value (or mean, or expectation) of is
provided the sum converges absolutely, i.e. . If it does not, does not exist.
The absolute-convergence proviso is not pedantry. A sum of infinitely many terms with mixed signs can be rearranged to give any value you like, and a mean that depends on the order in which you list the outcomes is no mean at all. Distributions with no expectation exist and are not exotic; the St. Petersburg payout, which pays with probability , has .
Intuition. is a weighted average of the possible values, weighted by how often each occurs. Mechanically it is the centre of mass of the pmf: put a mass at position on a weightless rod, and is where the rod balances.
That picture explains why the mean need not be a possible value — the balance point of two equal masses at and is , where there is no mass at all — and why a single far-out value with small probability can still drag the mean a long way.
We frequently need the mean not of but of some function of it, and the following result says we can compute it without ever finding the distribution of that function.
Theorem 2.10 (Law of the unconscious statistician). Let be discrete with pmf and let . Then
whenever the sum converges absolutely.
Proof. Let , with support . By the definition of expectation applied to ,
Now over those with , a disjoint union, so . Substituting,
since on the inner sum. The sets , as ranges over , partition , so the double sum is just . Absolute convergence licenses the rearrangement.∎
The name is a joke at the expense of people who use the formula without noticing it needs proof. The content is that you may evaluate at each and weight by , rather than first working out the pmf of — a saving that is enormous in practice.
Linearity
Theorem 2.11 (Linearity of expectation). Let and be discrete random variables on the same probability space with finite expectations, and let be constants. Then
No independence is required.
Proof. Write the expectation as a sum over the outcomes rather than over the values. For a discrete on a countable ,
because the events partition ; absolute convergence, which is exactly the finiteness of , justifies collapsing the double sum.
In that form the result is immediate. Let , so pointwise. Then
and the three sums are , and .∎
Look at what the proof used: only that and are functions on the same , so that they can be added pointwise. The joint behaviour of and never appeared. This is why linearity survives arbitrary dependence, and it is what makes it the most useful single fact in the chapter.
Remark. The contrast with variance is the thing to remember. Expectation is a sum over outcomes and therefore additive, always. Variance involves a square, and ; the cross term is what independence kills. Whenever you find yourself wondering whether a rule needs independence, ask whether a product of two variables appears anywhere in it.
Intuition. Linearity is a licence to decompose. If a complicated count can be written as for simple pieces — usually indicators, each worth or — then is just the sum of easy expectations, no matter how tangled the dependence between the pieces. You will see this used to get the binomial mean in two lines rather than half a page of series manipulation, and it is the standard tool for expectations that no direct summation can reach.
Lemma 2.12 (Expectation of an indicator). For an event , define the indicator by if and otherwise. Then
Proof. takes the value with probability and with probability , so . Since (as and ), the second expectation is the same. Then .∎
Variance
Definition 2.13 (Variance and standard deviation). Let have finite mean . The variance of is
and the standard deviation is .
Variance is the mean squared distance from the mean. Squaring is what stops positive and negative deviations from cancelling — always, by linearity, so the un-squared average deviation carries no information. The price is that variance is in squared units, which is why the standard deviation, in the original units, is what gets reported.
Proposition 2.14 (Computational formula for the variance). If then
Proof. Expand the square inside the expectation and apply linearity, treating as the constant it is:
Corollary 2.15 (Variance is non-negative, and ). Since is the expectation of a non-negative quantity, ; hence , with equality if and only if is constant with probability .
Proposition 2.16 (Variance under a linear change of scale). For constants and ,
Proof. Let . By linearity , so
The shift cancels — it moves and its mean by the same amount. Squaring and taking expectations,
using linearity to pull the constant out. Taking square roots gives , the absolute value because a standard deviation is non-negative.∎
The dropping out is the whole content: adding a constant relocates a distribution without stretching it, so it cannot change the spread. The says spread scales with the square of a multiplier — double every payout and the variance quadruples, while the standard deviation merely doubles.
Lemma 2.17 (Expectation of a product of independent variables). If and are independent discrete random variables with finite expectations, then .
Proof. Independence means for all . By the two-variable form of the law of the unconscious statistician applied to ,
and the double sum factors:
Theorem 2.18 (Variance of a sum of independent variables). If and are independent with finite variances, then
More generally, if are pairwise independent with finite variances, .
Proof. Write , . By linearity , so
Expand the square and use linearity:
The first two terms are and . For the third, note that if and are independent then so are and , so by Lemma Expectation of a product of independent variables
Hence the cross term vanishes and the variances add. For the general case, expand directly: it produces the squares and the cross terms with , each of which vanishes by the same argument. Only pairs ever appear, which is why pairwise independence suffices and mutual independence is not needed.∎
Remark. The quantity that vanished is the covariance . Without independence the identity reads
which is always true. Independence is a sufficient condition for the covariance to vanish, not a necessary one: uncorrelated variables need not be independent. Note also that subtracting independent variables still adds their variances, since — uncertainty never cancels.
Pitfall. Standard deviations do not add, ever. If and are independent each with , then and , not . Add variances, then take the square root once at the end.
Example 2.19 (Mean and variance of a payout). A game pays $10 with probability , $5 with probability , and with probability . Find and , and then the mean and variance of .
Solution.
- First verify the pmf: all values are non-negative and ✓.
- .
- By the law of the unconscious statistician with : .
- By the computational formula, , so .
- For : and .
- Sanity check: the payouts run from to , so a typical distance of about from is believable; and ranges over , a threefold stretch, so a ninefold variance is right.
Example 2.20 (Linearity without independence). Five cards are dealt from a standard -card deck without replacement. Let be the number of hearts. Find .
Solution.
- The draws are not independent — dealing a heart makes the next heart less likely — so no product rule is available and the pmf is a hypergeometric one, awkward to sum directly.
- Let if the th card dealt is a heart, and otherwise. Then .
- By symmetry each individual card is equally likely to be any of the , so for every , including the fifth. By Lemma Expectation of an indicator, .
- Linearity does not care that the are dependent: .
- The variance would be a genuinely harder calculation, because there the dependence does not cancel — this is exactly the asymmetry the chapter keeps returning to.
2.3The Binomial Distribution
The binomial is what you get when you repeat the same two-outcome experiment a fixed number of times and count successes. Its ubiquity comes from how little it assumes.
Definition 2.21 (Bernoulli trial and Bernoulli random variable). A Bernoulli trial is an experiment with exactly two outcomes, labelled success and failure, with . The associated Bernoulli random variable takes the value on success and on failure:
We write , and by Lemma Expectation of an indicator, and .
Definition 2.22 (Binomial distribution). Let count the successes in independent Bernoulli trials, each with the same success probability . Then has the binomial distribution with parameters and , written .
The four conditions are worth stating as a checklist, because a violated one invalidates everything that follows. The mnemonic is BINS: Binary outcomes; Independent trials; Number of trials fixed in advance; Same success probability throughout. Note what "fixed in advance" rules out — if you keep sampling until you have successes, is random and the distribution is negative binomial, not binomial.
Theorem 2.23 (The binomial pmf). If then
Proof. Fix . Any particular sequence of trial outcomes containing exactly successes and failures — say — has probability , because the trials are independent, so the probability of the sequence is the product of the individual probabilities, and appears once per success, once per failure. Crucially this product does not depend on the order: multiplication is commutative, so every such sequence has the same probability.
The event is the disjoint union of all such sequences. The number of them is the number of ways to choose which of the trial positions are the successes, namely . Summing the common probability over those disjoint outcomes gives the claim.∎
Corollary 2.24 (The binomial pmf is a pmf). The expressions are non-negative and sum to over .
Proof. Non-negativity is clear. For the total, the binomial theorem gives
That is the counting argument in full: a per-sequence probability that does not depend on order, times a count of the orders. Every piece of the formula is doing a job, and reading the formula back in those terms — " for one arrangement, arrangements" — is the fastest way to reconstruct it when you have forgotten it.
Mean and variance, the cheap way
You can obtain by summing and manipulating factorials. It works, and it is unpleasant. The decomposition argument is better, and the technique generalises far beyond this distribution.
Theorem 2.25 (Mean and variance of the binomial). If then
Proof. Let if trial is a success and otherwise, so each and
This identity is exact — the sum of the indicators literally counts the successes.
For the mean, apply Theorem Linearity of expectation, which needs no independence at all:
For the variance we do need independence, and the binomial model supplies it by hypothesis. By Theorem Variance of a sum of independent variables,
Remark. The proof is worth more than the formula. It shows the two hypotheses are used in different places: identical distribution and additivity of expectation give the mean; independence is what gives the variance. If the trials were dependent but still each had success probability — dealing cards without replacement, say — the mean would still be and the variance would not be . That is exactly what happens with the hypergeometric distribution later in this chapter.
Intuition. is the answer you would have guessed: flips of a coin that lands heads of the time should give around heads.
The variance is less obvious, but notice where it is largest. As a function of , the product peaks at and vanishes at and . That is right: a coin that always lands heads produces no uncertainty at all, while a fair coin is the most unpredictable one there is.
The figure makes a point that the formulas alone do not. For the pmf is symmetric, because swapping the labels "success" and "failure" maps and leaves the probabilities alone. For that symmetry is broken and the distribution leans right; for it leans left. The skew is strongest when is small — when the mean is close to the hard boundary at — and it washes out as grows, which is the seed of the normal approximation to the binomial, derived in the chapter on Continuous Probability Distributions.
Example 2.27 (Exactly successes). A fair coin is flipped times. Find , and the mean and standard deviation of .
Solution.
- Check BINS: two outcomes per flip, flips independent, fixed, constant ✓.
- , so .
- ; , so .
- Sanity check: is within one standard deviation of , so a probability near is reasonable for the second-most-likely value.
Example 2.28 (A cumulative probability via the complement). For , find .
Solution.
- Direct summation needs five terms (); the complement needs two. Use , being careful that "at least " excludes and only.
- .
- .
- .
- Sanity check: , so "at least " straddles the mean from just above; a value a little over one half is what you would expect.
Pitfall. Sampling without replacement breaks the I and the S in BINS at once: the trials are dependent and shifts after each draw. The binomial is then wrong, and the hypergeometric is right. The usual rule of thumb is that the binomial remains a serviceable approximation when the sample is no more than about of the population, because then the probabilities barely move; below that threshold, do not use it.
2.4The Poisson Distribution
The binomial needs a fixed . Many counting problems have no natural at all: the number of calls arriving at a switchboard in an hour, the number of typos on a page, the number of -particles a sample emits in a second. There is no list of trials to count — only a rate and a window.
Definition 2.29 (Poisson distribution). For , a random variable has the Poisson distribution with parameter , written , if
Proposition 2.30 (The Poisson pmf is a pmf). The stated probabilities are non-negative and sum to .
Proof. Each term is positive since and . Summing and using the exponential series ,
The support is all of : there is no upper bound, which is the structural difference from the binomial and the reason the Poisson is the natural model when no maximum count exists.
Theorem 2.31 (Mean and variance of the Poisson). If then and .
Proof. For the mean, the term contributes nothing, so start at and cancel one factor of against the factorial:
after substituting in the sum.
For the variance, compute the factorial moment , which is easier than because cancels two factors of the factorial. The and terms vanish, so
By linearity , and therefore
That the mean and the variance coincide is a strong and checkable claim about data, and it is the first thing to test before adopting a Poisson model.
Where the distribution comes from
The Poisson is not an arbitrary formula. It is what the binomial becomes when you chop a window into more and more, smaller and smaller, trials.
Theorem 2.32 (Poisson limit of the binomial). Fix and for each let with . Then for every fixed ,
Proof. Write and expand the binomial pmf:
Group the pieces and take with fixed.
- The falling factorial over has factors, each of the form ; there are finitely many, so their product tends to .
- , the standard limit defining the exponential.
- , again because is fixed.
The surviving constant factor is , so the product tends to .∎
Intuition. Split an hour into tiny intervals, so small that at most one call can arrive in any one of them. Each interval is then a Bernoulli trial, and if calls arrive at per hour the success probability in each is about . The count of calls is binomial with these parameters — and as you refine the intervals, while stays pinned at . What you are left with is the Poisson.
The limit also explains the mean and variance. The binomial variance is , which is the binomial mean in the limit. Mean and variance agree for the Poisson because has been driven to zero, and with it, to .
Method 2.34 (When a Poisson model is appropriate). Before fitting a Poisson, check the assumptions behind the limit:
- Counts, not measurements. must be a count of occurrences in a fixed window of time, length, area or volume.
- Constant rate. The expected number of events in a window is proportional to its size, with the same constant of proportionality throughout. A call centre busier at am than at am violates this unless you model the hours separately.
- Independence. Events in disjoint windows are independent, and one occurrence neither encourages nor inhibits another. Contagious diseases and traffic accidents in a pile-up both fail here.
- No simultaneity. In a sufficiently short window the chance of two or more events is negligible compared with the chance of one.
- Empirical check. The sample mean and sample variance should be close. If the variance is much larger — overdispersion, the usual outcome — the events are clustering and a negative binomial model normally fits better.
Proposition 2.35 (Sums of independent Poissons). If and are independent, then .
Proof. Condition on the total. For , decomposing over the ways and using independence,
Factor out and multiply and divide by inside the sum:
by the binomial theorem.∎
This is the property that lets you rescale a rate. If defects occur at per metre, then the count in metres is the sum of three independent Poisson variables, hence Poisson — rescale to the window you are actually asked about before doing anything else.
Example 2.36 (A Poisson probability, and a rescaled window). Emails arrive at a rate of per hour. Find the probability of exactly emails in one hour, and the probability of no emails in a -minute period.
Solution.
- For one hour, .
- A quarter of an hour is a quarter of the window, so the rate rescales to .
- .
- Sanity check by the sum rule: four independent quarter-hours each empty has probability , which agrees with computed directly for the full hour ✓.
Example 2.37 (At least one occurrence). Accidents at an intersection occur at per week. Find in a given week.
Solution.
- "At least one" spans infinitely many values, but its complement is the single term .
- .
- .
- Sanity check: with two accidents expected per week, a completely clear week should be the exception, so a value near is right.
Example 2.38 (Poisson approximation to a binomial). A component is defective with probability , independently, and a lot contains components. Approximate and compare with the exact binomial value.
Solution.
- is large and small, so set and treat as approximately Poisson.
- Approximation: .
- Exact: .
- The absolute error is about — small, and the approximation replaces a th power by a single exponential. The error is of order , so it shrinks as grows with fixed.
Pitfall. and are not interchangeable. is a probability, so ; is a rate, an expected count, and can be any positive number. Seeing " " and computing is a category error. Equally, is attached to a window: a rate of per week is not the parameter to use for a question about a month.
2.5The Geometric Distribution and Memorylessness
The binomial fixes the number of trials and lets the number of successes be random. Turn that around — fix the number of successes at one, and let the number of trials be random — and you get a waiting time.
Definition 2.39 (Geometric distribution). Perform independent Bernoulli trials with , and let be the index of the first success. Then has the geometric distribution with parameter :
Notation. Two conventions are in circulation. The one above counts trials up to and including the first success, so and . The other counts the failures before the first success, giving and . The variance is the same for both, since they differ by a constant. Software differs: check which one a function implements before trusting its output. This chapter uses the trial-counting convention throughout.
The pmf reads directly off the experiment: for the first success to be on trial , the first trials must all fail — probability by independence — and the th must succeed, probability . There is no binomial coefficient because there is only one arrangement.
Proposition 2.40 (The geometric tail). If is geometric with parameter , then for every integer ,
and consequently . In particular the probabilities sum to .
Proof. The event says the first trials all failed, which by independence has probability — no summation required. The cdf is the complement. Letting , because , so and the pmf accounts for all the mass.∎
Theorem 2.41 (Mean and variance of the geometric). If is geometric with parameter then
Proof. Write . For a non-negative integer-valued the tail-sum identity holds, and by Proposition The geometric tail this is a geometric series:
For the variance use the factorial moment again. Differentiating the geometric series twice with respect to gives , so
Then , and
using .∎
is the formula everyone remembers and it is the one worth sanity-checking against: if one trial in five succeeds, you wait five trials on average. Note how fast the variance grows as shrinks — at the mean is and the standard deviation is about , so waiting times of this kind are wildly variable, and the mean alone is a poor summary.
Memorylessness
Theorem 2.42 (Memorylessness of the geometric). Let be geometric with parameter . Then for all integers ,
Conversely, the geometric is the only distribution on with this property.
Proof. Since , the intersection of the two events is itself. By the definition of conditional probability and Proposition The geometric tail,
the division being legitimate because .
For the converse, suppose satisfies for all with . Taking and inducting gives . Setting yields , whose differences are exactly the geometric pmf.∎
Intuition. A coin has no memory. Ten tails in a row do not make a head "due" on the eleventh flip, and the number of further flips you must wait has exactly the distribution it had at the start. Memorylessness is the formal statement of that, and it is the mathematical refutation of the gambler's fallacy.
Be careful about what it does not say. Waiting a long time is unlikely in advance — is small. What memorylessness says is that given you have already waited that long, the future looks brand new. Surprise about the past is not evidence about the future.
Pitfall. Memorylessness is a property of independent trials with a constant , and nothing else. A lightbulb that wears out, a machine whose failure probability rises with age, a patient whose risk grows over time — none of these are memoryless, and modelling them as geometric will systematically understate the chance of imminent failure. Among discrete distributions the geometric is the unique memoryless one; among continuous ones it is the exponential, and no others.
Example 2.43 (Free throws). A player sinks each free throw independently with probability . Let be the number of the shot on which she records her first make. Find , , and .
Solution.
- — two misses, then a make.
- : still no make after four attempts.
- shots on average.
- , so — nearly as large as the mean.
- Sanity check on memorylessness: given she has missed four, the chance she needs more than three further shots is , the same as it was before she started.
2.6Negative Binomial and Hypergeometric
Two variations account for most of the remaining discrete problems you will meet. One relaxes the geometric's "first success" to "th success"; the other relaxes the binomial's independence by sampling from a finite pool.
Definition 2.44 (Negative binomial distribution). Perform independent Bernoulli trials and let be the index of the trial on which the th success occurs. Then has the negative binomial distribution with parameters and :
Proof. The formula deserves its derivation. The event requires two things at once: trial is a success, and exactly of the first trials are successes. These concern disjoint sets of trials and so are independent. The first has probability . The second is a binomial event on trials, with probability . Multiplying gives .∎
The constraint that the last trial is a success is what makes the coefficient rather than — a very common slip. Setting recovers the geometric, as it must.
Proposition 2.45 (Mean and variance of the negative binomial). If is negative binomial with parameters and , then
Proof. Decompose the waiting time into stages. Let be the number of trials up to the first success, the number of further trials from there to the second success, and so on, so that
Because the trials are independent with constant , each is geometric — this is memorylessness in action, since after the th success the process restarts — and the are independent of one another, as they depend on disjoint blocks of trials.
Linearity gives , and Theorem Variance of a sum of independent variables gives .∎
Example 2.46 (Waiting for the third make). A shooter makes each free throw independently with probability . Let be the shot on which she records her third make. Find and .
Solution.
- Here , . The fifth shot must be a make, and exactly of the first must be makes.
- .
- .
- Sanity check: sits just below the mean of , and it is in fact the modal value together with — a probability near for the single most likely outcome of a spread-out distribution is plausible.
Sampling without replacement
Definition 2.47 (Hypergeometric distribution). A population of items contains successes and failures. Draw items without replacement, all subsets equally likely, and let be the number of successes drawn. Then is hypergeometric:
for .
The formula is a counting argument, not a product of probabilities: of the equally likely samples, the ones with exactly successes are obtained by choosing of the successes and of the failures.
Proposition 2.48 (Mean and variance of the hypergeometric). With the population success proportion,
Proof. (Mean.) Let if the th item drawn is a success. By symmetry every item is equally likely to appear in position , so for every , and by linearity — which, as in the card example, does not care that the are dependent.
(Variance.) The are not independent, so the cross terms survive and the calculation of the covariance is the extra work; carrying it out gives the stated factor. We quote the result.∎
The mean is exactly the binomial mean: sampling without replacement does not bias the count. The variance, however, is smaller, by the finite population correction . That factor is at most , equals when , and drops to when — as it must, because a census has no sampling variability at all. Sampling without replacement is more precise than sampling with replacement, because it cannot waste draws on items it has already seen.
Corollary 2.49 (Binomial approximation to the hypergeometric). If is small, the correction factor is close to and the hypergeometric probabilities are close to binomial probabilities with . The usual working rule is .
Example 2.50 (Defective fuses). A box holds fuses, of them defective. Three are drawn without replacement. Find the probability that exactly one is defective, and .
Solution.
- Here , , , .
- , , .
- .
- .
- Compare the binomial: . The sample is of the population, above the rule, and the two values differ by nearly — visible evidence that the approximation is being pushed too far here.
2.7Choosing a Distribution
Every distribution in this chapter is built from Bernoulli trials or a limit of them, so the differences come down to three questions: what is fixed, what is random, and are the trials independent?
Method 2.51 (Identifying the distribution).
- Is the quantity a count of successes, or a count of trials? Successes binomial or hypergeometric. Trials geometric or negative binomial.
- If it is a count of successes: is the number of trials fixed in advance? If yes, and the draws are independent with constant — sampling with replacement, or from an effectively infinite population — it is binomial. If the draws are made without replacement from a finite pool, it is hypergeometric.
- If it is a count of trials: how many successes are you waiting for? One geometric. Exactly negative binomial.
- Is there no list of trials at all — only a rate over a window of time, length, area or volume? Then it is Poisson, with rescaled to the window in the question.
- Check the boundary cases. large with small and moderate: the Poisson approximates the binomial. Sample no more than of the population: the binomial approximates the hypergeometric.
The tells in the wording are reliable. "Out of patients, how many respond?" fixes and counts successes: binomial. "How many patients must be screened to find who qualify?" counts trials until the third success: negative binomial. "How many earthquakes next decade?" has no trials at all, only a rate: Poisson. "Five cards from a deck" is drawing from a small finite pool: hypergeometric.
| Distribution | Fixed | Random | Support | Mean | Variance |
|---|---|---|---|---|---|
| Bernoulli | one trial | success or not | | | |
| Binomial | trials | number of successes | | | |
| Poisson | a window | number of events | | | |
| Geometric | one success | number of trials | | | |
| NegBinom | successes | number of trials | | | |
| Hypergeom | draws, no replacement | number of successes | see above | | |
Example 2.52 (Reading the distribution off the wording). Classify each scenario, and give the parameters.
A. A quiz has true/false questions and a student guesses every one. How many does she get right?
B. A page of a manuscript averages typos. What is the chance a page is clean?
C. How many pages must an editor read to find the first typo?
D. A box of fuses contains defectives; three are drawn without replacement. How many are defective?
Solution.
- A — binomial, . A fixed number of independent trials with constant , counting successes. The mean is .
- B — Poisson, per page. Counting events in a fixed window with no natural ; .
- C — geometric on pages, with . The expected wait is pages. Note the two-step reading: a Poisson calculation supplies the that a geometric then consumes.
- D — hypergeometric, , , , as computed earlier; the binomial would give against the correct .
- The four tells, in order: fixed count of trials; rate over an interval; wait until the first success; draw from a small finite pool without replacement.
Summary. The load-bearing results of this chapter, with the hypotheses they need.
- A pmf is any non-negative function summing to over a countable support; the cdf is its running total, and is the size of 's jump at . For discrete , .
- Linearity of expectation. for any with finite means on a common sample space. No independence needed — this is what makes the indicator decomposition work.
- Variance identities. and , both unconditionally. But requires independence (or at least zero covariance); in general the cross term is there.
- Binomial : , needing binary outcomes, independence, fixed and constant . Mean (needs only constant ), variance (needs independence). Symmetric at , right-skewed below it.
- Poisson : , the , limit of the binomial. Mean variance , which is a testable claim; overdispersed data violates it. Independent Poissons add, so rescales with the window.
- Geometric : on , tail , mean , variance . It is the unique memoryless discrete distribution, and memorylessness needs independence and constant — not true of anything that ages or wears.
- Negative binomial : the th-success waiting time, a sum of independent geometrics; mean , variance .
- Hypergeometric : sampling without replacement. Mean , the same as the binomial, but variance — strictly smaller. The binomial approximates it when .
- Using the binomial when sampling without replacement from a small population. The trials are neither independent nor identically weighted. Use the hypergeometric unless the sample is under about of the population.
- Adding standard deviations instead of variances. Variances add for independent variables; standard deviations never do. Add the variances, then take one square root.
- Assuming independence for a variance. always; only when the covariance vanishes. Deciding which rule you are using is the first step, not an afterthought.
- **Forgetting that ** for independent . The minus sign squares away; uncertainty accumulates whether you add or subtract.
- **Mixing up and . ** For integer-valued , , and . Write the complement out rather than trusting a remembered form.
- **Confusing with . ** is a probability in ; is an expected count and can exceed . Also, belongs to a stated window — rescale it before answering a question about a different one.
- **Using in the negative binomial pmf.** The last trial is forced to be a success, so the coefficient is over the trials that remain free.
- Treating an ageing process as memoryless. Bulbs, machines and patients all have failure probabilities that change with time. The geometric model assumes constant ; without it, memorylessness — and the mean — is simply wrong.
- Fitting a Poisson to overdispersed counts. If the sample variance greatly exceeds the sample mean, the events are clustering and the independence assumption has failed. Check mean against variance before you fit.
- Reporting a mean for a highly skewed waiting time. When is small the geometric has a standard deviation nearly equal to its mean, so "on average trials" hides an enormous range.