Lecture notes · Introduction to Mathematical Statistics · Chapter 4

Chapter 4. Special Distributions: Lecture Notes

A handful of probability laws do most of the work in statistics, because each is the exact answer to a natural physical question. Rare events in a long stretch of time or space give the Poisson law; the waiting time to the next event gives the exponential and, for the \(r\)-th event, the gamma law; waiting for the first or the \(r\)-th success in repeated trials gives the geometric and negative binomial laws; and sums of many small independent effects give the normal law, the subject of the central limit theorem. This chapter derives each law from its story, computes with it, and ends with the idea of simulating what cannot be computed. The book proves the easy parts and leaves the rest to the reader or to an appendix; these notes add the missing arguments (a rate for the Poisson limit, the gaps of a Poisson process, why the continuity correction works, a complete proof of the central limit theorem, the law of the ratio of two gamma variables, the exact law of the warranty problem) and point out three small slips of the printed text.

Course home Ch. 1 Introduction Ch. 2 Probability Ch. 3 Random variables Ch. 4 Special distributions Ch. 5 Estimation Ch. 6 Hypothesis testing Ch. 7 Normal-based inference Ch. 8 Types of data Ch. 9 Two-sample inference Ch. 10 Goodness of fit Ch. 11 Regression Ch. 12 Analysis of variance Ch. 13 Randomized blocks Ch. 14 Nonparametric statistics

How to use the gap boxes and selected questions

Each Filling the gap box completes a step or a proof the book leaves out, and each selected question asks you to apply the chapter. Try it yourself first. When you are stuck, open Hint 1; the next hint unlocks one minute after you open the previous one, so take one hint at a time and think about it before moving on: the key idea first, then the tools, then the steps, with intermediate results to aim for. The full proof or solution appears after the last hint and unlocks two minutes later: use it to check your own argument. If you use a generative AI assistant, use it the same way: ask for a hint or for the next step only, then check what it says against these notes (why I teach this way). Spotted a mistake? Use the Report an error link at the end of each box: confirmed errors are corrected and listed, with thanks, in the errata.

How to read these notes

They follow the book. Sections carry the book's numbers (4.1 to 4.7) and numbered items keep theirs (Theorem 4.3.2, Example 4.5.1, Case Study 4.2.2). Everything is written in new words; the book is cited for each result, example and figure, and displayed equations that the book numbers keep their number, e.g. \((4.2.2)\).

Filling the gaps. Wherever the book says "it can be shown", leaves an exercise to the reader, defers to an appendix or works an example too fast to follow, an orange Filling the gap box gives the full argument. Proofs and derivations start hidden: open one with its bar, or use the button below. Each gap box and each selected question offers graded hints, one at a time, before the full solution. The book's Appendix 4.A.2 (the proof of the central limit theorem) is placed where the theorem is stated, in Filling the gap 4.9.

Figures and demonstrations. Ten figures of the chapter (4.2.4, 4.3.1, 4.3.5, 4.3.6, 4.3.7, 4.3.10, 4.5.4, 4.7.1, 4.7.2 and 4.7.6) are reproduced; three own figures (x4.1 to x4.3) show the law of small numbers with the Poisson fits, the gamma family with its waiting-time origin, and the speed of the central limit theorem. The schematic drawings, the fingerprint pictures and the statistical-package screenshots are not redrawn. All are computed by the Python code. The ▶ Demo boxes open an interactive demonstration already set to the case being discussed.

Main reference

R. J. Larsen and M. L. Marx, An Introduction to Mathematical Statistics and Its Applications, 6th edition, Pearson (2018), Chapter 4, pages 218–277. Section, case-study, figure, equation and question numbers below refer to this book. Further reading is listed in the references.

The explanations, derivations, figures and code are my own; equations are cited by their numbers in the book.

Companion courses

Everything in this chapter is also developed, at other levels and in other words, in the companion courses of this site. Where a proof there is complete, these notes give the statement and a short argument and link to it.

New here: the total variation rate of the Poisson limit (Filling the gap 4.1), the Poisson law derived from two local rules and the independence of the gaps of a Poisson process (4.4, 4.5), the Pearson yardstick for the Poisson fits (4.3), a local limit theorem that explains the continuity correction and the rule of thumb (4.7, 4.8), the book's proof of the central limit theorem made rigorous (4.9), the exact values behind the central limit examples (4.10), a closer look at the defense argument of Case Study 4.3.2 (4.11), the variance of the coupon collector's time and a tail bound (4.13), the gamma ratio theorem (4.20) and the exact law of the warranty cost (4.21).

The chapter at a glance

  • 4.1–4.2 A binomial count with many trials and a small success probability is nearly Poisson, with an error of at most \(np^2\) (Theorem 4.2.1, 4.1). Events that occur at random at a steady rate give Poisson counts (Theorem 4.2.2, 4.4) and exponential gaps (Theorem 4.2.3, 4.5). Poisson data are recognised by comparing proportions with the fitted law (4.3, Figure x4.1).
  • 4.3 The binomial, standardised, approaches the normal curve (Theorem 4.3.1, 4.7); more generally every standardised sum of independent, identically distributed variables with finite variance does (Theorem 4.3.2, 4.9). The normal law is closed under sums and linear maps (Theorem 4.3.3).
  • 4.4–4.5 Waiting for the first success: the geometric law (Theorem 4.4.1); waiting for the \(r\)-th: the negative binomial law, a sum of \(r\) independent geometric variables (Theorem 4.5.1, 4.14).
  • 4.6 Waiting for the \(r\)-th Poisson event: the gamma law (Theorem 4.6.1, 4.17), with mean \(r/\lambda\), variance \(r/\lambda^2\) and the additivity of shapes (Theorems 4.6.3, 4.6.4, 4.20); the chi-square law is a special case (4.18).
  • 4.7 When no formula is available, simulate: generate the random ingredients from their laws and tabulate the outcome (4.16, 4.21).

Notation. \(\P\), \(\E\), \(\V\) are probability, mean and variance. A probability function is \(p_X(k)=\P(X=k)\), a density \(f_Y(y)\), a cdf \(F_X(t)=\P(X\le t)\); \(\phi(z)=e^{-z^2/2}/\sqrt{2\pi}\) and \(\Phi\) are the standard normal density and cdf; \(q=1-p\). The Poisson mean is \(\lambda\) (or \(\lambda T\) for a time or region of size \(T\)). The sample mean of \(W_1,\dots,W_n\) is \(\bar W\).

Prerequisites. Chapter 3 of the book (Chapter 3 of these notes): binomial probabilities, densities and cdfs, expected values and variances, sums of independent variables, and moment-generating functions with their uniqueness theorem (Theorem 3.12.2).

Derivations start hidden: click any bar to open one.

4.1 Introduction

pp. 218–219 A probability function qualifies as a model for data only if it is nonnegative and adds (or integrates) to 1, and there are infinitely many such functions. The useful ones are those whose assumptions mimic the physical mechanism that produces the observations. A few mechanisms recur so often that their laws have names: the binomial and hypergeometric laws (Chapter 3), the uniform law (Example 3.4.1) and the five of this chapter. The book's opening example, the number of insect fragments in a bite of peanut butter, uses the Poisson law with mean \(\lambda=6\); we return to it in Example 4.2.4.

The chapter has one theme in two parts. Counts and waiting times of random events at a steady rate are linked by one picture, a sequence of independent trials or a Poisson process: counts are binomial or Poisson, waiting times are geometric, negative binomial, exponential or gamma. Sums of many independent contributions are linked by the central limit theorem: they are approximately normal, whatever the contributions look like.

See also (companion courses): Sections 2.3 and 2.4 of the graduate course list the discrete and continuous laws used in statistics, with their means and variances; Section 2.2 of the machine-learning course.

4.2 The Poisson Distribution

pp. 219–220 Evaluating \(\binom{1000}{500}p^{500}(1-p)^{500}\) was once a serious chore, and the first approximations to the binomial law were invented to avoid it. Poisson's (1837) addresses the case of many trials and a rare success: let the number of trials \(n\) grow and the success probability \(p\) shrink so that the mean \(np\) stays fixed.

Theorem 4.2.1 (the Poisson limit) p. 220

If \(X\) is binomial with parameters \(n\) and \(p\), and \(n\to\infty\), \(p\to0\) with \(np=\lambda\) fixed, then for every \(k=0,1,2,\dots\)

\[ \P(X=k)=\binom nk p^k(1-p)^{n-k}\longrightarrow\frac{e^{-\lambda}\lambda^k}{k!}. \]

The book's proof writes \(p=\lambda/n\), cancels \(n!/((n-k)!\,n^k)=\frac{n(n-1)\cdots(n-k+1)}{n^k}\to1\) (a product of \(k\) factors each tending to 1), and uses \((1-\lambda/n)^n\to e^{-\lambda}\) and \((1-\lambda/n)^{-k}\to1\).

pp. 220–221 Example 4.2.1 asks how large \(n\) must be. The theorem is silent, but the tables of the book compare the two laws for \(\lambda=1\). For \(n=5\), \(p=0.2\) the binomial probabilities of \(k=0,\dots,5\) are \(0.328,\ 0.410,\ 0.205,\ 0.051,\ 0.006,\ 0.000\) against \(0.368,\ 0.368,\ 0.184,\ 0.061,\ 0.015,\ 0.003\) for the Poisson (Table 4.2.1): visibly different. For \(n=100\), \(p=0.01\) they agree to three decimals in every cell (Table 4.2.2). Filling the gap 4.1 turns "how large" into a number: the largest possible disagreement over any set of values is at most \(np^2\), which is \(0.2\) and \(0.01\) for the two tables (the actual values are \(0.063\) and \(0.0028\)).

Filling the gap 4.1: how close the binomial is to the Poisson, with a bound pp. 220–221

Theorem 4.2.1 is a limit; in practice \(n\) is finite. The following bound, due to Le Cam, says exactly how the error scales and why "\(n\) large and \(p\) small" is the right condition. Let \(X\sim\Bin(n,p)\) and \(Y\sim\Pois(np)\). Then for every set \(A\) of nonnegative integers \[ |\P(X\in A)-\P(Y\in A)|\le n\,p\,(1-e^{-p})\le np^2. \]

Hint 1 of 5: the key idea

Can you build a binomial and a Poisson variable on the same probability space so that they disagree only rarely? How does the chance of disagreement compare with the distance you want to bound?

Hint 2 of 5: tools you will need
  • Quantile transform: a uniform \(U\) turns into any discrete law.
  • Sums of independent Poisson variables are Poisson (Theorem 3.12.3).
  • The union bound, and \(1-e^{-p}\le p\).
Hint 3 of 5: step 1

Use one uniform \(U_i\) per trial to produce a Bernoulli(\(p\)) variable and a Poisson(\(p\)) variable. Which values of \(U_i\) give 0 for both? Aim for: they can differ only when \(U_i>1-p\).

Hint 4 of 5: step 2

Add the two probabilities of disagreement: \(1-p<U_i\le e^{-p}\), and \(Y_i\ge2\). Aim for: \(\P(X_i\ne Y_i)=p(1-e^{-p})\le p^2\).

Hint 5 of 5: step 3

Sum over \(i\) and bound \(|\P(X\in A)-\P(Y\in A)|\) by \(\P(X\ne Y)\). State the result for \(np\) fixed, \(p=\lambda/n\).

Proof

The idea is to build \(X\) and \(Y\) on one probability space so that they differ rarely. Let \(U_1,\dots,U_n\) be independent \(\mathrm{Uniform}(0,1)\) variables. Put \(X_i=1\) if \(U_i>1-p\) and \(X_i=0\) otherwise, so \(X_i\sim\mathrm{Bernoulli}(p)\). Let \(Y_i\) be the quantile transform of \(U_i\) for the \(\Pois(p)\) law: \(Y_i=0\) if \(U_i\le e^{-p}\), \(Y_i=1\) if \(e^{-p}<U_i\le e^{-p}(1+p)\), and so on. Then \(Y_i\sim\Pois(p)\). Since \(1-p\le e^{-p}\), when \(U_i\le1-p\) both variables are 0. The pair can disagree only if \(U_i>1-p\), where \(X_i=1\), and it does so exactly in two cases: \(1-p<U_i\le e^{-p}\) (then \(Y_i=0\)) or \(Y_i\ge2\). Hence \[ \P(X_i\ne Y_i)=(e^{-p}-1+p)+(1-e^{-p}-pe^{-p})=p(1-e^{-p})\le p^2, \] using \(1-e^{-p}\le p\).

Now \(X=\sum X_i\sim\Bin(n,p)\) and \(Y=\sum Y_i\sim\Pois(np)\), because a sum of independent Poisson variables is Poisson with the summed mean (Theorem 3.12.3, Example 3.12.10 of the book). If \(X\ne Y\) then some \(X_i\ne Y_i\), so by the union bound \(\P(X\ne Y)\le n\,p(1-e^{-p})\). Finally, for any set \(A\), \(\P(X\in A)-\P(Y\in A)\le\P(X\in A,\,Y\notin A)\le\P(X\ne Y)\), and the same with the roles exchanged. ∎

With \(\lambda=np\) fixed the bound is \(\lambda p=\lambda^2/n\to0\), which proves Theorem 4.2.1 and gives its speed: halving \(p\) (doubling \(n\)) halves the worst-case error. The bound is generous: for Case Study 4.2.1 below it equals \(7076\cdot(0.000248)^2=0.00044\), almost as large as the probability \(0.00048\) being approximated, yet the two sides actually differ by about \(10^{-6}\). It is a safe guarantee, not a sharp estimate.

pp. 221–223 Example 4.2.2. Of 137.8 million tax returns, 1735 filers were convicted of tax fraud and sent to prison, so a randomly chosen filer has \(p=1735/137{,}800{,}000=1.26\times10^{-5}\). In a town of 65,000 filers the number \(X\) sent to prison is binomial, and \(\lambda=np=0.818\) (the book rounds the mean to 0.819). Then \[ \P(X\ge3)=1-\sum_{k=0}^2\frac{e^{-0.818}\,0.818^k}{k!}=0.050, \] and the exact binomial sum is the same to five decimals.

Case Study 4.2.1: the leukemia cluster in Niles pp. 222–223

Cook County outside Niles had 286 cases of childhood leukemia in 5⅓ years among 1,152,695 children, a rate of 24.8 per 100,000. Niles had 7076 children and recorded 8 cases. If each child independently had the county risk \(p=0.000248\), the number of cases is \(\Bin(7076,0.000248)\) with mean \(\lambda=1.755\), and the probability of 8 or more is \[ \P(X\ge8)=1-\sum_{k=0}^{7}\frac{e^{-1.755}1.755^k}{k!}=0.00048 \] (exact binomial 0.00048; the book prints 0.00047 from rounding the sum to 0.99953). A probability this small argues against purely random occurrence in Niles, but the question "how many towns would show a cluster this extreme somewhere?" cannot be answered from these data, which is why the controversy persists, as the book says. Chapter 6 treats this as a hypothesis test.

▶ DemoCase Study 4.2.1: the Niles clusterThe binomial and Poisson bars for 7076 children and risk 0.000248, with the tail probability of eight or more cases; five presets run from the book's two tables to a case where the limit fails.

See also (companion courses): the Poisson law as a limit of binomials, Result 2.6 of the graduate course; the Berry–Esseen demo (preset 3, Bernoulli(0.02)) for the same rare-event regime seen through the normal approximation.

The Poisson distribution

pp. 224–225 The limit \(e^{-\lambda}\lambda^k/k!\) is a probability function in its own right, and Bortkiewicz showed in 1898, with data on Prussian cavalrymen killed by horse kicks (Question 4.2.10), that it describes counts for which no \(n\) and \(p\) are known.

Theorem 4.2.2 (the Poisson distribution) p. 224

For \(\lambda>0\), \(p_X(k)=e^{-\lambda}\lambda^k/k!\), \(k=0,1,2,\dots\), is a probability function, and a random variable with it has \(\E X=\lambda\) and \(\V X=\lambda\).

The book checks that the probabilities sum to 1 with the exponential series \(\sum_k\lambda^k/k!=e^{\lambda}\) and refers to Example 3.12.9 for the moments.

Filling the gap 4.2: the Poisson mean and variance by factorial moments, and a quick test of the model pp. 224–225

The moments are proved in the book through the mgf, by differentiating twice. A shorter route is to compute \(\E[X(X-1)\cdots(X-j+1)]\), the \(j\)-th factorial moment, which for the Poisson law has a closed form for every \(j\).

Hint 1 of 5: the key idea

The \(j\)-th factorial moment \(\E[X(X-1)\cdots(X-j+1)]\) cancels almost all of \(k!\) in the Poisson sum. What is left?

Hint 2 of 5: tools you will need
  • The exponential series \(\sum_m\lambda^m/m!=e^\lambda\).
  • \(\V X=\E[X(X-1)]+\E X-(\E X)^2\).
  • Definition of the mgf (Definition 3.12.1).
Hint 3 of 5: step 1

Write \(k(k-1)\cdots(k-j+1)/k!=1/(k-j)!\) and shift the index \(m=k-j\). Aim for: \(\lambda^j\) times a Poisson sum equal to 1.

Hint 4 of 5: step 2

Read off \(j=1\) and \(j=2\) and combine them into the variance.

Hint 5 of 5: step 3

For the mgf, factor \(e^{tk}\lambda^k=(\lambda e^t)^k\) and recognise the exponential series. For the mites data, compare the sample mean with the sample variance.

Proof

For \(j\ge1\) the terms with \(k<j\) vanish, and \(k(k-1)\cdots(k-j+1)/k!=1/(k-j)!\), so \[ \E[X(X-1)\cdots(X-j+1)]=\sum_{k\ge j}\frac{e^{-\lambda}\lambda^k}{(k-j)!}=\lambda^j\sum_{m\ge0}\frac{e^{-\lambda}\lambda^m}{m!}=\lambda^j. \] With \(j=1\): \(\E X=\lambda\). With \(j=2\): \(\E X^2-\E X=\lambda^2\), so \(\V X=\lambda^2+\lambda-\lambda^2=\lambda\). The mgf is \[ M_X(t)=\sum_k e^{tk}\frac{e^{-\lambda}\lambda^k}{k!}=e^{-\lambda}\sum_k\frac{(\lambda e^t)^k}{k!}=\exp\{\lambda(e^t-1)\}, \] the form \(e^{-\lambda+\lambda e^t}\) of Appendix 4.A.1. ∎

A quick test. Equal mean and variance is a property of the Poisson law that data can contradict. The number of mite infestations per tree in Question 4.2.15 has sample mean 0.81 but sample variance 1.37: the counts are more spread out than any Poisson law allows (overdispersion), which fits the book's remark that infestations may be contagious. The horse-kick data of Question 4.2.10 give mean 0.61 and variance 0.61. For the 2608 eighth-minute counts of Case Study 4.2.2 the mean is 3.87 and the variance 3.66.

pp. 225–227 Fitting the Poisson law to data. In Case Studies 4.2.2 and 4.2.3 the book replaces \(\lambda\) by the sample mean \(\bar k\) and compares the observed proportions with \(e^{-\bar k}\bar k^k/k!\). The data are in Tables 4.2.3 and 4.2.4: the numbers of \(\alpha\)-particles emitted by a polonium source in each of 2608 eighth-minute intervals (Rutherford and Geiger, 1910; \(\bar k=10{,}092/2608=3.87\)), and the number of wars that began in each of the 432 years from 1500 to 1931 (\(\bar k=299/432=0.69\)). Figure x4.1(c, d) shows the agreement in both cases. Filling the gap 4.3 explains why \(\bar k\) is the right value to use and puts a number on "closely".

Filling the gap 4.3: why \(\lambda\) is replaced by \(\bar k\), and how to measure the fit pp. 225–227; Question 4.2.10

The book defers the choice \(\hat\lambda=\bar k\) to Chapter 5 and judges the fit by eye. Both can be made precise now.

Hint 1 of 5: the key idea

Which value of \(\lambda\) makes the observed counts most probable? And how can the mismatch between observed and expected counts be summarised in one number?

Hint 2 of 5: tools you will need
  • Log-likelihood and its derivative.
  • Pearson's statistic \(\sum(O-E)^2/E\), with degrees of freedom (cells \(-2\)).
  • Pooling cells whose expected count is below 5.
Hint 3 of 5: step 1

Write \(\ell(\lambda)=\sum(-\lambda+k_i\ln\lambda-\ln k_i!)\) and set \(\ell'=0\). Aim for: \(\hat\lambda=\bar k\); check \(\ell''<0\).

Hint 4 of 5: step 2

Compute \(E_j=n\,p_j\) with \(p_j\) from the fitted law, pooling the upper tail until every \(E_j\ge5\).

Hint 5 of 5: step 3

Form \(X^2\), then compare with a chi-square tail on (cells \(-2\)) degrees of freedom. Which of the four data sets is rejected?

Proof

The choice of \(\lambda\). For independent counts \(k_1,\dots,k_n\) from \(\Pois(\lambda)\) the likelihood is \(\prod e^{-\lambda}\lambda^{k_i}/k_i!\) and its logarithm is \(\ell(\lambda)=-n\lambda+(\sum k_i)\ln\lambda-\sum\ln k_i!\). Then \(\ell'(\lambda)=-n+\sum k_i/\lambda\) vanishes at \(\lambda=\bar k\), and \(\ell''(\lambda)=-\sum k_i/\lambda^2<0\), so \(\bar k\) is the value of \(\lambda\) under which the observed data are most probable. (With a pooled last cell valued at its lower limit, as in the book, \(\bar k\) is slightly too small.)

Measuring the fit. Let \(O_j\) be the observed count in cell \(j\) and \(E_j=n\,p_j\) the expected count under the fitted law. Pearson's statistic is \[ X^2=\sum_j\frac{(O_j-E_j)^2}{E_j}, \] which is small when observed and expected counts agree. Cells with expected count below 5 are pooled with their neighbour. When the Poisson model is true, \(X^2\) behaves like a chi-square variable with (number of cells \(-2\)) degrees of freedom (one degree is lost because the cell probabilities must sum to 1, one because \(\lambda\) was estimated); this is proved in Chapter 10 of the book and used here as a yardstick. The results for the data of this chapter:

Data\(\bar k\)cells\(X^2\)d.f.tail probability
\(\alpha\)-particles (Case Study 4.2.2)3.871212.98100.22
new wars per year (Case Study 4.2.3)0.6942.4020.30
horse-kick deaths (Question 4.2.10)0.6130.0610.80
mite infestations (Question 4.2.15)0.81311.1810.0008

A tail probability is the chance, if the Poisson model were true, of a mismatch at least this large. The first three are unremarkable, so the Poisson law fits; for the mites the chance is below one in a thousand, so the model is rejected, in agreement with the book's verdict. ∎

Four panels of paired bars. (a) Binomial with n equal 5 and p equal 0.2 against Poisson with mean 1: visibly different bars, distance 0.063. (b) Binomial with n equal 100 and p equal 0.01 against Poisson with mean 1: nearly identical bars, distance 0.003. (c) Observed proportions of alpha-particle counts per eighth of a minute against the Poisson with mean 3.87: close agreement. (d) Observed proportions of new wars per year against the Poisson with mean 0.69: close agreement.
Figure x4.1 (own figure). The Poisson limit and the Poisson fits. (a, b) The binomial law against the Poisson law of the same mean for the two tables of Example 4.2.1; the number above each panel is the largest disagreement over any set of values (total variation distance). (c, d) The observed proportions of Case Studies 4.2.2 and 4.2.3 against the Poisson law with the sample mean. Data: Tables 4.2.3 and 4.2.4 of Larsen and Marx (2018). Code: ch04_special_distributions.py, fig_x4_1.

The Poisson model: the law of small numbers

pp. 227–230 Why do radioactive decays and the outbreaks of wars share one law? Because both fit the same three assumptions. Cut a period of length \(T\) into \(n\) tiny subintervals of length \(T/n\) and suppose that (1) two or more events in one subinterval are essentially impossible, (2) events in different subintervals are independent, and (3) the chance of an event is the same in every subinterval. Then the count in \(T\) is the number of successes in \(n\) independent trials, each of probability \(p_n\) with \(np_n=\E X=\lambda T\), where \(\lambda\) is the rate (events per unit time), and Theorem 4.2.1 gives \[ \P(X=k)\doteq\frac{e^{-\lambda T}(\lambda T)^k}{k!}. \tag{4.2.2} \] Filling the gap 4.4 removes the word "essentially": it replaces the subintervals by two local rules and derives the law exactly.

Filling the gap 4.4: the Poisson law from two local rules pp. 227–228

Let \(N(t)\) be the number of events in \((0,t]\). Assume (i) the counts in disjoint intervals are independent and the count in an interval depends only on its length; (ii) for a short interval of length \(h\), \(\P(N(h)=1)=\lambda h+o(h)\) and \(\P(N(h)\ge2)=o(h)\), where \(o(h)/h\to0\). Then \[ \P(N(t)=k)=\frac{e^{-\lambda t}(\lambda t)^k}{k!},\qquad k=0,1,2,\dots \] Rule (ii) is the precise form of the book's assumptions 1 and 3: at most one event in a short interval, with probability proportional to its length.

Hint 1 of 5: the key idea

Let \(p_k(t)=\P(N(t)=k)\). What happens to \(p_k\) over a tiny extra interval of length \(h\)? Only two things have probability of order \(h\).

Hint 2 of 5: tools you will need
  • Independent, stationary increments: split \((0,t+h]\) into \((0,t]\) and \((t,t+h]\).
  • The local rules \(\P(N(h)=1)=\lambda h+o(h)\), \(\P(N(h)\ge2)=o(h)\).
  • A first-order linear differential equation, and induction on \(k\).
Hint 3 of 5: step 1: \(k=0\)

Show \(p_0(t+h)=p_0(t)(1-\lambda h+o(h))\) and let \(h\to0\). Aim for: \(p_0(t)=e^{-\lambda t}\).

Hint 4 of 5: step 2: the recursion

List the ways to have \(k\) events by \(t+h\) (none, one, or two or more new ones). Aim for: \(p_k'=-\lambda p_k+\lambda p_{k-1}\).

Hint 5 of 5: step 3: solve

Put \(q_k=e^{\lambda t}p_k\). Which equation does it satisfy, and how does induction finish?

Proof

Write \(p_k(t)=\P(N(t)=k)\). By (ii), \(p_0(h)=1-\lambda h+o(h)\). Split \((0,t+h]\) into \((0,t]\) and \((t,t+h]\); by (i) \[ p_0(t+h)=p_0(t)\,p_0(h)=p_0(t)\,(1-\lambda h+o(h)), \] so \(p_0'(t)=-\lambda p_0(t)\) with \(p_0(0)=1\), whence \(p_0(t)=e^{-\lambda t}\). For \(k\ge1\) there are three ways to have \(k\) events by time \(t+h\): \(k\) in \((0,t]\) and none in the next \(h\), \(k-1\) and one, or \(k-j\) and \(j\ge2\) with total probability at most \(\P(N(h)\ge2)=o(h)\). Hence \[ p_k(t+h)=p_k(t)(1-\lambda h)+p_{k-1}(t)\,\lambda h+o(h), \] and \(p_k'(t)=-\lambda p_k(t)+\lambda p_{k-1}(t)\) (the same computation with \(t-h\) shows the derivative exists from both sides). Put \(q_k(t)=e^{\lambda t}p_k(t)\): then \(q_k'=\lambda q_{k-1}\), \(q_k(0)=0\) for \(k\ge1\), \(q_0=1\). By induction \(q_k(t)=(\lambda t)^k/k!\): if it holds for \(k-1\), then \(q_k(t)=\int_0^t\lambda(\lambda s)^{k-1}/(k-1)!\,ds=(\lambda t)^k/k!\). ∎

As a by-product, \(\E N(t)=\lambda t\), the fact the book flags with "(why?)" on p. 227: the rate \(\lambda\) is the mean count per unit of time, and \(\lambda T=np_n\).

pp. 228–230 Example 4.2.3 asks why the number of wars starting in a year is Poisson. Each year offers a grid of possible pairs of nations, each pair a trial that rarely succeeds; some wars trigger others in the same year, which breaks independence (the four years with four or more wars of Table 4.2.4 are the visible trace), but only slightly. The same trials in different years have the same rate, which is why the 432 yearly counts together look like a Poisson sample.

p. 229 Which formula? The book lists three versions of the Poisson probability, \(e^{-np}(np)^k/k!\) (as an approximation), \(e^{-\lambda}\lambda^k/k!\) and \(e^{-\lambda T}(\lambda T)^k/k!\), and they are all \(e^{-m}m^k/k!\) with \(m=\E X\): the units of the rate must be matched to the units of the count. A source emitting 1.5 particles per second, counted over a minute, has \(m=1.5\times60=90\).

Example 4.2.4: bug parts in peanut butter p. 230

The legal limit is 30 fragments per 100 g, so a 20 g serving at the limit has \(m=0.30\times20=6\) fragments, and \[ \P(X\ge5)=1-\sum_{k=0}^4\frac{e^{-6}6^k}{k!}=1-0.2851=0.715 \] (the book rounds to 0.71).

p. 231 Questions 4.2.1–4.2.25 practise these steps. Two are worked below: Question 4.2.4 (a rare mutation, and how many cases would convince you the rate is too low) and Question 4.2.10 (Bortkiewicz's horse-kick data), plus Question 4.2.25 (thinning a Poisson count).

Intervals between events: the Poisson/exponential relationship

pp. 232–233 If events occur at rate \(\lambda\), how long until the next one?

Theorem 4.2.3 (exponential gaps) p. 233

If events satisfy the Poisson model at rate \(\lambda\) per unit time, the interval \(Y\) between consecutive events has density \(f_Y(y)=\lambda e^{-\lambda y}\), \(y>0\); that is, \(\P(Y>y)=e^{-\lambda y}\).

The book's argument: after an event at time \(a\), there is no event in \((a,a+y)\) exactly when \(Y>y\), and the Poisson count in that interval is zero with probability \(e^{-\lambda y}\); differentiate the cdf \(1-e^{-\lambda y}\).

Filling the gap 4.5: the gaps of a Poisson process are independent exponentials p. 233

The book's argument starts from "an event has occurred at time \(a\)", an event of probability zero, and silently uses that what happens after \(a\) is unaffected by it. Here is a computation that avoids both. Let \(T_1<T_2\) be the times of the first two events and \(\lambda\) the rate. Then \(T_1\) and \(T_2-T_1\) are independent, each exponential with rate \(\lambda\).

Hint 1 of 5: the key idea

The event {"first event after \(s\), second after \(t\)"} is a statement about counts in two disjoint intervals. Can you get the joint density of \((T_1,T_2)\) from it, without conditioning on a probability-zero event?

Hint 2 of 5: tools you will need
  • Counts in disjoint intervals are independent Poisson variables (gap 4.4 above).
  • Joint density from a joint survival function: \(f=\partial^2G/\partial s\partial t\).
  • Change of variables \((s,t)\mapsto(s,t-s)\), and factorisation means independence (Theorem 3.7.4).
Hint 3 of 5: step 1

For \(0<s<t\), write \(\{T_1>s,T_2>t\}\) as \(\{N(s)=0,\ N(t)-N(s)\le1\}\). Aim for: \(G(s,t)=e^{-\lambda t}(1+\lambda(t-s))\).

Hint 4 of 5: step 2

Differentiate in \(s\), then in \(t\). Aim for: \(f(s,t)=\lambda^2e^{-\lambda t}\) on \(0<s<t\).

Hint 5 of 5: step 3

Substitute \(u=t-s\) and look at the form of the result.

Proof

For \(0<s<t\), the event \(\{T_1>s,\ T_2>t\}\) says that there is no event in \((0,s]\) and at most one in \((s,t]\). The counts in these disjoint intervals are independent Poisson variables (Filling the gap 4.4), so \[ G(s,t):=\P(T_1>s,T_2>t)=e^{-\lambda s}\cdot e^{-\lambda(t-s)}\bigl(1+\lambda(t-s)\bigr)=e^{-\lambda t}\bigl(1+\lambda(t-s)\bigr). \] The joint density of \((T_1,T_2)\) is the mixed second derivative \(\partial^2G/\partial s\,\partial t\): first \(\partial G/\partial s=-\lambda e^{-\lambda t}\), then \(\partial/\partial t\) gives \(\lambda^2e^{-\lambda t}\), on the region \(0<s<t\). Change variables to \(s\) and \(u=t-s\) (Jacobian 1): \[ f_{T_1,\,T_2-T_1}(s,u)=\lambda^2e^{-\lambda(s+u)}=\bigl(\lambda e^{-\lambda s}\bigr)\bigl(\lambda e^{-\lambda u}\bigr),\qquad s,u>0. \] This factorises, so the first waiting time and the first gap are independent, and both are exponential with rate \(\lambda\). The same computation for the first \(r\) events (their joint density is \(\lambda^re^{-\lambda t_r}\) on \(0<t_1<\dots<t_r\)) shows that all the gaps are independent exponentials. ∎

The independence is what makes Section 4.6 work: the time of the \(r\)-th event is a sum of \(r\) independent exponential gaps. Marginally the first result also gives the book's statement with no conditioning: \(\P(T_1>y)=\P(N(y)=0)=e^{-\lambda y}\).

Case Study 4.2.4: earthquakes in the New Madrid Seismic Zone pp. 233–234

Between 12 January 1973 and 29 December 2013 there were 219 moderate earthquakes (aftershocks removed), giving 218 intervals with mean 65.91 days. If the quakes are Poisson events, the intervals should be exponential with rate \(\lambda=1/65.91=0.0152\) per day. Table 4.2.5 groups the intervals in 30-day classes; Figure 4.2.4 shows the density-scaled histogram (frequency divided by \(218\times30\)) with the exponential curve. The shape, a steep start and a long right tail, is exactly what the model predicts.

A density-scaled histogram of the intervals between New Madrid earthquakes in 30-day classes, falling from 0.013 in the first class to 0.001 in the last, with a red exponential curve starting at 0.0152 that follows the bars closely.
Figure 4.2.4. Intervals between earthquakes in the New Madrid zone against the exponential density with rate \(1/65.91\). Reproduces Larsen and Marx (2018), Figure 4.2.4 (the book's printed label has the exponent \(-0.015y\); see the notes on the book). Data: Table 4.2.5. Code: ch04_special_distributions.py, fig_4_2_4.

p. 234 Bad things come in threes. The exponential density is largest at 0: short gaps are the most likely ones. If bad events occur at random at 12 per year, the next gap is shorter than a week with probability \(1-e^{-12/52}=0.21\), even though the average gap is a month. Clusters of events are what randomness looks like; evenly spaced events would be a sign of something regular. The Poisson process demo (preset 1) draws exponential gaps on a time axis.

Example 4.2.5: waiting for a Perseid pp. 234–235

At 40 visible meteors per hour the rate is \(2/3\) per minute, so \(\P(Y>5)=e^{-10/3}=0.0357\). The book rounds the rate to 0.67 and gets \(e^{-3.35}=0.035\).

p. 235 Questions 4.2.26–4.2.29 apply the exponential gap; Question 4.2.29 (eruptions of Mauna Loa) asks for a density-scaled histogram of the 36 intervals, as in Figure 4.2.4. Question 4.2.26 is worked below.

4.3 The Normal Distribution

pp. 235–237 De Moivre found, early in the eighteenth century, that for a fair coin the standardised number of heads has a limiting shape. For \(X\sim\Bin(n,\tfrac12)\), \[ \P\Bigl(a\le\frac{X-n/2}{\sqrt{n/4}}\le b\Bigr)\doteq\frac1{\sqrt{2\pi}}\int_a^be^{-z^2/2}\,dz. \] Figure 4.3.1 shows the \(\Bin(20,\tfrac12)\) bars and the matching curve. The bar at \(k=10\) has height \(\binom{20}{10}2^{-20}=184{,}756/1{,}048{,}576=0.1762\); the area under the curve over \([9.5,10.5]\), that is over \(|z|\le0.5/\sqrt5=0.224\), is \(0.1769\) (the book reads \(0.174\) from a table that has \(z\) rounded to \(0.22\)).

Bars of the binomial probabilities for 20 trials with success probability one half, for k from 5 to 15, peaking at 0.176 at k equal 10, with a dashed red normal curve through the bar tops; a second axis on top shows z from minus 2 to 2.
Figure 4.3.1. The \(\Bin(20,\tfrac12)\) probability function and the normal curve with the same mean and variance; the top axis is \(z=(k-10)/\sqrt5\). Reproduces Larsen and Marx (2018), Figure 4.3.1. Code: ch04_special_distributions.py, fig_4_3_1.

Laplace extended the result to every \(p\) in 1812, which is why it carries both names.

Theorem 4.3.1 (De Moivre–Laplace) p. 237

If \(X\) is binomial with \(n\) trials and success probability \(p\), then for all numbers \(a<b\)

\[ \lim_{n\to\infty}\P\Bigl(a\le\frac{X-np}{\sqrt{np(1-p)}}\le b\Bigr)=\frac1{\sqrt{2\pi}}\int_a^be^{-z^2/2}\,dz. \]

The book proves it by showing that the mgf of the standardised variable tends to \(e^{t^2/2}\) and appealing to Theorem 3.12.2, and refers to Appendix 4.A.2 for the general case; it is the special case of Theorem 4.3.2 below with Bernoulli summands, as the book notes on p. 244. A direct proof by counting, which also explains the continuity correction, is Filling the gap 4.7.

p. 237 The function \(f_Z(z)=e^{-z^2/2}/\sqrt{2\pi}\) is the standard normal density; by convention a variable with this density is called \(Z\). The book checks that it integrates to 1 in polar coordinates and reads off \(M_Z(t)=e^{t^2/2}\), hence \(\E Z=0\), \(\V Z=1\).

Filling the gap 4.6: the standard normal density has total mass 1; its moments; location and scale p. 237; Definition 4.3.1

No substitution evaluates \(\int e^{-z^2/2}dz\) as an elementary function, and the cdf \(\Phi\) is not elementary either, but the total integral is computable. The book's polar-coordinate argument is correct; here it is with the steps it skips.

Hint 1 of 5: the key idea

The integral \(I=\int e^{-x^2/2}dx\) has no elementary antiderivative, but \(I^2\) is a double integral of a radially symmetric function. What coordinates suit it?

Hint 2 of 5: tools you will need
  • Tonelli's theorem for nonnegative integrands.
  • Polar coordinates \(dx\,dy=r\,dr\,d\theta\).
  • Integration by parts; linear maps of densities (Theorem 3.8.2).
Hint 3 of 5: step 1

Show \(0<I<\infty\), then write \(I^2\) as a double integral and go to polar coordinates. Aim for: \(I^2=2\pi\).

Hint 4 of 5: step 2

For \(\E Z\) use oddness; for \(\E Z^2\) integrate \(z\cdot ze^{-z^2/2}\) by parts. Aim for: \(\V Z=1\).

Hint 5 of 5: step 3

Put \(Y=\mu+\sigma Z\) and apply the linear-map rule. Then express \(\P(a\le Y\le b)\) through \(\Phi\).

Proof

Total mass. Let \(I=\int_{-\infty}^{\infty}e^{-x^2/2}dx\). The integrand is positive and bounded by \(e^{1/2-|x|}\), so \(0<I<\infty\). Since the integrand of \(I^2=\int\!\!\int e^{-(x^2+y^2)/2}\,dx\,dy\) is nonnegative, the iterated integral equals the double integral over \(\R^2\) (Tonelli's theorem), which we may compute in polar coordinates \(x=r\cos\theta\), \(y=r\sin\theta\), \(dx\,dy=r\,dr\,d\theta\): \[ I^2=\int_0^{2\pi}\!\!\int_0^\infty e^{-r^2/2}\,r\,dr\,d\theta=2\pi\Bigl[-e^{-r^2/2}\Bigr]_0^\infty=2\pi. \] Hence \(I=\sqrt{2\pi}\) (the positive root), and \(f_Z\) integrates to 1.

Moments. The integrand \(z\,e^{-z^2/2}\) is odd and absolutely integrable, so \(\E Z=0\). Integrating by parts with \(u=z\), \(dv=ze^{-z^2/2}dz\): \[ \E Z^2=\frac1{\sqrt{2\pi}}\Bigl(\bigl[-ze^{-z^2/2}\bigr]_{-\infty}^{\infty}+\int e^{-z^2/2}dz\Bigr)=0+1=1, \] so \(\V Z=1\). The mgf \(e^{t^2/2}\) is obtained by completing the square in Filling the gap 3.25.

Location and scale. For \(\sigma>0\) put \(Y=\mu+\sigma Z\). By the linear-map rule (Theorem 3.8.2) \(f_Y(y)=\frac1\sigma f_Z\bigl(\frac{y-\mu}\sigma\bigr)\), the density of Definition 4.3.1, with \(\E Y=\mu\), \(\V Y=\sigma^2\). Conversely, every \(Y\sim\N(\mu,\sigma^2)\) has a standard score \(Z=(Y-\mu)/\sigma\sim\N(0,1)\), so \[ \P(a\le Y\le b)=\Phi\Bigl(\frac{b-\mu}\sigma\Bigr)-\Phi\Bigl(\frac{a-\mu}\sigma\Bigr), \] which is why one table of \(\Phi\) serves all normal laws, and why a table printed only for \(z\ge0\) is enough, since \(\Phi(-z)=1-\Phi(z)\) by the symmetry of \(f_Z\). Software gives \(\Phi\) directly, for instance scipy.stats.norm.cdf(1.14) \(=0.8729\), the value the book reads from its Table A.1. ∎

pp. 238–240 Areas under the normal curve. Probabilities for \(Z\) come from \(F_Z=\Phi\): \(\P(Z>b)=1-\Phi(b)\) and \(\P(a\le Z\le b)=\Phi(b)-\Phi(a)\), the endpoints being irrelevant because points have probability 0. Questions 4.3.1–4.3.6 practise this.

pp. 239–240 The continuity correction. A binomial variable takes integer values, so its probability at \(k\) is the area of a bar from \(k-\tfrac12\) to \(k+\tfrac12\). To approximate \(\P(a\le X\le b)\) the integral of the normal density should therefore run from \(a-\tfrac12\) to \(b+\tfrac12\): \[ \P(a\le X\le b)\doteq\Phi\Bigl(\frac{b+\frac12-np}{\sqrt{np(1-p)}}\Bigr)-\Phi\Bigl(\frac{a-\frac12-np}{\sqrt{np(1-p)}}\Bigr). \] The book also gives a rule of thumb: use the approximation only if \(n>9\,p/(1-p)\) and \(n>9\,(1-p)/p\). Filling the gap 4.7 shows why the half-unit is the right shift and what it cannot repair; Filling the gap 4.8 derives the rule of thumb.

Filling the gap 4.7: a local limit theorem, and why the continuity correction works pp. 236–240

The book proves the De Moivre–Laplace theorem through mgfs and illustrates the continuity correction with a picture. Counting directly gives both at once. Let \(X\sim\Bin(n,p)\), \(\sigma_n=\sqrt{np(1-p)}\) and, for an integer \(k\), \(z_k=(k-np)/\sigma_n\). Local limit theorem. For every \(M>0\), \[ \P(X=k)=\frac{1}{\sigma_n}\,\phi(z_k)\,(1+o(1)),\qquad\text{uniformly over }|z_k|\le M, \] as \(n\to\infty\), with \(p\) fixed.

Hint 1 of 6: the key idea

Stirling's formula turns \(\binom nkp^kq^{n-k}\) into something whose logarithm you can expand around \(k=np\). What is the second-order term?

Hint 2 of 6: tools you will need
  • Stirling: \(m!\sim\sqrt{2\pi m}(m/e)^m\).
  • Taylor expansion of \(\ln(1\pm x)\) to second order.
  • The midpoint rule for an integral; Chebyshev's inequality for the tails.
Hint 3 of 6: step 1

Apply Stirling to \(n!,k!,(n-k)!\) and separate the square-root factor from the power factor. Aim for: \(1/(\sigma_n\sqrt{2\pi})\) times \((np/k)^k(nq/(n-k))^{n-k}\).

Hint 4 of 6: step 2

Set \(k=np(1+a)\), \(n-k=nq(1-b)\) and expand the logarithm. Aim for: \(-z^2/2+O(M^3/\sqrt n)\); the first-order terms cancel.

Hint 5 of 6: step 3

Interpret \(\phi(z_k)/\sigma_n\) as a midpoint-rule area of a cell of width \(1/\sigma_n\). Which end points does the sum of cells have?

Hint 6 of 6: step 4

Handle \(|z|>M\) with Chebyshev. Why does skewness leave an error even after the correction?

Proof

Write \(q=1-p\). For \(|z_k|\le M\) both \(k=np+z_k\sigma_n\) and \(n-k=nq-z_k\sigma_n\) tend to infinity, so Stirling's formula \(m!=\sqrt{2\pi m}\,(m/e)^m(1+o(1))\) applies to \(n!\), \(k!\), \((n-k)!\) and gives \[ \binom nk p^kq^{n-k}=\sqrt{\frac{n}{2\pi k(n-k)}}\;\Bigl(\frac{np}{k}\Bigr)^k\Bigl(\frac{nq}{n-k}\Bigr)^{n-k}(1+o(1)). \] Since \(k/n\to p\), the square root is \(\frac1{\sigma_n\sqrt{2\pi}}(1+o(1))\). For the rest, put \(k=np(1+a)\) and \(n-k=nq(1-b)\), where \(a=z\sqrt{q/(np)}\) and \(b=z\sqrt{p/(nq)}\) (writing \(z=z_k\)); both are \(O(1/\sqrt n)\). The logarithm of the product is \[ -k\ln(1+a)-(n-k)\ln(1-b). \] Expanding \(\ln(1\pm x)\) to second order, \(k\ln(1+a)=np(1+a)(a-\tfrac{a^2}2+O(n^{-3/2}))=np\,a+\tfrac12np\,a^2+O(n^{-1/2})\) and \((n-k)\ln(1-b)=-nq\,b+\tfrac12nq\,b^2+O(n^{-1/2})\). Now \(np\,a=z\sigma_n=nq\,b\), so the first-order terms cancel in the difference, and \(\tfrac12np\,a^2+\tfrac12nq\,b^2=\tfrac12z^2(q+p)=\tfrac12z^2\). The logarithm is therefore \(-z^2/2+O(M^3/\sqrt n)\), uniformly for \(|z|\le M\), which proves the claim. ∎

From points to intervals. A bar of the binomial probability function at \(k\) has the width \(1\) on the \(k\)-axis, which is \(1/\sigma_n\) on the \(z\)-axis, and by the local theorem its area is \(\phi(z_k)/\sigma_n\), the height of the curve at the middle of the cell \([z_k-\frac1{2\sigma_n},\,z_k+\frac1{2\sigma_n}]\) times its width. This is the midpoint rule for \(\int\phi\), whose error on one cell is at most \(\sup|\phi''|/(24\sigma_n^3)\). Summing the cells from \(a\) to \(b\) (about \(2M\sigma_n\) cells inside \(|z|\le M\)) gives \[ \P(a\le X\le b)=\int_{(a-\frac12-np)/\sigma_n}^{(b+\frac12-np)/\sigma_n}\phi(z)\,dz+(\text{error}\to0). \] The limits are exactly \(a-\tfrac12\) and \(b+\tfrac12\): this is the continuity correction. Without it the integral would run over \([a,b]\), which cuts half a cell off at each end and loses \(\approx\bigl[\phi(z_a)+\phi(z_b)\bigr]/(2\sigma_n)\), an error of the same order \(1/\sigma_n\) as the others.

The theorem. Outside \(|z|\le M\) the binomial puts probability at most \(1/M^2\) (Chebyshev) and so does the normal law; given \(\varepsilon\), choose \(M\) with \(2/M^2<\varepsilon\) and then \(n\) large. This proves Theorem 4.3.1 for \(a,b\) fixed.

What the correction cannot repair. The correction removes the "lattice" error from cutting cells in half. A second error of order \((1-2p)/\sigma_n\), caused by the skewness of the binomial law, remains (Feller 1968, Chapter VII); it vanishes when \(p=\frac12\) and is large when \(p\) is far from \(\frac12\). That is why the correction is excellent for \(\Bin(20,\frac12)\) (Figure 4.3.1) and still poor for a rare-event count (Question 4.3.20). The normal approximation demo shows both. ∎

Filling the gap 4.8: where the rule of thumb \(n>9p/(1-p)\) comes from p. 240

The book states the rule without explanation. A normal curve puts nearly all its mass within three standard deviations of its mean, but a binomial count is confined to \(0,\dots,n\); the approximation can only be sensible when the interval \(np\pm3\sigma_n\) lies inside \([0,n]\).

Hint 1 of 5: the key idea

Where should a normal curve with this mean and standard deviation put most of its mass, and what does a binomial count forbid?

Hint 2 of 5: tools you will need
  • The three-sigma interval \(np\pm3\sqrt{npq}\).
  • Squaring an inequality between positive numbers.
  • The support \(\{0,\dots,n\}\).
Hint 3 of 5: step 1

Require \(np-3\sigma_n>0\) and \(np+3\sigma_n<n\). Aim for: the two conditions as inequalities in \(n\).

Hint 4 of 5: step 2

Square each side and divide by \(np\) or \(nq\). Aim for: \(n>9q/p\) and \(n>9p/q\).

Hint 5 of 5: step 3

Test the rule on Questions 4.3.13 and 4.3.20 and on Example 4.3.1; then compare with the exact binomial value in the second.

Proof

With \(q=1-p\) and \(\sigma_n=\sqrt{npq}\): \(np-3\sigma_n>0\iff np>3\sqrt{npq}\iff n^2p^2>9npq\iff n>9q/p\). Likewise \(np+3\sigma_n<n\iff3\sigma_n<nq\iff9npq<n^2q^2\iff n>9p/q\). These are the two conditions of the rule. For \(p\le\frac12\) the binding condition is the first, \(np>9q\): about \(np>9\) when \(p\) is small and \(np>4.5\) when \(p=\frac12\).

Using it. For Question 4.3.13, \(n=10\), \(p=0.7\): \(9p/q=21>10\), so the normal approximation is not recommended. For Example 4.3.1 (\(n=178\), \(p=0.9\)): \(9p/q=81<178\), allowed. For Question 4.3.20 (\(n=3000\), \(p=0.001\)): \(9q/p=8991>3000\), not allowed, and the approximation is indeed bad (the Poisson law is the right tool). A warning: the rule is a safeguard, not a guarantee. In Example 4.3.1 it is satisfied, and yet the corrected normal value \(0.0191\) is \(44\%\) larger than the exact \(0.0133\), because \(\Bin(178,0.9)\) is still skewed and the question concerns a tail. ∎

Example 4.3.1: an overbooked flight p. 240

An airline sells 178 tickets for 168 seats; each ticket holder shows up independently with probability 0.9. The flight is overbooked if \(169\le X\le178\) show up, for \(X\sim\Bin(178,0.9)\), with \(np=160.2\), \(\sigma_n=\sqrt{16.02}=4.00\): \[ \P(169\le X\le178)\doteq1-\Phi\Bigl(\frac{168.5-160.2}{4.00}\Bigr)=1-\Phi(2.07)=0.019, \] the book's "about one in fifty". The exact binomial value is \(0.0133\), about one in seventy-five; without the correction the normal value is \(0.0140\), by chance closer. The approximation is good enough to see that overbooking by 10 is mostly safe, not good enough to price the risk to two figures (see Filling the gap 4.8).

▶ DemoExample 4.3.1: overbookingExact binomial probability, normal approximation with and without the continuity correction, and the rule-of-thumb check for any \(n\), \(p\) and range; five presets.

Case Study 4.3.1: Pratt and Woodruff's ESP experiment pp. 241–242

In 1938 thirty-two students made 60,000 guesses of the symbol on a card hidden from them, one of five, and were right 12,489 times. If guessing is pure chance, \(X\sim\Bin(60000,\frac15)\), with mean 12,000 and standard deviation \(\sqrt{9600}=97.98\). Then \[ \P(X\ge12{,}489)\doteq1-\Phi\Bigl(\frac{12{,}488.5-12{,}000}{97.98}\Bigr)=1-\Phi(4.99)=3\times10^{-7}, \] and the exact binomial tail is \(3.5\times10^{-7}\). Chance alone is therefore extremely hard to believe as the explanation of the 489 extra hits, but the result does not prove ESP: the book rightly points to possible flaws in the design and the scoring. The lesson of the case is the use of probability to separate an excess that "feels" small from one that is not: the excess is \(4.99\) standard deviations. Compare the first-year proportions demo for the same normal approximation applied to a test.

▶ DemoCase Study 4.3.1: sixty thousand guessesThe tail probability far out in the normal range, where relative errors are largest, for \(n=60000\), \(p=1/5\).

pp. 242–243 Questions 4.3.1–4.3.14 practise areas, the correction and the rule of thumb. Question 4.3.9 (a tied election) is worked below.

The central limit theorem

pp. 243–244 A binomial variable is a sum of \(n\) independent Bernoulli variables (Example 3.9.3), so Theorem 4.3.1 says that the standardised sum of independent Bernoulli variables is nearly normal. The same is true for sums of any independent, identically distributed variables with a finite variance; the result was developed over 150 years and named the Central Limit Theorem by Pólya in 1920.

Theorem 4.3.2 (the central limit theorem) p. 244; proof in Appendix 4.A.2

Let \(W_1,W_2,\dots\) be independent random variables with a common distribution having finite mean \(\mu\) and finite variance \(\sigma^2>0\). Then for all \(a<b\)

\[ \lim_{n\to\infty}\P\Bigl(a\le\frac{W_1+\cdots+W_n-n\mu}{\sqrt n\,\sigma}\le b\Bigr)=\frac1{\sqrt{2\pi}}\int_a^be^{-z^2/2}\,dz. \]

Equivalently, with \(\bar W=\frac1n\sum W_i\) (mean \(\mu\), variance \(\sigma^2/n\)), \(\P\bigl(a\le\frac{\bar W-\mu}{\sigma/\sqrt n}\le b\bigr)\to\Phi(b)-\Phi(a)\). The book states the theorem in full generality and proves it, in Appendix 4.A.2, under the extra assumption that the mgf exists.

Filling the gap 4.9: a complete proof of the central limit theorem (Appendix 4.A.2) pp. 276–277

The book's proof is the classical argument through moment-generating functions. It leans on one lemma that it states without proof and takes a limit with an intermediate point of Taylor's formula that changes with \(n\). Here is the same proof with each step justified, followed by the argument that removes the assumption that the mgf exists.

Hint 1 of 6: the key idea

The mgf of the standardised sum is \(M(t/\sqrt n)^n\). If \(M(u)=1+u^2/2+o(u^2)\), what is the limit of the \(n\)-th power?

Hint 2 of 6: tools you will need
  • Independence turns the mgf of a sum into a product (Theorem 3.12.3).
  • Taylor expansion with Peano remainder; \((1+x_n/n)^n\to e^x\) if \(x_n\to x\).
  • The continuity lemma for mgfs (graduate course).
Hint 3 of 6: step 1

Standardise to \(S_i\) and find \(M(0),M'(0),M''(0)\) (gap 3.26). Aim for: \(1,0,1\).

Hint 4 of 6: step 2

Expand \(M(t/\sqrt n)\) and show \((1+x_n/n)^n\to e^{t^2/2}\).

Hint 5 of 6: step 3

Recognise the normal mgf and invoke the lemma; sketch why mgf convergence gives convergence of cdfs (tightness, Helly, uniqueness).

Hint 6 of 6: step 4

Finally explain how the characteristic function removes the assumption that the mgf exists.

Proof

Assumption. The common mgf \(M_W(t)=\E e^{tW}\) is finite for \(|t|<h\), some \(h>0\). Put \(S_i=(W_i-\mu)/\sigma\), so \(\E S_i=0\), \(\V S_i=1\), and let \(M(t)=\E e^{tS_i}\), finite for \(|t|<h/\sigma\). By Theorem 3.12.1 (and Filling the gap 3.26, which allows differentiation under the expectation) \(M\) has derivatives of all orders in that interval, with \(M(0)=1\), \(M'(0)=\E S_i=0\), \(M''(0)=\E S_i^2=1\).

Step 1: the mgf of the standardised sum. Let \(T_n=(S_1+\cdots+S_n)/\sqrt n=(W_1+\cdots+W_n-n\mu)/(\sqrt n\sigma)\). By independence and Theorem 3.12.3, \(M_{T_n}(t)=M(t/\sqrt n)^n\).

Step 2: Taylor expansion at 0. Since \(M\) is twice differentiable at 0, Taylor's theorem with the Peano remainder gives \(M(u)=1+\tfrac12u^2+u^2\varepsilon(u)\) with \(\varepsilon(u)\to0\) as \(u\to0\). (The book writes the remainder as \(\tfrac12t^2M''(r)\) at an intermediate point; that is also correct, and the Peano form avoids having to follow the point as \(n\) grows.)

Step 3: the limit. Fix \(t\) and put \(u=t/\sqrt n\). Then \(M(t/\sqrt n)=1+x_n/n\) with \(x_n=\tfrac12t^2+t^2\varepsilon(t/\sqrt n)\to\tfrac12t^2\). If \(x_n\to x\) then \((1+x_n/n)^n\to e^{x}\) (take logarithms: \(n\ln(1+x_n/n)=x_n\cdot\frac{\ln(1+x_n/n)}{x_n/n}\to x\cdot1\)). Hence \[ M_{T_n}(t)\to e^{t^2/2}\quad\text{for every }t, \] the mgf of the standard normal law (Filling the gap 3.25).

Step 4: from mgfs to probabilities (the book's lemma). If \(M_{T_n}(t)\to e^{t^2/2}\) for all \(|t|<\delta\), then \(\P(T_n\le z)\to\Phi(z)\) for every \(z\). Sketch: (a) the sequence is tight: by Markov's inequality applied to \(e^{\pm sT_n}\) with \(s=\delta/2\), \(\P(|T_n|>a)\le e^{-sa}\bigl(M_{T_n}(s)+M_{T_n}(-s)\bigr)\), which is bounded by a constant times \(e^{-sa}\) for large \(n\). (b) By Helly's selection theorem every subsequence has a further subsequence whose cdfs converge to a cdf \(F\) at all continuity points. (c) The variables \(e^{tT_n}\), \(|t|<\delta/2\), are uniformly integrable because \(\sup_n\E e^{2tT_n}<\infty\), so the mgf of \(F\) equals the limit \(e^{t^2/2}\) on \(|t|<\delta/2\). (d) By the uniqueness theorem (Theorem 3.12.2) \(F=\Phi\). Every subsequence has a further subsequence converging to the same \(\Phi\), so the whole sequence converges; and since \(\Phi\) is continuous, \(\P(a\le T_n\le b)\to\Phi(b)-\Phi(a)\). A full proof of the lemma is in Filling the gap 5.16 of the graduate course. ∎

Without an mgf. Theorem 4.3.2 needs only a finite variance. Replace \(M(t)\) by the characteristic function \(\varphi(u)=\E e^{iuS_i}\), which exists for every distribution. The inequality \(|e^{ix}-1-ix+\tfrac12x^2|\le\min(|x|^3/6,\,x^2)\) and dominated convergence give \(\varphi(u)=1-\tfrac12u^2+o(u^2)\) using only \(\E S_i=0\), \(\E S_i^2=1\). Then \(\varphi(t/\sqrt n)^n=(1-\tfrac{t^2}{2n}+o(1/n))^n\to e^{-t^2/2}\), the characteristic function of \(Z\), and Lévy's continuity theorem completes the proof (Billingsley 1995, Sections 26 and 27). A proof that uses neither transforms but swaps the summands one at a time for normal variables is Lindeberg's, Filling the gap 5.7 of the graduate course.

Corollaries. With Bernoulli summands (\(\mu=p\), \(\sigma^2=p(1-p)\), mgf finite everywhere) this is Theorem 4.3.1. The finite variance is needed: for Cauchy variables \(\bar W\) is again Cauchy for every \(n\), and nothing converges to a normal law.

▶ DemoAverages on trial (first-year course)Sample means of body-temperature, uniform, skewed waiting-time and yes/no data for any \(n\), with the normal curve of the theorem on top.

pp. 244–246 Example 4.3.2 shows the theorem at work for data from \(\mathrm{Uniform}[0,10)\), with \(\mu=5\) and \(\sigma^2=25/3\). Figure 4.3.5 is a histogram of 100 such observations, flat as it should be. Figure 4.3.6 shows 50 averages of 8 observations: already bell-shaped around 5, with variance \(\sigma^2/8=25/24\). The CLT predicts \[ \P(4.5\le\bar Y<5.5)\doteq\Phi\Bigl(\frac{0.5}{\sqrt{25/24}}\Bigr)-\Phi\Bigl(\frac{-0.5}{\sqrt{25/24}}\Bigr)=\Phi(0.49)-\Phi(-0.49)=0.376, \] against 0.36 observed in the book's 50 averages and \(0.370\) exactly (Filling the gap 4.10).

A density-scaled histogram of 100 simulated observations from the uniform distribution on 0 to 10, with bars between 0.06 and 0.17 around the flat red line at 0.1.
Figure 4.3.5. A sample of 100 observations from the uniform density \(1/10\) on \([0,10)\) and the density itself (our own random sample; the book's differs). Reproduces Larsen and Marx (2018), Figure 4.3.5. Code: ch04_special_distributions.py, fig_4_3_5.
A density-scaled histogram of 50 sample averages of eight uniform observations, bell-shaped around 5, with a dashed red normal curve of variance 25 over 24.
Figure 4.3.6. Fifty averages, each of eight observations from the same uniform law, with the limiting normal curve \(\N(5,25/24)\). Reproduces Larsen and Marx (2018), Figure 4.3.6. Code: ch04_special_distributions.py, fig_4_3_6.

p. 246 Example 4.3.3. For \(n=15\) observations from \(f_Y(y)=3(1-y)^2\) on \([0,1]\) one finds \(\mu=\frac14\) and \(\sigma^2=\frac3{80}\), so \(\sigma/\sqrt{15}=0.05\) and \[ \P(\tfrac18\le\bar Y\le\tfrac38)\doteq\P(-2.50\le Z\le2.50)=0.9876. \] Example 4.3.4. An accountant rounds 100 independent items to the nearest \(\$100\); each rounding error is uniform on \([-50,50]\) with variance \(100^2/12=2500/3\). The total error \(S_{100}\) has variance \(250{,}000/3\), standard deviation \(\$288.7\), and \[ \P(|S_{100}|>500)\doteq2\bigl(1-\Phi(1.73)\bigr)=0.083. \] So the rounded budget is off by more than \(\$500\) about once in twelve times.

Filling the gap 4.10: how accurate the central limit approximations of Examples 4.3.2 to 4.3.4 are pp. 245–247

The theorem is a limit, so the three examples do not say how much error the approximation makes. For uniform summands the exact law of a sum is known, and for the third example it can be found by numerical convolution; the comparison is instructive.

Hint 1 of 5: the key idea

For uniform summands the exact law of a sum is a known polynomial formula. Evaluate it and compare it with the normal answer.

Hint 2 of 5: tools you will need
  • The Irwin–Hall cdf (graduate course).
  • Rescaling: the mean of \(U(0,10)\) variables is \((10/n)\) times a sum of \(U(0,1)\) variables.
  • The CLT approximation \(\Phi(b)-\Phi(a)\).
Hint 3 of 5: step 1

Translate each event to a sum of \(U(0,1)\) variables. Aim for: \(3.6\le S_8<4.4\) for Example 4.3.2.

Hint 4 of 5: step 2

Evaluate the alternating sum with exact fractions (software), then the CLT value. Aim for: a table of exact against CLT.

Hint 5 of 5: step 3

Explain the rate: which theorem bounds the error by \(1/\sqrt n\), and why do symmetric summands do better?

Proof

If \(U_1,\dots,U_n\) are independent \(\mathrm{Uniform}(0,1)\) and \(S=U_1+\cdots+U_n\), then \(\P(S\le x)=\frac1{n!}\sum_{k=0}^{\lfloor x\rfloor}(-1)^k\binom nk(x-k)^n\) for \(0\le x\le n\) (the Irwin–Hall law; derivation in Filling the gap 2.5 of the graduate course, or by induction with the convolution formula of Theorem 3.8.3). The values below are computed from it in exact rational arithmetic.

ExampleexactCLTbook prints
4.3.2: \(\P(4.5\le\bar Y<5.5)\), \(n=8\)0.36970.37580.37
4.3.3: \(\P(\frac18\le\bar Y\le\frac38)\), \(n=15\)0.98800.98760.9876
4.3.4: \(\P(|S_{100}|>500)\)0.08330.08330.0836

In the first line, \(\bar Y\in[4.5,5.5)\) is \(S\in[3.6,4.4)\) with \(S\) the sum of eight \(\mathrm{Uniform}(0,1)\) variables, and the CLT value is \(\Phi(0.49)-\Phi(-0.49)=0.3758\), which the book prints as 0.37 (see the notes on the book); the exact value is \(0.3697\). In the third, \(\P(|S_{100}|>500)=\P(|T-50|>5)\) for the sum \(T\) of 100 uniform variables, and the book's 0.0836 comes from rounding \(\sqrt3=1.732\) to \(1.73\). The sum in Example 4.3.3 has no simple closed form (the summands have a Beta(1,3) law); its exact value was found by convolving the density numerically. Even with \(n=8\) the error is below 0.01.

The rate. For a skewed summand the error does not vanish as fast. The Berry–Esseen theorem (Theorem 5.11 of the graduate course) bounds the largest gap between the cdf of the standardised sum and \(\Phi\) by \(C\,\E|W-\mu|^3/(\sigma^3\sqrt n)\), and Figure x4.3(b) shows that this \(1/\sqrt n\) rate is attained for sums of exponential variables: the exact gap is \(0.159\) at \(n=1\) and about \(0.13/\sqrt n\) for large \(n\). Symmetric summands (uniform, \(p=\frac12\) Bernoulli) do better, which is why Example 4.3.2 is so accurate at \(n=8\). ∎

Two panels. (a) Densities of the standardised sum of n exponential variables for n equal 1, 2, 5 and 30 approach the dashed standard normal curve; for n equal 1 the density is a steep exponential shape starting at minus 1. (b) On log-log axes the largest gap between the cdf of the standardised sum and the normal cdf falls from 0.16 at n equal 1 to 0.004 at n equal 1000, parallel to a line proportional to one over the square root of n.
Figure x4.3 (own figure). The central limit theorem for exponential summands. (a) Exact densities of the standardised sum of \(n\) independent exponential variables (a gamma law, Section 4.6) against \(N(0,1)\). (b) The largest difference between the exact and normal cdfs against \(n\), on logarithmic axes, with a line \(\propto1/\sqrt n\). Code: ch04_special_distributions.py, fig_x4_3.

pp. 247 Questions 4.3.15–4.3.20 apply the theorem to dice, roulette, Poisson and binomial sums. Question 4.3.20 (the Nevada test observers) is worked below and shows an approximation that fails.

The normal curve as a model for individual measurements

pp. 248–249 The theorem also explains why single measurements are so often bell-shaped. A reading is the true value plus the net effect of many small additive disturbances, \(Y=\mu^*+W_1+\cdots+W_t\), and if no disturbance dominates the sum is approximately normal. This is an argument, not a theorem: for a fixed \(t\) the normality is an assumption to be checked with a histogram, and measurements with occasional gross errors (heavy tails) are not normal at all. Taking the normal shape as given, the standardised variable \((Y-\mu)/\sigma\) is \(Z\), and \(Y=\mu+\sigma Z\) has the density of Definition 4.3.1, \[ f_Y(y)=\frac1{\sqrt{2\pi}\,\sigma}\exp\Bigl\{-\frac12\Bigl(\frac{y-\mu}\sigma\Bigr)^2\Bigr\},\qquad-\infty<y<\infty. \] Probabilities for \(Y\) are read from the \(Z\)-score \((y-\mu)/\sigma\) (Filling the gap 4.6).

Example 4.3.5: a breath analyzer pp. 249–250

Repeated readings on one person are \(\N(\mu,\sigma^2)\) with \(\mu\) the true blood alcohol concentration and \(\sigma=0.004\%\). A driver with true value \(0.075\%\), just under the limit \(0.08\%\), is wrongly booked if the reading is at least \(0.08\): \[\P(Y\ge0.08)=\P(Z\ge1.25)=1-0.8944=0.1056\], about 11%. The two shaded areas of Figure 4.3.7 are equal. Question 4.3.31 asks what happens with the true value \(0.09\%\) and whether averaging two readings helps.

Two bell curves side by side: the density of the reading, centred at 0.075 with the area above 0.080 shaded, and the standard normal density with the area above 1.25 shaded; both areas are 0.1056.
Figure 4.3.7. The probability that a driver with true value 0.075% reads at least 0.08% (left) and the same area on the \(z\)-scale (right). Reproduces Larsen and Marx (2018), Figure 4.3.7. Code: ch04_special_distributions.py, fig_4_3_7.

Case Study 4.3.2: fingerprint ridge counts and the two arguments pp. 250–253

A latent print on a murder weapon shows only a ridge count of at least 270. The defendant's count is 275. Male ridge counts are normal with mean 146 and standard deviation 52. The state's argument: \[\P(Y\ge275)\doteq\P(Z\ge(274.5-146)/52)=\P(Z\ge2.47)=0.0068\], "very rare". The defense's argument: if \(n\) men could have fired the gun, each has probability \(p=\P(Y\ge270)\doteq\P(Z\ge2.38)=0.0087\) of a count that large, and the number \(X\) with such a count is \(\Bin(n,p)\). The defense computes \[\P(X\ge2\mid X\ge1)=\dfrac{1-(1-p)^n-np(1-p)^{n-1}}{1-(1-p)^n}\], the chance that at least two men match given that at least one does. For \(n=50\) it is \(0.20\); for \(n=100\) it is \(0.37\); for \(n=200\) it is \(0.63\). The book leaves the jury to weigh the two. Filling the gap 4.11 sorts out what each number does and does not say.

Filling the gap 4.11: what the two numbers of Case Study 4.3.2 mean, and the question the jury should ask pp. 251–253

The state's \(0.0068\) is \(\P(\text{count}\ge275\mid\text{innocent random man})\), a statement about the evidence given a person, not the probability that the defendant is innocent given the evidence (confusing the two is the "prosecutor's fallacy"). The defense's quantity is closer to a probability about people, but it still needs care. Take \(n\) suspects with independent matches, each with probability \(p\), \(q=1-p\), and suppose the defendant matches.

Hint 1 of 6: the key idea

The state's number is about the evidence given a random man; the jury needs a probability about people. Which probability about the other suspects is the right one once the defendant matches, and how does Bayes' rule turn the evidence into a probability that the defendant is the source?

Hint 2 of 6: tools you will need
  • Independence of the other \(n-1\) men: their matches are \(\Bin(n-1,p)\).
  • Conditional probability \(\P(X\ge2\mid X\ge1)\).
  • Bayes' rule with a uniform prior over the \(n\) men.
Hint 3 of 6: step 1

Write the book's quantity in terms of \(q=1-p\) and compute it for \(n=50\). Aim for: about 0.20.

Hint 4 of 6: step 2

Compute \(\P(B\ge1)\) for \(B\sim\Bin(n-1,p)\). Why is it larger than the book's number?

Hint 5 of 6: step 3

Give each man prior probability \(1/n\) of being the source. How likely is the evidence (print and defendant both match) if the defendant is the source, and if someone else is? Aim for: \(1/(1+(n-1)p)\).

Hint 6 of 6: step 4

Tabulate the three numbers for \(n=25,50,100,200\) and decide what \(n\) the jury would need to know.

Proof

Let \(B\) be the number of the other \(n-1\) men who match: \(B\sim\Bin(n-1,p)\), independent of the defendant's own count. Three quantities answer three different questions.

(a) The book's. \(\P(X\ge2\mid X\ge1)\), where \(X\) counts matches among all \(n\) and nothing is known about who matches. It equals \(\dfrac{1-q^n-npq^{n-1}}{1-q^n}\).

(b) Another match, given that the defendant matches. \(\P(B\ge1)=1-q^{n-1}\). This is the event the book describes in words ("at least one other person besides the defendant" has such a count), and it is larger than the book's formula (a) because knowing that a particular man matches says nothing about the other \(n-1\), while "\(X\ge1\)" mixes in cases where only someone else matches.

(c) The chance that the defendant is the culprit. Suppose that, before the ridge counts are considered, each of the \(n\) men is equally likely to be the source, and counts are independent of who the source is. The evidence \(E\) is: the source's count is at least 270, and so is the defendant's. If the defendant is the source, \(\P(E)=p\) (one match needed); if another man \(j\) is the source, \(\P(E)=p^2\) (both must match). By Bayes' rule \[ \P(\text{defendant is the source}\mid E)=\frac{\frac1n\,p}{\frac1n\,p+\frac{n-1}n\,p^2}=\frac1{1+(n-1)p}. \] A tempting shortcut, "the source is one of the \(1+B\) matching men, each equally likely", gives \(\E[1/(1+B)]=(1-q^n)/(np)\), which is too large (0.47 instead of 0.36 for \(n=200\)): it forgets that the print's own count is evidence, which favours configurations with more matching men (Balding and Donnelly 1995). With \(p=0.00877\):

\(n\)(a) \(\P(X\ge2\mid X\ge1)\)(b) \(\P(\text{another match})\)(c) \(\P(\text{defendant is the source})\)
250.100.190.83
500.200.350.70
1000.370.580.54
2000.630.830.36

So the evidence is much weaker than "0.0068" suggests when the pool of suspects is large: with 100 possible men the defendant is barely more likely than not to be the source, and with 200 the chance is about one in three. The number that matters is (c), and it depends entirely on \(n\), which no one knows; that, and not arithmetic, is the reason the case is hard. (Table 4.3.2 of the book tabulates (a); it also rounds \(p\) to 0.0087, which changes the entries by less than 0.005.) ∎

Example 4.3.6: the lowest IQ that qualifies for Mensa p. 253

If IQs are \(\N(100,16^2)\), the top 2% are those with \(Y\ge y_L\), where \(\P(Z\ge(y_L-100)/16)=0.02\). The standard normal quantile is \(z_{0.02}=2.054\), so \(y_L=100+16(2.054)=132.9\); the book rounds the table value to 2.05 and answers 133. Figure 4.3.10 marks the cutoff.

A bell curve of IQ centred at 100 with standard deviation 16, the right tail beyond 132.9 shaded red and labelled as the top 2 percent of IQs.
Figure 4.3.10. The Mensa cutoff: the area to the right of \(y_L=132.9\) under the \(\N(100,16^2)\) density is 0.02. Reproduces Larsen and Marx (2018), Figure 4.3.10. Code: ch04_special_distributions.py, fig_4_3_10.

Example 4.3.7: recognising a normal mgf p. 254

If \(M_Y(t)=e^{3t+8t^2}\), compare with \(e^{\mu t+\sigma^2t^2/2}\): \(\mu=3\), \(\sigma^2=16\). By uniqueness (Theorem 3.12.2) \(Y\sim\N(3,16)\) and \[\P(-1\le Y\le9)=\Phi(1.5)-\Phi(-1)=0.9332-0.1587=0.7745\].

Theorem 4.3.3 and Corollaries 4.3.1, 4.3.2 (sums of normal variables) p. 254

If \(Y_1\sim\N(\mu_1,\sigma_1^2)\) and \(Y_2\sim\N(\mu_2,\sigma_2^2)\) are independent then \(Y_1+Y_2\sim\N(\mu_1+\mu_2,\sigma_1^2+\sigma_2^2)\). Consequently (i) the mean \(\bar Y\) of a random sample of size \(n\) from \(\N(\mu,\sigma^2)\) is \(\N(\mu,\sigma^2/n)\), and (ii) if \(Y_1,\dots,Y_n\) are independent \(\N(\mu_i,\sigma_i^2)\) and \(a_i\) are constants, then \(\sum a_iY_i\sim\N(\sum a_i\mu_i,\ \sum a_i^2\sigma_i^2)\).

The book's proof multiplies the mgfs \(e^{\mu_it+\sigma_i^2t^2/2}\) and uses uniqueness; the corollaries follow the same way from \(M_{aY}(t)=M_Y(at)\) (Question 4.3.37). Note that this is an exact statement for every \(n\), unlike the CLT, which is a limit. The graduate course lists it among the sums that stay in their family (Result 2.20), and the first-year normal sample demo uses the sampling law of \(\bar Y\).

Example 4.3.8: ten football players in an elevator pp. 254–255

Weights are \(\N(220,20^2)\); the load limit is 2400. \[\P(\sum_1^{10}Y_i>2400)=\P(\bar Y>240)=\P\bigl(Z>\frac{240-220}{20/\sqrt{10}}\bigr)=\P(Z>3.16)=0.0008\]. (With eleven players the limit per person drops to \(2400/11=218.2\), below the mean, and the probability of an overload is \(0.62\): the book's closing question.)

pp. 255–257 Questions 4.3.21–4.3.39 apply the normal model to tires, test scores, tolerances and sums of independent measurements. Question 4.3.31 (averaging two breath tests) is worked below.

4.4 The Geometric Distribution

p. 257 Run independent trials, each a success with probability \(p\), and let \(X\) be the number of the trial at which the first success occurs. The first \(k-1\) trials must fail and the \(k\)-th succeed, so \[ p_X(k)=(1-p)^{k-1}p,\qquad k=1,2,\dots \tag{4.4.1} \] the geometric law. The probabilities sum to 1: \(p\sum_{j\ge0}(1-p)^j=p/(1-(1-p))=1\).

Example 4.4.1: waiting for a seven pp. 257–258

Two fair dice are thrown until the sum is 7, which has probability \(6/36=\frac16\) on each throw. The chance that more than four throws are needed is \(\P(X>4)=(1-p)^4=(5/6)^4=0.482\) (the book sums \(1-\sum_{k\le4}(5/6)^{k-1}/6\) to get 0.48). In general \(\P(X>j)=(1-p)^j\), the chance that the first \(j\) trials all fail, which gives the cdf \(F_X(t)=1-(1-p)^{\lfloor t\rfloor}\) of Question 4.4.5.

Theorem 4.4.1 (the geometric law) p. 258

For \(p_X(k)=(1-p)^{k-1}p\): (a) \(M_X(t)=\dfrac{pe^t}{1-(1-p)e^t}\) for \(e^t<1/(1-p)\); (b) \(\E X=1/p\); (c) \(\V X=(1-p)/p^2\).

The book refers to Examples 3.12.1 and 3.12.5 for (a) and (b) and leaves (c) as an exercise (Questions 4.4.8 and 4.4.9).

Filling the gap 4.12: the geometric variance, the tail-sum mean and a link to the exponential law p. 258; Questions 4.4.5, 4.4.7, 4.4.9

The variance omitted by the book, and two further facts about the law that make it easy to use.

Hint 1 of 5: the key idea

The geometric probabilities are \(pq^{k-1}\). What operation on the series \(\sum q^k\) produces factors \(k\) and \(k(k-1)\)?

Hint 2 of 5: tools you will need
  • Term-by-term differentiation of a power series inside its radius of convergence.
  • \(\V X=\E[X(X-1)]+\E X-(\E X)^2\).
  • The tail-sum formula (gap 3.9) and memorylessness (gap 3.24).
Hint 3 of 5: step 1

Differentiate \(\sum q^k=(1-q)^{-1}\) once and twice. Aim for: \(\sum kq^{k-1}=p^{-2}\), \(\sum k(k-1)q^{k-2}=2p^{-3}\).

Hint 4 of 5: step 2

Form \(\E X\) and \(\E[X(X-1)]\), then the variance. Aim for: \(q/p^2\).

Hint 5 of 5: step 3

For the exponential link, find \(\P(\lceil Y\rceil>j)\) and compare with \(\P(X>j)=q^j\).

Proof

Mean and variance by differentiating a geometric series. Let \(q=1-p\). For \(|q|<1\), \(\sum_{k\ge0}q^k=(1-q)^{-1}\), and a power series may be differentiated term by term inside its radius of convergence, so \(\sum_{k\ge1}kq^{k-1}=(1-q)^{-2}\) and \(\sum_{k\ge2}k(k-1)q^{k-2}=2(1-q)^{-3}\). Hence \[ \E X=p\sum_{k\ge1}kq^{k-1}=\frac p{p^2}=\frac1p,\qquad \E[X(X-1)]=pq\sum_{k\ge2}k(k-1)q^{k-2}=\frac{2pq}{p^3}=\frac{2q}{p^2}, \] \[ \V X=\E[X(X-1)]+\E X-(\E X)^2=\frac{2q}{p^2}+\frac1p-\frac1{p^2}=\frac{2q+p-1}{p^2}=\frac q{p^2}. \] The tail-sum mean. Since \(\P(X>j)=q^j\), the formula \(\E X=\sum_{j\ge0}\P(X>j)\) (Filling the gap 3.9) gives \(\sum_jq^j=1/p\) at once.

A geometric law inside every exponential law. If \(Y\) is exponential with rate \(\lambda\), then \(\lceil Y\rceil\) (the number of the unit interval in which \(Y\) falls) satisfies \(\P(\lceil Y\rceil>j)=\P(Y>j)=e^{-\lambda j}=(e^{-\lambda})^j\), which is the geometric tail with \(1-p=e^{-\lambda}\): \(\lceil Y\rceil\) is geometric with \(p=1-e^{-\lambda}\), as in Question 4.4.7. Both laws have the memoryless property, and each is the only law on its range that has it (Filling the gap 3.24). The graduate course treats the geometric law in Result 2.6. ∎

Example 4.4.2: collecting the letters of VALUES pp. 258–259

Each purchase gives one of six letters at random, and a customer needs all six. Let \(X_i\) be the number of purchases needed to get the \(i\)-th new letter after the \((i-1)\)-th; once \(i-1\) letters are held, each purchase is new with probability \(p_i=(7-i)/6\), so \(X_i\) is geometric with that \(p_i\) and \(\E X_i=6/(7-i)\). The total number of purchases is \(X=X_1+\cdots+X_6\) and \[ \E X=1+\tfrac65+\tfrac64+\tfrac63+\tfrac62+\tfrac61=14.7. \]

Filling the gap 4.13: the coupon collector: independent stages, the variance and a tail bound pp. 258–259

The book adds the six means without saying why \(X\) is a sum of independent geometric variables (needed for the variance, not for the mean), and stops at the expectation. For \(m\) equally likely letters the stage success probabilities are \(p_i=(m-i+1)/m\).

Hint 1 of 5: the key idea

Each stage of the collection starts afresh, with a success probability that does not depend on which letters you hold. What does that say about the joint law of the stage lengths?

Hint 2 of 5: tools you will need
  • The chain rule for conditional probabilities.
  • Mean and variance of a geometric variable (Theorem 4.4.1) and variances of independent sums.
  • The union bound and \((1-1/m)^t\le e^{-t/m}\).
Hint 3 of 5: step 1

Condition on the history up to the start of stage \(i\). Aim for: a joint probability that is a product of geometric probabilities, so stages are independent.

Hint 4 of 5: step 2

Add means and variances with \(p_i=(m-i+1)/m\). Aim for: \(mH_m\) and \(m^2\sum j^{-2}-mH_m\); evaluate for \(m=6\).

Hint 5 of 5: step 3

For a tail bound, bound the probability that a given letter is still missing after \(t\) purchases, then take the union over letters; choose \(t=m\ln m+cm\).

Proof

Independence. Condition on everything that happened up to the moment the \((i-1)\)-th distinct letter arrives. From then on every purchase is a letter already held with probability \((i-1)/m\), whichever letters those are, and a new letter with probability \(p_i\). So, by the chain rule for conditional probabilities, \[ \P(X_1=x_1,\dots,X_m=x_m)=\prod_{i=1}^m\Bigl(\frac{i-1}m\Bigr)^{x_i-1}\frac{m-i+1}m, \] a product of geometric probability functions: the stage lengths are independent and \(X_i\sim\Geom(p_i)\).

Mean and variance. By Theorem 4.4.1, \(\E X=\sum_i1/p_i=m\sum_{j=1}^m\frac1j=mH_m\) (the harmonic number), and by independence \[ \V X=\sum_i\frac{1-p_i}{p_i^2}=m^2\sum_{j=1}^m\frac1{j^2}-mH_m. \] For \(m=6\): \(\E X=14.7\), \(\V X=36(1.4914)-14.7=38.99\), standard deviation \(6.24\). A customer needs about 15 purchases on average, but 25 or more is quite possible.

A tail bound. After \(t\) purchases the probability that a particular letter has never appeared is \((1-1/m)^t\le e^{-t/m}\). If some letter is missing then the collection is incomplete, so by the union bound \(\P(X>t)\le m\,e^{-t/m}\). Taking \(t=m\ln m+cm\) gives \(\P(X>m\ln m+cm)\le e^{-c}\). For \(m=6\) and 95% assurance take \(c=\ln20\): the bound says 29 purchases suffice with probability at least 0.95; the exact probability (inclusion–exclusion over the sets of missing letters) that 29 purchases are not enough is \(0.0302\). ∎

p. 259 Questions 4.4.1–4.4.10 are about the geometric law and its mgf. Question 4.4.6 (three dice) is worked below.

4.5 The Negative Binomial Distribution

pp. 259–260 Now wait for the \(r\)-th success. The \(r\)-th success occurs at trial \(k\) if exactly \(r-1\) of the first \(k-1\) trials succeed and trial \(k\) does: \[ p_X(k)=\binom{k-1}{r-1}p^r(1-p)^{k-r},\qquad k=r,r+1,\dots \tag{4.5.1} \] This is the negative binomial law with parameters \(r\) and \(p\); for \(r=1\) it is geometric. Two other definitions are in use, counting the failures before the \(r\)-th success or the trials in excess of \(r\); they are the same law shifted (Filling the gap 4.14, Questions 4.5.6 and 4.5.7).

Theorem 4.5.1 (the negative binomial law) pp. 260–261

For \(p_X(k)\) as in (4.5.1): (a) \(M_X(t)=\bigl[\dfrac{pe^t}{1-(1-p)e^t}\bigr]^r\); (b) \(\E X=r/p\); (c) \(\V X=r(1-p)/p^2\).

The book's proof writes \(X=X_1+\dots+X_r\), the sum of the waiting times for the first success and for each next one, each geometric with parameter \(p\), and multiplies mgfs and adds means and variances. That the \(X_i\) are independent is asserted, not shown.

Filling the gap 4.14: the waiting times between successes are independent geometric variables; the other forms of the law pp. 260–261; Questions 4.5.5–4.5.7

The proof of Theorem 4.5.1 rests on one unproved claim. Let \(G_1\) be the trial of the first success and \(G_i\) the number of further trials needed for the \(i\)-th success after the \((i-1)\)-th, so that \(X=G_1+\cdots+G_r\).

Hint 1 of 5: the key idea

The first \(g_1+\dots+g_r\) trials form one specific sequence of failures and successes. What is its probability, and what does that say about the gaps?

Hint 2 of 5: tools you will need
  • Independence of the trials; the geometric probability function.
  • Counting compositions of \(k\) into \(r\) positive parts.
  • The mgf of a sum of independent variables (Theorem 3.12.3).
Hint 3 of 5: step 1

Compute \(\P(G_1=g_1,\dots,G_r=g_r)\). Aim for: a product of \(r\) geometric probabilities.

Hint 4 of 5: step 2

Sum over compositions of \(k\). Aim for: \(\binom{k-1}{r-1}p^rq^{k-r}\).

Hint 5 of 5: step 3

For the failures form \(Y=X-r\), find its probability function, mean, variance and mgf, and explain the word 'negative'.

Proof

Independence. For positive integers \(g_1,\dots,g_r\), the event \(\{G_1=g_1,\dots,G_r=g_r\}\) says that the first \(g_1+\cdots+g_r\) trials form one particular sequence: \(g_1-1\) failures, a success, \(g_2-1\) failures, a success, and so on. That sequence has probability \(\prod_i(1-p)^{g_i-1}p\), a product of geometric probability functions. So \(G_1,\dots,G_r\) are independent, each \(\Geom(p)\), and Theorem 4.4.1 with \(M_X=M_{G_1}\cdots M_{G_r}\) proves (a), (b), (c).

The probability function again. Summing the displayed probability over all \((g_1,\dots,g_r)\) with sum \(k\): each of the \(\binom{k-1}{r-1}\) ways to cut \(k\) into \(r\) positive parts has probability \(p^r(1-p)^{k-r}\), so \(\P(X=k)=\binom{k-1}{r-1}p^r(1-p)^{k-r}\), which is (4.5.1). This also shows the probabilities add to 1, because the \(G_i\) are finite with probability 1. (Equivalently, \((1-q)^{-r}=\sum_{j\ge0}\binom{j+r-1}jq^j\) for \(|q|<1\): multiply \(r\) copies of \(\sum_jq^j\) and count the ways to write \(j\) as an ordered sum of \(r\) nonnegative integers.)

Other forms. Let \(Y=X-r\) be the number of failures before the \(r\)-th success. Then \(p_Y(j)=\binom{j+r-1}{j}p^r(1-p)^j\), \(j=0,1,\dots\) (Question 4.5.6), \(\E Y=r(1-p)/p\), \(\V Y=r(1-p)/p^2\) and \(M_Y(t)=e^{-rt}M_X(t)=\bigl[\dfrac p{1-(1-p)e^t}\bigr]^r\) (Question 4.5.7). The name comes from \(\binom{j+r-1}j=(-1)^j\binom{-r}j\), the coefficient in the binomial series with a negative exponent. Sums: if \(X_1,\dots,X_k\) are independent with parameters \((r_1,p),\dots,(r_k,p)\), the mgfs multiply to a negative binomial mgf with \(r=\sum r_i\): the law is closed under sums with a common \(p\) (Question 4.5.10; see Question 4.5.8). ∎

Example 4.5.1: the California Mellows pp. 261–263

The Mellows never swing, and the pitcher throws a strike with probability \(\tfrac12\). A batter strikes out if he sees three strikes before four balls; the pitch \(X\) on which that happens has \(\P(X=k)=\binom{k-1}2(\tfrac12)^k\), \(k=3,\dots,6\), so \[ \P(\text{strikeout})=\tfrac18+\tfrac3{16}+\tfrac6{32}+\tfrac{10}{64}=\tfrac{21}{32}. \] Otherwise the batter walks. In an inning the three outs are the successes in independent trials with success probability \(21/32\); so the number of batters facing the pitcher is \(T=W+3\), negative binomial with \(r=3\), \(p=21/32\), where \(W\) is the number of walks. Then \(\E W=\E T-3=\frac{3\cdot32}{21}-3=\frac{11}7\). A run scores only when a walk is issued with the bases loaded, so the runs in an inning are \(R=(W-3)^+\), and \(\E R=0.2026\) per inning (the book prints 0.202), \(9\times0.2026=1.82\) per game. Filling the gap 4.15 evaluates the infinite sum.

Filling the gap 4.15: the expected number of runs per inning, step by step pp. 261–263

The book writes \(\E R=\sum_{w\ge4}(w-3)p_W(w)\) and rearranges to equation (4.5.2); the rearrangement avoids summing the series, by using a known mean.

Hint 1 of 5: the key idea

Split \((W-3)^+\) into something whose mean you already know and a finite sum. What identity does that?

Hint 2 of 5: tools you will need
  • \(x^+=x+(-x)^+\).
  • Mean of a negative binomial variable and the shift \(T=W+3\).
  • The probability function \(p_W(w)=\binom{w+2}2q^3(1-q)^w\).
Hint 3 of 5: step 1

Write \(\E R=\E W-3+\E(3-W)^+\). Aim for: \(\E W=11/7\).

Hint 4 of 5: step 2

Evaluate \(\sum_{w=0}^2(3-w)p_W(w)\) with \(q=21/32\). Aim for: about 1.631.

Hint 5 of 5: step 3

Combine and multiply by 9 for a game. What does the model ignore?

Proof

For any \(w\), \((w-3)^+=(w-3)+(3-w)^+\), so \(\E R=\E W-3+\E(3-W)^+\). The first part is \(\frac{11}7-3=-\frac{10}7\), found from the mean of the negative binomial law. The last part is a finite sum because \((3-w)^+\) vanishes for \(w\ge3\): \[ \E(3-W)^+=\sum_{w=0}^2(3-w)\,p_W(w),\qquad p_W(w)=\binom{w+2}2q^3(1-q)^w,\quad q=\tfrac{21}{32}. \] With \(q^3=0.28262\) and \(1-q=0.34375\): \(p_W(0)=0.28262\), \(p_W(1)=3q^3(1-q)=0.29145\), \(p_W(2)=6q^3(1-q)^2=0.20038\); so \(\E(3-W)^+=3(0.28262)+2(0.29145)+0.20038=1.63114\) and \[ \E R=-1.42857+1.63114=0.2026\approx0.203. \] (The book prints 0.202, a truncation of 0.2026; the sum evaluated directly to \(w=600\) agrees with 0.2026.) For nine innings, which are independent and identical, \(\E=9(0.2026)=1.82\) runs. What the model leaves out: the batter's probability of striking out is the same for all batters and the pitcher never changes, assumptions that suit a game of chance more than baseball; the example is an exercise in combining the negative binomial law with a "positive part", not a baseball model. ∎

Case Study 4.5.1: generating random observations by hand pp. 263–266

To simulate the walks in 100 innings, hand each value of \(W\) a block of the two-digit numbers \(00,\dots,99\) whose size is \(100\,p_W(w)\), rounded: \(w=0\) gets 00–27, \(w=1\) gets 28–56, \(w=2\) gets 57–76, \(w=3\) gets 77–87, \(w=4\) gets 88–93, \(w=5\) gets 94–96, \(w=6,7\) get 97 and 98 and the remaining number 99 stands for eight or more (Table 4.5.1). Reading a table of random digits then produces observations from \(p_W\). Figure 4.5.4 does this with a computer's random digits. The same idea works for continuous laws, with a transformation of uniform numbers in place of a table; see Filling the gap 4.16.

Bars of the proportion of 100 simulated innings with w walks, for w from 0 to 8, beside red points on the negative binomial probabilities, which fall from 0.29 at w equal 1 to near zero at 8; the bars follow the points roughly, with random scatter.
Figure 4.5.4. The numbers of walks in 100 simulated innings (blocks of random digits as in Table 4.5.1) against the negative binomial probability function \(p_W\). Reproduces Larsen and Marx (2018), Figure 4.5.4 (our own random sample; with only 100 innings the bars scatter around the points). Code: ch04_special_distributions.py, fig_4_5_4.

Filling the gap 4.16: generating random numbers: the exponential, the discrete table and the sum of twelve uniforms pp. 264–266

The book gives three recipes without proof: \(-(1/\lambda)\ln U\) for the exponential law, a table lookup for a discrete law, and \(\sum_1^{12}U_i-6\) for the normal law. Here is why the first two are exact, why the third is only an approximation, and an exact alternative.

Hint 1 of 5: the key idea

If \(U\) is uniform, which function of \(U\) has a given cdf \(F\)? And what is wrong with a sum of twelve uniforms as a normal variable?

Hint 2 of 5: tools you will need
  • The generalised inverse of a cdf (Result 2.4).
  • Mean and variance of a uniform variable; cumulants add for independent sums.
  • Polar coordinates (gap 4.6).
Hint 3 of 5: step 1

Show \(\P(F^{-1}(U)\le y)=F(y)\). Aim for: the exponential recipe and the table lookup as special cases.

Hint 4 of 5: step 2

For twelve uniforms find the mean, variance, support and fourth cumulant. Aim for: bounded by \(\pm6\), lighter tails.

Hint 5 of 5: step 3

For an exact method, show that for independent normal \(X,Y\) the angle is uniform and \(R^2\) is exponential.

Proof

Inverse cdf. If \(U\) is uniform on \((0,1)\) and \(F\) is a cdf with generalised inverse \(F^{-1}(u)=\min\{y:F(y)\ge u\}\), then \(\P(F^{-1}(U)\le y)=\P(U\le F(y))=F(y)\), so \(F^{-1}(U)\) has cdf \(F\) (see Result 2.4 of the graduate course and its inverse-cdf demo, preset 3 for a Poisson law). For the exponential law \(F(y)=1-e^{-\lambda y}\), \(F^{-1}(u)=-\ln(1-u)/\lambda\), and since \(1-U\) is also uniform one may use \(-\ln U/\lambda\): \(\P(-\ln U/\lambda>y)=\P(U<e^{-\lambda y})=e^{-\lambda y}\). For a discrete law, \(F^{-1}\) is a step function whose steps are the blocks of Table 4.5.1; with two-digit numbers the block sizes are rounded to hundredths, so the table reproduces \(p_W\) only to about \(\pm0.005\) (use more digits for more accuracy).

Twelve uniforms. For \(U_i\sim\mathrm{Uniform}(0,1)\), \(\E U_i=\frac12\) and \(\V U_i=\frac1{12}\), so \(Z'=\sum_1^{12}U_i-6\) has mean 0 and variance \(12/12=1\). By the central limit theorem it is nearly standard normal, but it cannot be exactly normal: it is bounded by \(\pm6\), and its fourth cumulant is \(12\cdot(-\frac1{120})=-0.1\), so its tails are lighter. Exactly (Irwin–Hall), \(\P(|Z'|>3)=0.0020\) against \(0.0027\) for \(Z\), and \(\P(Z'>4)=8.5\times10^{-6}\) against \(3.2\times10^{-5}\). For simulations in which tails matter this is a visible defect.

An exact method. Let \(X,Y\) be independent \(\N(0,1)\). Their joint density \(e^{-(x^2+y^2)/2}/(2\pi)\) depends only on \(r^2=x^2+y^2\); in polar coordinates (Filling the gap 4.6) the angle \(\Theta\) is uniform on \((0,2\pi)\) and independent of \(R\), and \(\P(R^2>s)=\int_{\sqrt s}^\infty re^{-r^2/2}dr=e^{-s/2}\), so \(R^2\) is exponential with rate \(\frac12\). Hence \(R=\sqrt{-2\ln U_1}\), \(\Theta=2\pi U_2\), and \(Z=R\cos\Theta\), \(Z^*=R\sin\Theta\) are two independent standard normal variables (the Box–Muller transform), generated from two uniform numbers by the two exact recipes above. ∎

p. 266 Questions 4.5.1–4.5.10 include recognising a fabricated data set (4.5.3, whose counts match the negative binomial probabilities too well). Question 4.5.8 (a sum of three negative binomial variables) is worked below.

4.6 The Gamma Distribution

pp. 267–268 Section 4.2 gave the waiting time for the next Poisson event, exponential with rate \(\lambda\). The waiting time for the \(r\)-th event is the continuous analogue of the negative binomial variable of Section 4.5.

Theorem 4.6.1 (waiting time for the \(r\)-th event) p. 267

If events occur according to the Poisson model at rate \(\lambda\), the waiting time \(Y\) for the \(r\)-th event has density \[ f_Y(y)=\frac{\lambda^r}{(r-1)!}\,y^{r-1}e^{-\lambda y},\qquad y>0. \]

The book's proof: \(Y>y\) exactly when fewer than \(r\) events occur in \([0,y]\), so \(F_Y(y)=1-\sum_{k=0}^{r-1}e^{-\lambda y}(\lambda y)^k/k!\); differentiating, the sum telescopes to leave \(f_Y\).

Filling the gap 4.17: the gamma cdf is a Poisson tail, proved directly; the fuel pumps pp. 267–268

The book's proof differentiates the Poisson tail sum and watches it telescope. The identity behind it can be checked without any waiting-time picture, as a statement about two named distributions: for an integer \(r\ge1\), \[ \P(\text{Gamma}(r,\lambda)\le y)=\P(\text{Poisson}(\lambda y)\ge r)=1-\sum_{k=0}^{r-1}\frac{e^{-\lambda y}(\lambda y)^k}{k!}. \]

Hint 1 of 5: the key idea

Is the gamma cdf a Poisson tail? Treat it as a statement about two named distributions, and look for an antiderivative of \(f_r-f_{r-1}\).

Hint 2 of 5: tools you will need
  • Differentiating \(e^{-\lambda t}(\lambda t)^{r-1}/(r-1)!\).
  • Induction on \(r\).
  • The Poisson-process picture (gap 4.5).
Hint 3 of 5: step 1

Differentiate \(-e^{-\lambda t}(\lambda t)^{r-1}/(r-1)!\). Aim for: \(f_r(t)-f_{r-1}(t)\).

Hint 4 of 5: step 2

Integrate over \([0,y]\) and use induction from \(G_1=1-e^{-\lambda y}\). Aim for: the Poisson tail.

Hint 5 of 5: step 3

Apply to the fuel pumps: \(r=2\), \(\lambda y=0.5\).

Proof

Write \(f_r(t)=\lambda(\lambda t)^{r-1}e^{-\lambda t}/(r-1)!\) for the gamma density with integer shape \(r\) and \(G_r(y)=\int_0^yf_r\). For \(r\ge2\), \[ \frac{d}{dt}\Bigl[-\frac{e^{-\lambda t}(\lambda t)^{r-1}}{(r-1)!}\Bigr]=\frac{\lambda e^{-\lambda t}(\lambda t)^{r-1}}{(r-1)!}-\frac{\lambda e^{-\lambda t}(\lambda t)^{r-2}}{(r-2)!}=f_r(t)-f_{r-1}(t). \] Integrating over \([0,y]\) (the bracket vanishes at \(t=0\) when \(r\ge2\)) gives \(G_r(y)-G_{r-1}(y)=-e^{-\lambda y}(\lambda y)^{r-1}/(r-1)!\). With \(G_1(y)=1-e^{-\lambda y}\) and induction, \(G_r(y)=1-\sum_{k=0}^{r-1}e^{-\lambda y}(\lambda y)^k/k!\). Differentiating returns \(f_r\), which is the book's calculation, so Theorem 4.6.1 follows from the Poisson law of counts and is consistent with the independent-gaps description of Filling the gap 4.5: the waiting time for the \(r\)-th event is a sum of \(r\) independent exponential gaps, an Erlang law (Filling the gap 3.16), and the two routes agree. ∎

Example 4.6.1 (two fuel pumps). One pump runs, the other is a spare; pumps fail at rate \(\lambda=0.01\) per hour. The system fails before 50 hours when the second failure comes by then: \(r=2\), \(\lambda y=0.5\), \[ \P(Y\le50)=1-e^{-0.5}(1+0.5)=0.0902, \] which is the book's \(\int_0^{0.5}ue^{-u}du=(1-1.5e^{-0.5})=0.09\). A single pump would fail within 50 hours with probability \(1-e^{-0.5}=0.393\): the spare cuts the risk by a factor of 4.4.

pp. 268–269 Generalising the shape. Nothing in the density needs \(r\) to be an integer, provided \((r-1)!\) is replaced by Euler's gamma function \(\Gamma(r)=\int_0^\infty y^{r-1}e^{-y}dy\), finite for every real \(r>0\) (the integrand is integrable at 0 because \(r>0\) and at \(\infty\) because of \(e^{-y}\)).

Definition 4.6.1, Theorem 4.6.2 and Definition 4.6.2 (the gamma function and the gamma law) pp. 268–269

(a) \(\Gamma(1)=1\); (b) \(\Gamma(r)=(r-1)\Gamma(r-1)\) for \(r>1\); (c) \(\Gamma(r)=(r-1)!\) for integer \(r\). The gamma law with shape \(r>0\) and rate \(\lambda>0\) has density \(f_Y(y)=\dfrac{\lambda^r}{\Gamma(r)}y^{r-1}e^{-\lambda y}\), \(y\ge0\). The substitution \(u=\lambda y\) shows it integrates to 1.

Filling the gap 4.18: \(\Gamma(r)=(r-1)!\), \(\Gamma(\frac12)=\sqrt\pi\), and the chi-square law pp. 269–271; Questions 4.6.6, 4.6.7

The book leaves part (c) of Theorem 4.6.2 as an exercise, and later uses without comment that \(\Gamma(\frac12)=\sqrt\pi\) (Question 4.6.6) and that the chi-square law is a gamma law.

Hint 1 of 6: the key idea

Part (c) is an induction built on part (b); and \(\Gamma(1/2)\) can be read off the density of \(Z^2\). Why?

Hint 2 of 6: tools you will need
  • Integration by parts for \(\Gamma(r)\).
  • The cdf method for \(W=Z^2\).
  • A density integrates to 1, so normalising constants must agree.
Hint 3 of 6: step 1

Prove (b) by parts, then (c) by induction.

Hint 4 of 6: step 2

Find \(f_{Z^2}\) from \(2\Phi(\sqrt w)-1\). Aim for: \((2\pi)^{-1/2}w^{-1/2}e^{-w/2}\).

Hint 5 of 6: step 3

Compare it with the gamma density with \(r=\lambda=\tfrac12\) and equate constants. Aim for: \(\Gamma(1/2)=\sqrt\pi\).

Hint 6 of 6: step 4

Why is a sum of \(m\) squared normals Gamma\((m/2,1/2)\)? (Use gap 4.20.)

Proof

(c) by induction. \(\Gamma(1)=1=0!\). If \(\Gamma(n)=(n-1)!\), then by (b) \(\Gamma(n+1)=n\Gamma(n)=n\cdot(n-1)!=n!\). Part (b) is integration by parts: \(\int_0^\infty y^{r-1}e^{-y}dy=[-y^{r-1}e^{-y}]_0^\infty+(r-1)\int_0^\infty y^{r-2}e^{-y}dy\), the boundary term vanishing for \(r>1\).

\(\Gamma(\frac12)\). Let \(Z\) be standard normal and \(W=Z^2\). For \(w>0\), \(\P(W\le w)=\P(-\sqrt w\le Z\le\sqrt w)=2\Phi(\sqrt w)-1\); differentiating, \[ f_W(w)=2\phi(\sqrt w)\frac1{2\sqrt w}=\frac1{\sqrt{2\pi}}\,w^{-1/2}e^{-w/2},\qquad w>0. \] This has the form of a gamma density with \(r=\frac12\) and \(\lambda=\frac12\), whose normalising constant is \((\frac12)^{1/2}/\Gamma(\frac12)\). Both densities integrate to 1 and have the same shape, so the constants agree: \(\dfrac1{\sqrt2\,\Gamma(1/2)}=\dfrac1{\sqrt{2\pi}}\), i.e. \(\Gamma(\frac12)=\sqrt\pi\). Then \(\Gamma(\frac72)=\frac52\cdot\frac32\cdot\frac12\sqrt\pi=\frac{15}8\sqrt\pi\) (Question 4.6.7).

The chi-square law. The book remarks (p. 271) that the \(\chi^2\) distribution with \(m\) degrees of freedom is the gamma law with \(r=m/2\), \(\lambda=\frac12\). Indeed \(Z^2\) is Gamma\((\frac12,\frac12)\) by the computation above, and the sum of \(m\) independent such variables is Gamma\((\frac m2,\frac12)\) by the additivity of the shape (Filling the gap 4.20); that sum, \(Z_1^2+\cdots+Z_m^2\), is what \(\chi^2_m\) means. The mean and variance are \(m\) and \(2m\) (Theorem 4.6.3). The first-year advanced notes and Result 2.10 of the graduate course use this law. ∎

Theorem 4.6.3 (mean and variance of the gamma law) p. 269

If \(Y\) is gamma with shape \(r\) and rate \(\lambda\), then \(\E Y=r/\lambda\) and \(\V Y=r/\lambda^2\).

The book proves \(\E Y=r/\lambda\) by recognising a gamma integral and says that \(\E Y^2=r(r+1)/\lambda^2\) follows by "a similar calculation".

Filling the gap 4.19: all moments of the gamma law, its mgf, scale and mode pp. 269–271; Questions 4.6.4, 4.6.5, 4.6.8–4.6.10

One computation gives every moment, including the omitted second one.

Hint 1 of 5: the key idea

One integral \(\int y^{r+m-1}e^{-\lambda y}dy\) gives every moment. Which substitution evaluates it?

Hint 2 of 5: tools you will need
  • \(u=\lambda y\) and the definition of \(\Gamma\).
  • \(\Gamma(r+1)=r\Gamma(r)\).
  • Derivative of the log density for the mode.
Hint 3 of 5: step 1

Compute \(\E Y^m\) for real \(m>-r\). Aim for: \(\Gamma(r+m)/(\Gamma(r)\lambda^m)\).

Hint 4 of 5: step 2

Specialise to \(m=1,2\) and form the variance. Aim for: \(r/\lambda^2\).

Hint 5 of 5: step 3

Find the mgf on \(t<\lambda\), show \(\lambda Y\) is Gamma\((r,1)\), and locate the mode \((r-1)/\lambda\).

Proof

Moments. For every real \(m>-r\), \[ \E Y^m=\int_0^\infty y^m\frac{\lambda^r}{\Gamma(r)}y^{r-1}e^{-\lambda y}dy=\frac{\lambda^r}{\Gamma(r)}\cdot\frac{\Gamma(r+m)}{\lambda^{r+m}}=\frac{\Gamma(r+m)}{\Gamma(r)\,\lambda^m}, \] because \(\int_0^\infty y^{r+m-1}e^{-\lambda y}dy=\Gamma(r+m)/\lambda^{r+m}\) (substitute \(u=\lambda y\)). With \(m=1,2\) and \(\Gamma(r+1)=r\Gamma(r)\): \(\E Y=r/\lambda\), \(\E Y^2=r(r+1)/\lambda^2\), hence \(\V Y=r(r+1)/\lambda^2-r^2/\lambda^2=r/\lambda^2\). For an integer \(m\) this is \((m+r-1)!/((r-1)!\lambda^m)\) (Question 4.6.8), and for negative \(m\) it gives, for example, \(\E(1/Y)=\lambda/(r-1)\) when \(r>1\).

The mgf. For \(t<\lambda\), \(M_Y(t)=\frac{\lambda^r}{\Gamma(r)}\int_0^\infty y^{r-1}e^{-(\lambda-t)y}dy=\bigl(\frac{\lambda}{\lambda-t}\bigr)^r=(1-t/\lambda)^{-r}\); for \(t\ge\lambda\) the integral diverges. Then \(M_Y'(0)=r/\lambda\) and \(M_Y''(0)=r(r+1)/\lambda^2\), as above (Question 4.6.9).

Scale and mode. If \(c>0\), then \(\P(cY\le y)=\P(Y\le y/c)\) has density \(\frac1cf_Y(y/c)\), the gamma density with the same shape \(r\) and rate \(\lambda/c\); so \(\lambda Y\) is Gamma\((r,1)\) and \(\lambda\) is a pure scale parameter (Question 4.6.4). For \(r>1\) the logarithm of the density is \((r-1)\ln y-\lambda y+\text{const}\), with derivative \((r-1)/y-\lambda\), positive below \((r-1)/\lambda\) and negative above, so the unique mode is \((r-1)/\lambda\) (Question 4.6.5); for \(r\le1\) the density is decreasing. Finally, the skewness is \(\E(Y-\mu)^3/\sigma^3=2/\sqrt r\) (from the third cumulant \(2r/\lambda^3\)), which tends to 0: for large \(r\) the gamma law is close to normal, as it must be, since a Gamma\((r,\lambda)\) variable is a sum of \(r\) independent exponential variables. Figure x4.2(a) shows the family. ∎

Two panels. (a) Gamma densities with rate 1 and shapes 0.5, 1, 2, 5 and 10: the shape 0.5 curve is unbounded at 0, the shape 1 curve decays from 1, and the others are humps whose peaks move right and flatten as the shape grows. (b) A histogram of 40000 simulated times of the third event of a unit-rate Poisson process with the red curve y squared over 2 times e to the minus y, which fits it.
Figure x4.2 (own figure). (a) The gamma density with rate 1 for several shapes \(r\): decreasing for \(r\le1\), a hump with mode \(r-1\) for \(r>1\), more symmetric as \(r\) grows. (b) The simulated waiting time for the third event of a Poisson process with rate 1 (sum of three exponential gaps) against the Gamma\((3,1)\) density of Theorem 4.6.1. Code: ch04_special_distributions.py, fig_x4_2.

Theorems 4.6.4 and 4.6.5 (sums of gamma variables; the mgf) pp. 269–270

If \(U\sim\mathrm{Gamma}(r,\lambda)\) and \(V\sim\mathrm{Gamma}(s,\lambda)\) are independent (same rate), then \(U+V\sim\mathrm{Gamma}(r+s,\lambda)\). The mgf of Gamma\((r,\lambda)\) is \((1-t/\lambda)^{-r}\).

The book proves the first by the convolution integral, which leads to \(e^{-\lambda t}\lambda^{r+s}t^{r+s-1}c\) with a Beta-type integral \(c\), and identifies \(c=1/\Gamma(r+s)\) because the result must integrate to 1. That also yields the Beta integral \(\int_0^1v^{r-1}(1-v)^{s-1}dv=\Gamma(r)\Gamma(s)/\Gamma(r+s)\) as a by-product.

Filling the gap 4.20: the sum and the ratio of two gamma variables are independent, and the Beta integral pp. 269–270

A change of variables gives more than the book's convolution: the sum \(T=U+V\) and the share \(B=U/(U+V)\) are independent, \(T\) is Gamma\((r+s,\lambda)\) and \(B\) has the Beta\((r,s)\) density \(\dfrac{\Gamma(r+s)}{\Gamma(r)\Gamma(s)}b^{r-1}(1-b)^{s-1}\) on \((0,1)\).

Hint 1 of 5: the key idea

A bijection from \((u,v)\) to the sum and the share \((t,b)\) makes the joint density factorise. What is the Jacobian?

Hint 2 of 5: tools you will need
  • The Jacobian formula for two variables (Section 3.8).
  • Factorisation means independence (Theorem 3.7.4).
  • Normalising constants of gamma and beta densities.
Hint 3 of 5: step 1

Use \(u=tb\), \(v=t(1-b)\). Aim for: Jacobian \(t\).

Hint 4 of 5: step 2

Multiply the two gamma densities and the Jacobian. Aim for: a function of \(t\) times a function of \(b\).

Hint 5 of 5: step 3

Identify the two factors and equate constants to get the Beta integral.

Proof

The map \((u,v)\mapsto(t,b)=(u+v,\,u/(u+v))\) is a bijection from \((0,\infty)^2\) to \((0,\infty)\times(0,1)\) with inverse \(u=tb\), \(v=t(1-b)\) and Jacobian \(\bigl|\partial(u,v)/\partial(t,b)\bigr|=t\) (Section 3.8). By independence the joint density of \((U,V)\) is the product of the two gamma densities, so \[ f_{T,B}(t,b)=\frac{\lambda^r(tb)^{r-1}e^{-\lambda tb}}{\Gamma(r)}\cdot\frac{\lambda^s(t(1-b))^{s-1}e^{-\lambda t(1-b)}}{\Gamma(s)}\cdot t=\Bigl[\frac{\lambda^{r+s}t^{r+s-1}e^{-\lambda t}}{\Gamma(r)\Gamma(s)}\Bigr]b^{r-1}(1-b)^{s-1}. \] It factorises into a function of \(t\) times a function of \(b\), so \(T\) and \(B\) are independent (Theorem 3.7.4). The \(t\)-factor is proportional to the Gamma\((r+s,\lambda)\) density, which proves Theorem 4.6.4, and its integral is \(\Gamma(r+s)/\Gamma(r)\Gamma(s)\) times that of the Gamma density, i.e. the \(b\)-factor must integrate to \(\Gamma(r)\Gamma(s)/\Gamma(r+s)\): this is the Beta integral, now proved rather than assumed. The second proof of Theorem 4.6.4 is by mgfs: \((1-t/\lambda)^{-r}(1-t/\lambda)^{-s}=(1-t/\lambda)^{-(r+s)}\) and uniqueness. ∎

Consequences. A sum of \(r\) independent exponential variables with a common rate is Gamma\((r,\lambda)\) (the Erlang law; the \(r\)-th arrival time of Theorem 4.6.1); a sum of \(m\) independent squares of standard normals is \(\chi^2_m=\)Gamma\((\frac m2,\frac12)\); a chi-square variable divided by a sum of two independent ones is Beta (used in Chapter 7). The independence of \(T\) and \(B\) is special to the gamma family (a theorem of Lukacs, 1955).

p. 271 Questions 4.6.1–4.6.10 include the pdf of a sum of exponential lifetimes (4.6.1), the unique mode (4.6.5) and \(\Gamma(\frac12)\) (4.6.6). Question 4.6.3 (finding a gamma law from its mean and variance) is worked below.

4.7 Taking a Second Look at Statistics (Monte Carlo Simulations)

pp. 271–274 Many questions are too tangled for a formula: the answer depends on a random number of random quantities, or on a rule that cuts across them. A Monte Carlo study draws the random ingredients from their laws on a computer, computes the quantity of interest for each draw, repeats many times, and summarises the results by a histogram or a mean. The book's example is an extended warranty on a television, priced at \(\$200\), covering all repairs in the first two years. Repairs are needed at rate 0.75 per year and each costs a normal amount with mean \(\$100\) and standard deviation \(\$20\). Is the warranty a good buy?

The recipe: repair times are Poisson events at rate \(\lambda=0.75\) per year, so the intervals between them are exponential with density \(0.75e^{-0.75y}\) (Figure 4.7.1, Theorem 4.2.3); the cost of each repair is \(\N(100,20^2)\) (Figure 4.7.2). To simulate one customer, draw exponential gaps and add them until the total passes two years; for each gap that ends before then, draw a cost; the sum of those costs is one simulated two-year bill. Figure 4.7.6 repeats this for 100 customers. In the book's 100 runs the median bill was \(\$117.00\) and the mean \(\$159.10\), 24% of the customers had no repair at all, 33% paid more than \(\$200\), and 6% more than \(\$400\). Our own 100 runs give the figure below.

A decreasing exponential curve starting at 0.75 at y equal 0 and falling to near 0.01 at y equal 6 years.
Figure 4.7.1. The density \(0.75\,e^{-0.75y}\) of the time in years between two repairs. Reproduces Larsen and Marx (2018), Figure 4.7.1. Code: ch04_special_distributions.py, fig_4_7_1.
A bell curve centred at 100 with standard deviation 20, marked at 40, 100 and 160 dollars.
Figure 4.7.2. The normal density of the cost of one repair visit, mean \(\$100\), standard deviation \(\$20\); the marks are \(\mu-3\sigma\), \(\mu\), \(\mu+3\sigma\). Reproduces Larsen and Marx (2018), Figure 4.7.2. Code: ch04_special_distributions.py, fig_4_7_2.
A histogram of 100 simulated two-year repair costs in classes of 50 dollars: about 20 in each of the first two classes, falling to one in each class between 350 and 550, with vertical lines for the warranty price 200, the median 118 and the mean 151.
Figure 4.7.6. Total repair costs in 100 simulated two-year warranty periods, with the \(\$200\) price, the sample median and the sample mean. Reproduces Larsen and Marx (2018), Figure 4.7.6 (our own simulation, so the numbers differ slightly from the book's). Code: ch04_special_distributions.py, fig_4_7_6.
▶ DemoSimulating the warrantyChange the repair rate, the cost, the warranty length and price and the number of simulated customers; the histogram is shown beside the exact mean, median and probabilities; five presets.

Filling the gap 4.21: the warranty problem solved exactly, and how many simulations are enough pp. 271–274

The structure of the book's example (a Poisson number of repairs, each with an independent cost) is a compound Poisson sum, and its law can be written down. This gives the true values that the 100-run histogram only estimates, and shows how simulation error behaves.

Hint 1 of 6: the key idea

The bill is a random sum. Condition on the number of repairs, which is Poisson. How do you justify that exponential gaps produce a Poisson count?

Hint 2 of 6: tools you will need
  • Gamma\(\leftrightarrow\)Poisson duality (gap 4.17).
  • Iterated expectation and total variance (Result 3.12).
  • The standard error \(\sqrt{p(1-p)/m}\) of a proportion.
Hint 3 of 6: step 1

Show \(\P(N\ge r)=\P(S_r\le T)=\P(\text{Poisson}(\lambda T)\ge r)\) for all \(r\).

Hint 4 of 6: step 2

Condition on \(N\) to get \(\E W\) and \(\V W\). Aim for: \(150\) and \(15600\).

Hint 5 of 6: step 3

Write \(\P(W>x)\) as a sum over \(k\) of Poisson weights times normal tails. Aim for: 0.316 for \(x=200\).

Hint 6 of 6: step 4

Compare the book's simulated figures with the exact values in standard errors.

Proof

Why exponential gaps simulate a Poisson count. The recipe draws exponential gaps until the clock passes \(T\). The number \(N\) of repairs before \(T\) satisfies, with \(S_r\) the \(r\)-th arrival time (Gamma\((r,\lambda)\) as a sum of \(r\) independent exponentials), \(\P(N\ge r)=\P(S_r\le T)=\P(\mathrm{Poisson}(\lambda T)\ge r)\) by Filling the gap 4.17. This holds for every \(r\), so \(N\sim\mathrm{Poisson}(\lambda T)\), here with mean \(0.75\times2=1.5\). So the recipe produces the Poisson count of Section 4.2 and, given \(N\), independent costs \(C_1,\dots,C_N\sim\N(100,20^2)\).

Mean and variance of the bill \(W=C_1+\cdots+C_N\). Conditioning on \(N\): \(\E(W\mid N)=100N\) and \(\V(W\mid N)=400N\). By iterated expectation and the law of total variance (Results 3.11, 3.12 of the graduate course), \[ \E W=100\,\E N=150,\qquad \V W=\E[400N]+\V[100N]=400(1.5)+10^4(1.5)=15{,}600, \] so \(\mathrm{sd}(W)=\$124.9\). The mean bill is \(\$150\), below the price \(\$200\): on average the warranty loses \(\$50\) for the buyer.

The law of \(W\). \(W=0\) exactly when \(N=0\), probability \(e^{-1.5}=0.2231\); otherwise \(W\) is normal given \(N=k\), with mean \(100k\) and variance \(400k\): \[ \P(W>x)=\sum_{k\ge1}\frac{e^{-1.5}1.5^k}{k!}\Bigl[1-\Phi\Bigl(\frac{x-100k}{20\sqrt k}\Bigr)\Bigr]. \] This gives \(\P(W>200)=0.316\), \(\P(W>400)=0.042\), median \(\$118.7\). (A negative bill has probability about \(10^{-7}\) and is ignored.)

How good is a simulation? The fraction of \(m\) simulated customers whose bill exceeds \(\$200\) is a binomial proportion with standard error \(\sqrt{p(1-p)/m}\): with \(p=0.316\) and \(m=100\), \(0.046\). The book's 33% is \(0.3\) standard errors above the true 31.6%; its 24% without repairs is \(0.4\) standard errors above 22.3% (\(\sqrt{0.223\cdot0.777/100}=0.042\)); its mean \(\$159.10\) is \(0.7\) standard errors above \(\$150\) (\(124.9/\sqrt{100}=\$12.5\)). All three are consistent with the exact values: the simulation was fine and the apparent differences are chance. Reducing the standard error by a factor of 10 needs 100 times as many runs, so to know the mean to within \(\$1\) (one standard error) requires \((124.9)^2\approx15{,}600\) simulated customers. Fully worked solutions of this kind are the reason to simulate only after trying to compute; the Monte Carlo error demo of the graduate course shows the \(1/\sqrt m\) law. ∎

Appendix 4.A.1 Properties of Frequently-Used Probability Functions

pp. 274–276 The book's appendix tabulates the laws of Chapters 3 and 4. The table below lists the same facts in my own layout, with the number of the result that proves each.

LawProbability function or densityMeanVariancemgfProved in
Binomial\((n,p)\)\(\binom nkp^k(1-p)^{n-k}\), \(k=0..n\)\(np\)\(np(1-p)\)\((1-p+pe^t)^n\)Theorem 3.2.1
Hypergeometric\(\binom rk\binom w{n-k}/\binom Nn\)\(nr/N\)\(np(1-p)\frac{N-n}{N-1}\)–Theorem 3.2.2
Poisson\((\lambda)\)\(e^{-\lambda}\lambda^k/k!\), \(k\ge0\)\(\lambda\)\(\lambda\)\(e^{\lambda(e^t-1)}\)Theorem 4.2.2, 4.2
Geometric\((p)\)\((1-p)^{k-1}p\), \(k\ge1\)\(1/p\)\((1-p)/p^2\)\(\frac{pe^t}{1-(1-p)e^t}\)Theorem 4.4.1, 4.12
Negative binomial\((r,p)\)\(\binom{k-1}{r-1}p^r(1-p)^{k-r}\), \(k\ge r\)\(r/p\)\(r(1-p)/p^2\)\(\bigl[\frac{pe^t}{1-(1-p)e^t}\bigr]^r\)Theorem 4.5.1, 4.14
Exponential\((\lambda)\)\(\lambda e^{-\lambda y}\), \(y>0\)\(1/\lambda\)\(1/\lambda^2\)\(\frac\lambda{\lambda-t}\)Theorem 4.2.3
Gamma\((r,\lambda)\)\(\frac{\lambda^r}{\Gamma(r)}y^{r-1}e^{-\lambda y}\), \(y>0\)\(r/\lambda\)\(r/\lambda^2\)\((1-t/\lambda)^{-r}\)Theorems 4.6.3–4.6.5, 4.19
Normal\((\mu,\sigma^2)\)\(\frac1{\sqrt{2\pi}\sigma}e^{-\frac12(\frac{y-\mu}\sigma)^2}\)\(\mu\)\(\sigma^2\)\(e^{\mu t+\sigma^2t^2/2}\)Definition 4.3.1, 4.6
Uniform\((0,\theta)\)\(1/\theta\), \(0\le y\le\theta\)\(\theta/2\)\(\theta^2/12\)\(\frac{e^{\theta t}-1}{\theta t}\)Example 3.4.1

Relations among them: a sum of \(n\) independent Bernoulli variables is binomial; a binomial with large \(n\), small \(p\) is Poisson (4.1); the gaps of a Poisson process are exponential (4.5); \(r\) independent geometric variables add to a negative binomial; \(r\) independent exponential variables add to a gamma; \(\chi^2_m\) is Gamma\((m/2,1/2)\); and a standardised sum or mean of almost anything is nearly normal (4.9).

Notes on the book

Case Study 4.2.4: the rate and the printed density p. 233

The mean interval is 65.91 days, so the rate is \(\lambda=1/65.91=0.0152\) per day. The book prints "\(\lambda=1/65.91=0.15\)" and then the density \(f_Y(y)=0.015e^{-0.15y}\); with \(\lambda=0.15\) the mean interval would be under 7 days. The correct density is \(0.0152e^{-0.0152y}\). The curve in Figure 4.2.4 is drawn correctly, and its printed label \(0.015e^{-0.015y}\) is the rounded form of the right formula (Figure 4.2.4 here uses \(0.0152\)).

Example 4.3.2: 0.6879 − 0.3121 p. 246

The difference is \(0.3758\), which rounds to 0.38, not the printed 0.37. The exact value for the mean of eight uniform observations is \(0.3697\) (Filling the gap 4.10), so the printed 0.37 happens to be nearer the truth than the CLT value; the observed proportion in the book's 50 averages was 0.36.

Rounding in four worked examples pp. 223, 235, 236, 253

Case Study 4.2.1: \(1-0.99953=0.00047\), but the Poisson sum is \(0.999523\) to six places and the tail is \(0.000477\), i.e. 0.00048. Example 4.2.5: the rate \(40/60=0.667\) per minute was rounded to 0.67, giving \(e^{-3.35}=0.035\); the exact value is \(e^{-10/3}=0.0357\). Page 236: the table value for \(z=0.22\) gives 0.174, but \(z=0.5/\sqrt5=0.2236\) gives \(0.1769\), against the exact \(0.1762\). Example 4.3.6: the cutoff is \(100+16(2.054)=132.9\), printed as 133 after rounding \(z\) to 2.05. None of these affects a conclusion.

Selected questions

Ten of the book's questions, restated in my own words and covering every main section, with complete solutions (hidden). Numbers were cross-checked with the book's answers to the odd-numbered questions, which they match.

  1. Question 4.2.4 (a rare mutation). A chromosome mutation linked to colorblindness occurs on average once in 10,000 births. (a) Approximate the probability that exactly 3 of the next 20,000 babies have it. (b) How many affected babies out of 20,000 would make you think that "one in 10,000" is too low?

    Hint 1 of 4: the key idea

    Many trials, a tiny success probability: which approximation, and with what mean? For (b), which tail probability decides?

    Hint 2 of 4: tools you will need
    • Theorem 4.2.1 and the bound \(np^2\) (gap 4.1).
    • The Poisson pmf and tail \(\P(X\ge k)=1-\P(X\le k-1)\).
    Hint 3 of 4: part (a)

    Find \(np\) and evaluate the Poisson pmf at 3. Aim for: about 0.18.

    Hint 4 of 4: part (b)

    Tabulate \(\P(X\ge k)\) for \(k=5,\dots,8\) and decide what small probability would convince you.

    Solution

    (a) The number \(X\) of affected babies is \(\Bin(20000,10^{-4})\) with mean \(np=2\); with \(n\) large and \(p\) small the Poisson law with \(\lambda=2\) applies (Theorem 4.2.1; the bound of Filling the gap 4.1 is \(np^2=0.0002\)): \[\P(X=3)\doteq e^{-2}\frac{2^3}{3!}=0.1804.\] The exact binomial value is \(0.18046\).

    (b) "Too low" means too many cases, so look at the upper tails \(\P(X\ge k)=1-\P(X\le k-1)\) under \(\lambda=2\): \(k=5\): 0.053; \(k=6\): 0.017; \(k=7\): 0.0045; \(k=8\): 0.0011. Five or more is not unusual (about one chance in nineteen), six or more is rare (about one in sixty), and seven or more would happen by chance only about once in 220 such samples. The answer depends on how much doubt one tolerates: a 5% rule would flag 5 or more, a 1% rule 7 or more. Seven cases is a convincing excess; the book's hint asks for exactly this table (compare Case Study 4.2.1).

  2. Question 4.2.10 (Bortkiewicz's horse kicks). Over 20 years, ten Prussian cavalry corps (200 corps-years) recorded the annual deaths from horse kicks: 0 deaths in 109 corps-years, 1 in 65, 2 in 22, 3 in 3, 4 in 1. Show that a Poisson law describes the data.

    Hint 1 of 5: the key idea

    Fit means: estimate \(\lambda\), compute expected counts, compare. Which summaries can contradict a Poisson model?

    Hint 2 of 5: tools you will need
    • \(\hat\lambda=\bar k\) and Pearson's statistic (gap 4.3).
    • Mean equals variance for a Poisson law (gap 4.2).
    Hint 3 of 5: step 1

    Compute \(\bar k\) from the table. Aim for: 0.61.

    Hint 4 of 5: step 2

    Expected counts \(200\,e^{-0.61}0.61^k/k!\), pooling the last cells. Compare with the observed counts.

    Hint 5 of 5: step 3

    Compute the sample variance and compare with \(\bar k\).

    Solution

    The mean is \(\bar k=(0\cdot109+1\cdot65+2\cdot22+3\cdot3+4\cdot1)/200=122/200=0.61\). The fitted probabilities \(e^{-0.61}0.61^k/k!\) are \(0.5434,\ 0.3314,\ 0.1011,\ 0.0206,\ 0.0031\) for \(k=0,\dots,4\), and the tail \(\P(X\ge4)=0.0036\), so the expected counts out of 200 are \(108.7,\ 66.3,\ 20.2,\ 4.1\) and \(0.7\) for \(4\) or more, against the observed \(109,\ 65,\ 22,\ 3,\ 1\). Pooling the cells with expected counts below 5 (the last two) gives three cells with \(X^2=0.06\) on \(3-2=1\) degree of freedom (Filling the gap 4.3), tail probability \(0.80\): the fit could hardly be better. A second check is the variance, which for a Poisson law equals the mean: the sample variance of the data is \(0.608\), against \(0.61\). The assumptions are plausible too: kicks are rare events for each soldier, with similar risk in every corps-year. Figure x4.1 shows the same comparison for Case Studies 4.2.2 and 4.2.3.

  3. Question 4.2.25 (thinning a Poisson count). \(X_1\) is Poisson with mean \(\lambda\); given \(X_1=x_1\), \(X_2\) is binomial with \(x_1\) trials and success probability \(p\). Show that \(X_2\) is Poisson with mean \(\lambda p\).

    Hint 1 of 5: the key idea

    Condition on \(X_1\) and use the total probability formula; which factorials cancel?

    Hint 2 of 5: tools you will need
    • Law of total probability.
    • \(\binom xk/x!=1/(k!(x-k)!)\).
    • Exponential series, or the Poisson mgf as a pgf.
    Hint 3 of 5: step 1

    Write \(\P(X_2=k)=\sum_{x\ge k}\binom xkp^kq^{x-k}e^{-\lambda}\lambda^x/x!\).

    Hint 4 of 5: step 2

    Shift \(j=x-k\) and pull out the factors free of \(j\). Aim for: a series \(\sum[\lambda q]^j/j!\).

    Hint 5 of 5: step 3

    Sum it to \(e^{\lambda q}\) and simplify. Alternatively compute \(\E e^{tX_2}\) by conditioning.

    Solution

    By the law of total probability, for \(k=0,1,2,\dots\), \[\P(X_2=k)=\sum_{x\ge k}\binom xkp^k(1-p)^{x-k}\,\frac{e^{-\lambda}\lambda^x}{x!}.\] Since \(\binom xk/x!=1/(k!\,(x-k)!)\), put \(j=x-k\): \[\P(X_2=k)=\frac{e^{-\lambda}(\lambda p)^k}{k!}\sum_{j\ge0}\frac{[\lambda(1-p)]^j}{j!}=\frac{e^{-\lambda}(\lambda p)^k}{k!}\,e^{\lambda(1-p)}=\frac{e^{-\lambda p}(\lambda p)^k}{k!}.\] Another way: \(\E e^{tX_2}=\E\bigl[(1-p+pe^t)^{X_1}\bigr]\), and for a Poisson variable \(\E s^{X_1}=e^{\lambda(s-1)}\) (the mgf at \(s=e^t\)), so \(M_{X_2}(t)=\exp\{\lambda(1-p+pe^t-1)\}=\exp\{\lambda p(e^t-1)\}\), the Poisson\((\lambda p)\) mgf. Interpretation: if each of a Poisson number of events is independently kept with probability \(p\) ("thinning"), the kept events are again a Poisson process, with rate \(\lambda p\); this is why the rate of customers who buy, of calls that are faulty or of particles that are detected is again Poisson (the Poisson process demo, preset 4, shows thinning).

  4. Question 4.2.26 (airplane crashes). Commercial plane crashes in a country occur at the rate of 2.5 per year. (a) Is it reasonable to treat them as Poisson events? (b) What is the probability of four or more crashes next year? (c) What is the probability that the next two crashes occur within three months of one another?

    Hint 1 of 5: the key idea

    Is the count of crashes Poisson in spirit? For the gap, which law governs the time between events?

    Hint 2 of 5: tools you will need
    Hint 3 of 5: part (a)

    List the three assumptions and say which a common cause (weather, design fault) would violate.

    Hint 4 of 5: part (b)

    Use \(\lambda=2.5\) and the complement of \(\P(X\le3)\).

    Hint 5 of 5: part (c)

    Convert 3 months to years and use the exponential cdf. Aim for: \(1-e^{-0.625}\).

    Solution

    (a) The three assumptions are plausible: a crash is a rare event for each flight, the very large number of flights makes the count a sum of many small chances, and one crash seldom causes another. Doubts: a common cause (weather, a design fault, a change in traffic) could make crashes cluster or the rate vary with the season or the year, which would spoil independence and a constant rate. Treat it as a model to be checked with data.

    (b) With \(X\sim\Pois(2.5)\): \(\P(X\ge4)=1-e^{-2.5}\bigl(1+2.5+\frac{2.5^2}2+\frac{2.5^3}6\bigr)=1-0.7576=0.2424\).

    (c) The gap \(Y\) between consecutive crashes is exponential with rate 2.5 per year (Theorem 4.2.3), so \(\P(Y\le\tfrac14)=1-e^{-2.5/4}=1-e^{-0.625}=0.4647\). Nearly half of the successive gaps are shorter than three months although the average gap is \(1/2.5=0.4\) years: the exponential law puts its mass near 0 (the "bad things come in threes" effect of Case Study 4.2.4).

  5. Question 4.3.9 (a close election). Fifty-five percent of registered voters in Sheridanville favor the incumbent mayor. If 400 voters go to the polls, approximate the probability (a) that the race ends in a tie, (b) that the challenger wins.

    Hint 1 of 5: the key idea

    Binomial, \(n=400\), \(p=0.55\): which approximation, and what do the integers \(200\) and \(199\) become?

    Hint 2 of 5: tools you will need
    • Continuity correction (gap 4.7).
    • \(\Phi\) from a table or software.
    Hint 3 of 5: step 1

    Compute \(np\) and \(\sigma_n\). Aim for: 220 and 9.95.

    Hint 4 of 5: part (a)

    A tie is \(X=200\): integrate over \([199.5,200.5]\).

    Hint 5 of 5: part (b)

    The challenger wins when \(X\le199\): use \(199.5\).

    Solution

    Let \(X\sim\Bin(400,0.55)\) count votes for the mayor: \(np=220\), \(\sigma_n=\sqrt{400(0.55)(0.45)}=\sqrt{99}=9.95\). (The rule of thumb holds: \(9p/(1-p)=11\ll400\).)

    (a) A tie is \(X=200\). With the continuity correction, \[\P(X=200)=\P(199.5\le X\le200.5)\doteq\Phi\Bigl(\frac{200.5-220}{9.95}\Bigr)-\Phi\Bigl(\frac{199.5-220}{9.95}\Bigr)=\Phi(-1.96)-\Phi(-2.06)=0.0250-0.0197=0.0053.\] Without the correction the approximation would give an interval of length 0 and hence probability 0: a lattice variable needs it. The exact value is \(0.00534\).

    (b) The challenger wins if \(X\le199\): \[\P(X\le199)\doteq\Phi\Bigl(\frac{199.5-220}{9.95}\Bigr)=\Phi(-2.06)=0.0197.\] The exact value is \(0.0199\). Both agree with the book's 0.0053 and 0.0197.

  6. Question 4.3.20 (an approximation that fails). Eight leukemia cases were diagnosed among 3000 observers of a 1957 nuclear test; the expected number from demographics was 3. Assess the significance by computing \(\P(X\ge8)\) exactly with a Poisson law and then with the central limit theorem.

    Hint 1 of 5: the key idea

    Do the exact computation with the Poisson law first, then the normal one. Why might they differ a lot?

    Hint 2 of 5: tools you will need
    • Poisson limit (gap 4.1).
    • Continuity correction and the rule of thumb (4.7, 4.8).
    Hint 3 of 5: step 1

    Find \(\P(X\ge8)\) for Poisson(3). Aim for: about 0.012.

    Hint 4 of 5: step 2

    Normal approximation with mean 3, sd \(\sqrt3\), with and without the correction.

    Hint 5 of 5: step 3

    Compare the two answers; use skewness and the rule \(n>9q/p\) to explain, and interpret the exact probability carefully.

    Solution

    Model the number of cases as \(\Bin(3000,0.001)\), mean 3. The Poisson limit applies (\(np^2=0.003\)): \(X\approx\Pois(3)\), and \[\P(X\ge8)=1-e^{-3}\sum_{k=0}^{7}\frac{3^k}{k!}=1-0.9881=0.0119\] (the exact binomial tail is \(0.01186\)). With the central limit theorem, \(\sigma=\sqrt3=1.732\), and with the continuity correction \[\P(X\ge8)\doteq1-\Phi\Bigl(\frac{7.5-3}{1.732}\Bigr)=1-\Phi(2.60)=0.0047,\] and without it \(1-\Phi(2.89)=0.0019\). The normal answers are too small by a factor of 2.5 to 6. Reason: \(\Pois(3)\) is strongly skewed to the right (skewness \(1/\sqrt3=0.58\)), so its upper tail is far heavier than the symmetric normal tail (Filling the gap 4.7), and the rule of thumb (\(n>9q/p=8991\)) warns us in advance that \(n=3000\) is too small.

    Conclusion. Eight or more cases would arise by chance only about 1.2% of the time if the baseline of 3 were right: unusual, a reason to look further, but, as with Case Study 4.2.1, the probability was calculated after the fact for the one group that looked remarkable, and the evidence is weaker than the number suggests. The normal approximation demo (preset 4) shows this case.

  7. Question 4.3.31 (taking the breath test twice). A breath analyzer reading is \(\N(\mu,0.004^2)\) (in percent) where \(\mu\) is the true blood alcohol level; the legal limit is 0.08. (a) If the true level is 0.09, what is the probability the machine reads below the limit? (b) The police let the driver take the test once or twice and average the two readings. Which should a driver with \(\mu=0.075\) choose, and which a driver with \(\mu=0.09\)?

    Hint 1 of 5: the key idea

    The average of two independent readings has a smaller standard deviation. Which direction does that push each driver's probability?

    Hint 2 of 5: tools you will need
    • Corollary 4.3.1: \(\bar Y\sim\N(\mu,\sigma^2/n)\).
    • Z-scores and \(\Phi\) (gap 4.6).
    Hint 3 of 5: part (a)

    \(z=(0.08-0.09)/0.004\).

    Hint 4 of 5: part (b), \(\mu=0.075\)

    Compare \(\P(\text{reading}\ge0.08)\) with one reading and with the average of two.

    Hint 5 of 5: part (b), \(\mu=0.09\)

    Compare \(\P(\text{reading}<0.08)\) in the two cases and decide.

    Solution

    (a) \(\P(Y<0.08)=\P\bigl(Z<\frac{0.08-0.09}{0.004}\bigr)=\Phi(-2.5)=0.0062\).

    (b) The average of two independent readings is \(\N(\mu,0.004^2/2)\) with standard deviation \(0.004/\sqrt2=0.00283\) (Corollary 4.3.1). For \(\mu=0.075\) the chance of being wrongly over the limit is \(\P(Z>1.25)=0.1056\) with one test and \(\P\bigl(Z>\frac{0.005}{0.00283}\bigr)=\P(Z>1.77)=0.0385\) with two: the sober-side driver gains from averaging and should take the test twice. For \(\mu=0.09\) the chance of wrongly passing is \(0.0062\) with one test and \(\Phi\bigl(\frac{-0.01}{0.00283}\bigr)=\Phi(-3.54)=0.0002\) with two: this driver should take the test once. Averaging reduces the spread of the reading, which helps whoever's true value is on the favorable side of the limit and hurts the other (the book's answer agrees).

  8. Question 4.4.6 (three dice). Three fair dice are thrown repeatedly. Let \(X\) be the throw on which a sum of 4 first appears. Find \(\P(65\le X\le75)\) using the cdf of a geometric variable.

    Hint 1 of 4: the key idea

    What is the probability that three dice sum to 4, and what is the geometric cdf?

    Hint 2 of 4: tools you will need
    • Counting outcomes of three dice.
    • \(F_X(t)=1-(1-p)^{\lfloor t\rfloor}\) (gap 4.12).
    Hint 3 of 4: step 1

    Count the ordered triples with sum 4. Aim for: \(p=3/216\).

    Hint 4 of 4: step 2

    Write \(\P(65\le X\le75)=F(75)-F(64)\) and evaluate.

    Solution

    A sum of 4 occurs for the ordered triples with faces \(\{1,1,2\}\) in some order: 3 of the 216 equally likely outcomes, so \(p=3/216=1/72\). The cdf is \(F_X(t)=1-(1-p)^{\lfloor t\rfloor}\) (Question 4.4.5: the first \(\lfloor t\rfloor\) throws must not all fail), so \[\P(65\le X\le75)=F_X(75)-F_X(64)=(71/72)^{64}-(71/72)^{75}=0.40856-0.35030=0.0583.\] Equivalently, sum the geometric probabilities from 65 to 75; the difference of two tails is the quick way.

  9. Question 4.5.8 (a sum of negative binomial variables). \(X_1,X_2,X_3\) are independent, each with probability function \(\binom{k-1}2(\frac45)^3(\frac15)^{k-3}\), \(k=3,4,\dots\) Let \(X=X_1+X_2+X_3\). Find \(\P(10\le X\le12)\).

    Hint 1 of 4: the key idea

    Which law has mgf \([pe^t/(1-qe^t)]^9\)? What is \(X\)?

    Hint 2 of 4: tools you will need
    Hint 3 of 4: step 1

    Multiply the three mgfs and identify the law. Aim for: negative binomial with \(r=9\), \(p=4/5\).

    Hint 4 of 4: step 2

    Evaluate \(\P(X=k)=\binom{k-1}8(0.8)^9(0.2)^{k-9}\) for \(k=10,11,12\) and add.

    Solution

    Each \(X_i\) is negative binomial with \(r=3\), \(p=\frac45\), with mgf \(\bigl[\frac{pe^t}{1-(1-p)e^t}\bigr]^3\). By independence the mgf of \(X\) is the product, \(\bigl[\frac{pe^t}{1-(1-p)e^t}\bigr]^9\), so by uniqueness \(X\) is negative binomial with \(r=9\) and \(p=\frac45\) (the time of the 9th success; Filling the gap 4.14): \(\P(X=k)=\binom{k-1}8(\frac45)^9(\frac15)^{k-9}\), \(k\ge9\). Then \[\P(X=10)=9\,(0.8)^9(0.2)=0.24159,\quad\P(X=11)=45\,(0.8)^9(0.2)^2=0.24159,\quad\P(X=12)=165\,(0.8)^9(0.2)^3=0.17717,\] and \(\P(10\le X\le12)=0.6604\). (A check by mean and variance: \(\E X=9/0.8=11.25\) and \(\V X=9(0.2)/0.64=2.81\), so \(X\) is centred near 11 and the three values \(10,11,12\) carry most of the probability.)

  10. Question 4.6.3 (a gamma law from its moments). A set of 100 measurements comes from a gamma law with \(\E Y=1.5\) and \(\V Y=0.75\). How many would you expect in the interval \([1.0,\,2.5]\)?

    Hint 1 of 5: the key idea

    Two moments determine a gamma law. Which equations?

    Hint 2 of 5: tools you will need
    • \(\E Y=r/\lambda\), \(\V Y=r/\lambda^2\) (gap 4.19).
    • Poisson-tail form of the cdf for integer \(r\) (gap 4.17).
    Hint 3 of 5: step 1

    Divide the mean by the variance. Aim for: \(\lambda=2\), \(r=3\).

    Hint 4 of 5: step 2

    Write \(F(y)=1-e^{-2y}(1+2y+(2y)^2/2)\) and evaluate at 2.5 and 1.

    Hint 5 of 5: step 3

    Multiply the probability by 100.

    Solution

    For a gamma law with shape \(r\) and rate \(\lambda\), \(\E Y=r/\lambda\) and \(\V Y=r/\lambda^2\) (Theorem 4.6.3). Dividing, \(\E Y/\V Y=\lambda=1.5/0.75=2\), and then \(r=\lambda\E Y=3\). With integer \(r=3\) the cdf is a Poisson tail (Filling the gap 4.17): \(F(y)=1-e^{-2y}\bigl(1+2y+\frac{(2y)^2}2\bigr)\). So \(F(2.5)=1-e^{-5}(1+5+12.5)=0.8753\) and \(F(1)=1-e^{-2}(1+2+2)=0.3233\), and \(\P(1.0\le Y\le2.5)=0.5520\). About \(100\times0.552\approx55\) of the measurements are expected to fall in the interval (with a standard deviation of \(\sqrt{100(0.552)(0.448)}=5\) about that number).

Demonstrations for this chapter

Each demonstration runs in the browser and links back to these notes. The ▶ Demo boxes above open them already set to the case under discussion.

DemonstrationWhat you can seeSections and results
Rare events: the binomial becomes PoissonBinomial and Poisson bars side by side for any \(n\) and \(p\), the exact largest disagreement (total variation distance) against the bound \(np^2\), and a tail probability. Presets: 1 Table 4.2.1, \(n=5\); 2 Table 4.2.2, \(n=100\); 3 Example 4.2.2, the town of 65,000; 4 Case Study 4.2.1, Niles; 5 a case where the limit fails.Section 4.2; 4.1, 4.4; Question 4.2.4
Normal approximation to the binomialThe exact binomial probability of a range, the normal approximation with and without the continuity correction, the check of the rule of thumb and the size of the error, with bars and curve. Presets: 1 Figure 4.3.1; 2 Example 4.3.1, overbooking; 3 Case Study 4.3.1, ESP; 4 Question 4.3.20, Nevada (the approximation fails); 5 Question 4.3.9, a tied election.Section 4.3; 4.7, 4.8; Questions 4.3.9, 4.3.20
Simulating a warrantyA Monte Carlo study of the two-year repair bill: histogram of simulated bills beside the exact compound Poisson mean, median and tail probabilities, with the number of simulated customers adjustable to see the \(1/\sqrt m\) behaviour. Presets: 1 the book's 100 customers; 2 20,000 customers; 3 repairs twice as frequent; 4 costly, variable repairs; 5 a one-year warranty.Section 4.7; 4.16, 4.17, 4.21

Related demonstrations elsewhere: for the central limit theorem (Section 4.3), the first-year central limit theorem demo and the graduate Berry–Esseen demo; for Poisson processes, exponential gaps and gamma waiting times (Sections 4.2 and 4.6), the Poisson process demo; for generating random numbers (Case Study 4.5.1), the inverse-cdf sampling demo; for moment-generating functions and sums (Sections 4.3 and 4.5), the mgf of sums demo; for the sample mean of a normal sample, the first-year normal sample demo.

References

  1. Billingsley, P. (1995). Probability and Measure, 3rd edition. Wiley, New York.
  2. Feller, W. (1968). An Introduction to Probability Theory and Its Applications, volume I, 3rd edition. Wiley, New York.
  3. Larsen, R. J. and Marx, M. L. (2018). An Introduction to Mathematical Statistics and Its Applications, 6th edition. Pearson, Boston. Chapter 4, pp. 218–277.
  4. Le Cam, L. (1960). An approximation theorem for the Poisson binomial distribution. Pacific Journal of Mathematics, 10(4), 1181–1197.
  5. Balding, D. J. and Donnelly, P. (1995). Inference in forensic identification. Journal of the Royal Statistical Society, Series A, 158(1), 21–53.
  6. Lukacs, E. (1955). A characterization of the gamma distribution. Annals of Mathematical Statistics, 26(2), 319–324.