Continuous Random Variables and Their Distributions
After completing this chapter, you will be able to:
Explain in plain language why continuous random variables require a fundamentally different approach than discrete ones
Define probability density functions and cumulative distribution functions for continuous random variables, and compute probabilities using integration
Calculate expected values, variances, and standard deviations for continuous distributions
Derive and apply the Uniform distribution to model equally-likely outcomes over an interval
Derive and apply the Normal distribution, standardize variables, and compute probabilities using tables and R
Derive and apply the Gamma distribution family — including the Exponential and Chi-Square distributions as special cases
Derive and apply the Beta distribution to model proportions and percentages
Compute and use moment generating functions for continuous distributions
Apply Tchebysheff’s theorem to bound probabilities for any continuous distribution
Prerequisites: Chapters 2–4. Calculus II (integration techniques, improper integrals, the Gamma function). Builds on: Discrete random variables, expected values, MGFs (Chapter 4).
Content current as of April 2026.
Buffon’s Needle. In 1777, Georges-Louis Leclerc, Comte de Buffon, posed one of the strangest questions in the history of mathematics: drop a needle of length ℓ \ell ℓ onto a floor ruled with parallel lines spaced d d d apart. What is the probability that the needle crosses a line?
The answer is breathtaking: P = 2 ℓ π d P = \frac{2\ell}{\pi d} P = π d 2 ℓ . Yes — π \pi π , the ratio of a circle’s circumference to its diameter, appears in the answer to a problem about straight needles and straight lines. No circles anywhere in sight.
This means you can estimate π \pi π by dropping needles. In 1901, the Italian mathematician Mario Lazzarini claimed to have tossed a needle 3,408 times and obtained π ≈ 3.1415929 \pi \approx 3.1415929 π ≈ 3.1415929 — accurate to six decimal places. (His result was almost certainly rigged, but the mathematics behind it is flawless.)
The derivation requires two things you don’t yet have: a continuous random variable for the needle’s angle, and integration over a probability density function. By the end of this chapter, you’ll derive Buffon’s formula yourself — and understand why π \pi π was hiding in the floorboards all along.
1 From Discrete to Continuous: The Conceptual Leap ¶ In Chapter 4, we studied discrete random variables — things you can count, like the number of defective items in a batch or the number of heads in 10 coin flips. Every possible value got its own probability: p ( 0 ) = 0.10 p(0) = 0.10 p ( 0 ) = 0.10 , p ( 1 ) = 0.25 p(1) = 0.25 p ( 1 ) = 0.25 , and so on, and all the probabilities summed to 1.
But what if you’re measuring something that can take any value in an interval? The exact weight of a newborn baby. The precise amount of rainfall tomorrow. The time until the next earthquake. These measurements don’t come in neat, countable packages — they live on a continuum.
Here’s the fundamental problem: you cannot assign a positive probability to every single point on a line and still have everything sum to 1. There are uncountably many points. If each one got even the tiniest positive probability, the sum would be infinite.
So how do we handle probability for continuous quantities? The answer changes everything: we stop asking “What is the probability of this exact value?” and start asking “What is the probability of falling in this interval?” Instead of summing probabilities, we integrate them. This section makes that transition precise.
Real-life motivation: A weather station measures daily rainfall to the nearest hundredth of an inch. Could the rainfall tomorrow be exactly 1.73000000... inches? In theory, sure — but you’d never observe that exact value even if you measured for a million years. What matters is the probability of rainfall between 1.5 and 2.0 inches. That’s a question continuous probability can answer.
1.1 Why the Discrete Approach Breaks Down ¶ In Chapter 4, we defined a discrete random variable Y Y Y by assigning probabilities p ( y ) p(y) p ( y ) to each possible value, subject to two rules: p ( y ) ≥ 0 p(y) \geq 0 p ( y ) ≥ 0 for all y y y , and ∑ all y p ( y ) = 1 \sum_{\text{all } y} p(y) = 1 ∑ all y p ( y ) = 1 . This works beautifully when Y Y Y can take only finitely many or countably many values.
Now imagine trying to do the same for the daily rainfall Y Y Y at a weather station, where Y Y Y can take any value between 0 and, say, 6 inches. Suppose we try to assign a positive probability p ( y ) = c > 0 p(y) = c > 0 p ( y ) = c > 0 to every point in the interval [ 0 , 6 ] [0, 6] [ 0 , 6 ] . How many points are in that interval? Uncountably many — more than can be listed, more than the integers, more than all the rational numbers combined. And if each point gets probability c > 0 c > 0 c > 0 , the “sum” over uncountably many terms would be ∞ \infty ∞ , not 1. The axioms of probability are violated.
The inescapable conclusion:
If Y Y Y is a continuous random variable, then for any specific value a a a :
P ( Y = a ) = 0 P(Y = a) = 0 P ( Y = a ) = 0 This is not a deficiency of the theory — it reflects the reality that with a truly continuous measurement, the probability of observing any single exact value is zero.
This might feel strange. If P ( Y = 1.73 ) = 0 P(Y = 1.73) = 0 P ( Y = 1.73 ) = 0 , does that mean a rainfall of 1.73 inches is impossible? No. It means that 1.73 is possible but has probability zero — just as a single point has length zero, yet a collection of points makes up the entire real line.
The practical consequence is profound: for continuous random variables, only intervals have positive probability. We ask P ( 1.5 ≤ Y ≤ 2.0 ) P(1.5 \leq Y \leq 2.0) P ( 1.5 ≤ Y ≤ 2.0 ) , not P ( Y = 1.73 ) P(Y = 1.73) P ( Y = 1.73 ) .
1.2 The Distribution Function: Our Starting Point ¶ The key to defining continuous random variables is a function you’ve already met briefly in Chapter 4.
Every random variable — discrete or continuous — has a CDF. What distinguishes discrete from continuous is the shape of F ( y ) F(y) F ( y ) :
For a discrete random variable, F ( y ) F(y) F ( y ) is a step function — it jumps at each value with positive probability and is flat in between.
For a continuous random variable, F ( y ) F(y) F ( y ) is a smooth, continuous curve with no jumps.
If F ( y ) F(y) F ( y ) is a distribution function, then:
F ( − ∞ ) ≡ lim y → − ∞ F ( y ) = 0 F(-\infty) \equiv \lim_{y \to -\infty} F(y) = 0 F ( − ∞ ) ≡ lim y → − ∞ F ( y ) = 0
F ( ∞ ) ≡ lim y → ∞ F ( y ) = 1 F(\infty) \equiv \lim_{y \to \infty} F(y) = 1 F ( ∞ ) ≡ lim y → ∞ F ( y ) = 1
F ( y ) F(y) F ( y ) is nondecreasing: if y 1 < y 2 y_1 < y_2 y 1 < y 2 , then F ( y 1 ) ≤ F ( y 2 ) F(y_1) \leq F(y_2) F ( y 1 ) ≤ F ( y 2 )
Why this makes sense: Property 1 says the probability of being below everything is 0. Property 2 says the probability of being below everything is 1. Property 3 says that as you move to the right, you accumulate more probability — never less.
This leads us to the formal definition of a continuous random variable:
Because F ( y ) F(y) F ( y ) is continuous (no jumps), there are no single points with positive probability — confirming the zero-probability fact above.
1.3 See It First: Histograms Converging to a Curve ¶ Before we go further into the theory, let’s watch the discrete-to-continuous transition happen. In Chapter 1, we saw that as the number of observations grows, a relative frequency histogram gets smoother. Let’s see this with exponential data:
# Watch the discrete-to-continuous transition
par(mfrow = c(2, 2))
for (n_obs in c(50, 500, 5000, 50000)) {
sim_data <- rexp(n_obs, rate = 0.5)
hist(sim_data, breaks = 40, freq = FALSE,
main = paste("n =", format(n_obs, big.mark = ",")),
xlab = "y", ylab = "Density",
col = "steelblue", border = "white",
xlim = c(0, 15))
curve(dexp(x, rate = 0.5), add = TRUE, col = "red", lwd = 2)
}Run this code. As n n n increases from 50 to 50,000, the histogram bars melt into the smooth red curve. That red curve — f ( y ) = 0.5 e − 0.5 y f(y) = 0.5 e^{-0.5y} f ( y ) = 0.5 e − 0.5 y for y ≥ 0 y \geq 0 y ≥ 0 — is the probability density function (PDF). The histogram is its discrete approximation; the PDF is the continuous truth.
This is the “See It” step of our pipeline. Now we formalize.
We learned that continuous random variables require a fundamentally different approach than discrete ones. You can’t assign a positive probability to every point on a line — there are too many points. Instead, probabilities live in intervals , and we compute them using areas under curves rather than sums.
The real-life interpretation: When a weather app says there’s a “30% chance of 1–2 inches of rain,” that 30% is the area under a probability density function between 1 and 2. The probability of exactly 1.3742 inches is zero — but the probability of an interval around it is positive and meaningful. Every continuous measurement you’ve ever encountered — blood pressure, reaction time, the weight of a package — works this way.
We also saw that the cumulative distribution function F ( y ) = P ( Y ≤ y ) F(y) = P(Y \leq y) F ( y ) = P ( Y ≤ y ) is the foundation: smooth and continuous for continuous random variables, with step-function jumps for discrete ones.
Looking ahead: In the next section, we’ll define the probability density function — the smooth curve that the histogram converges to — and develop the tools to compute probabilities, expected values, and everything else we need.
2 Probability Density Functions and CDFs ¶ We just established that continuous random variables need areas, not sums. But areas under what ? In this section, we define the probability density function (PDF) — the smooth curve that a histogram converges to — and show how it connects to the CDF from Section 5.1.
Here’s the key relationship: the PDF is the derivative of the CDF, and the CDF is the integral of the PDF. If you know calculus, this is the Fundamental Theorem of Calculus applied to probability.
We’ll learn to verify that a function qualifies as a valid PDF, compute probabilities by integrating the PDF over intervals, and find specific quantiles (like the median) by solving equations involving the CDF.
Real-life motivation: A hospital measures the time (in hours) that patients spend in the emergency room. The distribution of wait times isn’t uniform — most patients are seen quickly, but a few wait a very long time. The PDF captures the shape of this distribution: tall near zero (many short waits), tapering off to the right (fewer long waits). The probability that you’ll wait between 2 and 4 hours is the area under this curve between 2 and 4.
2.1 The Probability Density Function ¶ The CDF F ( y ) F(y) F ( y ) tells us accumulated probability: “How much probability sits to the left of y y y ?” The PDF tells us the rate at which probability accumulates at the point y y y .
Because F ( y ) F(y) F ( y ) is the integral of f ( y ) f(y) f ( y ) , we can write:
F ( y ) = ∫ − ∞ y f ( t ) d t F(y) = \int_{-\infty}^{y} f(t) \, dt F ( y ) = ∫ − ∞ y f ( t ) d t This is just the Fundamental Theorem of Calculus. The CDF at any point y y y is the total area under the PDF from − ∞ -\infty − ∞ to y y y .
2.2 Properties of a PDF ¶ Since the CDF has properties (Theorem 5.1), the PDF inherits corresponding properties:
If f ( y ) f(y) f ( y ) is a density function for a continuous random variable, then:
f ( y ) ≥ 0 f(y) \geq 0 f ( y ) ≥ 0 for all y y y , − ∞ < y < ∞ -\infty < y < \infty − ∞ < y < ∞
∫ − ∞ ∞ f ( y ) d y = 1 \displaystyle\int_{-\infty}^{\infty} f(y) \, dy = 1 ∫ − ∞ ∞ f ( y ) d y = 1
Why this makes sense: Property 1 says the density is never negative — you can’t have a negative rate of probability accumulation. Property 2 says the total area under the entire PDF is 1 — all the probability is accounted for.
Proof.
Strategy: Both properties follow directly from the CDF properties in Theorem 5.1.
Property 1: Because F ( y ) F(y) F ( y ) is nondecreasing, its derivative f ( y ) = F ′ ( y ) f(y) = F'(y) f ( y ) = F ′ ( y ) must be nonnegative wherever it exists. ✓ \checkmark ✓
Property 2: Because F ( − ∞ ) = 0 F(-\infty) = 0 F ( − ∞ ) = 0 and F ( ∞ ) = 1 F(\infty) = 1 F ( ∞ ) = 1 :
∫ − ∞ ∞ f ( y ) d y = F ( ∞ ) − F ( − ∞ ) = 1 − 0 = 1 ■ \int_{-\infty}^{\infty} f(y) \, dy = F(\infty) - F(-\infty) = 1 - 0 = 1 \qquad \blacksquare ∫ − ∞ ∞ f ( y ) d y = F ( ∞ ) − F ( − ∞ ) = 1 − 0 = 1 ■ The value f ( y ) f(y) f ( y ) is a density , not a probability. It is perfectly valid for f ( y ) > 1 f(y) > 1 f ( y ) > 1 at some points — what matters is that the total area under f ( y ) f(y) f ( y ) equals 1. For example, if f ( y ) = 3 f(y) = 3 f ( y ) = 3 on the interval [ 0 , 1 / 3 ] [0, 1/3] [ 0 , 1/3 ] and f ( y ) = 0 f(y) = 0 f ( y ) = 0 elsewhere, the density exceeds 1 everywhere in its support, but the total area is 3 × 1 3 = 1 3 \times \frac{1}{3} = 1 3 × 3 1 = 1 . This is a valid PDF.
2.3 Computing Probabilities: Integration ¶ The reason we care about PDFs is that they let us compute probabilities:
This probability is the area under the PDF between a a a and b b b . Notice a beautiful consequence: because P ( Y = a ) = 0 P(Y = a) = 0 P ( Y = a ) = 0 and P ( Y = b ) = 0 P(Y = b) = 0 P ( Y = b ) = 0 for continuous random variables, it doesn’t matter whether we use strict or non-strict inequalities:
P ( a < Y < b ) = P ( a ≤ Y < b ) = P ( a < Y ≤ b ) = P ( a ≤ Y ≤ b ) = ∫ a b f ( y ) d y P(a < Y < b) = P(a \leq Y < b) = P(a < Y \leq b) = P(a \leq Y \leq b) = \int_a^b f(y) \, dy P ( a < Y < b ) = P ( a ≤ Y < b ) = P ( a < Y ≤ b ) = P ( a ≤ Y ≤ b ) = ∫ a b f ( y ) d y This is not true for discrete random variables — and it simplifies our life enormously.
2.4 Worked Examples ¶ To verify a PDF and compute probabilities, you’ll integrate polynomial expressions. The key rule:
∫ a b y n d y = y n + 1 n + 1 ∣ a b = b n + 1 n + 1 − a n + 1 n + 1 \int_a^b y^n \, dy = \frac{y^{n+1}}{n+1}\bigg|_a^b = \frac{b^{n+1}}{n+1} - \frac{a^{n+1}}{n+1} ∫ a b y n d y = n + 1 y n + 1 ∣ ∣ a b = n + 1 b n + 1 − n + 1 a n + 1 This is the power rule for definite integrals. When a constant c c c multiplies the integrand, pull it out front: ∫ a b c ⋅ y n d y = c ∫ a b y n d y \int_a^b c \cdot y^n \, dy = c \int_a^b y^n \, dy ∫ a b c ⋅ y n d y = c ∫ a b y n d y . Every example below uses these two facts.
The Problem.
A random variable Y Y Y has the density function:
f ( y ) = { c y 2 , 0 ≤ y ≤ 2 0 , elsewhere f(y) = \begin{cases} cy^2, & 0 \leq y \leq 2 \\ 0, & \text{elsewhere} \end{cases} f ( y ) = { c y 2 , 0 , 0 ≤ y ≤ 2 elsewhere (a) Find the value of c c c that makes f ( y ) f(y) f ( y ) a valid density function.
(b) Find P ( 1 ≤ Y ≤ 2 ) P(1 \leq Y \leq 2) P ( 1 ≤ Y ≤ 2 ) .
(c) Find the CDF F ( y ) F(y) F ( y ) .
Solution.
(a) For f ( y ) f(y) f ( y ) to be a valid PDF, we need ∫ − ∞ ∞ f ( y ) d y = 1 \int_{-\infty}^{\infty} f(y) \, dy = 1 ∫ − ∞ ∞ f ( y ) d y = 1 :
∫ 0 2 c y 2 d y = c ⋅ y 3 3 ∣ 0 2 = c ⋅ 8 3 = 1 \int_0^2 cy^2 \, dy = c \cdot \frac{y^3}{3}\bigg|_0^2 = c \cdot \frac{8}{3} = 1 ∫ 0 2 c y 2 d y = c ⋅ 3 y 3 ∣ ∣ 0 2 = c ⋅ 3 8 = 1 So f ( y ) = 3 8 y 2 f(y) = \frac{3}{8}y^2 f ( y ) = 8 3 y 2 on [ 0 , 2 ] [0, 2] [ 0 , 2 ] .
(b) Using the PDF:
P ( 1 ≤ Y ≤ 2 ) = ∫ 1 2 3 8 y 2 d y = 3 8 ⋅ y 3 3 ∣ 1 2 = 1 8 ( y 3 ) ∣ 1 2 = 1 8 ( 8 − 1 ) = 7 8 P(1 \leq Y \leq 2) = \int_1^2 \frac{3}{8}y^2 \, dy = \frac{3}{8} \cdot \frac{y^3}{3}\bigg|_1^2 = \frac{1}{8}(y^3)\bigg|_1^2 = \frac{1}{8}(8 - 1) = \frac{7}{8} P ( 1 ≤ Y ≤ 2 ) = ∫ 1 2 8 3 y 2 d y = 8 3 ⋅ 3 y 3 ∣ ∣ 1 2 = 8 1 ( y 3 ) ∣ ∣ 1 2 = 8 1 ( 8 − 1 ) = 8 7 (c) The CDF is F ( y ) = ∫ − ∞ y f ( t ) d t F(y) = \int_{-\infty}^{y} f(t) \, dt F ( y ) = ∫ − ∞ y f ( t ) d t . We need to consider three regions:
For y < 0 y < 0 y < 0 : F ( y ) = ∫ − ∞ y 0 d t = 0 F(y) = \int_{-\infty}^{y} 0 \, dt = 0 F ( y ) = ∫ − ∞ y 0 d t = 0
For 0 ≤ y ≤ 2 0 \leq y \leq 2 0 ≤ y ≤ 2 : F ( y ) = ∫ 0 y 3 8 t 2 d t = 3 8 ⋅ t 3 3 ∣ 0 y = y 3 8 F(y) = \int_0^y \frac{3}{8}t^2 \, dt = \frac{3}{8} \cdot \frac{t^3}{3}\bigg|_0^y = \frac{y^3}{8} F ( y ) = ∫ 0 y 8 3 t 2 d t = 8 3 ⋅ 3 t 3 ∣ ∣ 0 y = 8 y 3
For y > 2 y > 2 y > 2 : F ( y ) = ∫ 0 2 3 8 t 2 d t + ∫ 2 y 0 d t = 1 F(y) = \int_0^2 \frac{3}{8}t^2 \, dt + \int_2^y 0 \, dt = 1 F ( y ) = ∫ 0 2 8 3 t 2 d t + ∫ 2 y 0 d t = 1
So:
F ( y ) = { 0 , y < 0 y 3 / 8 , 0 ≤ y ≤ 2 1 , y > 2 F(y) = \begin{cases} 0, & y < 0 \\ y^3/8, & 0 \leq y \leq 2 \\ 1, & y > 2 \end{cases} F ( y ) = ⎩ ⎨ ⎧ 0 , y 3 /8 , 1 , y < 0 0 ≤ y ≤ 2 y > 2 Check: F ( 0 ) = 0 F(0) = 0 F ( 0 ) = 0 ✓, F ( 2 ) = 8 / 8 = 1 F(2) = 8/8 = 1 F ( 2 ) = 8/8 = 1 ✓, and F ′ ( y ) = 3 y 2 / 8 = f ( y ) F'(y) = 3y^2/8 = f(y) F ′ ( y ) = 3 y 2 /8 = f ( y ) on ( 0 , 2 ) (0,2) ( 0 , 2 ) ✓.
In R.
# Define the PDF
f <- function(y) ifelse(y >= 0 & y <= 2, (3/8) * y^2, 0)
# Verify total area = 1
integrate(f, -Inf, Inf)
# 1 with absolute error < 2e-14
# P(1 <= Y <= 2)
integrate(f, 1, 2)
# 0.875 with absolute error < 9.7e-15
# That's 7/8 ✓Interpretation.
The density f ( y ) = 3 8 y 2 f(y) = \frac{3}{8}y^2 f ( y ) = 8 3 y 2 is zero at y = 0 y = 0 y = 0 and increases to f ( 2 ) = 3 2 f(2) = \frac{3}{2} f ( 2 ) = 2 3 at y = 2 y = 2 y = 2 . Notice that f ( 2 ) = 1.5 > 1 f(2) = 1.5 > 1 f ( 2 ) = 1.5 > 1 — that’s fine, because f ( y ) f(y) f ( y ) is a density, not a probability. The total area under the curve is what must equal 1, and it does. Most of the probability (7 8 = 87.5 % \frac{7}{8} = 87.5\% 8 7 = 87.5% ) is concentrated in the upper half of the interval [ 1 , 2 ] [1, 2] [ 1 , 2 ] because the density is much higher there.
The Problem.
The time Y Y Y (in hours) that a library book on 3-hour reserve is actually checked out has the CDF:
F ( y ) = { 0 , y < 0 y 2 9 , 0 ≤ y < 3 1 , y ≥ 3 F(y) = \begin{cases} 0, & y < 0 \\ \frac{y^2}{9}, & 0 \leq y < 3 \\ 1, & y \geq 3 \end{cases} F ( y ) = ⎩ ⎨ ⎧ 0 , 9 y 2 , 1 , y < 0 0 ≤ y < 3 y ≥ 3 (a) Find the PDF f ( y ) f(y) f ( y ) .
(b) Find P ( 1 ≤ Y ≤ 2 ) P(1 \leq Y \leq 2) P ( 1 ≤ Y ≤ 2 ) .
(c) Find the median checkout time.
Solution.
(a) Differentiate F ( y ) F(y) F ( y ) :
f ( y ) = F ′ ( y ) = { 2 y 9 , 0 < y < 3 0 , elsewhere f(y) = F'(y) = \begin{cases} \frac{2y}{9}, & 0 < y < 3 \\ 0, & \text{elsewhere} \end{cases} f ( y ) = F ′ ( y ) = { 9 2 y , 0 , 0 < y < 3 elsewhere Check: f ( y ) ≥ 0 f(y) \geq 0 f ( y ) ≥ 0 for all y y y ✓, and ∫ 0 3 2 y 9 d y = 2 9 ⋅ y 2 2 ∣ 0 3 = 1 9 ( 9 ) = 1 \int_0^3 \frac{2y}{9} \, dy = \frac{2}{9} \cdot \frac{y^2}{2}\big|_0^3 = \frac{1}{9}(9) = 1 ∫ 0 3 9 2 y d y = 9 2 ⋅ 2 y 2 ∣ ∣ 0 3 = 9 1 ( 9 ) = 1 ✓.
(b) Using the CDF directly:
P ( 1 ≤ Y ≤ 2 ) = F ( 2 ) − F ( 1 ) = 4 9 − 1 9 = 3 9 = 1 3 P(1 \leq Y \leq 2) = F(2) - F(1) = \frac{4}{9} - \frac{1}{9} = \frac{3}{9} = \frac{1}{3} P ( 1 ≤ Y ≤ 2 ) = F ( 2 ) − F ( 1 ) = 9 4 − 9 1 = 9 3 = 3 1 Or equivalently by integrating: ∫ 1 2 2 y 9 d y = 1 9 ( y 2 ) ∣ 1 2 = 4 − 1 9 = 1 3 \int_1^2 \frac{2y}{9} \, dy = \frac{1}{9}(y^2)\big|_1^2 = \frac{4 - 1}{9} = \frac{1}{3} ∫ 1 2 9 2 y d y = 9 1 ( y 2 ) ∣ ∣ 1 2 = 9 4 − 1 = 3 1 ✓.
(c) The median ϕ 0.5 \phi_{0.5} ϕ 0.5 satisfies F ( ϕ 0.5 ) = 0.5 F(\phi_{0.5}) = 0.5 F ( ϕ 0.5 ) = 0.5 :
ϕ 0.5 2 9 = 0.5 ⟹ ϕ 0.5 2 = 4.5 ⟹ ϕ 0.5 = 4.5 ≈ 2.12 hours \frac{\phi_{0.5}^2}{9} = 0.5 \implies \phi_{0.5}^2 = 4.5 \implies \phi_{0.5} = \sqrt{4.5} \approx 2.12 \text{ hours} 9 ϕ 0.5 2 = 0.5 ⟹ ϕ 0.5 2 = 4.5 ⟹ ϕ 0.5 = 4.5 ≈ 2.12 hours In R.
# Define PDF and CDF
f <- function(y) ifelse(y > 0 & y < 3, 2*y/9, 0)
Fy <- function(y) ifelse(y < 0, 0, ifelse(y < 3, y^2/9, 1))
# P(1 <= Y <= 2)
Fy(2) - Fy(1) # 0.3333333
# Median
sqrt(4.5) # 2.12132Interpretation.
The density f ( y ) = 2 y 9 f(y) = \frac{2y}{9} f ( y ) = 9 2 y starts at zero and increases linearly, meaning longer checkout times are more likely than shorter ones. The median is about 2.12 hours — half of all checkouts are returned before 2.12 hours, and half after. Notice that the median (≈ 2.12 \approx 2.12 ≈ 2.12 ) is greater than the midpoint of the interval (1.5), which makes sense because the density puts more weight on higher values.
2.5 Quantiles and Percentiles ¶ If 0 < p < 1 0 < p < 1 0 < p < 1 , the p p p th quantile (or 100 p 100p 100 p th percentile ) of a continuous random variable Y Y Y is the value ϕ p \phi_p ϕ p such that:
F ( ϕ p ) = P ( Y ≤ ϕ p ) = p F(\phi_p) = P(Y \leq \phi_p) = p F ( ϕ p ) = P ( Y ≤ ϕ p ) = p The median is the special case ϕ 0.5 \phi_{0.5} ϕ 0.5 . The first quartile is ϕ 0.25 \phi_{0.25} ϕ 0.25 , and the third quartile is ϕ 0.75 \phi_{0.75} ϕ 0.75 .
Solution.
A continuous random variable Y Y Y has the density function:
f ( y ) = { k ( 3 − y ) , 0 ≤ y ≤ 3 0 , elsewhere f(y) = \begin{cases} k(3 - y), & 0 \leq y \leq 3 \\ 0, & \text{elsewhere} \end{cases} f ( y ) = { k ( 3 − y ) , 0 , 0 ≤ y ≤ 3 elsewhere (a) Find k k k .
∫ 0 3 k ( 3 − y ) d y = k [ 3 y − y 2 2 ] 0 3 = k ( 9 − 9 2 ) = 9 k 2 = 1 ⟹ k = 2 9 \int_0^3 k(3 - y) \, dy = k\left[3y - \frac{y^2}{2}\right]_0^3 = k\left(9 - \frac{9}{2}\right) = \frac{9k}{2} = 1 \implies k = \frac{2}{9} ∫ 0 3 k ( 3 − y ) d y = k [ 3 y − 2 y 2 ] 0 3 = k ( 9 − 2 9 ) = 2 9 k = 1 ⟹ k = 9 2 (b) Find F ( y ) F(y) F ( y ) .
For 0 ≤ y ≤ 3 0 \leq y \leq 3 0 ≤ y ≤ 3 :
F ( y ) = ∫ 0 y 2 9 ( 3 − t ) d t = 2 9 [ 3 t − t 2 2 ] 0 y = 2 9 ( 3 y − y 2 2 ) = 6 y − y 2 9 F(y) = \int_0^y \frac{2}{9}(3 - t) \, dt = \frac{2}{9}\left[3t - \frac{t^2}{2}\right]_0^y = \frac{2}{9}\left(3y - \frac{y^2}{2}\right) = \frac{6y - y^2}{9} F ( y ) = ∫ 0 y 9 2 ( 3 − t ) d t = 9 2 [ 3 t − 2 t 2 ] 0 y = 9 2 ( 3 y − 2 y 2 ) = 9 6 y − y 2 F ( y ) = { 0 , y < 0 6 y − y 2 9 , 0 ≤ y ≤ 3 1 , y > 3 F(y) = \begin{cases} 0, & y < 0 \\ \frac{6y - y^2}{9}, & 0 \leq y \leq 3 \\ 1, & y > 3 \end{cases} F ( y ) = ⎩ ⎨ ⎧ 0 , 9 6 y − y 2 , 1 , y < 0 0 ≤ y ≤ 3 y > 3 (c) Find P ( 0.5 ≤ Y ≤ 2 ) P(0.5 \leq Y \leq 2) P ( 0.5 ≤ Y ≤ 2 ) .
P ( 0.5 ≤ Y ≤ 2 ) = F ( 2 ) − F ( 0.5 ) = 12 − 4 9 − 3 − 0.25 9 = 8 9 − 2.75 9 = 5.25 9 ≈ 0.5833 P(0.5 \leq Y \leq 2) = F(2) - F(0.5) = \frac{12 - 4}{9} - \frac{3 - 0.25}{9} = \frac{8}{9} - \frac{2.75}{9} = \frac{5.25}{9} \approx 0.5833 P ( 0.5 ≤ Y ≤ 2 ) = F ( 2 ) − F ( 0.5 ) = 9 12 − 4 − 9 3 − 0.25 = 9 8 − 9 2.75 = 9 5.25 ≈ 0.5833 (d) Find the median.
6 ϕ 0.5 − ϕ 0.5 2 9 = 0.5 ⟹ ϕ 0.5 2 − 6 ϕ 0.5 + 4.5 = 0 \frac{6\phi_{0.5} - \phi_{0.5}^2}{9} = 0.5 \implies \phi_{0.5}^2 - 6\phi_{0.5} + 4.5 = 0 9 6 ϕ 0.5 − ϕ 0.5 2 = 0.5 ⟹ ϕ 0.5 2 − 6 ϕ 0.5 + 4.5 = 0 Using the quadratic formula: ϕ 0.5 = 6 ± 36 − 18 2 = 6 ± 18 2 = 3 ± 3 2 2 \phi_{0.5} = \frac{6 \pm \sqrt{36 - 18}}{2} = \frac{6 \pm \sqrt{18}}{2} = 3 \pm \frac{3\sqrt{2}}{2} ϕ 0.5 = 2 6 ± 36 − 18 = 2 6 ± 18 = 3 ± 2 3 2
Since 0 ≤ ϕ 0.5 ≤ 3 0 \leq \phi_{0.5} \leq 3 0 ≤ ϕ 0.5 ≤ 3 : ϕ 0.5 = 3 − 3 2 2 ≈ 3 − 2.121 = 0.879 \phi_{0.5} = 3 - \frac{3\sqrt{2}}{2} \approx 3 - 2.121 = 0.879 ϕ 0.5 = 3 − 2 3 2 ≈ 3 − 2.121 = 0.879
In R:
f <- function(y) ifelse(y >= 0 & y <= 3, (2/9) * (3 - y), 0)
integrate(f, 0.5, 2) # 0.5833333
# Median: solve the quadratic
3 - 3*sqrt(2)/2 # 0.87867972.6 Conditional Probability with Continuous Random Variables ¶ Conditional probabilities work the same way as in the discrete case, but with integrals instead of sums:
P ( Y > 1.5 ∣ Y < 3 ) = P ( Y > 1.5 and Y < 3 ) P ( Y < 3 ) = P ( 1.5 < Y < 3 ) P ( Y < 3 ) P(Y > 1.5 \mid Y < 3) = \frac{P(Y > 1.5 \text{ and } Y < 3)}{P(Y < 3)} = \frac{P(1.5 < Y < 3)}{P(Y < 3)} P ( Y > 1.5 ∣ Y < 3 ) = P ( Y < 3 ) P ( Y > 1.5 and Y < 3 ) = P ( Y < 3 ) P ( 1.5 < Y < 3 ) The Problem.
Using the checkout time distribution from Example 5.2, where f ( y ) = 2 y 9 f(y) = \frac{2y}{9} f ( y ) = 9 2 y for 0 < y < 3 0 < y < 3 0 < y < 3 , find the probability that a book is checked out for more than 2 hours, given that it has already been out for at least 1 hour.
Solution.
P ( Y > 2 ∣ Y > 1 ) = P ( Y > 2 and Y > 1 ) P ( Y > 1 ) = P ( Y > 2 ) P ( Y > 1 ) P(Y > 2 \mid Y > 1) = \frac{P(Y > 2 \text{ and } Y > 1)}{P(Y > 1)} = \frac{P(Y > 2)}{P(Y > 1)} P ( Y > 2 ∣ Y > 1 ) = P ( Y > 1 ) P ( Y > 2 and Y > 1 ) = P ( Y > 1 ) P ( Y > 2 ) P ( Y > 2 ) = 1 − F ( 2 ) = 1 − 4 9 = 5 9 P(Y > 2) = 1 - F(2) = 1 - \frac{4}{9} = \frac{5}{9} P ( Y > 2 ) = 1 − F ( 2 ) = 1 − 9 4 = 9 5 P ( Y > 1 ) = 1 − F ( 1 ) = 1 − 1 9 = 8 9 P(Y > 1) = 1 - F(1) = 1 - \frac{1}{9} = \frac{8}{9} P ( Y > 1 ) = 1 − F ( 1 ) = 1 − 9 1 = 9 8 P ( Y > 2 ∣ Y > 1 ) = 5 / 9 8 / 9 = 5 8 = 0.625 P(Y > 2 \mid Y > 1) = \frac{5/9}{8/9} = \frac{5}{8} = 0.625 P ( Y > 2 ∣ Y > 1 ) = 8/9 5/9 = 8 5 = 0.625 Interpretation.
Given that the book has already been out for an hour, there’s a 62.5% chance it will be out for more than 2 hours. Notice this is higher than the unconditional probability P ( Y > 2 ) = 5 / 9 ≈ 55.6 % P(Y > 2) = 5/9 \approx 55.6\% P ( Y > 2 ) = 5/9 ≈ 55.6% . This makes intuitive sense: the density increases with y y y , so a book that’s already been out for a while is more likely to stay out even longer.
Interpreting f ( y ) f(y) f ( y ) as a probability. The density f ( y ) f(y) f ( y ) is NOT a probability. It is a rate — the rate at which probability accumulates at the point y y y . Only the integral of f ( y ) f(y) f ( y ) over an interval gives a probability. The density can exceed 1.
Forgetting that P ( Y = a ) = 0 P(Y = a) = 0 P ( Y = a ) = 0 . For continuous random variables, the probability of any single exact value is zero. This means P ( Y < 3 ) = P ( Y ≤ 3 ) P(Y < 3) = P(Y \leq 3) P ( Y < 3 ) = P ( Y ≤ 3 ) . If you’re computing P ( 1 ≤ Y ≤ 2 ) P(1 \leq Y \leq 2) P ( 1 ≤ Y ≤ 2 ) and you accidentally exclude the endpoints, you get the same answer — no harm done.
Confusing PDF and CDF. The PDF f ( y ) f(y) f ( y ) is the derivative of the CDF F ( y ) F(y) F ( y ) . The CDF goes from 0 to 1 and is always nondecreasing. The PDF can be any nonnegative function whose total area is 1 — it does NOT need to be between 0 and 1.
Leaving f ( y ) f(y) f ( y ) undefined outside the support. Always define f ( y ) = 0 f(y) = 0 f ( y ) = 0 outside the interval where the density is positive. If f ( y ) = 2 y f(y) = 2y f ( y ) = 2 y for 0 ≤ y ≤ 1 0 \leq y \leq 1 0 ≤ y ≤ 1 , write the complete definition with “0 elsewhere.” If you forget, your integrals will have wrong limits.
Not checking your CDF. After computing F ( y ) F(y) F ( y ) , always verify: does F ( y ) = 0 F(y) = 0 F ( y ) = 0 at the left boundary? Does F ( y ) = 1 F(y) = 1 F ( y ) = 1 at the right boundary? Is F ( y ) F(y) F ( y ) continuous (no jumps)? If any check fails, retrace your integration.
2.7 Section 5.2 Exercises ¶ 5.2.1. A continuous random variable Y Y Y has the density function:
f ( y ) = { c y ( 2 − y ) , 0 ≤ y ≤ 2 0 , elsewhere f(y) = \begin{cases} cy(2 - y), & 0 \leq y \leq 2 \\ 0, & \text{elsewhere} \end{cases} f ( y ) = { cy ( 2 − y ) , 0 , 0 ≤ y ≤ 2 elsewhere (a) Find the value of c c c .
(b) Find F ( y ) F(y) F ( y ) .
(c) Find P ( 0.5 ≤ Y ≤ 1.5 ) P(0.5 \leq Y \leq 1.5) P ( 0.5 ≤ Y ≤ 1.5 ) .
(d) Find P ( Y > 1 ∣ Y < 1.5 ) P(Y > 1 \mid Y < 1.5) P ( Y > 1 ∣ Y < 1.5 ) .
5.2.2. The distribution function of a continuous random variable Y Y Y is:
F ( y ) = { 0 , y < 1 1 − 1 y 2 , y ≥ 1 F(y) = \begin{cases} 0, & y < 1 \\ 1 - \frac{1}{y^2}, & y \geq 1 \end{cases} F ( y ) = { 0 , 1 − y 2 1 , y < 1 y ≥ 1 (a) Show that F ( y ) F(y) F ( y ) has all the properties of a valid CDF.
(b) Find the PDF f ( y ) f(y) f ( y ) .
(c) Find P ( Y > 3 ) P(Y > 3) P ( Y > 3 ) .
(d) Find the median of Y Y Y .
(e) Find P ( Y > 4 ∣ Y > 2 ) P(Y > 4 \mid Y > 2) P ( Y > 4 ∣ Y > 2 ) .
5.2.3. A continuous random variable Y Y Y has the density function:
f ( y ) = { 0.3 , − 1 < y ≤ 0 0.3 + k y , 0 < y ≤ 1 0 , elsewhere f(y) = \begin{cases} 0.3, & -1 < y \leq 0 \\ 0.3 + ky, & 0 < y \leq 1 \\ 0, & \text{elsewhere} \end{cases} f ( y ) = ⎩ ⎨ ⎧ 0.3 , 0.3 + k y , 0 , − 1 < y ≤ 0 0 < y ≤ 1 elsewhere (a) Find k k k .
(b) Find F ( y ) F(y) F ( y ) .
(c) Find P ( Y > 0.5 ) P(Y > 0.5) P ( Y > 0.5 ) .
5.2.4. A supermarket receives a delivery of a perishable product. The proportion of the delivery that is still usable after y y y days follows the density function:
f ( y ) = { 3 8 ( 2 − y ) 2 , 0 ≤ y ≤ 2 0 , elsewhere f(y) = \begin{cases} \frac{3}{8}(2 - y)^2, & 0 \leq y \leq 2 \\ 0, & \text{elsewhere} \end{cases} f ( y ) = { 8 3 ( 2 − y ) 2 , 0 , 0 ≤ y ≤ 2 elsewhere (a) Verify that this is a valid PDF.
(b) What fraction of the delivery is still usable after 1 day? (That is, find P ( Y > 1 ) P(Y > 1) P ( Y > 1 ) .)
(c) Find the median shelf life.
5.2.5. (Proof ) Let f ( y ) f(y) f ( y ) be a PDF that is symmetric about 0, meaning f ( y ) = f ( − y ) f(y) = f(-y) f ( y ) = f ( − y ) for all y y y . Show that P ( Y > 0 ) = 1 / 2 P(Y > 0) = 1/2 P ( Y > 0 ) = 1/2 . (Hint: Use the substitution u = − y u = -y u = − y in the integral ∫ 0 ∞ f ( y ) d y \int_{0}^{\infty} f(y) \, dy ∫ 0 ∞ f ( y ) d y .)
We now have the two main tools for working with continuous random variables: the PDF f ( y ) = F ′ ( y ) f(y) = F'(y) f ( y ) = F ′ ( y ) and the CDF F ( y ) = ∫ − ∞ y f ( t ) d t F(y) = \int_{-\infty}^y f(t) \, dt F ( y ) = ∫ − ∞ y f ( t ) d t . They are two sides of the same coin — the CDF accumulates probability, and the PDF describes the rate of accumulation.
The real-life interpretation: The PDF is the “shape” of uncertainty. When you see a weather forecast showing a graph of possible rainfall amounts, with a peak around 1 inch and a long tail to the right — that graph is a PDF. The height of the curve at any point tells you how “concentrated” the probability is near that value. To find the probability of any range of outcomes, you compute the area under the curve between those values.
We also learned practical techniques: given a PDF, find c c c to make it valid (set the total area to 1); given a CDF, differentiate to find the PDF; compute conditional probabilities by dividing integrals. And we got our first Common Mistakes — especially the crucial fact that f ( y ) f(y) f ( y ) is a density, not a probability, and can exceed 1.
Looking ahead: Now that we know how to compute probabilities with PDFs, we need measures of center and spread: the expected value and variance. That’s Section 5.3.
3 Expected Values for Continuous Random Variables ¶ In Chapter 4, we defined the expected value of a discrete random variable as E ( Y ) = ∑ y y ⋅ p ( y ) E(Y) = \sum_y y \cdot p(y) E ( Y ) = ∑ y y ⋅ p ( y ) — a weighted average where each value is weighted by its probability. We also defined the variance V ( Y ) = E [ ( Y − μ ) 2 ] V(Y) = E[(Y - \mu)^2] V ( Y ) = E [( Y − μ ) 2 ] as a measure of spread.
Now we need the continuous versions. The conceptual idea is identical — a “weighted average” — but the mechanism changes: sums become integrals, and p ( y ) p(y) p ( y ) becomes f ( y ) d y f(y) \, dy f ( y ) d y . Everything else carries over: the variance shortcut formula, the linearity of expectation, the rules for constants. If you understood expected values in Chapter 4, this section is the calculus upgrade.
Real-life motivation: An insurance company models the dollar amount of individual claims using a continuous distribution. The expected value E ( Y ) E(Y) E ( Y ) tells them the average claim size — the number they use to set premiums. The variance V ( Y ) V(Y) V ( Y ) tells them how wildly claims vary — the number they use to set reserves. Both require integrating the claim distribution. Without expected values, there are no premiums, no reserves, and no insurance industry.
3.1 The Expected Value ¶ Compare this to the discrete case: E ( Y ) = ∑ y ⋅ p ( y ) E(Y) = \sum y \cdot p(y) E ( Y ) = ∑ y ⋅ p ( y ) . The integral replaces the sum, f ( y ) d y f(y) \, dy f ( y ) d y replaces p ( y ) p(y) p ( y ) , and everything else is the same.
Throughout this chapter, we integrate expressions of the form ∫ y n f ( y ) d y \int y^n f(y) \, dy ∫ y n f ( y ) d y . Here are the rules that appear repeatedly:
Power Rule: ∫ y n d y = y n + 1 n + 1 + C \displaystyle\int y^n \, dy = \frac{y^{n+1}}{n+1} + C ∫ y n d y = n + 1 y n + 1 + C for n ≠ − 1 n \neq -1 n = − 1
Exponential Rule: ∫ e a y d y = 1 a e a y + C \displaystyle\int e^{ay} \, dy = \frac{1}{a}e^{ay} + C ∫ e a y d y = a 1 e a y + C
Definite Integral (Fundamental Theorem of Calculus): ∫ a b g ( y ) d y = G ( b ) − G ( a ) \displaystyle\int_a^b g(y) \, dy = G(b) - G(a) ∫ a b g ( y ) d y = G ( b ) − G ( a ) , where G ′ ( y ) = g ( y ) G'(y) = g(y) G ′ ( y ) = g ( y )
Constant Multiple Rule: ∫ c ⋅ g ( y ) d y = c ∫ g ( y ) d y \displaystyle\int c \cdot g(y) \, dy = c \int g(y) \, dy ∫ c ⋅ g ( y ) d y = c ∫ g ( y ) d y — constants pull out of integrals
Integration by Parts: ∫ u d v = u v − ∫ v d u \displaystyle\int u \, dv = uv - \int v \, du ∫ u d v = uv − ∫ v d u — used for products like y ⋅ e − y y \cdot e^{-y} y ⋅ e − y
u u u -Substitution: If u = h ( y ) u = h(y) u = h ( y ) , then d u = h ′ ( y ) d y du = h'(y) \, dy d u = h ′ ( y ) d y , and the integral is rewritten in terms of u u u
If you’re rusty on any of these, revisit them now — every section of this chapter uses them.
3.2 Expected Value of a Function of Y Y Y ¶ Just as in the discrete case, we often need the expected value of some function g ( Y ) g(Y) g ( Y ) rather than Y Y Y itself:
Let g ( Y ) g(Y) g ( Y ) be a function of a continuous random variable Y Y Y . Then:
E [ g ( Y ) ] = ∫ − ∞ ∞ g ( y ) f ( y ) d y E[g(Y)] = \int_{-\infty}^{\infty} g(y) \, f(y) \, dy E [ g ( Y )] = ∫ − ∞ ∞ g ( y ) f ( y ) d y provided the integral exists.
Why this matters: This theorem lets us compute E ( Y 2 ) E(Y^2) E ( Y 2 ) , E ( e t Y ) E(e^{tY}) E ( e t Y ) , E ( a Y + b ) E(aY + b) E ( aY + b ) , or E E E of any function of Y Y Y — all without first finding the distribution of g ( Y ) g(Y) g ( Y ) .
3.3 Variance and Standard Deviation ¶ The shortcut formula from Chapter 4 still works:
V ( Y ) = E ( Y 2 ) − [ E ( Y ) ] 2 = E ( Y 2 ) − μ 2 V(Y) = E(Y^2) - [E(Y)]^2 = E(Y^2) - \mu^2 V ( Y ) = E ( Y 2 ) − [ E ( Y ) ] 2 = E ( Y 2 ) − μ 2 Proof.
Strategy: Expand ( Y − μ ) 2 (Y - \mu)^2 ( Y − μ ) 2 inside the expectation, then use the fact that the expected value of a sum is the sum of the expected values (linearity), and that μ \mu μ is a constant.
V ( Y ) = E [ ( Y − μ ) 2 ] V(Y) = E[(Y - \mu)^2] V ( Y ) = E [( Y − μ ) 2 ] First, expand the square algebraically — this is just ( a − b ) 2 = a 2 − 2 a b + b 2 (a - b)^2 = a^2 - 2ab + b^2 ( a − b ) 2 = a 2 − 2 ab + b 2 :
= E [ Y 2 − 2 μ Y + μ 2 ] = E[Y^2 - 2\mu Y + \mu^2] = E [ Y 2 − 2 μ Y + μ 2 ] Now apply linearity of expectation (Theorem 5.6, property 3) — the expectation of a sum is the sum of expectations:
= E ( Y 2 ) − E ( 2 μ Y ) + E ( μ 2 ) = E(Y^2) - E(2\mu Y) + E(\mu^2) = E ( Y 2 ) − E ( 2 μ Y ) + E ( μ 2 ) Since μ \mu μ is a constant, we can pull it out (property 2): E ( 2 μ Y ) = 2 μ ⋅ E ( Y ) = 2 μ ⋅ μ = 2 μ 2 E(2\mu Y) = 2\mu \cdot E(Y) = 2\mu \cdot \mu = 2\mu^2 E ( 2 μ Y ) = 2 μ ⋅ E ( Y ) = 2 μ ⋅ μ = 2 μ 2 . And E ( μ 2 ) = μ 2 E(\mu^2) = \mu^2 E ( μ 2 ) = μ 2 (property 1: the expectation of a constant is itself). So:
= E ( Y 2 ) − 2 μ 2 + μ 2 = E ( Y 2 ) − μ 2 ■ = E(Y^2) - 2\mu^2 + \mu^2 = E(Y^2) - \mu^2 \qquad \blacksquare = E ( Y 2 ) − 2 μ 2 + μ 2 = E ( Y 2 ) − μ 2 ■ In practice: To compute V ( Y ) V(Y) V ( Y ) , you compute two integrals — E ( Y ) = ∫ y f ( y ) d y E(Y) = \int y \, f(y) \, dy E ( Y ) = ∫ y f ( y ) d y and E ( Y 2 ) = ∫ y 2 f ( y ) d y E(Y^2) = \int y^2 \, f(y) \, dy E ( Y 2 ) = ∫ y 2 f ( y ) d y — then subtract the square of the first from the second. This is almost always easier than computing ∫ ( y − μ ) 2 f ( y ) d y \int (y - \mu)^2 f(y) \, dy ∫ ( y − μ ) 2 f ( y ) d y directly.
3.4 Properties of Expected Value ¶ The linearity results from Chapter 4 carry over unchanged:
Let c c c be a constant and let g ( Y ) , g 1 ( Y ) , … , g k ( Y ) g(Y), g_1(Y), \ldots, g_k(Y) g ( Y ) , g 1 ( Y ) , … , g k ( Y ) be functions of a continuous random variable Y Y Y . Then:
E ( c ) = c E(c) = c E ( c ) = c
E [ c g ( Y ) ] = c ⋅ E [ g ( Y ) ] E[cg(Y)] = c \cdot E[g(Y)] E [ c g ( Y )] = c ⋅ E [ g ( Y )]
E [ g 1 ( Y ) + g 2 ( Y ) + ⋯ + g k ( Y ) ] = E [ g 1 ( Y ) ] + E [ g 2 ( Y ) ] + ⋯ + E [ g k ( Y ) ] E[g_1(Y) + g_2(Y) + \cdots + g_k(Y)] = E[g_1(Y)] + E[g_2(Y)] + \cdots + E[g_k(Y)] E [ g 1 ( Y ) + g 2 ( Y ) + ⋯ + g k ( Y )] = E [ g 1 ( Y )] + E [ g 2 ( Y )] + ⋯ + E [ g k ( Y )]
As a consequence:
3.5 Worked Examples ¶ The Problem.
The density function from Example 5.1 was f ( y ) = 3 8 y 2 f(y) = \frac{3}{8}y^2 f ( y ) = 8 3 y 2 for 0 ≤ y ≤ 2 0 \leq y \leq 2 0 ≤ y ≤ 2 . Find μ = E ( Y ) \mu = E(Y) μ = E ( Y ) and σ 2 = V ( Y ) \sigma^2 = V(Y) σ 2 = V ( Y ) .
Solution.
Step 1: Find E ( Y ) E(Y) E ( Y ) .
E ( Y ) = ∫ 0 2 y ⋅ 3 8 y 2 d y = 3 8 ∫ 0 2 y 3 d y = 3 8 ⋅ y 4 4 ∣ 0 2 = 3 8 ⋅ 16 4 = 3 8 ⋅ 4 = 3 2 = 1.5 E(Y) = \int_0^2 y \cdot \frac{3}{8}y^2 \, dy = \frac{3}{8}\int_0^2 y^3 \, dy = \frac{3}{8} \cdot \frac{y^4}{4}\bigg|_0^2 = \frac{3}{8} \cdot \frac{16}{4} = \frac{3}{8} \cdot 4 = \frac{3}{2} = 1.5 E ( Y ) = ∫ 0 2 y ⋅ 8 3 y 2 d y = 8 3 ∫ 0 2 y 3 d y = 8 3 ⋅ 4 y 4 ∣ ∣ 0 2 = 8 3 ⋅ 4 16 = 8 3 ⋅ 4 = 2 3 = 1.5 Step 2: Find E ( Y 2 ) E(Y^2) E ( Y 2 ) .
E ( Y 2 ) = ∫ 0 2 y 2 ⋅ 3 8 y 2 d y = 3 8 ∫ 0 2 y 4 d y = 3 8 ⋅ y 5 5 ∣ 0 2 = 3 8 ⋅ 32 5 = 12 5 = 2.4 E(Y^2) = \int_0^2 y^2 \cdot \frac{3}{8}y^2 \, dy = \frac{3}{8}\int_0^2 y^4 \, dy = \frac{3}{8} \cdot \frac{y^5}{5}\bigg|_0^2 = \frac{3}{8} \cdot \frac{32}{5} = \frac{12}{5} = 2.4 E ( Y 2 ) = ∫ 0 2 y 2 ⋅ 8 3 y 2 d y = 8 3 ∫ 0 2 y 4 d y = 8 3 ⋅ 5 y 5 ∣ ∣ 0 2 = 8 3 ⋅ 5 32 = 5 12 = 2.4 Step 3: Apply the shortcut formula.
V ( Y ) = E ( Y 2 ) − [ E ( Y ) ] 2 = 2.4 − ( 1.5 ) 2 = 2.4 − 2.25 = 0.15 V(Y) = E(Y^2) - [E(Y)]^2 = 2.4 - (1.5)^2 = 2.4 - 2.25 = 0.15 V ( Y ) = E ( Y 2 ) − [ E ( Y ) ] 2 = 2.4 − ( 1.5 ) 2 = 2.4 − 2.25 = 0.15 σ = 0.15 ≈ 0.3873 \sigma = \sqrt{0.15} \approx 0.3873 σ = 0.15 ≈ 0.3873 In R.
f <- function(y) ifelse(y >= 0 & y <= 2, (3/8) * y^2, 0)
# E(Y)
EY <- integrate(function(y) y * f(y), 0, 2)$value
EY # 1.5
# E(Y^2)
EY2 <- integrate(function(y) y^2 * f(y), 0, 2)$value
EY2 # 2.4
# Variance and SD
VY <- EY2 - EY^2
VY # 0.15
sqrt(VY) # 0.3872983Interpretation.
The mean of 1.5 sits at the center of the interval [ 0 , 2 ] [0, 2] [ 0 , 2 ] , but the distribution is right-skewed (the density increases as y y y increases), so values near 2 are more common than values near 0. The standard deviation of about 0.39 tells us that a “typical” observation is roughly 0.39 units from the mean. The interval μ ± 2 σ = ( 0.73 , 2.27 ) \mu \pm 2\sigma = (0.73, 2.27) μ ± 2 σ = ( 0.73 , 2.27 ) captures most of the probability.
The Problem.
The proportion of time Y Y Y that a manufacturing robot is in operation during a 40-hour work week has the density function f ( y ) = 2 y f(y) = 2y f ( y ) = 2 y for 0 ≤ y ≤ 1 0 \leq y \leq 1 0 ≤ y ≤ 1 . The weekly profit (in hundreds of dollars) from the robot is X = 200 Y − 60 X = 200Y - 60 X = 200 Y − 60 .
(a) Find E ( Y ) E(Y) E ( Y ) and V ( Y ) V(Y) V ( Y ) .
(b) Find the expected weekly profit E ( X ) E(X) E ( X ) and V ( X ) V(X) V ( X ) .
Solution.
(a)
E ( Y ) = ∫ 0 1 y ⋅ 2 y d y = 2 ∫ 0 1 y 2 d y = 2 ⋅ y 3 3 ∣ 0 1 = 2 3 E(Y) = \int_0^1 y \cdot 2y \, dy = 2\int_0^1 y^2 \, dy = 2 \cdot \frac{y^3}{3}\bigg|_0^1 = \frac{2}{3} E ( Y ) = ∫ 0 1 y ⋅ 2 y d y = 2 ∫ 0 1 y 2 d y = 2 ⋅ 3 y 3 ∣ ∣ 0 1 = 3 2 E ( Y 2 ) = ∫ 0 1 y 2 ⋅ 2 y d y = 2 ∫ 0 1 y 3 d y = 2 ⋅ y 4 4 ∣ 0 1 = 1 2 E(Y^2) = \int_0^1 y^2 \cdot 2y \, dy = 2\int_0^1 y^3 \, dy = 2 \cdot \frac{y^4}{4}\bigg|_0^1 = \frac{1}{2} E ( Y 2 ) = ∫ 0 1 y 2 ⋅ 2 y d y = 2 ∫ 0 1 y 3 d y = 2 ⋅ 4 y 4 ∣ ∣ 0 1 = 2 1 V ( Y ) = 1 2 − ( 2 3 ) 2 = 1 2 − 4 9 = 9 − 8 18 = 1 18 V(Y) = \frac{1}{2} - \left(\frac{2}{3}\right)^2 = \frac{1}{2} - \frac{4}{9} = \frac{9 - 8}{18} = \frac{1}{18} V ( Y ) = 2 1 − ( 3 2 ) 2 = 2 1 − 9 4 = 18 9 − 8 = 18 1 (b) Since X = 200 Y − 60 X = 200Y - 60 X = 200 Y − 60 (a linear function of Y Y Y ):
E ( X ) = 200 ⋅ E ( Y ) − 60 = 200 ⋅ 2 3 − 60 = 400 3 − 60 = 400 − 180 3 = 220 3 ≈ $ 73.33 (hundreds) E(X) = 200 \cdot E(Y) - 60 = 200 \cdot \frac{2}{3} - 60 = \frac{400}{3} - 60 = \frac{400 - 180}{3} = \frac{220}{3} \approx \$73.33 \text{ (hundreds)} E ( X ) = 200 ⋅ E ( Y ) − 60 = 200 ⋅ 3 2 − 60 = 3 400 − 60 = 3 400 − 180 = 3 220 ≈ $73.33 (hundreds) V ( X ) = 20 0 2 ⋅ V ( Y ) = 40000 ⋅ 1 18 = 40000 18 ≈ 2222.22 V(X) = 200^2 \cdot V(Y) = 40000 \cdot \frac{1}{18} = \frac{40000}{18} \approx 2222.22 V ( X ) = 20 0 2 ⋅ V ( Y ) = 40000 ⋅ 18 1 = 18 40000 ≈ 2222.22 The expected weekly profit is about $7,333, with a standard deviation of 2222.22 ≈ $ 4 , 714 \sqrt{2222.22} \approx \$4,714 2222.22 ≈ $4 , 714 (in original dollar units, multiply hundreds by 100).
Solution.
A thermostatically controlled switch turns on at a temperature Y Y Y (in °F) with density:
f ( y ) = { 1 / 4 , 58 ≤ y ≤ 62 0 , elsewhere f(y) = \begin{cases} 1/4, & 58 \leq y \leq 62 \\ 0, & \text{elsewhere} \end{cases} f ( y ) = { 1/4 , 0 , 58 ≤ y ≤ 62 elsewhere (a) Find E ( Y ) E(Y) E ( Y ) and V ( Y ) V(Y) V ( Y ) .
E ( Y ) = ∫ 58 62 y ⋅ 1 4 d y = 1 4 ⋅ y 2 2 ∣ 58 62 = 1 8 ( 6 2 2 − 5 8 2 ) = 1 8 ( 3844 − 3364 ) = 480 8 = 60 E(Y) = \int_{58}^{62} y \cdot \frac{1}{4} \, dy = \frac{1}{4} \cdot \frac{y^2}{2}\bigg|_{58}^{62} = \frac{1}{8}(62^2 - 58^2) = \frac{1}{8}(3844 - 3364) = \frac{480}{8} = 60 E ( Y ) = ∫ 58 62 y ⋅ 4 1 d y = 4 1 ⋅ 2 y 2 ∣ ∣ 58 62 = 8 1 ( 6 2 2 − 5 8 2 ) = 8 1 ( 3844 − 3364 ) = 8 480 = 60 E ( Y 2 ) = ∫ 58 62 y 2 ⋅ 1 4 d y = 1 4 ⋅ y 3 3 ∣ 58 62 = 1 12 ( 238328 − 195112 ) = 43216 12 = 3601.333 E(Y^2) = \int_{58}^{62} y^2 \cdot \frac{1}{4} \, dy = \frac{1}{4} \cdot \frac{y^3}{3}\bigg|_{58}^{62} = \frac{1}{12}(238328 - 195112) = \frac{43216}{12} = 3601.333 E ( Y 2 ) = ∫ 58 62 y 2 ⋅ 4 1 d y = 4 1 ⋅ 3 y 3 ∣ ∣ 58 62 = 12 1 ( 238328 − 195112 ) = 12 43216 = 3601.333 V ( Y ) = 3601.333 − 6 0 2 = 3601.333 − 3600 = 4 3 ≈ 1.333 V(Y) = 3601.333 - 60^2 = 3601.333 - 3600 = \frac{4}{3} \approx 1.333 V ( Y ) = 3601.333 − 6 0 2 = 3601.333 − 3600 = 3 4 ≈ 1.333 (b) The cost to recalibrate is C = 5 ( Y − 60 ) 2 + 10 C = 5(Y - 60)^2 + 10 C = 5 ( Y − 60 ) 2 + 10 . Find E ( C ) E(C) E ( C ) .
E ( C ) = 5 E [ ( Y − 60 ) 2 ] + 10 = 5 V ( Y ) + 10 = 5 ⋅ 4 3 + 10 = 20 3 + 10 = 50 3 ≈ $ 16.67 E(C) = 5E[(Y - 60)^2] + 10 = 5V(Y) + 10 = 5 \cdot \frac{4}{3} + 10 = \frac{20}{3} + 10 = \frac{50}{3} \approx \$16.67 E ( C ) = 5 E [( Y − 60 ) 2 ] + 10 = 5 V ( Y ) + 10 = 5 ⋅ 3 4 + 10 = 3 20 + 10 = 3 50 ≈ $16.67 Note: E [ ( Y − 60 ) 2 ] = V ( Y ) E[(Y - 60)^2] = V(Y) E [( Y − 60 ) 2 ] = V ( Y ) because μ = 60 \mu = 60 μ = 60 , so ( Y − 60 ) 2 = ( Y − μ ) 2 (Y - 60)^2 = (Y - \mu)^2 ( Y − 60 ) 2 = ( Y − μ ) 2 .
3.6 Section 5.3 Exercises ¶ 5.3.1. If Y Y Y has the density function from Guided Practice 5.1 — f ( y ) = 2 9 ( 3 − y ) f(y) = \frac{2}{9}(3 - y) f ( y ) = 9 2 ( 3 − y ) for 0 ≤ y ≤ 3 0 \leq y \leq 3 0 ≤ y ≤ 3 — find E ( Y ) E(Y) E ( Y ) and V ( Y ) V(Y) V ( Y ) .
5.3.2. A continuous random variable Y Y Y has the density function:
f ( y ) = { 3 2 y 2 + y , 0 ≤ y ≤ 1 0 , elsewhere f(y) = \begin{cases} \frac{3}{2}y^2 + y, & 0 \leq y \leq 1 \\ 0, & \text{elsewhere} \end{cases} f ( y ) = { 2 3 y 2 + y , 0 , 0 ≤ y ≤ 1 elsewhere (a) Verify that this is a valid PDF.
(b) Find E ( Y ) E(Y) E ( Y ) and V ( Y ) V(Y) V ( Y ) .
5.3.3. The weekly repair cost Y Y Y for a machine (in hundreds of dollars) has density function f ( y ) = 4 y 3 f(y) = 4y^3 f ( y ) = 4 y 3 for 0 ≤ y ≤ 1 0 \leq y \leq 1 0 ≤ y ≤ 1 , and 0 elsewhere.
(a) Find E ( Y ) E(Y) E ( Y ) and V ( Y ) V(Y) V ( Y ) .
(b) If the machine generates a weekly revenue of R = 3 − 2 Y R = 3 - 2Y R = 3 − 2 Y (in hundreds), find E ( R ) E(R) E ( R ) and V ( R ) V(R) V ( R ) .
(c) What is the probability that the repair cost exceeds the expected repair cost?
5.3.4. (Proof ) Prove Theorem 5.6, property 2: E [ c g ( Y ) ] = c E [ g ( Y ) ] E[cg(Y)] = cE[g(Y)] E [ c g ( Y )] = c E [ g ( Y )] for a continuous random variable Y Y Y with PDF f ( y ) f(y) f ( y ) . (Hint: Pull the constant c c c out of the integral.)
5.3.5. If Y Y Y has the CDF from Exercise 5.2.2 — F ( y ) = 1 − 1 / y 2 F(y) = 1 - 1/y^2 F ( y ) = 1 − 1/ y 2 for y ≥ 1 y \geq 1 y ≥ 1 — find E ( Y ) E(Y) E ( Y ) . Does E ( Y 2 ) E(Y^2) E ( Y 2 ) exist? (Hint: Check whether the improper integral converges.)
We extended the expected value and variance from discrete to continuous random variables. The conceptual meaning is unchanged — E ( Y ) E(Y) E ( Y ) is the “balance point” of the density, and V ( Y ) V(Y) V ( Y ) measures how spread out the distribution is — but the computation now uses integrals instead of sums.
The real-life interpretation: When an insurance company says “the average claim is $5,200,” they computed E ( Y ) = ∫ y f ( y ) d y E(Y) = \int y \, f(y) \, dy E ( Y ) = ∫ y f ( y ) d y where f ( y ) f(y) f ( y ) is the density of claim amounts. When they say “claims are highly variable,” they computed V ( Y ) V(Y) V ( Y ) or σ \sigma σ . The linear transformation rule E ( a Y + b ) = a E ( Y ) + b E(aY + b) = aE(Y) + b E ( aY + b ) = a E ( Y ) + b lets them instantly convert between units — if claims are in thousands, multiply E ( Y ) E(Y) E ( Y ) by 1000 to get dollars.
The shortcut formula V ( Y ) = E ( Y 2 ) − μ 2 V(Y) = E(Y^2) - \mu^2 V ( Y ) = E ( Y 2 ) − μ 2 saves enormous effort. Compute two integrals (E ( Y ) E(Y) E ( Y ) and E ( Y 2 ) E(Y^2) E ( Y 2 ) ) instead of one ugly integral with ( y − μ ) 2 (y - \mu)^2 ( y − μ ) 2 .
Exercise 5.3.5 hints at something subtle: some distributions have infinite variance, or even infinite mean. These “heavy-tailed” distributions arise in finance and insurance — and they’re part of why extreme events are more common than people expect.
Looking ahead: We now have the general tools — PDF, CDF, E ( Y ) E(Y) E ( Y ) , V ( Y ) V(Y) V ( Y ) . Starting in Section 5.4, we study specific named distributions that appear everywhere in practice, beginning with the simplest: the Uniform distribution.
The Uniform distribution is the simplest continuous distribution: every value in an interval is equally likely. The density is a flat, horizontal line — a rectangle whose area is 1.
Despite its simplicity, the Uniform distribution is surprisingly important. It models measurement rounding errors, the arrival time of an event within a known window, and the output of random number generators. It is also the building block for simulating any other continuous distribution — a fact exploited by every statistical software package on the planet.
Real-life motivation: A city bus is scheduled to arrive at your stop sometime between 8:00 and 8:12 AM. You arrive at exactly 8:00. If the bus is equally likely to arrive at any moment in that 12-minute window, how long should you expect to wait? What’s the probability you wait more than 8 minutes? The Uniform distribution answers both questions immediately.
4.1 Definition and Density Function ¶ A random variable Y Y Y has a continuous Uniform distribution on the interval ( θ 1 , θ 2 ) (\theta_1, \theta_2) ( θ 1 , θ 2 ) , written Y ∼ Uniform ( θ 1 , θ 2 ) Y \sim \text{Uniform}(\theta_1, \theta_2) Y ∼ Uniform ( θ 1 , θ 2 ) , if and only if its density function is:
f ( y ) = { 1 θ 2 − θ 1 , θ 1 ≤ y ≤ θ 2 0 , elsewhere f(y) = \begin{cases} \dfrac{1}{\theta_2 - \theta_1}, & \theta_1 \leq y \leq \theta_2 \\[6pt] 0, & \text{elsewhere} \end{cases} f ( y ) = ⎩ ⎨ ⎧ θ 2 − θ 1 1 , 0 , θ 1 ≤ y ≤ θ 2 elsewhere The parameters θ 1 \theta_1 θ 1 and θ 2 \theta_2 θ 2 are the endpoints of the interval.
The density is a constant 1 θ 2 − θ 1 \frac{1}{\theta_2 - \theta_1} θ 2 − θ 1 1 — a flat line. The height is chosen so the area of the rectangle equals 1:
Area = base × height = ( θ 2 − θ 1 ) × 1 θ 2 − θ 1 = 1 ✓ \text{Area} = \text{base} \times \text{height} = (\theta_2 - \theta_1) \times \frac{1}{\theta_2 - \theta_1} = 1 \checkmark Area = base × height = ( θ 2 − θ 1 ) × θ 2 − θ 1 1 = 1 ✓ This is the “equally likely” distribution: any subinterval of a given length has the same probability, regardless of where it sits within ( θ 1 , θ 2 ) (\theta_1, \theta_2) ( θ 1 , θ 2 ) .
For θ 1 ≤ y ≤ θ 2 \theta_1 \leq y \leq \theta_2 θ 1 ≤ y ≤ θ 2 :
F ( y ) = ∫ θ 1 y 1 θ 2 − θ 1 d t = y − θ 1 θ 2 − θ 1 F(y) = \int_{\theta_1}^{y} \frac{1}{\theta_2 - \theta_1} \, dt = \frac{y - \theta_1}{\theta_2 - \theta_1} F ( y ) = ∫ θ 1 y θ 2 − θ 1 1 d t = θ 2 − θ 1 y − θ 1 The complete CDF:
F ( y ) = { 0 , y < θ 1 y − θ 1 θ 2 − θ 1 , θ 1 ≤ y ≤ θ 2 1 , y > θ 2 F(y) = \begin{cases} 0, & y < \theta_1 \\ \dfrac{y - \theta_1}{\theta_2 - \theta_1}, & \theta_1 \leq y \leq \theta_2 \\[6pt] 1, & y > \theta_2 \end{cases} F ( y ) = ⎩ ⎨ ⎧ 0 , θ 2 − θ 1 y − θ 1 , 1 , y < θ 1 θ 1 ≤ y ≤ θ 2 y > θ 2 4.3 Mean and Variance ¶ If Y ∼ Uniform ( θ 1 , θ 2 ) Y \sim \text{Uniform}(\theta_1, \theta_2) Y ∼ Uniform ( θ 1 , θ 2 ) , then:
μ = E ( Y ) = θ 1 + θ 2 2 and σ 2 = V ( Y ) = ( θ 2 − θ 1 ) 2 12 \mu = E(Y) = \frac{\theta_1 + \theta_2}{2} \qquad \text{and} \qquad \sigma^2 = V(Y) = \frac{(\theta_2 - \theta_1)^2}{12} μ = E ( Y ) = 2 θ 1 + θ 2 and σ 2 = V ( Y ) = 12 ( θ 2 − θ 1 ) 2 Proof.
Strategy: Integrate directly using the constant density 1 θ 2 − θ 1 \frac{1}{\theta_2 - \theta_1} θ 2 − θ 1 1 .
Mean:
E ( Y ) = ∫ θ 1 θ 2 y ⋅ 1 θ 2 − θ 1 d y = 1 θ 2 − θ 1 ⋅ y 2 2 ∣ θ 1 θ 2 = θ 2 2 − θ 1 2 2 ( θ 2 − θ 1 ) = ( θ 2 + θ 1 ) ( θ 2 − θ 1 ) 2 ( θ 2 − θ 1 ) = θ 1 + θ 2 2 E(Y) = \int_{\theta_1}^{\theta_2} y \cdot \frac{1}{\theta_2 - \theta_1} \, dy = \frac{1}{\theta_2 - \theta_1} \cdot \frac{y^2}{2}\bigg|_{\theta_1}^{\theta_2} = \frac{\theta_2^2 - \theta_1^2}{2(\theta_2 - \theta_1)} = \frac{(\theta_2 + \theta_1)(\theta_2 - \theta_1)}{2(\theta_2 - \theta_1)} = \frac{\theta_1 + \theta_2}{2} E ( Y ) = ∫ θ 1 θ 2 y ⋅ θ 2 − θ 1 1 d y = θ 2 − θ 1 1 ⋅ 2 y 2 ∣ ∣ θ 1 θ 2 = 2 ( θ 2 − θ 1 ) θ 2 2 − θ 1 2 = 2 ( θ 2 − θ 1 ) ( θ 2 + θ 1 ) ( θ 2 − θ 1 ) = 2 θ 1 + θ 2 The mean is simply the midpoint of the interval — exactly what “equally likely” suggests.
Variance:
E ( Y 2 ) = ∫ θ 1 θ 2 y 2 ⋅ 1 θ 2 − θ 1 d y = 1 θ 2 − θ 1 ⋅ y 3 3 ∣ θ 1 θ 2 = θ 2 3 − θ 1 3 3 ( θ 2 − θ 1 ) = θ 2 2 + θ 1 θ 2 + θ 1 2 3 E(Y^2) = \int_{\theta_1}^{\theta_2} y^2 \cdot \frac{1}{\theta_2 - \theta_1} \, dy = \frac{1}{\theta_2 - \theta_1} \cdot \frac{y^3}{3}\bigg|_{\theta_1}^{\theta_2} = \frac{\theta_2^3 - \theta_1^3}{3(\theta_2 - \theta_1)} = \frac{\theta_2^2 + \theta_1\theta_2 + \theta_1^2}{3} E ( Y 2 ) = ∫ θ 1 θ 2 y 2 ⋅ θ 2 − θ 1 1 d y = θ 2 − θ 1 1 ⋅ 3 y 3 ∣ ∣ θ 1 θ 2 = 3 ( θ 2 − θ 1 ) θ 2 3 − θ 1 3 = 3 θ 2 2 + θ 1 θ 2 + θ 1 2 Now apply the shortcut:
V ( Y ) = E ( Y 2 ) − μ 2 = θ 2 2 + θ 1 θ 2 + θ 1 2 3 − ( θ 1 + θ 2 2 ) 2 V(Y) = E(Y^2) - \mu^2 = \frac{\theta_2^2 + \theta_1\theta_2 + \theta_1^2}{3} - \left(\frac{\theta_1 + \theta_2}{2}\right)^2 V ( Y ) = E ( Y 2 ) − μ 2 = 3 θ 2 2 + θ 1 θ 2 + θ 1 2 − ( 2 θ 1 + θ 2 ) 2 = θ 2 2 + θ 1 θ 2 + θ 1 2 3 − θ 1 2 + 2 θ 1 θ 2 + θ 2 2 4 = \frac{\theta_2^2 + \theta_1\theta_2 + \theta_1^2}{3} - \frac{\theta_1^2 + 2\theta_1\theta_2 + \theta_2^2}{4} = 3 θ 2 2 + θ 1 θ 2 + θ 1 2 − 4 θ 1 2 + 2 θ 1 θ 2 + θ 2 2 = 4 ( θ 2 2 + θ 1 θ 2 + θ 1 2 ) − 3 ( θ 1 2 + 2 θ 1 θ 2 + θ 2 2 ) 12 = \frac{4(\theta_2^2 + \theta_1\theta_2 + \theta_1^2) - 3(\theta_1^2 + 2\theta_1\theta_2 + \theta_2^2)}{12} = 12 4 ( θ 2 2 + θ 1 θ 2 + θ 1 2 ) − 3 ( θ 1 2 + 2 θ 1 θ 2 + θ 2 2 ) = 4 θ 2 2 + 4 θ 1 θ 2 + 4 θ 1 2 − 3 θ 1 2 − 6 θ 1 θ 2 − 3 θ 2 2 12 = θ 2 2 − 2 θ 1 θ 2 + θ 1 2 12 = ( θ 2 − θ 1 ) 2 12 ■ = \frac{4\theta_2^2 + 4\theta_1\theta_2 + 4\theta_1^2 - 3\theta_1^2 - 6\theta_1\theta_2 - 3\theta_2^2}{12} = \frac{\theta_2^2 - 2\theta_1\theta_2 + \theta_1^2}{12} = \frac{(\theta_2 - \theta_1)^2}{12} \qquad \blacksquare = 12 4 θ 2 2 + 4 θ 1 θ 2 + 4 θ 1 2 − 3 θ 1 2 − 6 θ 1 θ 2 − 3 θ 2 2 = 12 θ 2 2 − 2 θ 1 θ 2 + θ 1 2 = 12 ( θ 2 − θ 1 ) 2 ■ 4.4 Worked Examples ¶ The Problem.
A bus arrives at a stop uniformly at random between 8:00 and 8:12 AM. You arrive at exactly 8:00.
(a) What is the probability that you wait more than 8 minutes?
(b) What is your expected waiting time?
(c) What is the probability that you wait between 3 and 7 minutes?
Solution.
Let Y Y Y = your waiting time (in minutes). Then Y ∼ Uniform ( 0 , 12 ) Y \sim \text{Uniform}(0, 12) Y ∼ Uniform ( 0 , 12 ) .
(a) P ( Y > 8 ) = ∫ 8 12 1 12 d y = 12 − 8 12 = 4 12 = 1 3 P(Y > 8) = \int_8^{12} \frac{1}{12} \, dy = \frac{12 - 8}{12} = \frac{4}{12} = \frac{1}{3} P ( Y > 8 ) = ∫ 8 12 12 1 d y = 12 12 − 8 = 12 4 = 3 1
Or using the CDF: P ( Y > 8 ) = 1 − F ( 8 ) = 1 − 8 − 0 12 − 0 = 1 − 2 3 = 1 3 P(Y > 8) = 1 - F(8) = 1 - \frac{8 - 0}{12 - 0} = 1 - \frac{2}{3} = \frac{1}{3} P ( Y > 8 ) = 1 − F ( 8 ) = 1 − 12 − 0 8 − 0 = 1 − 3 2 = 3 1
(b) E ( Y ) = 0 + 12 2 = 6 E(Y) = \frac{0 + 12}{2} = 6 E ( Y ) = 2 0 + 12 = 6 minutes.
You should expect to wait 6 minutes — the midpoint of the interval.
(c) P ( 3 ≤ Y ≤ 7 ) = 7 − 3 12 = 4 12 = 1 3 P(3 \leq Y \leq 7) = \frac{7 - 3}{12} = \frac{4}{12} = \frac{1}{3} P ( 3 ≤ Y ≤ 7 ) = 12 7 − 3 = 12 4 = 3 1
In R.
# Y ~ Uniform(0, 12)
# P(Y > 8)
punif(8, min = 0, max = 12, lower.tail = FALSE) # 0.3333333
# E(Y) and V(Y)
(0 + 12) / 2 # 6 (mean)
(12 - 0)^2 / 12 # 12 (variance)
sqrt(12) # 3.464 (SD)
# P(3 <= Y <= 7)
punif(7, 0, 12) - punif(3, 0, 12) # 0.3333333
# Simulate to verify
set.seed(42)
sim <- runif(100000, min = 0, max = 12)
mean(sim > 8) # ≈ 0.333
mean(sim) # ≈ 6.0
mean(sim >= 3 & sim <= 7) # ≈ 0.333The Problem.
Customer arrivals at a checkout counter follow a Poisson process. During a given 20-minute period, exactly one customer arrived. Find the probability that the customer arrived in the last 4 minutes.
Solution.
This is a classic result: given that exactly one event occurs in an interval, the actual time of occurrence is uniformly distributed over that interval. (This is a property of the Poisson process that we state without proof here.)
So the arrival time Y ∼ Uniform ( 0 , 20 ) Y \sim \text{Uniform}(0, 20) Y ∼ Uniform ( 0 , 20 ) .
P ( Y > 16 ) = 20 − 16 20 = 4 20 = 1 5 = 0.20 P(Y > 16) = \frac{20 - 16}{20} = \frac{4}{20} = \frac{1}{5} = 0.20 P ( Y > 16 ) = 20 20 − 16 = 20 4 = 5 1 = 0.20 The probability is 1 / 5 1/5 1/5 — the same as the ratio of the subinterval length (4 minutes) to the full interval (20 minutes). For a Uniform distribution, probability equals proportion of length. This is true for any 4-minute window within the 20-minute period.
The Problem.
A circuit board failure interrupts computing work until a replacement arrives. The delivery time Y Y Y (in days) is uniformly distributed between 1 and 5 days. The total cost of the interruption is C = c 0 + c 1 Y 2 C = c_0 + c_1 Y^2 C = c 0 + c 1 Y 2 , where c 0 c_0 c 0 is the fixed replacement cost and c 1 c_1 c 1 is the proportional disruption cost.
(a) Find the expected delivery time.
(b) Find E ( C ) E(C) E ( C ) in terms of c 0 c_0 c 0 and c 1 c_1 c 1 .
Solution.
Y ∼ Uniform ( 1 , 5 ) Y \sim \text{Uniform}(1, 5) Y ∼ Uniform ( 1 , 5 ) .
(a) E ( Y ) = 1 + 5 2 = 3 E(Y) = \frac{1 + 5}{2} = 3 E ( Y ) = 2 1 + 5 = 3 days.
(b) We need E ( Y 2 ) E(Y^2) E ( Y 2 ) :
E ( Y 2 ) = ∫ 1 5 y 2 ⋅ 1 4 d y = 1 4 ⋅ y 3 3 ∣ 1 5 = 1 12 ( 125 − 1 ) = 124 12 = 31 3 E(Y^2) = \int_1^5 y^2 \cdot \frac{1}{4} \, dy = \frac{1}{4} \cdot \frac{y^3}{3}\bigg|_1^5 = \frac{1}{12}(125 - 1) = \frac{124}{12} = \frac{31}{3} E ( Y 2 ) = ∫ 1 5 y 2 ⋅ 4 1 d y = 4 1 ⋅ 3 y 3 ∣ ∣ 1 5 = 12 1 ( 125 − 1 ) = 12 124 = 3 31 E ( C ) = c 0 + c 1 E ( Y 2 ) = c 0 + 31 c 1 3 E(C) = c_0 + c_1 E(Y^2) = c_0 + \frac{31c_1}{3} E ( C ) = c 0 + c 1 E ( Y 2 ) = c 0 + 3 31 c 1 Check with variance formula: V ( Y ) = ( 5 − 1 ) 2 / 12 = 16 / 12 = 4 / 3 V(Y) = (5-1)^2/12 = 16/12 = 4/3 V ( Y ) = ( 5 − 1 ) 2 /12 = 16/12 = 4/3 . Then E ( Y 2 ) = V ( Y ) + [ E ( Y ) ] 2 = 4 / 3 + 9 = 31 / 3 E(Y^2) = V(Y) + [E(Y)]^2 = 4/3 + 9 = 31/3 E ( Y 2 ) = V ( Y ) + [ E ( Y ) ] 2 = 4/3 + 9 = 31/3 ✓.
Solution.
A precision instrument has a measurement error Y Y Y (in millimeters) that is uniformly distributed between -0.04 and +0.04.
(a) Find the probability that the measurement error is within ± 0.01 \pm 0.01 ± 0.01 mm.
Y ∼ Uniform ( − 0.04 , 0.04 ) Y \sim \text{Uniform}(-0.04, 0.04) Y ∼ Uniform ( − 0.04 , 0.04 )
P ( − 0.01 ≤ Y ≤ 0.01 ) = 0.01 − ( − 0.01 ) 0.04 − ( − 0.04 ) = 0.02 0.08 = 0.25 P(-0.01 \leq Y \leq 0.01) = \frac{0.01 - (-0.01)}{0.04 - (-0.04)} = \frac{0.02}{0.08} = 0.25 P ( − 0.01 ≤ Y ≤ 0.01 ) = 0.04 − ( − 0.04 ) 0.01 − ( − 0.01 ) = 0.08 0.02 = 0.25 (b) Find E ( Y ) E(Y) E ( Y ) and V ( Y ) V(Y) V ( Y ) .
E ( Y ) = − 0.04 + 0.04 2 = 0 V ( Y ) = ( 0.08 ) 2 12 = 0.0064 12 ≈ 0.000533 E(Y) = \frac{-0.04 + 0.04}{2} = 0 \qquad V(Y) = \frac{(0.08)^2}{12} = \frac{0.0064}{12} \approx 0.000533 E ( Y ) = 2 − 0.04 + 0.04 = 0 V ( Y ) = 12 ( 0.08 ) 2 = 12 0.0064 ≈ 0.000533 The mean error is 0 (errors are equally likely to be positive or negative), and the SD is 0.000533 ≈ 0.0231 \sqrt{0.000533} \approx 0.0231 0.000533 ≈ 0.0231 mm.
(c) Find the median and the first quartile.
Median: ϕ 0.5 = − 0.04 + 0.04 2 = 0 \phi_{0.5} = \frac{-0.04 + 0.04}{2} = 0 ϕ 0.5 = 2 − 0.04 + 0.04 = 0 (same as the mean, since Uniform is symmetric).
First quartile: ϕ 0.25 = − 0.04 + 0.25 ( 0.08 ) = − 0.04 + 0.02 = − 0.02 \phi_{0.25} = -0.04 + 0.25(0.08) = -0.04 + 0.02 = -0.02 ϕ 0.25 = − 0.04 + 0.25 ( 0.08 ) = − 0.04 + 0.02 = − 0.02 mm.
Every computer’s random number generator fundamentally produces values from a Uniform ( 0 , 1 ) \text{Uniform}(0, 1) Uniform ( 0 , 1 ) distribution. In R, the function runif(n) generates n n n such values. To transform these into any other continuous distribution, we use a technique called the probability integral transform (which you’ll explore in Chapter 7):
If U ∼ Uniform ( 0 , 1 ) U \sim \text{Uniform}(0, 1) U ∼ Uniform ( 0 , 1 ) and F F F is any continuous CDF, then Y = F − 1 ( U ) Y = F^{-1}(U) Y = F − 1 ( U ) has CDF F F F .
This is how R internally generates exponential, normal, gamma, and all other continuous random variables — starting from the humble Uniform.
# Generate Uniform(0,1) and transform to Exponential(rate = 2)
set.seed(123)
U <- runif(10000) # Uniform(0, 1)
Y <- -log(1 - U) / 2 # Transform: F_inv for Exponential(2)
# Verify: compare to direct exponential generation
par(mfrow = c(1, 2))
hist(Y, breaks = 50, freq = FALSE, main = "Transformed from Uniform",
col = "steelblue", border = "white")
curve(dexp(x, rate = 2), add = TRUE, col = "red", lwd = 2)
hist(rexp(10000, rate = 2), breaks = 50, freq = FALSE,
main = "Direct rexp()",
col = "steelblue", border = "white")
curve(dexp(x, rate = 2), add = TRUE, col = "red", lwd = 2)4.6 Section 5.4 Exercises ¶ 5.4.1. A parachutist lands at a random point on a line between markers A and B that are 100 meters apart. The landing point Y Y Y (measured from A) is uniformly distributed on ( 0 , 100 ) (0, 100) ( 0 , 100 ) .
(a) Find the probability that the parachutist lands within 15 meters of marker A.
(b) Find the probability that the parachutist is closer to A than to B.
(c) Find the probability that the distance from A is more than three times the distance from B.
5.4.2. The amount of daily rainfall (in inches) at a monitoring station during the rainy season can be modeled as Uniform ( 0 , 0.5 ) \text{Uniform}(0, 0.5) Uniform ( 0 , 0.5 ) on days when it rains.
(a) Find the mean and standard deviation of daily rainfall on rainy days.
(b) Find the probability that rainfall exceeds 0.3 inches on a rainy day.
(c) Given that rainfall exceeded 0.2 inches, find the conditional probability it exceeded 0.4 inches.
5.4.3. A circular wheel of circumference 2 feet is spun. The distance Y Y Y (in feet) traveled by a mark on the wheel’s rim before stopping is Uniform ( 0 , 2 ) \text{Uniform}(0, 2) Uniform ( 0 , 2 ) . The area A A A of the circular sector swept out is A = Y 2 / ( 4 π ) A = Y^2 / (4\pi) A = Y 2 / ( 4 π ) .
(a) Find E ( A ) E(A) E ( A ) and V ( A ) V(A) V ( A ) .
(b) Find the probability that A > 0.1 A > 0.1 A > 0.1 square feet.
5.4.4. (Proof ) Show that the median of a Uniform ( θ 1 , θ 2 ) \text{Uniform}(\theta_1, \theta_2) Uniform ( θ 1 , θ 2 ) distribution equals its mean. Then show that for any Uniform distribution, P ( Y ≤ μ ) = P ( Y ≥ μ ) = 0.5 P(Y \leq \mu) = P(Y \geq \mu) = 0.5 P ( Y ≤ μ ) = P ( Y ≥ μ ) = 0.5 . Is this property true for all continuous distributions? Explain.
5.4.5. Three independent measurements are made by a precision instrument whose error is Uniform ( − 0.05 , 0.05 ) \text{Uniform}(-0.05, 0.05) Uniform ( − 0.05 , 0.05 ) . What is the probability that exactly one of the three errors exceeds 0.03 in absolute value? (Hint: First find p = P ( ∣ Y ∣ > 0.03 ) p = P(|Y| > 0.03) p = P ( ∣ Y ∣ > 0.03 ) , then use a result from Chapter 4.)
Confusing the density height with a probability. For Uniform ( 0 , 2 ) \text{Uniform}(0, 2) Uniform ( 0 , 2 ) , the density is f ( y ) = 0.5 f(y) = 0.5 f ( y ) = 0.5 everywhere on [ 0 , 2 ] [0, 2] [ 0 , 2 ] . The number 0.5 is the density, not the probability of anything. The probability of the interval [ 0 , 1 ] [0, 1] [ 0 , 1 ] is 0.5 × 1 = 0.5 0.5 \times 1 = 0.5 0.5 × 1 = 0.5 — area, not height.
Computing variance as ( θ 2 − θ 1 ) 2 (\theta_2 - \theta_1)^2 ( θ 2 − θ 1 ) 2 instead of ( θ 2 − θ 1 ) 2 / 12 (\theta_2 - \theta_1)^2/12 ( θ 2 − θ 1 ) 2 /12 . The interval width appears squared in the variance formula, but divided by 12. Don’t forget the 12.
Assuming the conditional distribution is still Uniform. It is! If Y ∼ Uniform ( a , b ) Y \sim \text{Uniform}(a, b) Y ∼ Uniform ( a , b ) and you condition on Y Y Y being in a subinterval ( c , d ) ⊂ ( a , b ) (c, d) \subset (a, b) ( c , d ) ⊂ ( a , b ) , then Y ∣ c < Y < d ∼ Uniform ( c , d ) Y \mid c < Y < d \sim \text{Uniform}(c, d) Y ∣ c < Y < d ∼ Uniform ( c , d ) . This makes conditional probability calculations easy but is easy to overlook.
The Uniform distribution is the “flat” distribution — every value in the interval ( θ 1 , θ 2 ) (\theta_1, \theta_2) ( θ 1 , θ 2 ) is equally likely. Its density is a constant 1 / ( θ 2 − θ 1 ) 1/(\theta_2 - \theta_1) 1/ ( θ 2 − θ 1 ) , its mean is the midpoint ( θ 1 + θ 2 ) / 2 (\theta_1 + \theta_2)/2 ( θ 1 + θ 2 ) /2 , and its variance is ( θ 2 − θ 1 ) 2 / 12 (\theta_2 - \theta_1)^2/12 ( θ 2 − θ 1 ) 2 /12 .
The real-life interpretation: The Uniform distribution models situations of perfect ignorance within a known range. If a bus arrives “sometime between 8:00 and 8:12” and you have no further information, the Uniform is the appropriate model. It also models measurement rounding error (equally likely to round up or down within the rounding precision) and the arrival time of a single Poisson event within a known time window.
Perhaps most importantly, the Uniform( 0 , 1 ) (0, 1) ( 0 , 1 ) distribution is the engine of all simulation . Every random number generator produces Uniform values, which are then transformed into whatever distribution you need. When you call rnorm() or rexp() in R, the software starts with runif() and applies a mathematical transformation. The Uniform distribution is simple on the surface, but it powers all of computational statistics.
Looking ahead: The next distribution is the most famous and most important in all of statistics — the Normal (bell-shaped) distribution. It appears everywhere in nature, and Section 5.5 will explain why.
5 The Normal Distribution ¶ The Normal distribution — the famous “bell curve” — is the single most important distribution in all of statistics. SAT scores, blood pressure readings, measurement errors in physics experiments, heights of adults, IQ scores — they all follow approximately Normal distributions.
But why? What is it about the Normal distribution that makes it appear everywhere in nature? The answer is the Central Limit Theorem (Chapter 7): whenever you average many independent random effects, the result is approximately Normal, regardless of the individual distributions. Height is the sum of thousands of genetic and environmental factors. Measurement error is the sum of many tiny instrument imperfections. The bell curve emerges whenever many small contributions add up.
In this section, we’ll define the Normal distribution, learn to compute probabilities by standardizing (converting any Normal to the standard Normal), and practice reading the Z Z Z -table and using R. We will also prove that the parameters μ \mu μ and σ \sigma σ truly are the mean and variance — but that proof uses moment generating functions, so we’ll defer it to Section 5.8.
Real-life motivation: A pharmaceutical company manufactures tablets that should contain 500 mg of active ingredient. Due to natural variation in the production process, the actual amount follows a Normal distribution with mean μ = 500 \mu = 500 μ = 500 mg and standard deviation σ = 5 \sigma = 5 σ = 5 mg. A tablet is considered defective if it contains less than 490 mg or more than 510 mg. What proportion of tablets are defective? The answer — about 4.56% — comes directly from the Normal distribution.
5.1 Definition and Shape ¶ A random variable Y Y Y has a Normal distribution with parameters μ \mu μ and σ > 0 \sigma > 0 σ > 0 , written Y ∼ N ( μ , σ 2 ) Y \sim N(\mu, \sigma^2) Y ∼ N ( μ , σ 2 ) , if and only if its density function is:
f ( y ) = 1 σ 2 π e − ( y − μ ) 2 / ( 2 σ 2 ) , − ∞ < y < ∞ f(y) = \frac{1}{\sigma\sqrt{2\pi}} \, e^{-(y - \mu)^2 / (2\sigma^2)}, \qquad -\infty < y < \infty f ( y ) = σ 2 π 1 e − ( y − μ ) 2 / ( 2 σ 2 ) , − ∞ < y < ∞ This formula looks intimidating, but each piece has a clear purpose:
The exponent − ( y − μ ) 2 / ( 2 σ 2 ) -(y - \mu)^2/(2\sigma^2) − ( y − μ ) 2 / ( 2 σ 2 ) creates the bell shape — it’s largest when y = μ y = \mu y = μ (the peak) and falls off symmetrically on both sides.
The term σ \sigma σ in the exponent controls the width : larger σ \sigma σ means a wider, flatter bell; smaller σ \sigma σ means a taller, narrower bell.
The constant 1 σ 2 π \frac{1}{\sigma\sqrt{2\pi}} σ 2 π 1 in front is a normalizing constant that forces the total area to equal 1. You never need to memorize this — just know it’s there to satisfy Theorem 5.2.
If Y ∼ N ( μ , σ 2 ) Y \sim N(\mu, \sigma^2) Y ∼ N ( μ , σ 2 ) , then:
E ( Y ) = μ and V ( Y ) = σ 2 E(Y) = \mu \qquad \text{and} \qquad V(Y) = \sigma^2 E ( Y ) = μ and V ( Y ) = σ 2 Why this matters: The parameters μ \mu μ and σ 2 \sigma^2 σ 2 that appear in the density formula really are the mean and variance. This is not true for all distributions — sometimes parameters are more abstract. For the Normal, the name tells you the meaning.
The proof uses the moment generating function and will be given in Section 5.8.
5.2 Key Properties of the Normal Distribution ¶ Symmetric about μ \mu μ . The density satisfies f ( μ + a ) = f ( μ − a ) f(\mu + a) = f(\mu - a) f ( μ + a ) = f ( μ − a ) for all a a a . The bell curve is a mirror image around the vertical line y = μ y = \mu y = μ .
The mean, median, and mode are all equal to μ \mu μ . This is a consequence of symmetry.
The inflection points are at y = μ ± σ y = \mu \pm \sigma y = μ ± σ . The curve changes from “curving downward” to “curving upward” exactly one standard deviation from the mean.
The total area under the curve is 1. This is guaranteed by the normalizing constant. Proving ∫ − ∞ ∞ e − x 2 / 2 d x = 2 π \int_{-\infty}^{\infty} e^{-x^2/2} \, dx = \sqrt{2\pi} ∫ − ∞ ∞ e − x 2 /2 d x = 2 π requires a clever double-integral trick (switching to polar coordinates). We accept this result.
The empirical rule (68-95-99.7):
P ( μ − σ < Y < μ + σ ) ≈ 0.6827 P(\mu - \sigma < Y < \mu + \sigma) \approx 0.6827 P ( μ − σ < Y < μ + σ ) ≈ 0.6827 — about 68% of values within 1 SD
P ( μ − 2 σ < Y < μ + 2 σ ) ≈ 0.9545 P(\mu - 2\sigma < Y < \mu + 2\sigma) \approx 0.9545 P ( μ − 2 σ < Y < μ + 2 σ ) ≈ 0.9545 — about 95% within 2 SDs
P ( μ − 3 σ < Y < μ + 3 σ ) ≈ 0.9973 P(\mu - 3\sigma < Y < \mu + 3\sigma) \approx 0.9973 P ( μ − 3 σ < Y < μ + 3 σ ) ≈ 0.9973 — about 99.7% within 3 SDs
# See the empirical rule in action
par(mfrow = c(1, 1))
curve(dnorm(x, 0, 1), from = -4, to = 4, lwd = 2,
main = "Standard Normal: The 68-95-99.7 Rule",
xlab = "z (standard deviations from the mean)", ylab = "f(z)")
# Shade the 68% region
x_fill <- seq(-1, 1, length = 200)
polygon(c(-1, x_fill, 1), c(0, dnorm(x_fill), 0),
col = rgb(0, 0.5, 1, 0.3), border = NA)
text(0, 0.15, "68.27%", col = "blue", font = 2)
# Mark ±1, ±2, ±3
abline(v = c(-3, -2, -1, 1, 2, 3), lty = 2, col = "gray50")There are infinitely many Normal distributions — one for every pair ( μ , σ ) (\mu, \sigma) ( μ , σ ) . Yet we need only one table. The trick is standardization :
The key result:
If Y ∼ N ( μ , σ 2 ) Y \sim N(\mu, \sigma^2) Y ∼ N ( μ , σ 2 ) , then:
Z = Y − μ σ ∼ N ( 0 , 1 ) Z = \frac{Y - \mu}{\sigma} \sim N(0, 1) Z = σ Y − μ ∼ N ( 0 , 1 ) Why this works: The transformation Z = ( Y − μ ) / σ Z = (Y - \mu)/\sigma Z = ( Y − μ ) / σ shifts the distribution to center it at 0 (subtracting μ \mu μ ) and rescales it to have standard deviation 1 (dividing by σ \sigma σ ). The proof that Z Z Z is Normal with mean 0 and variance 1 will be given in Chapter 7 using the transformation method.
The practical consequence: To find P ( a ≤ Y ≤ b ) P(a \leq Y \leq b) P ( a ≤ Y ≤ b ) for any Normal distribution:
P ( a ≤ Y ≤ b ) = P ( a − μ σ ≤ Z ≤ b − μ σ ) = Φ ( b − μ σ ) − Φ ( a − μ σ ) P(a \leq Y \leq b) = P\left(\frac{a - \mu}{\sigma} \leq Z \leq \frac{b - \mu}{\sigma}\right) = \Phi\left(\frac{b - \mu}{\sigma}\right) - \Phi\left(\frac{a - \mu}{\sigma}\right) P ( a ≤ Y ≤ b ) = P ( σ a − μ ≤ Z ≤ σ b − μ ) = Φ ( σ b − μ ) − Φ ( σ a − μ ) The Z Z Z -value tells you how many standard deviations a value is from the mean. A Z Z Z -value of 2 means “2 standard deviations above the mean.” A Z Z Z -value of -1.5 means “1.5 standard deviations below the mean.”
5.4 Using the Standard Normal Table ¶ Table 4 in the Appendix gives P ( Z > z ) P(Z > z) P ( Z > z ) — the right-tail area — for nonnegative values of z z z . We denote this area A ( z ) = P ( Z > z ) = 1 − Φ ( z ) A(z) = P(Z > z) = 1 - \Phi(z) A ( z ) = P ( Z > z ) = 1 − Φ ( z ) .
To handle all cases:
You Want How to Get It P ( Z > z ) P(Z > z) P ( Z > z ) for z > 0 z > 0 z > 0 Read A ( z ) A(z) A ( z ) directly from the table P ( Z < z ) P(Z < z) P ( Z < z ) for z > 0 z > 0 z > 0 1 − A ( z ) 1 - A(z) 1 − A ( z ) P ( Z > z ) P(Z > z) P ( Z > z ) for z < 0 z < 0 z < 0 $1 - A( P ( Z < z ) P(Z < z) P ( Z < z ) for z < 0 z < 0 z < 0 $A( P ( a < Z < b ) P(a < Z < b) P ( a < Z < b ) Φ ( b ) − Φ ( a ) \Phi(b) - \Phi(a) Φ ( b ) − Φ ( a ) , or combine A A A -values
5.5 Worked Examples ¶ The Problem.
Let Z ∼ N ( 0 , 1 ) Z \sim N(0, 1) Z ∼ N ( 0 , 1 ) . Find:
(a) P ( Z > 1.65 ) P(Z > 1.65) P ( Z > 1.65 )
(b) P ( − 2 ≤ Z ≤ 2 ) P(-2 \leq Z \leq 2) P ( − 2 ≤ Z ≤ 2 )
(c) P ( 0 ≤ Z ≤ 1.73 ) P(0 \leq Z \leq 1.73) P ( 0 ≤ Z ≤ 1.73 )
(d) Find c c c such that P ( Z > c ) = 0.10 P(Z > c) = 0.10 P ( Z > c ) = 0.10 .
Solution.
(a) From the Z Z Z -table: A ( 1.65 ) = 0.0495 A(1.65) = 0.0495 A ( 1.65 ) = 0.0495 .
P ( Z > 1.65 ) = 0.0495 P(Z > 1.65) = 0.0495 P ( Z > 1.65 ) = 0.0495 (b) By symmetry:
P ( − 2 ≤ Z ≤ 2 ) = 1 − 2 ⋅ A ( 2.0 ) = 1 − 2 ( 0.0228 ) = 1 − 0.0456 = 0.9544 P(-2 \leq Z \leq 2) = 1 - 2 \cdot A(2.0) = 1 - 2(0.0228) = 1 - 0.0456 = 0.9544 P ( − 2 ≤ Z ≤ 2 ) = 1 − 2 ⋅ A ( 2.0 ) = 1 − 2 ( 0.0228 ) = 1 − 0.0456 = 0.9544 About 95.44% of the probability lies within 2 standard deviations of the mean — the “95%” in the empirical rule.
(c) The area from 0 to 1.73:
P ( 0 ≤ Z ≤ 1.73 ) = P ( Z > 0 ) − P ( Z > 1.73 ) = 0.5 − A ( 1.73 ) = 0.5 − 0.0418 = 0.4582 P(0 \leq Z \leq 1.73) = P(Z > 0) - P(Z > 1.73) = 0.5 - A(1.73) = 0.5 - 0.0418 = 0.4582 P ( 0 ≤ Z ≤ 1.73 ) = P ( Z > 0 ) − P ( Z > 1.73 ) = 0.5 − A ( 1.73 ) = 0.5 − 0.0418 = 0.4582 (d) We need A ( c ) = 0.10 A(c) = 0.10 A ( c ) = 0.10 . Looking in the table for the area closest to 0.10:
A ( 1.28 ) = 0.1003 A(1.28) = 0.1003 A ( 1.28 ) = 0.1003 and A ( 1.29 ) = 0.0985 A(1.29) = 0.0985 A ( 1.29 ) = 0.0985 , so c ≈ 1.28 c \approx 1.28 c ≈ 1.28 .
In R.
# (a) P(Z > 1.65)
pnorm(1.65, lower.tail = FALSE) # 0.04947
# (b) P(-2 <= Z <= 2)
pnorm(2) - pnorm(-2) # 0.9545
# (c) P(0 <= Z <= 1.73)
pnorm(1.73) - pnorm(0) # 0.4582
# (d) Find c such that P(Z > c) = 0.10
qnorm(0.10, lower.tail = FALSE) # 1.2816The Problem.
A pharmaceutical company manufactures tablets that should contain 500 mg of active ingredient. Due to production variability, the actual content Y Y Y follows N ( 500 , 25 ) N(500, 25) N ( 500 , 25 ) — that is, μ = 500 \mu = 500 μ = 500 mg and σ = 5 \sigma = 5 σ = 5 mg. A tablet is defective if it contains less than 490 mg or more than 510 mg.
(a) What proportion of tablets are defective?
(b) The company wants to reduce the defective rate to at most 1%. What standard deviation σ \sigma σ would achieve this?
Solution.
(a) Standardize:
P ( Y < 490 or Y > 510 ) = P ( Z < 490 − 500 5 ) + P ( Z > 510 − 500 5 ) P(Y < 490 \text{ or } Y > 510) = P\left(Z < \frac{490 - 500}{5}\right) + P\left(Z > \frac{510 - 500}{5}\right) P ( Y < 490 or Y > 510 ) = P ( Z < 5 490 − 500 ) + P ( Z > 5 510 − 500 ) = P ( Z < − 2 ) + P ( Z > 2 ) = 2 ⋅ A ( 2.0 ) = 2 ( 0.0228 ) = 0.0456 = P(Z < -2) + P(Z > 2) = 2 \cdot A(2.0) = 2(0.0228) = 0.0456 = P ( Z < − 2 ) + P ( Z > 2 ) = 2 ⋅ A ( 2.0 ) = 2 ( 0.0228 ) = 0.0456 About 4.56% of tablets are defective.
(b) We need P ( Y < 490 or Y > 510 ) ≤ 0.01 P(Y < 490 \text{ or } Y > 510) \leq 0.01 P ( Y < 490 or Y > 510 ) ≤ 0.01 . By symmetry:
2 ⋅ P ( Z > 10 σ ) = 0.01 ⟹ P ( Z > 10 σ ) = 0.005 2 \cdot P\left(Z > \frac{10}{\sigma}\right) = 0.01 \implies P\left(Z > \frac{10}{\sigma}\right) = 0.005 2 ⋅ P ( Z > σ 10 ) = 0.01 ⟹ P ( Z > σ 10 ) = 0.005 From the table: A ( 2.576 ) ≈ 0.005 A(2.576) \approx 0.005 A ( 2.576 ) ≈ 0.005 , so:
10 σ = 2.576 ⟹ σ = 10 2.576 ≈ 3.88 mg \frac{10}{\sigma} = 2.576 \implies \sigma = \frac{10}{2.576} \approx 3.88 \text{ mg} σ 10 = 2.576 ⟹ σ = 2.576 10 ≈ 3.88 mg The company needs to tighten the standard deviation from 5 mg to about 3.88 mg — a 22% reduction in variability.
In R.
# (a) Defective proportion
pnorm(490, 500, 5) + pnorm(510, 500, 5, lower.tail = FALSE) # 0.04550
# (b) Required sigma
10 / qnorm(0.005, lower.tail = FALSE) # 3.882Interpretation.
This is exactly how quality control works in manufacturing. The specification limits (490, 510) are fixed by regulation. The mean μ = 500 \mu = 500 μ = 500 is set by the production target. The only thing the company can control is σ \sigma σ — the precision of the process. Reducing σ \sigma σ requires better equipment, tighter process control, or both. The Normal distribution turns “how precise must we be?” into a concrete number: σ ≤ 3.88 \sigma \leq 3.88 σ ≤ 3.88 mg.
The Problem.
Scores on a college entrance exam are Normally distributed with mean 72 and standard deviation 8.
(a) What fraction of scores falls between 78 and 90?
(b) What score marks the 90th percentile?
(c) The top 5% of scorers receive a scholarship. What is the minimum scholarship score?
Solution.
Y ∼ N ( 72 , 64 ) Y \sim N(72, 64) Y ∼ N ( 72 , 64 ) , so μ = 72 \mu = 72 μ = 72 and σ = 8 \sigma = 8 σ = 8 .
(a) Standardize both endpoints:
z 1 = 78 − 72 8 = 0.75 z 2 = 90 − 72 8 = 2.25 z_1 = \frac{78 - 72}{8} = 0.75 \qquad z_2 = \frac{90 - 72}{8} = 2.25 z 1 = 8 78 − 72 = 0.75 z 2 = 8 90 − 72 = 2.25 P ( 78 ≤ Y ≤ 90 ) = P ( 0.75 ≤ Z ≤ 2.25 ) = A ( 0.75 ) − A ( 2.25 ) = 0.2266 − 0.0122 = 0.2144 P(78 \leq Y \leq 90) = P(0.75 \leq Z \leq 2.25) = A(0.75) - A(2.25) = 0.2266 - 0.0122 = 0.2144 P ( 78 ≤ Y ≤ 90 ) = P ( 0.75 ≤ Z ≤ 2.25 ) = A ( 0.75 ) − A ( 2.25 ) = 0.2266 − 0.0122 = 0.2144 About 21.4% of scores fall between 78 and 90.
(b) The 90th percentile: P ( Y ≤ ϕ 0.9 ) = 0.90 P(Y \leq \phi_{0.9}) = 0.90 P ( Y ≤ ϕ 0.9 ) = 0.90 , so P ( Z ≤ z 0.9 ) = 0.90 P(Z \leq z_{0.9}) = 0.90 P ( Z ≤ z 0.9 ) = 0.90 , which means P ( Z > z 0.9 ) = 0.10 P(Z > z_{0.9}) = 0.10 P ( Z > z 0.9 ) = 0.10 .
From the table: z 0.9 ≈ 1.28 z_{0.9} \approx 1.28 z 0.9 ≈ 1.28 . Unstandardize:
ϕ 0.9 = μ + z 0.9 ⋅ σ = 72 + 1.28 ( 8 ) = 72 + 10.24 = 82.24 \phi_{0.9} = \mu + z_{0.9} \cdot \sigma = 72 + 1.28(8) = 72 + 10.24 = 82.24 ϕ 0.9 = μ + z 0.9 ⋅ σ = 72 + 1.28 ( 8 ) = 72 + 10.24 = 82.24 (c) The top 5% means P ( Y > c ) = 0.05 P(Y > c) = 0.05 P ( Y > c ) = 0.05 , so P ( Z > z ) = 0.05 P(Z > z) = 0.05 P ( Z > z ) = 0.05 . From the table: z ≈ 1.645 z \approx 1.645 z ≈ 1.645 .
c = 72 + 1.645 ( 8 ) = 72 + 13.16 = 85.16 c = 72 + 1.645(8) = 72 + 13.16 = 85.16 c = 72 + 1.645 ( 8 ) = 72 + 13.16 = 85.16 The minimum scholarship score is about 85.2.
In R.
# (a) P(78 <= Y <= 90)
pnorm(90, 72, 8) - pnorm(78, 72, 8) # 0.2144
# (b) 90th percentile
qnorm(0.90, 72, 8) # 82.25
# (c) Top 5% cutoff
qnorm(0.95, 72, 8) # 85.16
Solution.
The tensile strength of an aluminum alloy is Normally distributed with mean 12 GPa and standard deviation 1.6 GPa.
(a) Find the probability that a specimen has strength greater than 14.5 GPa.
z = 14.5 − 12 1.6 = 2.5 1.6 = 1.5625 z = \frac{14.5 - 12}{1.6} = \frac{2.5}{1.6} = 1.5625 z = 1.6 14.5 − 12 = 1.6 2.5 = 1.5625 P ( Y > 14.5 ) = P ( Z > 1.5625 ) ≈ A ( 1.56 ) = 0.0594 P(Y > 14.5) = P(Z > 1.5625) \approx A(1.56) = 0.0594 P ( Y > 14.5 ) = P ( Z > 1.5625 ) ≈ A ( 1.56 ) = 0.0594 In R: pnorm(14.5, 12, 1.6, lower.tail = FALSE) → 0.0593
(b) Find the first quartile of the strength distribution.
The first quartile satisfies P ( Y ≤ ϕ 0.25 ) = 0.25 P(Y \leq \phi_{0.25}) = 0.25 P ( Y ≤ ϕ 0.25 ) = 0.25 , so P ( Z ≤ z 0.25 ) = 0.25 P(Z \leq z_{0.25}) = 0.25 P ( Z ≤ z 0.25 ) = 0.25 .
By symmetry: z 0.25 = − z 0.75 z_{0.25} = -z_{0.75} z 0.25 = − z 0.75 . From the table: P ( Z > 0.674 ) ≈ 0.25 P(Z > 0.674) \approx 0.25 P ( Z > 0.674 ) ≈ 0.25 , so z 0.25 = − 0.674 z_{0.25} = -0.674 z 0.25 = − 0.674 .
ϕ 0.25 = 12 + ( − 0.674 ) ( 1.6 ) = 12 − 1.078 = 10.92 GPa \phi_{0.25} = 12 + (-0.674)(1.6) = 12 - 1.078 = 10.92 \text{ GPa} ϕ 0.25 = 12 + ( − 0.674 ) ( 1.6 ) = 12 − 1.078 = 10.92 GPa In R: qnorm(0.25, 12, 1.6) → 10.92
(c) The manufacturer rejects specimens below 9 GPa. What proportion is rejected?
z = 9 − 12 1.6 = − 1.875 z = \frac{9 - 12}{1.6} = -1.875 z = 1.6 9 − 12 = − 1.875 P ( Y < 9 ) = P ( Z < − 1.875 ) = A ( 1.875 ) ≈ A ( 1.88 ) = 0.0301 P(Y < 9) = P(Z < -1.875) = A(1.875) \approx A(1.88) = 0.0301 P ( Y < 9 ) = P ( Z < − 1.875 ) = A ( 1.875 ) ≈ A ( 1.88 ) = 0.0301 About 3% are rejected.
In R: pnorm(9, 12, 1.6) → 0.03013
5.6 The Standard Normal as a Reference ¶ Notice the pattern in every example:
Standardize: Convert Y Y Y -values to Z Z Z -values using z = ( y − μ ) / σ z = (y - \mu)/\sigma z = ( y − μ ) / σ .
Look up: Find the probability using the Z Z Z -table or R’s pnorm().
Unstandardize (if needed): Convert Z Z Z -values back to Y Y Y -values using y = μ + z σ y = \mu + z\sigma y = μ + z σ .
This three-step pattern works for every Normal probability problem. The key R functions:
Function What It Computes pnorm(y, mu, sigma)P ( Y ≤ y ) P(Y \leq y) P ( Y ≤ y ) — CDFpnorm(y, mu, sigma, lower.tail = FALSE)P ( Y > y ) P(Y > y) P ( Y > y ) — right tailqnorm(p, mu, sigma)ϕ p \phi_p ϕ p — the p p p th quantilednorm(y, mu, sigma)f ( y ) f(y) f ( y ) — the density (not a probability!)rnorm(n, mu, sigma)Generate n n n random Normal values
# Simulate: verify the 68-95-99.7 rule
set.seed(2026)
Y <- rnorm(1000000, mean = 50, sd = 10)
mean(abs(Y - 50) < 10) # ≈ 0.6827 (within 1 SD)
mean(abs(Y - 50) < 20) # ≈ 0.9545 (within 2 SDs)
mean(abs(Y - 50) < 30) # ≈ 0.9973 (within 3 SDs)Writing N ( μ , σ ) N(\mu, \sigma) N ( μ , σ ) instead of N ( μ , σ 2 ) N(\mu, \sigma^2) N ( μ , σ 2 ) . The second parameter of N ( μ , σ 2 ) N(\mu, \sigma^2) N ( μ , σ 2 ) is the variance , not the standard deviation. If Y ∼ N ( 100 , 25 ) Y \sim N(100, 25) Y ∼ N ( 100 , 25 ) , then σ 2 = 25 \sigma^2 = 25 σ 2 = 25 and σ = 5 \sigma = 5 σ = 5 . Some textbooks use the convention N ( μ , σ ) N(\mu, \sigma) N ( μ , σ ) — this book uses N ( μ , σ 2 ) N(\mu, \sigma^2) N ( μ , σ 2 ) , and so does the reference textbook.
Forgetting to standardize. You cannot look up P ( Y > 78 ) P(Y > 78) P ( Y > 78 ) directly in the Z Z Z -table if Y ∼ N ( 72 , 64 ) Y \sim N(72, 64) Y ∼ N ( 72 , 64 ) . You must first compute z = ( 78 − 72 ) / 8 = 0.75 z = (78 - 72)/8 = 0.75 z = ( 78 − 72 ) /8 = 0.75 and then look up P ( Z > 0.75 ) P(Z > 0.75) P ( Z > 0.75 ) .
Using the wrong tail. If the table gives A ( z ) = P ( Z > z ) A(z) = P(Z > z) A ( z ) = P ( Z > z ) , then P ( Z < z ) = 1 − A ( z ) P(Z < z) = 1 - A(z) P ( Z < z ) = 1 − A ( z ) , and P ( Z < − z ) = A ( z ) P(Z < -z) = A(z) P ( Z < − z ) = A ( z ) by symmetry. Draw a picture every time until the pattern becomes automatic.
Confusing f ( y ) f(y) f ( y ) with P ( Y = y ) P(Y = y) P ( Y = y ) . The Normal density f ( y ) f(y) f ( y ) can be computed with dnorm(), but this is the height of the bell curve, not a probability. For continuous distributions, P ( Y = y ) = 0 P(Y = y) = 0 P ( Y = y ) = 0 always. Use pnorm() for probabilities.
Thinking the Normal distribution is bounded. The Normal distribution extends from − ∞ -\infty − ∞ to + ∞ +\infty + ∞ . A N ( 500 , 25 ) N(500, 25) N ( 500 , 25 ) model technically assigns positive probability to negative values — but P ( Y < 0 ) = P ( Z < − 100 ) ≈ 0 P(Y < 0) = P(Z < -100) \approx 0 P ( Y < 0 ) = P ( Z < − 100 ) ≈ 0 , which is effectively zero. In practice, this is fine.
5.7 Section 5.5 Exercises ¶ 5.5.1. Let Z ∼ N ( 0 , 1 ) Z \sim N(0, 1) Z ∼ N ( 0 , 1 ) . Find:
(a) P ( Z > 1.96 ) P(Z > 1.96) P ( Z > 1.96 )
(b) P ( − 1.5 < Z < 0.5 ) P(-1.5 < Z < 0.5) P ( − 1.5 < Z < 0.5 )
(c) P ( ∣ Z ∣ > 2.33 ) P(|Z| > 2.33) P ( ∣ Z ∣ > 2.33 )
(d) The value c c c such that P ( − c < Z < c ) = 0.90 P(-c < Z < c) = 0.90 P ( − c < Z < c ) = 0.90
5.5.2. The diastolic blood pressure of adult males is Normally distributed with mean 82 mmHg and standard deviation 10 mmHg.
(a) What proportion of men have blood pressure above 100 mmHg?
(b) A man is classified as having “high blood pressure” if his reading exceeds 90 mmHg. What proportion of men fall in this category?
(c) A health study recruits men with blood pressure between 70 and 90 mmHg. What proportion of the male population is eligible?
(d) What blood pressure value marks the 95th percentile?
5.5.3. A machine fills cereal boxes. The weight of cereal per box is N ( 368 , 16 ) N(368, 16) N ( 368 , 16 ) grams. The label says 360 grams.
(a) What proportion of boxes are underweight (less than 360 g)?
(b) The company wants at most 2% of boxes to be underweight. If μ \mu μ cannot be changed, what is the maximum allowable σ \sigma σ ?
(c) Alternatively, if σ = 4 \sigma = 4 σ = 4 is fixed, what mean μ \mu μ would ensure at most 2% underweight?
5.5.4. Two lightbulbs are installed in a fixture. Bulb A has a lifetime that is N ( 900 , 10000 ) N(900, 10000) N ( 900 , 10000 ) hours and Bulb B has a lifetime that is N ( 1100 , 22500 ) N(1100, 22500) N ( 1100 , 22500 ) hours. The lifetimes are independent.
(a) Find the probability that Bulb A lasts more than 1000 hours.
(b) Let D = B − A D = B - A D = B − A be the difference in lifetimes. What is the distribution of D D D ? (Hint: A linear combination of independent Normals is Normal. What are E ( D ) E(D) E ( D ) and V ( D ) V(D) V ( D ) ?)
(c) Find the probability that Bulb B outlasts Bulb A by more than 300 hours.
5.5.5. (Proof ) Show that if Y ∼ N ( μ , σ 2 ) Y \sim N(\mu, \sigma^2) Y ∼ N ( μ , σ 2 ) , then P ( Y ≤ μ ) = 0.5 P(Y \leq \mu) = 0.5 P ( Y ≤ μ ) = 0.5 . (Hint: Use the substitution u = 2 μ − y u = 2\mu - y u = 2 μ − y to show that ∫ − ∞ μ f ( y ) d y = ∫ μ ∞ f ( y ) d y \int_{-\infty}^{\mu} f(y) \, dy = \int_{\mu}^{\infty} f(y) \, dy ∫ − ∞ μ f ( y ) d y = ∫ μ ∞ f ( y ) d y .)
The Normal distribution N ( μ , σ 2 ) N(\mu, \sigma^2) N ( μ , σ 2 ) is the bell-shaped curve defined by two parameters: the mean μ \mu μ (the center) and the variance σ 2 \sigma^2 σ 2 (the spread). Its density is symmetric about μ \mu μ , and 68/95/99.7% of the probability lies within 1/2/3 standard deviations of the mean.
The key technique is standardization: convert any Normal variable Y Y Y to the standard Normal Z = ( Y − μ ) / σ Z = (Y - \mu)/\sigma Z = ( Y − μ ) / σ , look up the probability, and convert back if needed. The Z Z Z -value tells you “how many standard deviations from the mean.”
The real-life interpretation: When a doctor says your cholesterol is “1.5 standard deviations above average,” that’s a Z Z Z -value. When a student asks “is a score of 82 good on this test?”, the answer depends on μ \mu μ and σ \sigma σ — a score of 82 on a N ( 75 , 25 ) N(75, 25) N ( 75 , 25 ) exam (z = 1.4 z = 1.4 z = 1.4 , top 8%) is very different from 82 on a N ( 85 , 9 ) N(85, 9) N ( 85 , 9 ) exam (z = − 1.0 z = -1.0 z = − 1.0 , bottom 16%). The Z Z Z -score is the universal yardstick for comparing values across different Normal distributions.
The Normal distribution also has a deep connection to other distributions we’ll study. The Chi-Square distribution (Section 5.6) arises from squaring standard Normals. The t t t -distribution and F F F -distribution (which you’ll meet in mathematical statistics) are built from ratios involving Normal and Chi-Square variables. The Normal is not just one distribution — it’s the foundation of an entire family.
Looking ahead: The next section introduces the Gamma distribution family — a versatile family of right-skewed distributions that includes the Exponential (for modeling wait times) and the Chi-Square (for statistical inference) as special cases.
6 The Gamma Distribution Family ¶ The Normal distribution is symmetric — it works beautifully when data clusters around a central value with equal spread on both sides. But many real-world quantities are right-skewed : they have a natural lower bound (often zero), a peak near the left, and a long tail stretching to the right. Wait times, lifetimes of equipment, insurance claims, rainfall amounts — all share this shape.
The Gamma distribution is a flexible family designed for exactly these situations. It has two parameters — shape (α \alpha α ) and scale (β \beta β ) — that let it take on a wide range of right-skewed shapes, from sharply peaked to nearly flat.
What makes the Gamma family powerful is that it contains two famous distributions as special cases:
The Exponential distribution (α = 1 \alpha = 1 α = 1 ): models the waiting time until the next event in a Poisson process. It has the remarkable memoryless property — the probability of waiting t t t more minutes is the same whether you’ve been waiting 5 minutes or 5 hours.
The Chi-Square distribution (α = ν / 2 \alpha = \nu/2 α = ν /2 , β = 2 \beta = 2 β = 2 ): arises from sums of squared standard Normals. It is the foundation of hypothesis testing in mathematical statistics.
By learning the Gamma distribution first, you get all three distributions at once.
Real-life motivation: A nuclear reactor contains components whose lifetimes follow Gamma distributions. A technician needs to know: what’s the probability a component fails within the first 1,000 hours? What’s the expected replacement cost per year? The Gamma distribution answers both. Meanwhile, the call center down the road uses the Exponential distribution to model the time between incoming calls — and the quality engineer upstairs uses the Chi-Square distribution to test whether the production line meets specifications. All three are the same family.
6.1 The Gamma Function ¶ Before defining the Gamma distribution, we need a mathematical tool: the Gamma function .
The Gamma function is an extension of the factorial to all positive real numbers (not just integers). Its key properties:
Recursion: Γ ( α ) = ( α − 1 ) ⋅ Γ ( α − 1 ) \Gamma(\alpha) = (\alpha - 1) \cdot \Gamma(\alpha - 1) Γ ( α ) = ( α − 1 ) ⋅ Γ ( α − 1 ) for α > 1 \alpha > 1 α > 1
Factorial connection: Γ ( n ) = ( n − 1 ) ! \Gamma(n) = (n - 1)! Γ ( n ) = ( n − 1 )! for any positive integer n n n
Special value: Γ ( 1 ) = 1 \Gamma(1) = 1 Γ ( 1 ) = 1
Half-integer value: Γ ( 1 / 2 ) = π \Gamma(1/2) = \sqrt{\pi} Γ ( 1/2 ) = π
Proof of Property 1 (Recursion).
Strategy: We’ll use integration by parts on Γ ( α ) = ∫ 0 ∞ t α − 1 e − t d t \Gamma(\alpha) = \int_0^{\infty} t^{\alpha-1} e^{-t} \, dt Γ ( α ) = ∫ 0 ∞ t α − 1 e − t d t .
Set u = t α − 1 u = t^{\alpha-1} u = t α − 1 and d v = e − t d t dv = e^{-t} \, dt d v = e − t d t . Then:
d u = ( α − 1 ) t α − 2 d t and v = ∫ e − t d t = − e − t du = (\alpha - 1)t^{\alpha - 2} \, dt \qquad \text{and} \qquad v = \int e^{-t} \, dt = -e^{-t} d u = ( α − 1 ) t α − 2 d t and v = ∫ e − t d t = − e − t Applying integration by parts:
Γ ( α ) = [ t α − 1 ⋅ ( − e − t ) ] 0 ∞ ⏟ boundary term + ( α − 1 ) ∫ 0 ∞ t α − 2 e − t d t \Gamma(\alpha) = \underbrace{\left[t^{\alpha-1} \cdot (-e^{-t})\right]_0^{\infty}}_{\text{boundary term}} + (\alpha - 1)\int_0^{\infty} t^{\alpha-2} e^{-t} \, dt Γ ( α ) = boundary term [ t α − 1 ⋅ ( − e − t ) ] 0 ∞ + ( α − 1 ) ∫ 0 ∞ t α − 2 e − t d t Evaluating the boundary term: We need lim t → ∞ t α − 1 e − t \lim_{t \to \infty} t^{\alpha-1}e^{-t} lim t → ∞ t α − 1 e − t and the value at t = 0 t = 0 t = 0 .
As t → ∞ t \to \infty t → ∞ : the exponential e − t e^{-t} e − t decays to zero faster than any polynomial t α − 1 t^{\alpha-1} t α − 1 grows (this is a standard calculus fact: exponentials always beat polynomials). So lim t → ∞ t α − 1 e − t = 0 \lim_{t \to \infty} t^{\alpha-1}e^{-t} = 0 lim t → ∞ t α − 1 e − t = 0 .
At t = 0 t = 0 t = 0 : 0 α − 1 ⋅ e 0 = 0 ⋅ 1 = 0 0^{\alpha-1} \cdot e^{0} = 0 \cdot 1 = 0 0 α − 1 ⋅ e 0 = 0 ⋅ 1 = 0 (since α > 1 \alpha > 1 α > 1 means α − 1 > 0 \alpha - 1 > 0 α − 1 > 0 ).
The boundary term is 0 − 0 = 0 0 - 0 = 0 0 − 0 = 0 . Therefore:
Γ ( α ) = 0 + ( α − 1 ) ∫ 0 ∞ t α − 2 e − t d t = ( α − 1 ) ⋅ Γ ( α − 1 ) ■ \Gamma(\alpha) = 0 + (\alpha - 1) \int_0^{\infty} t^{\alpha-2} e^{-t} \, dt = (\alpha - 1) \cdot \Gamma(\alpha - 1) \qquad \blacksquare Γ ( α ) = 0 + ( α − 1 ) ∫ 0 ∞ t α − 2 e − t d t = ( α − 1 ) ⋅ Γ ( α − 1 ) ■ Proof of Property 3: Γ ( 1 ) = ∫ 0 ∞ t 1 − 1 e − t d t = ∫ 0 ∞ e − t d t = [ − e − t ] 0 ∞ = 0 − ( − 1 ) = 1 \Gamma(1) = \int_0^{\infty} t^{1-1}e^{-t} \, dt = \int_0^{\infty} e^{-t} \, dt = \left[-e^{-t}\right]_0^{\infty} = 0 - (-1) = 1 Γ ( 1 ) = ∫ 0 ∞ t 1 − 1 e − t d t = ∫ 0 ∞ e − t d t = [ − e − t ] 0 ∞ = 0 − ( − 1 ) = 1 .
Proof of Property 2 (by induction): From Properties 1 and 3:
Γ ( 2 ) = 1 ⋅ Γ ( 1 ) = 1 = 1 ! \Gamma(2) = 1 \cdot \Gamma(1) = 1 = 1! Γ ( 2 ) = 1 ⋅ Γ ( 1 ) = 1 = 1 ! Γ ( 3 ) = 2 ⋅ Γ ( 2 ) = 2 ⋅ 1 = 2 ! \Gamma(3) = 2 \cdot \Gamma(2) = 2 \cdot 1 = 2! Γ ( 3 ) = 2 ⋅ Γ ( 2 ) = 2 ⋅ 1 = 2 ! Γ ( 4 ) = 3 ⋅ Γ ( 3 ) = 3 ⋅ 2 = 6 = 3 ! \Gamma(4) = 3 \cdot \Gamma(3) = 3 \cdot 2 = 6 = 3! Γ ( 4 ) = 3 ⋅ Γ ( 3 ) = 3 ⋅ 2 = 6 = 3 ! In general: Γ ( n ) = ( n − 1 ) ⋅ ( n − 2 ) ⋯ 2 ⋅ 1 = ( n − 1 ) ! \Gamma(n) = (n-1) \cdot (n-2) \cdots 2 \cdot 1 = (n-1)! Γ ( n ) = ( n − 1 ) ⋅ ( n − 2 ) ⋯ 2 ⋅ 1 = ( n − 1 )! for any positive integer n n n .
# Verify Gamma function properties
gamma(1) # 1 (= 0!)
gamma(2) # 1 (= 1!)
gamma(5) # 24 (= 4!)
gamma(0.5) # 1.7724539 (= sqrt(pi))
sqrt(pi) # 1.7724539 ✓
gamma(10) # 362880 (= 9!)
factorial(9) # 362880 ✓6.2 The Gamma Distribution ¶ A random variable Y Y Y has a Gamma distribution with shape parameter α > 0 \alpha > 0 α > 0 and scale parameter β > 0 \beta > 0 β > 0 , written Y ∼ Gamma ( α , β ) Y \sim \text{Gamma}(\alpha, \beta) Y ∼ Gamma ( α , β ) , if and only if:
f ( y ) = { y α − 1 e − y / β β α Γ ( α ) , y > 0 0 , y ≤ 0 f(y) = \begin{cases} \dfrac{y^{\alpha-1} e^{-y/\beta}}{\beta^{\alpha} \, \Gamma(\alpha)}, & y > 0 \\[8pt] 0, & y \leq 0 \end{cases} f ( y ) = ⎩ ⎨ ⎧ β α Γ ( α ) y α − 1 e − y / β , 0 , y > 0 y ≤ 0 The density is zero for y ≤ 0 y \leq 0 y ≤ 0 (the Gamma distribution lives on the positive real line), and the denominator β α Γ ( α ) \beta^{\alpha}\Gamma(\alpha) β α Γ ( α ) is the normalizing constant that makes the total area 1.
Verification that ∫ 0 ∞ f ( y ) d y = 1 \int_0^{\infty} f(y) \, dy = 1 ∫ 0 ∞ f ( y ) d y = 1 :
To evaluate ∫ f ( g ( x ) ) ⋅ g ′ ( x ) d x \int f(g(x)) \cdot g'(x) \, dx ∫ f ( g ( x )) ⋅ g ′ ( x ) d x , substitute u = g ( x ) u = g(x) u = g ( x ) , so d u = g ′ ( x ) d x du = g'(x) \, dx d u = g ′ ( x ) d x . The integral becomes ∫ f ( u ) d u \int f(u) \, du ∫ f ( u ) d u , which is often simpler. Don’t forget to change the limits if it’s a definite integral.
We need to show ∫ 0 ∞ y α − 1 e − y / β β α Γ ( α ) d y = 1 \int_0^{\infty} \frac{y^{\alpha-1}e^{-y/\beta}}{\beta^{\alpha}\Gamma(\alpha)} \, dy = 1 ∫ 0 ∞ β α Γ ( α ) y α − 1 e − y / β d y = 1 . Substitute u = y / β u = y/\beta u = y / β :
If u = y / β u = y/\beta u = y / β , then y = u β y = u\beta y = u β and d y = β d u dy = \beta \, du d y = β d u
When y = 0 y = 0 y = 0 : u = 0 u = 0 u = 0 . When y → ∞ y \to \infty y → ∞ : u → ∞ u \to \infty u → ∞ . (Limits don’t change their form.)
Substituting piece by piece:
∫ 0 ∞ y α − 1 e − y / β β α Γ ( α ) d y = 1 β α Γ ( α ) ∫ 0 ∞ ( u β ) α − 1 ⏟ y α − 1 ⋅ e − u ⏟ e − y / β ⋅ β d u ⏟ d y \int_0^{\infty} \frac{y^{\alpha-1} e^{-y/\beta}}{\beta^{\alpha}\Gamma(\alpha)} \, dy = \frac{1}{\beta^{\alpha}\Gamma(\alpha)} \int_0^{\infty} \underbrace{(u\beta)^{\alpha-1}}_{y^{\alpha-1}} \cdot \underbrace{e^{-u}}_{e^{-y/\beta}} \cdot \underbrace{\beta \, du}_{dy} ∫ 0 ∞ β α Γ ( α ) y α − 1 e − y / β d y = β α Γ ( α ) 1 ∫ 0 ∞ y α − 1 ( u β ) α − 1 ⋅ e − y / β e − u ⋅ d y β d u Now expand ( u β ) α − 1 = u α − 1 ⋅ β α − 1 (u\beta)^{\alpha-1} = u^{\alpha-1} \cdot \beta^{\alpha-1} ( u β ) α − 1 = u α − 1 ⋅ β α − 1 , and combine with the extra β \beta β from d y dy d y :
= 1 β α Γ ( α ) ⋅ β α − 1 ⋅ β ∫ 0 ∞ u α − 1 e − u d u = β α β α Γ ( α ) ∫ 0 ∞ u α − 1 e − u d u = \frac{1}{\beta^{\alpha}\Gamma(\alpha)} \cdot \beta^{\alpha-1} \cdot \beta \int_0^{\infty} u^{\alpha-1}e^{-u} \, du = \frac{\beta^{\alpha}}{\beta^{\alpha}\Gamma(\alpha)} \int_0^{\infty} u^{\alpha-1}e^{-u} \, du = β α Γ ( α ) 1 ⋅ β α − 1 ⋅ β ∫ 0 ∞ u α − 1 e − u d u = β α Γ ( α ) β α ∫ 0 ∞ u α − 1 e − u d u The remaining integral is exactly Γ ( α ) \Gamma(\alpha) Γ ( α ) by definition:
= β α β α ⋅ Γ ( α ) Γ ( α ) = 1 ✓ = \frac{\cancel{\beta^{\alpha}}}{\cancel{\beta^{\alpha}}} \cdot \frac{\cancel{\Gamma(\alpha)}}{\cancel{\Gamma(\alpha)}} = 1 \qquad \checkmark = β α β α ⋅ Γ ( α ) Γ ( α ) = 1 ✓ This substitution trick — replacing y / β y/\beta y / β with u u u to convert a Gamma integral into the definition of Γ ( α ) \Gamma(\alpha) Γ ( α ) — will appear repeatedly throughout this chapter and in Section 5.8.
If Y ∼ Gamma ( α , β ) Y \sim \text{Gamma}(\alpha, \beta) Y ∼ Gamma ( α , β ) , then:
E ( Y ) = α β and V ( Y ) = α β 2 E(Y) = \alpha\beta \qquad \text{and} \qquad V(Y) = \alpha\beta^2 E ( Y ) = α β and V ( Y ) = α β 2 The proof via the moment generating function is given in Section 5.8.
# See how the Gamma shape changes with alpha
par(mfrow = c(2, 2))
for (a in c(1, 2, 5, 10)) {
curve(dgamma(x, shape = a, scale = 2), from = 0, to = 40, lwd = 2,
main = bquote(alpha == .(a) ~ ", " ~ beta == 2),
xlab = "y", ylab = "f(y)", col = "steelblue")
abline(v = a * 2, lty = 2, col = "red") # mean
}Run this code and notice: when α = 1 \alpha = 1 α = 1 , the density is a decreasing exponential. As α \alpha α increases, the density becomes more bell-shaped and shifts to the right. The red dashed line marks the mean α β \alpha\beta α β . The Gamma distribution is remarkably flexible.
6.3 Special Case 1: The Exponential Distribution ¶ A random variable Y Y Y has an Exponential distribution with scale parameter β > 0 \beta > 0 β > 0 , written Y ∼ Exponential ( β ) Y \sim \text{Exponential}(\beta) Y ∼ Exponential ( β ) , if Y ∼ Gamma ( 1 , β ) Y \sim \text{Gamma}(1, \beta) Y ∼ Gamma ( 1 , β ) . Its density simplifies to:
f ( y ) = { 1 β e − y / β , y > 0 0 , y ≤ 0 f(y) = \begin{cases} \dfrac{1}{\beta} e^{-y/\beta}, & y > 0 \\[6pt] 0, & y \leq 0 \end{cases} f ( y ) = ⎩ ⎨ ⎧ β 1 e − y / β , 0 , y > 0 y ≤ 0 Equivalently, with rate parameter λ = 1 / β \lambda = 1/\beta λ = 1/ β : f ( y ) = λ e − λ y f(y) = \lambda e^{-\lambda y} f ( y ) = λ e − λ y for y > 0 y > 0 y > 0 .
Since α = 1 \alpha = 1 α = 1 : E ( Y ) = β = 1 / λ E(Y) = \beta = 1/\lambda E ( Y ) = β = 1/ λ and V ( Y ) = β 2 = 1 / λ 2 V(Y) = \beta^2 = 1/\lambda^2 V ( Y ) = β 2 = 1/ λ 2 .
The CDF has a closed form (unusual for the Gamma family). Let’s derive it step by step:
F ( y ) = ∫ 0 y 1 β e − t / β d t F(y) = \int_0^y \frac{1}{\beta}e^{-t/\beta} \, dt F ( y ) = ∫ 0 y β 1 e − t / β d t ∫ e a t d t = 1 a e a t + C \int e^{at} \, dt = \frac{1}{a}e^{at} + C ∫ e a t d t = a 1 e a t + C Here a = − 1 / β a = -1/\beta a = − 1/ β , so ∫ e − t / β d t = 1 − 1 / β e − t / β = − β e − t / β + C \int e^{-t/\beta} \, dt = \frac{1}{-1/\beta} e^{-t/\beta} = -\beta \, e^{-t/\beta} + C ∫ e − t / β d t = − 1/ β 1 e − t / β = − β e − t / β + C .
F ( y ) = 1 β ⋅ ( − β e − t / β ) ∣ 0 y = − e − t / β ∣ 0 y = − e − y / β − ( − e 0 ) = 1 − e − y / β F(y) = \frac{1}{\beta} \cdot \left(-\beta \, e^{-t/\beta}\right)\bigg|_0^y = -e^{-t/\beta}\bigg|_0^y = -e^{-y/\beta} - (-e^{0}) = 1 - e^{-y/\beta} F ( y ) = β 1 ⋅ ( − β e − t / β ) ∣ ∣ 0 y = − e − t / β ∣ ∣ 0 y = − e − y / β − ( − e 0 ) = 1 − e − y / β So the Exponential CDF is:
F ( y ) = 1 − e − y / β , y > 0 F(y) = 1 - e^{-y/\beta}, \qquad y > 0 F ( y ) = 1 − e − y / β , y > 0 This is one of the few distributions where the CDF has a clean closed form — no tables or software needed.
6.3.1 The Memoryless Property ¶ The Exponential distribution is the only continuous distribution with this remarkable property:
If Y ∼ Exponential ( β ) Y \sim \text{Exponential}(\beta) Y ∼ Exponential ( β ) , then for any s , t > 0 s, t > 0 s , t > 0 :
P ( Y > s + t ∣ Y > s ) = P ( Y > t ) P(Y > s + t \mid Y > s) = P(Y > t) P ( Y > s + t ∣ Y > s ) = P ( Y > t ) In words: Given that you’ve already waited s s s units of time, the probability of waiting at least t t t more is the same as if you’d just started waiting. The distribution “forgets” how long you’ve been waiting.
Proof.
Strategy: Use the definition of conditional probability and the exponential survival function P ( Y > y ) = e − y / β P(Y > y) = e^{-y/\beta} P ( Y > y ) = e − y / β .
P ( Y > s + t ∣ Y > s ) = P ( Y > s + t and Y > s ) P ( Y > s ) = P ( Y > s + t ) P ( Y > s ) P(Y > s + t \mid Y > s) = \frac{P(Y > s + t \text{ and } Y > s)}{P(Y > s)} = \frac{P(Y > s + t)}{P(Y > s)} P ( Y > s + t ∣ Y > s ) = P ( Y > s ) P ( Y > s + t and Y > s ) = P ( Y > s ) P ( Y > s + t ) = e − ( s + t ) / β e − s / β = e − t / β = P ( Y > t ) ■ = \frac{e^{-(s+t)/\beta}}{e^{-s/\beta}} = e^{-t/\beta} = P(Y > t) \qquad \blacksquare = e − s / β e − ( s + t ) / β = e − t / β = P ( Y > t ) ■ Why this matters: The memoryless property is why the Exponential distribution models the waiting time between Poisson events. If calls arrive at a switchboard according to a Poisson process, the time until the next call is Exponential — and no matter how long you’ve been waiting, the distribution of your remaining wait is the same.
6.3.2 The Poisson–Exponential Connection ¶ There is a deep link between two distributions from different chapters:
If events occur according to a Poisson process with rate λ \lambda λ events per unit time, then:
The number of events in a time interval of length t t t follows a Poisson ( λ t ) \text{Poisson}(\lambda t) Poisson ( λ t ) distribution (Chapter 4).
The time between consecutive events follows an Exponential ( 1 / λ ) \text{Exponential}(1/\lambda) Exponential ( 1/ λ ) distribution.
These are two views of the same random process — one counts events, the other measures gaps.
The Problem.
Under harsh operating conditions, the lifetime (in months) of a transistor is Exponentially distributed with parameter β = 5 \beta = 5 β = 5 (mean lifetime = 5 months).
(a) Find the probability that the transistor lasts longer than 8 months.
(b) Find the probability that the lifetime is between 3 and 7 months.
(c) Find the median lifetime.
(d) Given that a transistor has survived 6 months, find the probability it survives at least 2 more months.
Solution.
Y ∼ Exponential ( β = 5 ) Y \sim \text{Exponential}(\beta = 5) Y ∼ Exponential ( β = 5 ) , so f ( y ) = 1 5 e − y / 5 f(y) = \frac{1}{5}e^{-y/5} f ( y ) = 5 1 e − y /5 and F ( y ) = 1 − e − y / 5 F(y) = 1 - e^{-y/5} F ( y ) = 1 − e − y /5 .
(a) P ( Y > 8 ) = e − 8 / 5 = e − 1.6 ≈ 0.2019 P(Y > 8) = e^{-8/5} = e^{-1.6} \approx 0.2019 P ( Y > 8 ) = e − 8/5 = e − 1.6 ≈ 0.2019
(b) P ( 3 < Y < 7 ) = F ( 7 ) − F ( 3 ) = ( 1 − e − 7 / 5 ) − ( 1 − e − 3 / 5 ) = e − 0.6 − e − 1.4 = 0.5488 − 0.2466 = 0.3022 P(3 < Y < 7) = F(7) - F(3) = (1 - e^{-7/5}) - (1 - e^{-3/5}) = e^{-0.6} - e^{-1.4} = 0.5488 - 0.2466 = 0.3022 P ( 3 < Y < 7 ) = F ( 7 ) − F ( 3 ) = ( 1 − e − 7/5 ) − ( 1 − e − 3/5 ) = e − 0.6 − e − 1.4 = 0.5488 − 0.2466 = 0.3022
(c) Solve F ( ϕ 0.5 ) = 0.5 F(\phi_{0.5}) = 0.5 F ( ϕ 0.5 ) = 0.5 : 1 − e − ϕ 0.5 / 5 = 0.5 ⟹ e − ϕ 0.5 / 5 = 0.5 ⟹ ϕ 0.5 = − 5 ln ( 0.5 ) = 5 ln ( 2 ) ≈ 3.466 1 - e^{-\phi_{0.5}/5} = 0.5 \implies e^{-\phi_{0.5}/5} = 0.5 \implies \phi_{0.5} = -5\ln(0.5) = 5\ln(2) \approx 3.466 1 − e − ϕ 0.5 /5 = 0.5 ⟹ e − ϕ 0.5 /5 = 0.5 ⟹ ϕ 0.5 = − 5 ln ( 0.5 ) = 5 ln ( 2 ) ≈ 3.466 months.
The median (3.47 months) is less than the mean (5 months) — the Exponential distribution is heavily right-skewed.
(d) By the memoryless property:
P ( Y > 8 ∣ Y > 6 ) = P ( Y > 2 ) = e − 2 / 5 = e − 0.4 ≈ 0.6703 P(Y > 8 \mid Y > 6) = P(Y > 2) = e^{-2/5} = e^{-0.4} \approx 0.6703 P ( Y > 8 ∣ Y > 6 ) = P ( Y > 2 ) = e − 2/5 = e − 0.4 ≈ 0.6703 No calculation involving the 6 months of past survival is needed — the distribution doesn’t “remember.”
In R.
# Y ~ Exponential(beta = 5), or equivalently rate = 1/5
# (a) P(Y > 8)
pexp(8, rate = 1/5, lower.tail = FALSE) # 0.2019
# (b) P(3 < Y < 7)
pexp(7, rate = 1/5) - pexp(3, rate = 1/5) # 0.3022
# (c) Median
qexp(0.5, rate = 1/5) # 3.466
# (d) Memoryless: P(Y > 2)
pexp(2, rate = 1/5, lower.tail = FALSE) # 0.6703The Problem.
A radioactive source emits particles according to a Poisson process at a mean rate of 3 particles per second. Let T T T be the waiting time (in seconds) between consecutive emissions.
(a) What is the distribution of T T T ? Find its mean and standard deviation.
(b) Find P ( T > 1 ) P(T > 1) P ( T > 1 ) .
(c) Find P ( 0.2 < T < 0.8 ) P(0.2 < T < 0.8) P ( 0.2 < T < 0.8 ) .
(d) If 2 seconds have elapsed since the last emission, what is the probability that the next emission occurs within 0.5 seconds?
Solution.
The Poisson rate is λ = 3 \lambda = 3 λ = 3 per second, so T ∼ Exponential ( β = 1 / 3 ) T \sim \text{Exponential}(\beta = 1/3) T ∼ Exponential ( β = 1/3 ) , or equivalently rate = 3 = 3 = 3 .
(a) E ( T ) = 1 / λ = 1 / 3 E(T) = 1/\lambda = 1/3 E ( T ) = 1/ λ = 1/3 seconds, σ = 1 / λ = 1 / 3 \sigma = 1/\lambda = 1/3 σ = 1/ λ = 1/3 seconds. (For the Exponential, the mean and SD are always equal.)
(b) P ( T > 1 ) = e − 3 ( 1 ) = e − 3 ≈ 0.0498 P(T > 1) = e^{-3(1)} = e^{-3} \approx 0.0498 P ( T > 1 ) = e − 3 ( 1 ) = e − 3 ≈ 0.0498
(c) P ( 0.2 < T < 0.8 ) = e − 3 ( 0.2 ) − e − 3 ( 0.8 ) = e − 0.6 − e − 2.4 = 0.5488 − 0.0907 = 0.4581 P(0.2 < T < 0.8) = e^{-3(0.2)} - e^{-3(0.8)} = e^{-0.6} - e^{-2.4} = 0.5488 - 0.0907 = 0.4581 P ( 0.2 < T < 0.8 ) = e − 3 ( 0.2 ) − e − 3 ( 0.8 ) = e − 0.6 − e − 2.4 = 0.5488 − 0.0907 = 0.4581
(d) Memoryless property: P ( T ≤ 2.5 ∣ T > 2 ) = P ( T ≤ 0.5 ) = 1 − e − 3 ( 0.5 ) = 1 − e − 1.5 ≈ 0.7769 P(T \leq 2.5 \mid T > 2) = P(T \leq 0.5) = 1 - e^{-3(0.5)} = 1 - e^{-1.5} \approx 0.7769 P ( T ≤ 2.5 ∣ T > 2 ) = P ( T ≤ 0.5 ) = 1 − e − 3 ( 0.5 ) = 1 − e − 1.5 ≈ 0.7769 .
The 2 seconds of waiting are irrelevant.
6.4 Special Case 2: The Chi-Square Distribution ¶ A random variable Y Y Y has a Chi-Square distribution with ν \nu ν degrees of freedom , written Y ∼ χ 2 ( ν ) Y \sim \chi^2(\nu) Y ∼ χ 2 ( ν ) , if Y ∼ Gamma ( ν / 2 , 2 ) Y \sim \text{Gamma}(\nu/2, 2) Y ∼ Gamma ( ν /2 , 2 ) . Its density is:
f ( y ) = { y ν / 2 − 1 e − y / 2 2 ν / 2 Γ ( ν / 2 ) , y > 0 0 , y ≤ 0 f(y) = \begin{cases} \dfrac{y^{\nu/2 - 1} e^{-y/2}}{2^{\nu/2} \, \Gamma(\nu/2)}, & y > 0 \\[8pt] 0, & y \leq 0 \end{cases} f ( y ) = ⎩ ⎨ ⎧ 2 ν /2 Γ ( ν /2 ) y ν /2 − 1 e − y /2 , 0 , y > 0 y ≤ 0 Since α = ν / 2 \alpha = \nu/2 α = ν /2 and β = 2 \beta = 2 β = 2 : E ( Y ) = ν E(Y) = \nu E ( Y ) = ν and V ( Y ) = 2 ν V(Y) = 2\nu V ( Y ) = 2 ν .
Why does the Chi-Square matter? If Z 1 , Z 2 , … , Z ν Z_1, Z_2, \ldots, Z_\nu Z 1 , Z 2 , … , Z ν are independent standard Normal random variables, then:
Z 1 2 + Z 2 2 + ⋯ + Z ν 2 ∼ χ 2 ( ν ) Z_1^2 + Z_2^2 + \cdots + Z_\nu^2 \sim \chi^2(\nu) Z 1 2 + Z 2 2 + ⋯ + Z ν 2 ∼ χ 2 ( ν ) This is the bridge between the Normal distribution and statistical inference. In mathematical statistics, the Chi-Square distribution is used for testing hypotheses about variances, goodness-of-fit tests, and constructing confidence intervals.
# Visualize the Gamma family tree
par(mfrow = c(1, 3))
# Exponential: Gamma(1, 2)
curve(dgamma(x, 1, scale = 2), 0, 15, lwd = 2, col = "steelblue",
main = "Exponential(β=2)\n= Gamma(1, 2)", ylab = "f(y)")
# Chi-Square(6): Gamma(3, 2)
curve(dgamma(x, 3, scale = 2), 0, 25, lwd = 2, col = "darkorange",
main = "Chi-Square(ν=6)\n= Gamma(3, 2)", ylab = "f(y)")
# General Gamma(5, 3)
curve(dgamma(x, 5, scale = 3), 0, 40, lwd = 2, col = "purple",
main = "Gamma(α=5, β=3)", ylab = "f(y)")6.5 The Gamma Family Tree ¶ The relationships are worth seeing in one place:
The Problem.
The time (in minutes) a randomly selected student spends using a computer terminal has a Gamma distribution with mean 20 minutes and variance 80 min2 ^2 2 .
(a) Find the parameters α \alpha α and β \beta β .
(b) Find the probability that a student uses the terminal for at most 24 minutes.
(c) Find the probability that a student uses it between 15 and 30 minutes.
Solution.
(a) From the mean and variance formulas:
α β = 20 and α β 2 = 80 \alpha\beta = 20 \qquad \text{and} \qquad \alpha\beta^2 = 80 α β = 20 and α β 2 = 80 Dividing the second by the first: β = 80 / 20 = 4 \beta = 80/20 = 4 β = 80/20 = 4 . Then α = 20 / 4 = 5 \alpha = 20/4 = 5 α = 20/4 = 5 .
So Y ∼ Gamma ( 5 , 4 ) Y \sim \text{Gamma}(5, 4) Y ∼ Gamma ( 5 , 4 ) .
(b) There is no closed-form CDF for the general Gamma distribution (except when α \alpha α is a positive integer, via integration by parts). We use R:
# Y ~ Gamma(shape = 5, scale = 4)
pgamma(24, shape = 5, scale = 4) # 0.7149P ( Y ≤ 24 ) ≈ 0.715 P(Y \leq 24) \approx 0.715 P ( Y ≤ 24 ) ≈ 0.715 .
(c) P ( 15 ≤ Y ≤ 30 ) = F ( 30 ) − F ( 15 ) P(15 \leq Y \leq 30) = F(30) - F(15) P ( 15 ≤ Y ≤ 30 ) = F ( 30 ) − F ( 15 ) :
pgamma(30, shape = 5, scale = 4) - pgamma(15, shape = 5, scale = 4)
# 0.5455About 55% of students spend between 15 and 30 minutes.
Interpretation.
To find α \alpha α and β \beta β from the mean and variance, always use the same trick: divide V ( Y ) = α β 2 V(Y) = \alpha\beta^2 V ( Y ) = α β 2 by E ( Y ) = α β E(Y) = \alpha\beta E ( Y ) = α β to get β \beta β , then solve for α \alpha α . This works because the α \alpha α cancels cleanly.
Solution.
A random variable Y Y Y has the density function:
f ( y ) = { k y 3 e − y / 2 , y > 0 0 , elsewhere f(y) = \begin{cases} k \, y^3 \, e^{-y/2}, & y > 0 \\ 0, & \text{elsewhere} \end{cases} f ( y ) = { k y 3 e − y /2 , 0 , y > 0 elsewhere (a) Identify the distribution by matching to the Gamma density.
Compare with the Gamma density: f ( y ) = y α − 1 e − y / β β α Γ ( α ) f(y) = \frac{y^{\alpha-1}e^{-y/\beta}}{\beta^{\alpha}\Gamma(\alpha)} f ( y ) = β α Γ ( α ) y α − 1 e − y / β .
So Y ∼ Gamma ( 4 , 2 ) Y \sim \text{Gamma}(4, 2) Y ∼ Gamma ( 4 , 2 ) , which is also χ 2 ( 8 ) \chi^2(8) χ 2 ( 8 ) (since α = ν / 2 = 4 ⟹ ν = 8 \alpha = \nu/2 = 4 \implies \nu = 8 α = ν /2 = 4 ⟹ ν = 8 , and β = 2 \beta = 2 β = 2 ).
(b) Find k k k .
k = 1 β α Γ ( α ) = 1 2 4 ⋅ Γ ( 4 ) = 1 16 ⋅ 6 = 1 96 k = \frac{1}{\beta^{\alpha}\Gamma(\alpha)} = \frac{1}{2^4 \cdot \Gamma(4)} = \frac{1}{16 \cdot 6} = \frac{1}{96} k = β α Γ ( α ) 1 = 2 4 ⋅ Γ ( 4 ) 1 = 16 ⋅ 6 1 = 96 1 (c) Find E ( Y ) E(Y) E ( Y ) and V ( Y ) V(Y) V ( Y ) .
E ( Y ) = α β = 4 ( 2 ) = 8 V ( Y ) = α β 2 = 4 ( 4 ) = 16 E(Y) = \alpha\beta = 4(2) = 8 \qquad V(Y) = \alpha\beta^2 = 4(4) = 16 E ( Y ) = α β = 4 ( 2 ) = 8 V ( Y ) = α β 2 = 4 ( 4 ) = 16 Or, since Y ∼ χ 2 ( 8 ) Y \sim \chi^2(8) Y ∼ χ 2 ( 8 ) : E ( Y ) = ν = 8 E(Y) = \nu = 8 E ( Y ) = ν = 8 and V ( Y ) = 2 ν = 16 V(Y) = 2\nu = 16 V ( Y ) = 2 ν = 16 ✓.
(d) Find P ( Y > 12 ) P(Y > 12) P ( Y > 12 ) .
pgamma(12, shape = 4, scale = 2, lower.tail = FALSE) # 0.1512
# Equivalently:
pchisq(12, df = 8, lower.tail = FALSE) # 0.1512 ✓6.6 Section 5.6 Exercises ¶ 5.6.1. The time (in hours) until a server crashes follows an Exponential distribution with mean 200 hours.
(a) Find the probability that the server runs for at least 300 hours without crashing.
(b) Given that it has run for 150 hours, find the probability it runs at least 100 more hours.
(c) What is the median time to failure?
(d) Find the probability that the server crashes within the first 50 hours.
5.6.2. Calls arrive at a helpline at a Poisson rate of 4 per hour. Let T T T be the time (in hours) between consecutive calls.
(a) What is the distribution of T T T ? State its mean and variance.
(b) Find P ( T > 0.5 ) P(T > 0.5) P ( T > 0.5 ) .
(c) Find P ( T < 0.1 ) P(T < 0.1) P ( T < 0.1 ) .
(d) A new operator is told “on average, you’ll wait 15 minutes between calls.” Verify this claim.
5.6.3. A random variable Y Y Y has the density:
f ( y ) = { 1 6 y e − y / 3 , y > 0 0 , elsewhere f(y) = \begin{cases} \frac{1}{6}y \, e^{-y/3}, & y > 0 \\ 0, & \text{elsewhere} \end{cases} f ( y ) = { 6 1 y e − y /3 , 0 , y > 0 elsewhere (a) Identify the Gamma parameters α \alpha α and β \beta β .
(b) Find E ( Y ) E(Y) E ( Y ) and σ \sigma σ .
(c) Find P ( Y > 10 ) P(Y > 10) P ( Y > 10 ) using R.
5.6.4. A Chi-Square random variable has 12 degrees of freedom.
(a) State the mean and variance.
(b) Express this as a Gamma distribution.
(c) Use R to find P ( χ 12 2 > 21.026 ) P(\chi^2_{12} > 21.026) P ( χ 12 2 > 21.026 ) . What significance does this value have?
5.6.5. (Proof ) Prove the memoryless property of the Exponential distribution: if Y ∼ Exp ( β ) Y \sim \text{Exp}(\beta) Y ∼ Exp ( β ) , then P ( Y > s + t ∣ Y > s ) = P ( Y > t ) P(Y > s + t \mid Y > s) = P(Y > t) P ( Y > s + t ∣ Y > s ) = P ( Y > t ) for all s , t > 0 s, t > 0 s , t > 0 . Then show that if Y Y Y has a non-Exponential continuous distribution supported on ( 0 , ∞ ) (0, \infty) ( 0 , ∞ ) , the memoryless property fails. (Hint: For the second part, consider a specific counterexample such as the Gamma(2, 1) distribution.)
5.6.6. Show that Γ ( 1 / 2 ) = π \Gamma(1/2) = \sqrt{\pi} Γ ( 1/2 ) = π . (Hint: Write Γ ( 1 / 2 ) = ∫ 0 ∞ t − 1 / 2 e − t d t \Gamma(1/2) = \int_0^{\infty} t^{-1/2}e^{-t} \, dt Γ ( 1/2 ) = ∫ 0 ∞ t − 1/2 e − t d t , make the substitution t = u 2 / 2 t = u^2/2 t = u 2 /2 , and recognize the resulting integral as related to the standard Normal density.)
Confusing scale β \beta β with rate λ = 1 / β \lambda = 1/\beta λ = 1/ β . Some textbooks (and R’s dexp function) parameterize the Exponential by the rate λ \lambda λ . This book (and the reference textbook) use the scale β = 1 / λ \beta = 1/\lambda β = 1/ λ . In R: dexp(y, rate = lambda) = dgamma(y, shape = 1, scale = 1/lambda). Always check which convention your source uses.
Forgetting that Γ ( n ) = ( n − 1 ) ! \Gamma(n) = (n-1)! Γ ( n ) = ( n − 1 )! , not n ! n! n ! . The Gamma function is “shifted” by one compared to the factorial: Γ ( 5 ) = 4 ! = 24 \Gamma(5) = 4! = 24 Γ ( 5 ) = 4 ! = 24 , not 5 ! = 120 5! = 120 5 ! = 120 .
Trying to find a closed-form CDF for the general Gamma. There is no closed-form CDF when α \alpha α is not a positive integer. Use R’s pgamma() or tables. The Exponential (α = 1 \alpha = 1 α = 1 ) is the exception — its CDF is 1 − e − y / β 1 - e^{-y/\beta} 1 − e − y / β .
Applying the memoryless property to non-Exponential distributions. Only the Exponential distribution (among continuous distributions) is memoryless. If a component’s lifetime is Gamma(2, 5) instead of Exponential(5), the conditional probability P ( Y > s + t ∣ Y > s ) ≠ P ( Y > t ) P(Y > s+t \mid Y > s) \neq P(Y > t) P ( Y > s + t ∣ Y > s ) = P ( Y > t ) . Don’t assume memorylessness without checking that α = 1 \alpha = 1 α = 1 .
Mixing up Chi-Square parameters. The χ 2 ( ν ) \chi^2(\nu) χ 2 ( ν ) distribution has E ( Y ) = ν E(Y) = \nu E ( Y ) = ν and V ( Y ) = 2 ν V(Y) = 2\nu V ( Y ) = 2 ν . Students sometimes write V ( Y ) = ν V(Y) = \nu V ( Y ) = ν or E ( Y ) = 2 ν E(Y) = 2\nu E ( Y ) = 2 ν . Remember: the variance is twice the mean.
The Gamma distribution is a flexible, right-skewed family defined by shape α \alpha α and scale β \beta β . It lives on ( 0 , ∞ ) (0, \infty) ( 0 , ∞ ) and has mean α β \alpha\beta α β and variance α β 2 \alpha\beta^2 α β 2 . Two critically important distributions are special cases:
Exponential (α = 1 \alpha = 1 α = 1 ): models wait times between Poisson events, has the memoryless property, and has a closed-form CDF F ( y ) = 1 − e − y / β F(y) = 1 - e^{-y/\beta} F ( y ) = 1 − e − y / β .
Chi-Square (α = ν / 2 \alpha = \nu/2 α = ν /2 , β = 2 \beta = 2 β = 2 ): the sum of ν \nu ν squared standard Normals, with mean ν \nu ν and variance 2 ν 2\nu 2 ν .
The real-life interpretation: The Exponential distribution governs “waiting for the next event” — the next call, the next failure, the next emission. Its memoryless property is both mathematically elegant and practically useful: if a component’s lifetime is truly Exponential, then a 5-year-old component is just as likely to fail tomorrow as a brand-new one. This is why the Exponential models random failure (like a light bulb burning out) but not wear-out failure (like brake pads wearing thin). For wear-out, you need a Gamma with α > 1 \alpha > 1 α > 1 — a distribution that “remembers” how long the component has been in use.
The Gamma function Γ ( α ) \Gamma(\alpha) Γ ( α ) is the mathematical glue holding the family together, extending the factorial to non-integer values and serving as the normalizing constant for the Gamma density.
Looking ahead: The Beta distribution (Section 5.7) is the next named distribution — it models proportions and percentages, living on the interval [ 0 , 1 ] [0, 1] [ 0 , 1 ] rather than on ( 0 , ∞ ) (0, \infty) ( 0 , ∞ ) .
7 The Beta Distribution ¶ All the distributions so far live on infinite or semi-infinite intervals: the Normal on ( − ∞ , ∞ ) (-\infty, \infty) ( − ∞ , ∞ ) , the Gamma on ( 0 , ∞ ) (0, \infty) ( 0 , ∞ ) , the Uniform on any finite interval. But what if your random variable is a proportion — a number that must lie between 0 and 1?
The proportion of defective items in a shipment. The fraction of the day a machine is running. A baseball player’s batting average. A website’s click-through rate. All are numbers between 0 and 1, and the Beta distribution is designed specifically to model them.
The Beta distribution has two shape parameters, α \alpha α and β \beta β , that control whether the density is U-shaped, bell-shaped, left-skewed, right-skewed, or flat. When α = β = 1 \alpha = \beta = 1 α = β = 1 , it reduces to the Uniform(0, 1) — so the Uniform is actually a special case of the Beta.
Real-life motivation: A factory’s weekly repair cost, expressed as a fraction of the total budget, follows a Beta distribution. If α \alpha α and β \beta β are known, management can answer: “What is the probability that repairs consume more than 40% of our budget this week?” That’s a Beta probability.
7.1 Definition ¶ A random variable Y Y Y has a Beta distribution with parameters α > 0 \alpha > 0 α > 0 and β > 0 \beta > 0 β > 0 , written Y ∼ Beta ( α , β ) Y \sim \text{Beta}(\alpha, \beta) Y ∼ Beta ( α , β ) , if and only if:
f ( y ) = { y α − 1 ( 1 − y ) β − 1 B ( α , β ) , 0 ≤ y ≤ 1 0 , elsewhere f(y) = \begin{cases} \dfrac{y^{\alpha - 1}(1 - y)^{\beta - 1}}{B(\alpha, \beta)}, & 0 \leq y \leq 1 \\[8pt] 0, & \text{elsewhere} \end{cases} f ( y ) = ⎩ ⎨ ⎧ B ( α , β ) y α − 1 ( 1 − y ) β − 1 , 0 , 0 ≤ y ≤ 1 elsewhere where B ( α , β ) B(\alpha, \beta) B ( α , β ) is the Beta function :
B ( α , β ) = ∫ 0 1 t α − 1 ( 1 − t ) β − 1 d t = Γ ( α ) Γ ( β ) Γ ( α + β ) B(\alpha, \beta) = \int_0^1 t^{\alpha-1}(1-t)^{\beta-1} \, dt = \frac{\Gamma(\alpha)\Gamma(\beta)}{\Gamma(\alpha + \beta)} B ( α , β ) = ∫ 0 1 t α − 1 ( 1 − t ) β − 1 d t = Γ ( α + β ) Γ ( α ) Γ ( β ) The Beta function B ( α , β ) B(\alpha, \beta) B ( α , β ) serves as the normalizing constant — it ensures ∫ 0 1 f ( y ) d y = 1 \int_0^1 f(y) \, dy = 1 ∫ 0 1 f ( y ) d y = 1 . The relationship B ( α , β ) = Γ ( α ) Γ ( β ) / Γ ( α + β ) B(\alpha, \beta) = \Gamma(\alpha)\Gamma(\beta)/\Gamma(\alpha + \beta) B ( α , β ) = Γ ( α ) Γ ( β ) /Γ ( α + β ) connects the Beta function to the Gamma function, and allows us to evaluate it using factorials when α \alpha α and β \beta β are integers.
7.2 Mean and Variance ¶ If Y ∼ Beta ( α , β ) Y \sim \text{Beta}(\alpha, \beta) Y ∼ Beta ( α , β ) , then:
E ( Y ) = α α + β and V ( Y ) = α β ( α + β ) 2 ( α + β + 1 ) E(Y) = \frac{\alpha}{\alpha + \beta} \qquad \text{and} \qquad V(Y) = \frac{\alpha\beta}{(\alpha + \beta)^2(\alpha + \beta + 1)} E ( Y ) = α + β α and V ( Y ) = ( α + β ) 2 ( α + β + 1 ) α β Proof of E ( Y ) E(Y) E ( Y ) .
Strategy: Integrate y ⋅ f ( y ) y \cdot f(y) y ⋅ f ( y ) over [ 0 , 1 ] [0, 1] [ 0 , 1 ] , then recognize the result as a ratio of Beta functions.
E ( Y ) = ∫ 0 1 y ⋅ y α − 1 ( 1 − y ) β − 1 B ( α , β ) d y = 1 B ( α , β ) ∫ 0 1 y α ( 1 − y ) β − 1 d y E(Y) = \int_0^1 y \cdot \frac{y^{\alpha-1}(1-y)^{\beta-1}}{B(\alpha,\beta)} \, dy = \frac{1}{B(\alpha,\beta)} \int_0^1 y^{\alpha}(1-y)^{\beta-1} \, dy E ( Y ) = ∫ 0 1 y ⋅ B ( α , β ) y α − 1 ( 1 − y ) β − 1 d y = B ( α , β ) 1 ∫ 0 1 y α ( 1 − y ) β − 1 d y The integral ∫ 0 1 y α ( 1 − y ) β − 1 d y \int_0^1 y^{\alpha}(1-y)^{\beta-1} \, dy ∫ 0 1 y α ( 1 − y ) β − 1 d y has the form ∫ 0 1 y ( α + 1 ) − 1 ( 1 − y ) β − 1 d y = B ( α + 1 , β ) \int_0^1 y^{(\alpha+1)-1}(1-y)^{\beta-1} \, dy = B(\alpha+1, \beta) ∫ 0 1 y ( α + 1 ) − 1 ( 1 − y ) β − 1 d y = B ( α + 1 , β ) . So:
E ( Y ) = B ( α + 1 , β ) B ( α , β ) = Γ ( α + 1 ) Γ ( β ) / Γ ( α + β + 1 ) Γ ( α ) Γ ( β ) / Γ ( α + β ) E(Y) = \frac{B(\alpha+1, \beta)}{B(\alpha, \beta)} = \frac{\Gamma(\alpha+1)\Gamma(\beta)/\Gamma(\alpha+\beta+1)}{\Gamma(\alpha)\Gamma(\beta)/\Gamma(\alpha+\beta)} E ( Y ) = B ( α , β ) B ( α + 1 , β ) = Γ ( α ) Γ ( β ) /Γ ( α + β ) Γ ( α + 1 ) Γ ( β ) /Γ ( α + β + 1 ) The Γ ( β ) \Gamma(\beta) Γ ( β ) terms cancel. Using the recursion Γ ( α + 1 ) = α ⋅ Γ ( α ) \Gamma(\alpha+1) = \alpha \cdot \Gamma(\alpha) Γ ( α + 1 ) = α ⋅ Γ ( α ) and Γ ( α + β + 1 ) = ( α + β ) Γ ( α + β ) \Gamma(\alpha+\beta+1) = (\alpha+\beta)\Gamma(\alpha+\beta) Γ ( α + β + 1 ) = ( α + β ) Γ ( α + β ) :
= α ⋅ Γ ( α ) ⋅ Γ ( α + β ) Γ ( α ) ⋅ ( α + β ) ⋅ Γ ( α + β ) = α α + β ■ = \frac{\alpha \cdot \cancel{\Gamma(\alpha)} \cdot \cancel{\Gamma(\alpha+\beta)}}{\cancel{\Gamma(\alpha)} \cdot (\alpha+\beta) \cdot \cancel{\Gamma(\alpha+\beta)}} = \frac{\alpha}{\alpha + \beta} \qquad \blacksquare = Γ ( α ) ⋅ ( α + β ) ⋅ Γ ( α + β ) α ⋅ Γ ( α ) ⋅ Γ ( α + β ) = α + β α ■ The variance proof follows the same pattern (computing E ( Y 2 ) E(Y^2) E ( Y 2 ) via B ( α + 2 , β ) / B ( α , β ) B(\alpha+2, \beta)/B(\alpha, \beta) B ( α + 2 , β ) / B ( α , β ) and applying the shortcut formula). We leave the detailed algebra as Exercise 5.7.5.
7.3 Special Cases and Shape ¶ The Beta distribution is a shape-shifter:
α = β = 1 \alpha = \beta = 1 α = β = 1 : f ( y ) = 1 f(y) = 1 f ( y ) = 1 — the Uniform ( 0 , 1 ) \text{Uniform}(0, 1) Uniform ( 0 , 1 )
α = β > 1 \alpha = \beta > 1 α = β > 1 : symmetric, bell-shaped, centered at 1 / 2 1/2 1/2
α > β \alpha > \beta α > β : left-skewed (piles up near 1)
α < β \alpha < \beta α < β : right-skewed (piles up near 0)
α < 1 \alpha < 1 α < 1 and β < 1 \beta < 1 β < 1 : U-shaped (concentrated near 0 and 1)
# Visualize the Beta family's flexibility
par(mfrow = c(2, 2))
curve(dbeta(x, 1, 1), 0, 1, lwd = 2, col = "steelblue", ylim = c(0, 3),
main = "Beta(1,1) = Uniform", ylab = "f(y)")
curve(dbeta(x, 5, 5), 0, 1, lwd = 2, col = "darkorange",
main = "Beta(5,5): Symmetric bell", ylab = "f(y)")
curve(dbeta(x, 2, 8), 0, 1, lwd = 2, col = "purple",
main = "Beta(2,8): Right-skewed", ylab = "f(y)")
curve(dbeta(x, 0.5, 0.5), 0, 1, lwd = 2, col = "red",
main = "Beta(0.5,0.5): U-shaped", ylab = "f(y)")The Problem.
The weekly repair cost Y Y Y for a machine, measured as a proportion of the weekly budget, has the density:
f ( y ) = { 6 y ( 1 − y ) , 0 ≤ y ≤ 1 0 , elsewhere f(y) = \begin{cases} 6y(1 - y), & 0 \leq y \leq 1 \\ 0, & \text{elsewhere} \end{cases} f ( y ) = { 6 y ( 1 − y ) , 0 , 0 ≤ y ≤ 1 elsewhere (a) Identify the distribution.
(b) Find E ( Y ) E(Y) E ( Y ) and V ( Y ) V(Y) V ( Y ) .
(c) Find the probability that repair costs exceed 60% of the budget.
(d) How much should be budgeted so actual costs exceed the budget only 10% of the time?
Solution.
(a) Compare f ( y ) = 6 y ( 1 − y ) = 6 y 2 − 1 ( 1 − y ) 2 − 1 f(y) = 6y(1 - y) = 6 y^{2-1}(1-y)^{2-1} f ( y ) = 6 y ( 1 − y ) = 6 y 2 − 1 ( 1 − y ) 2 − 1 with the Beta density. We identify α = 2 \alpha = 2 α = 2 , β = 2 \beta = 2 β = 2 , and the constant is 6 = 1 / B ( 2 , 2 ) = Γ ( 4 ) / [ Γ ( 2 ) Γ ( 2 ) ] = 6 / ( 1 ⋅ 1 ) = 6 6 = 1/B(2,2) = \Gamma(4)/[\Gamma(2)\Gamma(2)] = 6/(1 \cdot 1) = 6 6 = 1/ B ( 2 , 2 ) = Γ ( 4 ) / [ Γ ( 2 ) Γ ( 2 )] = 6/ ( 1 ⋅ 1 ) = 6 ✓.
So Y ∼ Beta ( 2 , 2 ) Y \sim \text{Beta}(2, 2) Y ∼ Beta ( 2 , 2 ) .
(b) Using the formulas:
E ( Y ) = 2 2 + 2 = 1 2 = 0.50 E(Y) = \frac{2}{2+2} = \frac{1}{2} = 0.50 E ( Y ) = 2 + 2 2 = 2 1 = 0.50 V ( Y ) = 2 ⋅ 2 ( 2 + 2 ) 2 ( 2 + 2 + 1 ) = 4 16 ⋅ 5 = 4 80 = 1 20 = 0.05 V(Y) = \frac{2 \cdot 2}{(2+2)^2(2+2+1)} = \frac{4}{16 \cdot 5} = \frac{4}{80} = \frac{1}{20} = 0.05 V ( Y ) = ( 2 + 2 ) 2 ( 2 + 2 + 1 ) 2 ⋅ 2 = 16 ⋅ 5 4 = 80 4 = 20 1 = 0.05 σ = 0.05 ≈ 0.2236 \sigma = \sqrt{0.05} \approx 0.2236 σ = 0.05 ≈ 0.2236 (c) P ( Y > 0.6 ) = ∫ 0.6 1 6 y ( 1 − y ) d y P(Y > 0.6) = \int_{0.6}^{1} 6y(1-y) \, dy P ( Y > 0.6 ) = ∫ 0.6 1 6 y ( 1 − y ) d y
Using the power rule: 6 y ( 1 − y ) = 6 y − 6 y 2 6y(1-y) = 6y - 6y^2 6 y ( 1 − y ) = 6 y − 6 y 2
= ∫ 0.6 1 ( 6 y − 6 y 2 ) d y = [ 3 y 2 − 2 y 3 ] 0.6 1 = ( 3 − 2 ) − ( 3 ( 0.36 ) − 2 ( 0.216 ) ) = 1 − ( 1.08 − 0.432 ) = 1 − 0.648 = 0.352 = \int_{0.6}^{1} (6y - 6y^2) \, dy = \left[3y^2 - 2y^3\right]_{0.6}^{1} = (3 - 2) - (3(0.36) - 2(0.216)) = 1 - (1.08 - 0.432) = 1 - 0.648 = 0.352 = ∫ 0.6 1 ( 6 y − 6 y 2 ) d y = [ 3 y 2 − 2 y 3 ] 0.6 1 = ( 3 − 2 ) − ( 3 ( 0.36 ) − 2 ( 0.216 )) = 1 − ( 1.08 − 0.432 ) = 1 − 0.648 = 0.352 About 35.2% of weeks, costs exceed 60% of the budget.
(d) Find c c c such that P ( Y > c ) = 0.10 P(Y > c) = 0.10 P ( Y > c ) = 0.10 , i.e., P ( Y ≤ c ) = 0.90 P(Y \leq c) = 0.90 P ( Y ≤ c ) = 0.90 :
qbeta(0.90, 2, 2) # 0.8042Budget about 80.4% of the maximum to keep overruns below 10%.
Solution.
During an eight-hour shift, the proportion of time Y Y Y a stamping machine is down for maintenance has a Beta ( 1 , 2 ) \text{Beta}(1, 2) Beta ( 1 , 2 ) distribution.
(a) Write down the PDF.
With α = 1 \alpha = 1 α = 1 , β = 2 \beta = 2 β = 2 : B ( 1 , 2 ) = Γ ( 1 ) Γ ( 2 ) / Γ ( 3 ) = ( 1 ) ( 1 ) / ( 2 ) = 1 / 2 B(1,2) = \Gamma(1)\Gamma(2)/\Gamma(3) = (1)(1)/(2) = 1/2 B ( 1 , 2 ) = Γ ( 1 ) Γ ( 2 ) /Γ ( 3 ) = ( 1 ) ( 1 ) / ( 2 ) = 1/2 .
f ( y ) = y 0 ( 1 − y ) 1 1 / 2 = 2 ( 1 − y ) , 0 ≤ y ≤ 1 f(y) = \frac{y^{0}(1-y)^{1}}{1/2} = 2(1-y), \qquad 0 \leq y \leq 1 f ( y ) = 1/2 y 0 ( 1 − y ) 1 = 2 ( 1 − y ) , 0 ≤ y ≤ 1 (b) Find E ( Y ) E(Y) E ( Y ) and V ( Y ) V(Y) V ( Y ) .
E ( Y ) = 1 1 + 2 = 1 3 V ( Y ) = 1 ⋅ 2 ( 3 ) 2 ( 4 ) = 2 36 = 1 18 E(Y) = \frac{1}{1+2} = \frac{1}{3} \qquad V(Y) = \frac{1 \cdot 2}{(3)^2(4)} = \frac{2}{36} = \frac{1}{18} E ( Y ) = 1 + 2 1 = 3 1 V ( Y ) = ( 3 ) 2 ( 4 ) 1 ⋅ 2 = 36 2 = 18 1 (c) The cost of downtime is C = 10 + 20 Y + 4 Y 2 C = 10 + 20Y + 4Y^2 C = 10 + 20 Y + 4 Y 2 . Find E ( C ) E(C) E ( C ) .
We need E ( Y 2 ) = V ( Y ) + [ E ( Y ) ] 2 = 1 / 18 + 1 / 9 = 1 / 18 + 2 / 18 = 3 / 18 = 1 / 6 E(Y^2) = V(Y) + [E(Y)]^2 = 1/18 + 1/9 = 1/18 + 2/18 = 3/18 = 1/6 E ( Y 2 ) = V ( Y ) + [ E ( Y ) ] 2 = 1/18 + 1/9 = 1/18 + 2/18 = 3/18 = 1/6 .
E ( C ) = 10 + 20 ⋅ 1 3 + 4 ⋅ 1 6 = 10 + 20 3 + 2 3 = 10 + 22 3 = 52 3 ≈ $ 17.33 E(C) = 10 + 20 \cdot \frac{1}{3} + 4 \cdot \frac{1}{6} = 10 + \frac{20}{3} + \frac{2}{3} = 10 + \frac{22}{3} = \frac{52}{3} \approx \$17.33 E ( C ) = 10 + 20 ⋅ 3 1 + 4 ⋅ 6 1 = 10 + 3 20 + 3 2 = 10 + 3 22 = 3 52 ≈ $17.33 7.4 Section 5.7 Exercises ¶ 5.7.1. A random variable Y Y Y has density f ( y ) = 12 y 2 ( 1 − y ) f(y) = 12y^2(1 - y) f ( y ) = 12 y 2 ( 1 − y ) for 0 ≤ y ≤ 1 0 \leq y \leq 1 0 ≤ y ≤ 1 .
(a) Identify the Beta parameters α \alpha α and β \beta β .
(b) Find E ( Y ) E(Y) E ( Y ) and V ( Y ) V(Y) V ( Y ) using the Beta formulas.
(c) Verify E ( Y ) E(Y) E ( Y ) by direct integration.
5.7.2. The proportion of impurities in ore samples follows a Beta ( 3 , 5 ) \text{Beta}(3, 5) Beta ( 3 , 5 ) distribution. Each sample is worth W = 5 − 0.5 Y W = 5 - 0.5Y W = 5 − 0.5 Y dollars.
(a) Find E ( Y ) E(Y) E ( Y ) , V ( Y ) V(Y) V ( Y ) .
(b) Find E ( W ) E(W) E ( W ) and V ( W ) V(W) V ( W ) .
(c) Find P ( Y < 0.5 ) P(Y < 0.5) P ( Y < 0.5 ) using R.
5.7.3. Show that the Beta ( 1 , 1 ) \text{Beta}(1, 1) Beta ( 1 , 1 ) distribution is the Uniform ( 0 , 1 ) \text{Uniform}(0, 1) Uniform ( 0 , 1 ) distribution by verifying that the Beta density with α = β = 1 \alpha = \beta = 1 α = β = 1 reduces to f ( y ) = 1 f(y) = 1 f ( y ) = 1 for 0 ≤ y ≤ 1 0 \leq y \leq 1 0 ≤ y ≤ 1 .
5.7.4. A random variable Y ∼ Beta ( α , β ) Y \sim \text{Beta}(\alpha, \beta) Y ∼ Beta ( α , β ) with α = β \alpha = \beta α = β has mean 1 / 2 1/2 1/2 . Show this algebraically. Then argue from symmetry that the PDF satisfies f ( y ) = f ( 1 − y ) f(y) = f(1-y) f ( y ) = f ( 1 − y ) , and explain why this implies the mean must be 1 / 2 1/2 1/2 .
5.7.5. (Proof ) Derive V ( Y ) V(Y) V ( Y ) for Y ∼ Beta ( α , β ) Y \sim \text{Beta}(\alpha, \beta) Y ∼ Beta ( α , β ) . (Hint: Find E ( Y 2 ) E(Y^2) E ( Y 2 ) using the same Beta-function ratio technique from the E ( Y ) E(Y) E ( Y ) proof: E ( Y 2 ) = B ( α + 2 , β ) / B ( α , β ) E(Y^2) = B(\alpha+2, \beta)/B(\alpha, \beta) E ( Y 2 ) = B ( α + 2 , β ) / B ( α , β ) . Then apply the shortcut formula.)
The Beta distribution models random proportions on [ 0 , 1 ] [0, 1] [ 0 , 1 ] , with density f ( y ) ∝ y α − 1 ( 1 − y ) β − 1 f(y) \propto y^{\alpha-1}(1-y)^{\beta-1} f ( y ) ∝ y α − 1 ( 1 − y ) β − 1 . Its two parameters give it extraordinary flexibility: symmetric or skewed, bell-shaped or U-shaped, concentrated or spread out.
The real-life interpretation: Any time you have a random variable that is naturally a fraction or percentage — market share, completion rate, defect rate, the proportion of a budget consumed — the Beta distribution is a natural candidate. Its mean α / ( α + β ) \alpha/(\alpha + \beta) α / ( α + β ) is a “weighted average” of 0 and 1, where α \alpha α represents “successes” and β \beta β represents “failures.” In Bayesian statistics (which you’ll meet in mathematical statistics), the Beta distribution is the standard prior for unknown probabilities.
Looking ahead: Section 5.8 introduces moment generating functions for continuous distributions — the tool that lets us prove the mean and variance formulas for the Normal and Gamma distributions, and provides a powerful method for identifying distributions.
8 Moments and Moment-Generating Functions ¶ In Chapter 4, we introduced moment generating functions (MGFs) for discrete random variables. The idea was simple but powerful: if you can find M ( t ) = E ( e t Y ) M(t) = E(e^{tY}) M ( t ) = E ( e t Y ) , then the k k k th moment E ( Y k ) E(Y^k) E ( Y k ) is the k k k th derivative M ( k ) ( 0 ) M^{(k)}(0) M ( k ) ( 0 ) .
Now we extend MGFs to continuous distributions. The definition is the same — only the computation changes from a sum to an integral. We’ll use MGFs to prove the mean and variance formulas for the Normal and Gamma distributions that we stated without proof in earlier sections.
MGFs also have a uniqueness property: if two distributions have the same MGF, they are the same distribution. This means MGFs serve as “fingerprints” — you can identify a distribution by computing its MGF and matching it to a known form.
Real-life motivation: Suppose you know a random variable has MGF M ( t ) = ( 1 − 2 t ) − 3 M(t) = (1 - 2t)^{-3} M ( t ) = ( 1 − 2 t ) − 3 . Without any other information, you can conclude it’s a Gamma ( 3 , 2 ) \text{Gamma}(3, 2) Gamma ( 3 , 2 ) distribution (or equivalently, a χ 2 ( 6 ) \chi^2(6) χ 2 ( 6 ) ). The MGF uniquely identifies the distribution.
8.1 Definition and Basic Properties ¶ Before the MGF, let us formally define moments — a concept also covered in the reference textbook (Definition 4.13).
If Y Y Y is a continuous random variable, the k k k th moment about the origin (or k k k th raw moment ) is:
μ k ′ = E ( Y k ) = ∫ − ∞ ∞ y k f ( y ) d y , k = 1 , 2 , 3 , … \mu_k' = E(Y^k) = \int_{-\infty}^{\infty} y^k f(y) \, dy, \qquad k = 1, 2, 3, \ldots μ k ′ = E ( Y k ) = ∫ − ∞ ∞ y k f ( y ) d y , k = 1 , 2 , 3 , … The k k k th moment about the mean (or k k k th central moment ) is:
μ k = E [ ( Y − μ ) k ] , k = 1 , 2 , 3 , … \mu_k = E[(Y - \mu)^k], \qquad k = 1, 2, 3, \ldots μ k = E [( Y − μ ) k ] , k = 1 , 2 , 3 , … Notice that μ 1 ′ = μ = E ( Y ) \mu_1' = \mu = E(Y) μ 1 ′ = μ = E ( Y ) (the mean) and μ 2 = V ( Y ) = σ 2 \mu_2 = V(Y) = \sigma^2 μ 2 = V ( Y ) = σ 2 (the variance). The third central moment μ 3 \mu_3 μ 3 measures skewness, and the fourth μ 4 \mu_4 μ 4 measures kurtosis (tail heaviness).
The moment-generating function of a continuous random variable Y Y Y is:
M ( t ) = E ( e t Y ) = ∫ − ∞ ∞ e t y f ( y ) d y M(t) = E(e^{tY}) = \int_{-\infty}^{\infty} e^{ty} f(y) \, dy M ( t ) = E ( e t Y ) = ∫ − ∞ ∞ e t y f ( y ) d y provided the integral exists for all t t t in some interval ( − h , h ) (-h, h) ( − h , h ) around 0.
If M ( t ) M(t) M ( t ) exists, then the k k k th moment of Y Y Y is:
E ( Y k ) = M ( k ) ( 0 ) = d k M ( t ) d t k ∣ t = 0 E(Y^k) = M^{(k)}(0) = \frac{d^k M(t)}{dt^k}\bigg|_{t=0} E ( Y k ) = M ( k ) ( 0 ) = d t k d k M ( t ) ∣ ∣ t = 0 In particular: E ( Y ) = M ′ ( 0 ) E(Y) = M'(0) E ( Y ) = M ′ ( 0 ) and E ( Y 2 ) = M ′ ′ ( 0 ) E(Y^2) = M''(0) E ( Y 2 ) = M ′′ ( 0 ) .
8.2 The Gamma MGF — Full Derivation ¶ This is the most important MGF derivation in this chapter, because it also gives us the Exponential and Chi-Square MGFs as special cases.
If Y ∼ Gamma ( α , β ) Y \sim \text{Gamma}(\alpha, \beta) Y ∼ Gamma ( α , β ) , then:
M ( t ) = ( 1 − β t ) − α , t < 1 / β M(t) = (1 - \beta t)^{-\alpha}, \qquad t < 1/\beta M ( t ) = ( 1 − βt ) − α , t < 1/ β Proof.
Strategy: Compute E ( e t Y ) E(e^{tY}) E ( e t Y ) by integrating, then use the same substitution trick from the Gamma normalization proof to convert the integral into a recognizable Γ ( α ) \Gamma(\alpha) Γ ( α ) form.
M ( t ) = E ( e t Y ) = ∫ 0 ∞ e t y ⋅ y α − 1 e − y / β β α Γ ( α ) d y M(t) = E(e^{tY}) = \int_0^{\infty} e^{ty} \cdot \frac{y^{\alpha-1}e^{-y/\beta}}{\beta^{\alpha}\Gamma(\alpha)} \, dy M ( t ) = E ( e t Y ) = ∫ 0 ∞ e t y ⋅ β α Γ ( α ) y α − 1 e − y / β d y Combine the two exponentials: e t y ⋅ e − y / β = e y ( t − 1 / β ) = e − y ( 1 / β − t ) e^{ty} \cdot e^{-y/\beta} = e^{y(t - 1/\beta)} = e^{-y(1/\beta - t)} e t y ⋅ e − y / β = e y ( t − 1/ β ) = e − y ( 1/ β − t ) .
For this integral to converge, we need 1 / β − t > 0 1/\beta - t > 0 1/ β − t > 0 , i.e., t < 1 / β t < 1/\beta t < 1/ β . Assuming this:
M ( t ) = 1 β α Γ ( α ) ∫ 0 ∞ y α − 1 e − y ( 1 / β − t ) d y M(t) = \frac{1}{\beta^{\alpha}\Gamma(\alpha)} \int_0^{\infty} y^{\alpha-1} e^{-y(1/\beta - t)} \, dy M ( t ) = β α Γ ( α ) 1 ∫ 0 ∞ y α − 1 e − y ( 1/ β − t ) d y Let u = y ( 1 / β − t ) u = y(1/\beta - t) u = y ( 1/ β − t ) , so y = u / ( 1 / β − t ) y = u/(1/\beta - t) y = u / ( 1/ β − t ) and d y = d u / ( 1 / β − t ) dy = du/(1/\beta - t) d y = d u / ( 1/ β − t ) .
When y = 0 y = 0 y = 0 : u = 0 u = 0 u = 0 . When y → ∞ y \to \infty y → ∞ : u → ∞ u \to \infty u → ∞ .
Write 1 / β − t = ( 1 − β t ) / β 1/\beta - t = (1 - \beta t)/\beta 1/ β − t = ( 1 − βt ) / β to keep expressions clean.
Substitute u = y ⋅ 1 − β t β u = y \cdot \frac{1 - \beta t}{\beta} u = y ⋅ β 1 − βt , so y = u β 1 − β t y = \frac{u\beta}{1 - \beta t} y = 1 − βt u β and d y = β 1 − β t d u dy = \frac{\beta}{1 - \beta t} \, du d y = 1 − βt β d u :
M ( t ) = 1 β α Γ ( α ) ∫ 0 ∞ ( u β 1 − β t ) α − 1 e − u ⋅ β 1 − β t d u M(t) = \frac{1}{\beta^{\alpha}\Gamma(\alpha)} \int_0^{\infty} \left(\frac{u\beta}{1-\beta t}\right)^{\alpha-1} e^{-u} \cdot \frac{\beta}{1-\beta t} \, du M ( t ) = β α Γ ( α ) 1 ∫ 0 ∞ ( 1 − βt u β ) α − 1 e − u ⋅ 1 − βt β d u Collect the powers of β / ( 1 − β t ) \beta/(1-\beta t) β / ( 1 − βt ) : the exponent α − 1 \alpha - 1 α − 1 from the y α − 1 y^{\alpha-1} y α − 1 term plus 1 from the d y dy d y term gives α \alpha α total:
= 1 β α Γ ( α ) ⋅ β α ( 1 − β t ) α ∫ 0 ∞ u α − 1 e − u d u = \frac{1}{\beta^{\alpha}\Gamma(\alpha)} \cdot \frac{\beta^{\alpha}}{(1-\beta t)^{\alpha}} \int_0^{\infty} u^{\alpha-1}e^{-u} \, du = β α Γ ( α ) 1 ⋅ ( 1 − βt ) α β α ∫ 0 ∞ u α − 1 e − u d u The β α \beta^{\alpha} β α terms cancel. The integral is Γ ( α ) \Gamma(\alpha) Γ ( α ) :
= β α β α ⋅ Γ ( α ) ⋅ Γ ( α ) ( 1 − β t ) α = ( 1 − β t ) − α ■ = \frac{\cancel{\beta^{\alpha}}}{\cancel{\beta^{\alpha}} \cdot \cancel{\Gamma(\alpha)}} \cdot \frac{\cancel{\Gamma(\alpha)}}{(1-\beta t)^{\alpha}} = (1 - \beta t)^{-\alpha} \qquad \blacksquare = β α ⋅ Γ ( α ) β α ⋅ ( 1 − βt ) α Γ ( α ) = ( 1 − βt ) − α ■ 8.3 Deriving E ( Y ) E(Y) E ( Y ) and V ( Y ) V(Y) V ( Y ) for the Gamma from the MGF ¶ Now we can finally prove Theorem 5.11:
M ( t ) = ( 1 − β t ) − α M(t) = (1 - \beta t)^{-\alpha} M ( t ) = ( 1 − βt ) − α First derivative (using the chain rule: d d t ( 1 − β t ) − α = − α ( 1 − β t ) − α − 1 ⋅ ( − β ) = α β ( 1 − β t ) − α − 1 \frac{d}{dt}(1 - \beta t)^{-\alpha} = -\alpha(1 - \beta t)^{-\alpha - 1} \cdot (-\beta) = \alpha\beta(1 - \beta t)^{-\alpha - 1} d t d ( 1 − βt ) − α = − α ( 1 − βt ) − α − 1 ⋅ ( − β ) = α β ( 1 − βt ) − α − 1 ):
M ′ ( t ) = α β ( 1 − β t ) − α − 1 M'(t) = \alpha\beta(1 - \beta t)^{-\alpha-1} M ′ ( t ) = α β ( 1 − βt ) − α − 1 E ( Y ) = M ′ ( 0 ) = α β ( 1 ) − α − 1 = α β ✓ E(Y) = M'(0) = \alpha\beta(1)^{-\alpha-1} = \alpha\beta \qquad \checkmark E ( Y ) = M ′ ( 0 ) = α β ( 1 ) − α − 1 = α β ✓ Second derivative (chain rule again):
M ′ ′ ( t ) = α β ⋅ ( − α − 1 ) ( 1 − β t ) − α − 2 ⋅ ( − β ) = α ( α + 1 ) β 2 ( 1 − β t ) − α − 2 M''(t) = \alpha\beta \cdot (-\alpha-1)(1-\beta t)^{-\alpha-2} \cdot (-\beta) = \alpha(\alpha+1)\beta^2(1-\beta t)^{-\alpha-2} M ′′ ( t ) = α β ⋅ ( − α − 1 ) ( 1 − βt ) − α − 2 ⋅ ( − β ) = α ( α + 1 ) β 2 ( 1 − βt ) − α − 2 E ( Y 2 ) = M ′ ′ ( 0 ) = α ( α + 1 ) β 2 E(Y^2) = M''(0) = \alpha(\alpha+1)\beta^2 E ( Y 2 ) = M ′′ ( 0 ) = α ( α + 1 ) β 2 Variance:
V ( Y ) = E ( Y 2 ) − [ E ( Y ) ] 2 = α ( α + 1 ) β 2 − ( α β ) 2 = α 2 β 2 + α β 2 − α 2 β 2 = α β 2 ✓ V(Y) = E(Y^2) - [E(Y)]^2 = \alpha(\alpha+1)\beta^2 - (\alpha\beta)^2 = \alpha^2\beta^2 + \alpha\beta^2 - \alpha^2\beta^2 = \alpha\beta^2 \qquad \checkmark V ( Y ) = E ( Y 2 ) − [ E ( Y ) ] 2 = α ( α + 1 ) β 2 − ( α β ) 2 = α 2 β 2 + α β 2 − α 2 β 2 = α β 2 ✓ 8.4 MGFs for Special Cases ¶ Setting α = 1 \alpha = 1 α = 1 (Exponential): M ( t ) = ( 1 − β t ) − 1 M(t) = (1 - \beta t)^{-1} M ( t ) = ( 1 − βt ) − 1 for t < 1 / β t < 1/\beta t < 1/ β .
Setting α = ν / 2 \alpha = \nu/2 α = ν /2 , β = 2 \beta = 2 β = 2 (Chi-Square): M ( t ) = ( 1 − 2 t ) − ν / 2 M(t) = (1 - 2t)^{-\nu/2} M ( t ) = ( 1 − 2 t ) − ν /2 for t < 1 / 2 t < 1/2 t < 1/2 .
8.5 The Normal MGF ¶ If Y ∼ N ( μ , σ 2 ) Y \sim N(\mu, \sigma^2) Y ∼ N ( μ , σ 2 ) , then:
M ( t ) = e μ t + σ 2 t 2 / 2 M(t) = e^{\mu t + \sigma^2 t^2 / 2} M ( t ) = e μ t + σ 2 t 2 /2 Proof.
Strategy: Start with the standard Normal (μ = 0 \mu = 0 μ = 0 , σ = 1 \sigma = 1 σ = 1 ), then generalize using Y = μ + σ Z Y = \mu + \sigma Z Y = μ + σ Z .
Step 1: Standard Normal MGF. For Z ∼ N ( 0 , 1 ) Z \sim N(0, 1) Z ∼ N ( 0 , 1 ) :
M Z ( t ) = ∫ − ∞ ∞ e t z ⋅ 1 2 π e − z 2 / 2 d z = 1 2 π ∫ − ∞ ∞ e t z − z 2 / 2 d z M_Z(t) = \int_{-\infty}^{\infty} e^{tz} \cdot \frac{1}{\sqrt{2\pi}}e^{-z^2/2} \, dz = \frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty} e^{tz - z^2/2} \, dz M Z ( t ) = ∫ − ∞ ∞ e t z ⋅ 2 π 1 e − z 2 /2 d z = 2 π 1 ∫ − ∞ ∞ e t z − z 2 /2 d z The key trick is completing the square in the exponent:
t z − z 2 2 = − 1 2 ( z 2 − 2 t z ) = − 1 2 ( z 2 − 2 t z + t 2 ) + t 2 2 = − ( z − t ) 2 2 + t 2 2 tz - \frac{z^2}{2} = -\frac{1}{2}(z^2 - 2tz) = -\frac{1}{2}(z^2 - 2tz + t^2) + \frac{t^2}{2} = -\frac{(z-t)^2}{2} + \frac{t^2}{2} t z − 2 z 2 = − 2 1 ( z 2 − 2 t z ) = − 2 1 ( z 2 − 2 t z + t 2 ) + 2 t 2 = − 2 ( z − t ) 2 + 2 t 2 So:
M Z ( t ) = 1 2 π e t 2 / 2 ∫ − ∞ ∞ e − ( z − t ) 2 / 2 d z M_Z(t) = \frac{1}{\sqrt{2\pi}} e^{t^2/2} \int_{-\infty}^{\infty} e^{-(z-t)^2/2} \, dz M Z ( t ) = 2 π 1 e t 2 /2 ∫ − ∞ ∞ e − ( z − t ) 2 /2 d z The remaining integral is the total area under a N ( t , 1 ) N(t, 1) N ( t , 1 ) density (shifted Normal), which equals 2 π \sqrt{2\pi} 2 π . Therefore:
M Z ( t ) = 1 2 π ⋅ e t 2 / 2 ⋅ 2 π = e t 2 / 2 M_Z(t) = \frac{1}{\cancel{\sqrt{2\pi}}} \cdot e^{t^2/2} \cdot \cancel{\sqrt{2\pi}} = e^{t^2/2} M Z ( t ) = 2 π 1 ⋅ e t 2 /2 ⋅ 2 π = e t 2 /2 Step 2: General Normal. If Y = μ + σ Z Y = \mu + \sigma Z Y = μ + σ Z , then E ( e t Y ) = E ( e t ( μ + σ Z ) ) = e t μ ⋅ E ( e ( t σ ) Z ) = e t μ ⋅ e ( t σ ) 2 / 2 = e μ t + σ 2 t 2 / 2 E(e^{tY}) = E(e^{t(\mu + \sigma Z)}) = e^{t\mu} \cdot E(e^{(t\sigma)Z}) = e^{t\mu} \cdot e^{(t\sigma)^2/2} = e^{\mu t + \sigma^2 t^2/2} E ( e t Y ) = E ( e t ( μ + σ Z ) ) = e t μ ⋅ E ( e ( t σ ) Z ) = e t μ ⋅ e ( t σ ) 2 /2 = e μ t + σ 2 t 2 /2 ■ \qquad \blacksquare ■
Deriving E ( Y ) E(Y) E ( Y ) and V ( Y ) V(Y) V ( Y ) from the Normal MGF:
M ′ ( t ) = ( μ + σ 2 t ) ⋅ e μ t + σ 2 t 2 / 2 ⟹ E ( Y ) = M ′ ( 0 ) = μ ⋅ 1 = μ ✓ M'(t) = (\mu + \sigma^2 t) \cdot e^{\mu t + \sigma^2 t^2/2} \implies E(Y) = M'(0) = \mu \cdot 1 = \mu \qquad \checkmark M ′ ( t ) = ( μ + σ 2 t ) ⋅ e μ t + σ 2 t 2 /2 ⟹ E ( Y ) = M ′ ( 0 ) = μ ⋅ 1 = μ ✓ M ′ ′ ( t ) = [ σ 2 + ( μ + σ 2 t ) 2 ] ⋅ e μ t + σ 2 t 2 / 2 ⟹ E ( Y 2 ) = M ′ ′ ( 0 ) = σ 2 + μ 2 M''(t) = [\sigma^2 + (\mu + \sigma^2 t)^2] \cdot e^{\mu t + \sigma^2 t^2/2} \implies E(Y^2) = M''(0) = \sigma^2 + \mu^2 M ′′ ( t ) = [ σ 2 + ( μ + σ 2 t ) 2 ] ⋅ e μ t + σ 2 t 2 /2 ⟹ E ( Y 2 ) = M ′′ ( 0 ) = σ 2 + μ 2 V ( Y ) = ( σ 2 + μ 2 ) − μ 2 = σ 2 ✓ V(Y) = (\sigma^2 + \mu^2) - \mu^2 = \sigma^2 \qquad \checkmark V ( Y ) = ( σ 2 + μ 2 ) − μ 2 = σ 2 ✓ 8.6 Section 5.8 Exercises ¶ 5.8.1. Find the MGF of the Uniform ( θ 1 , θ 2 ) \text{Uniform}(\theta_1, \theta_2) Uniform ( θ 1 , θ 2 ) distribution. (Hint: Integrate e t y / ( θ 2 − θ 1 ) e^{ty}/(\theta_2 - \theta_1) e t y / ( θ 2 − θ 1 ) from θ 1 \theta_1 θ 1 to θ 2 \theta_2 θ 2 . The result is M ( t ) = e θ 2 t − e θ 1 t ( θ 2 − θ 1 ) t M(t) = \frac{e^{\theta_2 t} - e^{\theta_1 t}}{(\theta_2 - \theta_1)t} M ( t ) = ( θ 2 − θ 1 ) t e θ 2 t − e θ 1 t for t ≠ 0 t \neq 0 t = 0 .) Verify that M ′ ( 0 ) = ( θ 1 + θ 2 ) / 2 M'(0) = (\theta_1 + \theta_2)/2 M ′ ( 0 ) = ( θ 1 + θ 2 ) /2 .
5.8.2. A random variable has MGF M ( t ) = ( 1 − 4 t ) − 3 M(t) = (1 - 4t)^{-3} M ( t ) = ( 1 − 4 t ) − 3 . Identify the distribution, and state its mean and variance.
5.8.3. A random variable has MGF M ( t ) = e 5 t + 8 t 2 M(t) = e^{5t + 8t^2} M ( t ) = e 5 t + 8 t 2 . Identify the distribution, and state its mean and variance.
5.8.4. (Proof ) Using the Gamma MGF, prove that the sum of ν \nu ν independent Exponential( β ) (\beta) ( β ) random variables has a Gamma ( ν , β ) \text{Gamma}(\nu, \beta) Gamma ( ν , β ) distribution. (Hint: The MGF of a sum of independent RVs is the product of their individual MGFs. What is [ ( 1 − β t ) − 1 ] ν [(1-\beta t)^{-1}]^{\nu} [( 1 − βt ) − 1 ] ν ?)
The moment generating function M ( t ) = E ( e t Y ) M(t) = E(e^{tY}) M ( t ) = E ( e t Y ) is a powerful tool with three uses:
Finding moments: E ( Y ) = M ′ ( 0 ) E(Y) = M'(0) E ( Y ) = M ′ ( 0 ) , E ( Y 2 ) = M ′ ′ ( 0 ) E(Y^2) = M''(0) E ( Y 2 ) = M ′′ ( 0 ) , then V ( Y ) = M ′ ′ ( 0 ) − [ M ′ ( 0 ) ] 2 V(Y) = M''(0) - [M'(0)]^2 V ( Y ) = M ′′ ( 0 ) − [ M ′ ( 0 ) ] 2 .
Proving mean/variance formulas: We used the Gamma MGF ( 1 − β t ) − α (1-\beta t)^{-\alpha} ( 1 − βt ) − α to prove E ( Y ) = α β E(Y) = \alpha\beta E ( Y ) = α β and V ( Y ) = α β 2 V(Y) = \alpha\beta^2 V ( Y ) = α β 2 , and the Normal MGF e μ t + σ 2 t 2 / 2 e^{\mu t + \sigma^2 t^2/2} e μ t + σ 2 t 2 /2 to prove E ( Y ) = μ E(Y) = \mu E ( Y ) = μ and V ( Y ) = σ 2 V(Y) = \sigma^2 V ( Y ) = σ 2 .
Identifying distributions: If you compute an MGF and it matches a known form, you’ve identified the distribution — because MGFs are unique.
The real-life interpretation: MGFs are a theoretical tool, not something you’d compute on the job. But they’re the engine behind many results you’ll use constantly: the fact that a sum of independent Normals is Normal, the fact that a sum of independent Gammas (with the same β \beta β ) is Gamma, and the Central Limit Theorem itself. These are proved using MGFs.
Looking ahead: Our final section gives a universal bound on probabilities — Tchebysheff’s theorem works for any distribution, with no assumptions about its shape.
9 Tchebysheff’s Theorem ¶ Every distribution we’ve studied — Uniform, Normal, Gamma, Beta — has its own specific formula for computing P ( ∣ Y − μ ∣ ≥ k σ ) P(|Y - \mu| \geq k\sigma) P ( ∣ Y − μ ∣ ≥ kσ ) . But what if you don’t know the distribution? What if all you know is the mean μ \mu μ and variance σ 2 \sigma^2 σ 2 ?
Tchebysheff’s theorem gives a universal bound: for any distribution (continuous or discrete), at least 1 − 1 / k 2 1 - 1/k^2 1 − 1/ k 2 of the probability lies within k k k standard deviations of the mean. This bound is conservative — it’s rarely tight — but it works with no assumptions about the shape of the distribution.
Real-life motivation: A quality engineer knows a part has mean diameter μ = 10 \mu = 10 μ = 10 mm and standard deviation σ = 0.3 \sigma = 0.3 σ = 0.3 mm, but doesn’t know the exact distribution. Tchebysheff guarantees that at least 75% of parts are within ± 0.6 \pm 0.6 ± 0.6 mm of the mean (k = 2 k = 2 k = 2 ), and at least 89% are within ± 0.9 \pm 0.9 ± 0.9 mm (k = 3 k = 3 k = 3 ) — regardless of the distribution’s shape.
Let Y Y Y be a continuous random variable with mean μ \mu μ and finite variance σ 2 \sigma^2 σ 2 . Then for any k > 0 k > 0 k > 0 :
P ( ∣ Y − μ ∣ ≥ k σ ) ≤ 1 k 2 P(|Y - \mu| \geq k\sigma) \leq \frac{1}{k^2} P ( ∣ Y − μ ∣ ≥ kσ ) ≤ k 2 1 Equivalently: P ( ∣ Y − μ ∣ < k σ ) ≥ 1 − 1 k 2 P(|Y - \mu| < k\sigma) \geq 1 - \frac{1}{k^2} P ( ∣ Y − μ ∣ < kσ ) ≥ 1 − k 2 1
Proof.
Strategy: Start from the definition of variance and cleverly restrict the domain of integration to show that the variance is at least as large as k 2 σ 2 k^2\sigma^2 k 2 σ 2 times the probability we want to bound.
σ 2 = ∫ − ∞ ∞ ( y − μ ) 2 f ( y ) d y \sigma^2 = \int_{-\infty}^{\infty} (y - \mu)^2 f(y) \, dy σ 2 = ∫ − ∞ ∞ ( y − μ ) 2 f ( y ) d y This integral is over all y y y . Since the integrand ( y − μ ) 2 f ( y ) (y-\mu)^2 f(y) ( y − μ ) 2 f ( y ) is nonnegative everywhere, the integral over all of R \mathbb{R} R is at least as large as the integral over any subset. In particular, restricting to the set where ∣ y − μ ∣ ≥ k σ |y - \mu| \geq k\sigma ∣ y − μ ∣ ≥ kσ :
σ 2 ≥ ∫ ∣ y − μ ∣ ≥ k σ ( y − μ ) 2 f ( y ) d y \sigma^2 \geq \int_{|y - \mu| \geq k\sigma} (y - \mu)^2 f(y) \, dy σ 2 ≥ ∫ ∣ y − μ ∣ ≥ kσ ( y − μ ) 2 f ( y ) d y On this restricted domain, ∣ y − μ ∣ ≥ k σ |y - \mu| \geq k\sigma ∣ y − μ ∣ ≥ kσ , which means ( y − μ ) 2 ≥ k 2 σ 2 (y - \mu)^2 \geq k^2\sigma^2 ( y − μ ) 2 ≥ k 2 σ 2 . Replace the integrand with this lower bound:
≥ ∫ ∣ y − μ ∣ ≥ k σ k 2 σ 2 f ( y ) d y = k 2 σ 2 ∫ ∣ y − μ ∣ ≥ k σ f ( y ) d y = k 2 σ 2 ⋅ P ( ∣ Y − μ ∣ ≥ k σ ) \geq \int_{|y - \mu| \geq k\sigma} k^2\sigma^2 \, f(y) \, dy = k^2\sigma^2 \int_{|y - \mu| \geq k\sigma} f(y) \, dy = k^2\sigma^2 \cdot P(|Y - \mu| \geq k\sigma) ≥ ∫ ∣ y − μ ∣ ≥ kσ k 2 σ 2 f ( y ) d y = k 2 σ 2 ∫ ∣ y − μ ∣ ≥ kσ f ( y ) d y = k 2 σ 2 ⋅ P ( ∣ Y − μ ∣ ≥ kσ ) So σ 2 ≥ k 2 σ 2 ⋅ P ( ∣ Y − μ ∣ ≥ k σ ) \sigma^2 \geq k^2\sigma^2 \cdot P(|Y - \mu| \geq k\sigma) σ 2 ≥ k 2 σ 2 ⋅ P ( ∣ Y − μ ∣ ≥ kσ ) . Divide both sides by k 2 σ 2 k^2\sigma^2 k 2 σ 2 :
P ( ∣ Y − μ ∣ ≥ k σ ) ≤ 1 k 2 ■ P(|Y - \mu| \geq k\sigma) \leq \frac{1}{k^2} \qquad \blacksquare P ( ∣ Y − μ ∣ ≥ kσ ) ≤ k 2 1 ■ Standard values:
k k k At most 1 / k 2 1/k^2 1/ k 2 outside μ ± k σ \mu \pm k\sigma μ ± kσ At least 1 − 1 / k 2 1 - 1/k^2 1 − 1/ k 2 inside 2 ≤ 25 % \leq 25\% ≤ 25% ≥ 75 % \geq 75\% ≥ 75% 3 ≤ 11.1 % \leq 11.1\% ≤ 11.1% ≥ 88.9 % \geq 88.9\% ≥ 88.9% 4 ≤ 6.25 % \leq 6.25\% ≤ 6.25% ≥ 93.75 % \geq 93.75\% ≥ 93.75%
Compare these to the Normal: for k = 2 k=2 k = 2 , the Normal has 4.56% outside (not 25%), and for k = 3 k=3 k = 3 , only 0.27% (not 11.1%). Tchebysheff is conservative — but it works for every distribution, not just the Normal.
The Problem.
Experience shows that the time (in minutes) for a periodic maintenance check on a machine follows a Gamma distribution with α = 3.1 \alpha = 3.1 α = 3.1 and β = 2 \beta = 2 β = 2 . A new maintenance worker takes 22.5 minutes. Does this time disagree with prior experience?
Solution.
μ = α β = 3.1 ( 2 ) = 6.2 \mu = \alpha\beta = 3.1(2) = 6.2 μ = α β = 3.1 ( 2 ) = 6.2 minutes. σ 2 = α β 2 = 3.1 ( 4 ) = 12.4 \sigma^2 = \alpha\beta^2 = 3.1(4) = 12.4 σ 2 = α β 2 = 3.1 ( 4 ) = 12.4 , so σ = 12.4 ≈ 3.52 \sigma = \sqrt{12.4} \approx 3.52 σ = 12.4 ≈ 3.52 .
How far is 22.5 from the mean? ∣ 22.5 − 6.2 ∣ = 16.3 |22.5 - 6.2| = 16.3 ∣22.5 − 6.2∣ = 16.3 , and k = 16.3 / 3.52 ≈ 4.63 k = 16.3/3.52 \approx 4.63 k = 16.3/3.52 ≈ 4.63 .
By Tchebysheff: P ( ∣ Y − 6.2 ∣ ≥ 16.3 ) ≤ 1 / 4.6 3 2 ≈ 0.047 P(|Y - 6.2| \geq 16.3) \leq 1/4.63^2 \approx 0.047 P ( ∣ Y − 6.2∣ ≥ 16.3 ) ≤ 1/4.6 3 2 ≈ 0.047 .
There is at most a 4.7% chance of a maintenance time this far from the mean. This suggests the new worker’s time is unusually long — possibly due to inexperience.
We can also compute the exact probability using R:
# Exact: P(Y > 22.5) for Gamma(3.1, scale = 2)
pgamma(22.5, shape = 3.1, scale = 2, lower.tail = FALSE)
# 0.001150 — much smaller than Tchebysheff's bound of 0.047The exact probability is about 0.12% — Tchebysheff’s bound of 4.7% is very conservative (as expected), but both tell the same story: this time is unusually long.
9.1 Section 5.9 Exercises ¶ 5.9.1. A random variable Y Y Y has E ( Y ) = 50 E(Y) = 50 E ( Y ) = 50 and V ( Y ) = 25 V(Y) = 25 V ( Y ) = 25 . Using Tchebysheff’s theorem, find a lower bound on P ( 40 < Y < 60 ) P(40 < Y < 60) P ( 40 < Y < 60 ) .
5.9.2. A distribution has mean 100 and standard deviation 15. What is the minimum probability that a randomly selected value lies between 55 and 145? What does the bound become if the distribution is known to be Normal? Compare.
5.9.3. (Proof ) Use Tchebysheff’s theorem to prove the following: if V ( Y ) = 0 V(Y) = 0 V ( Y ) = 0 , then P ( Y = μ ) = 1 P(Y = \mu) = 1 P ( Y = μ ) = 1 . (Hint: For any ϵ > 0 \epsilon > 0 ϵ > 0 , set k σ = ϵ k\sigma = \epsilon kσ = ϵ and take σ → 0 \sigma \to 0 σ → 0 .)
Tchebysheff’s theorem gives a distribution-free bound: for any distribution with finite mean and variance, at least 1 − 1 / k 2 1 - 1/k^2 1 − 1/ k 2 of the probability lies within k k k standard deviations of the mean. It requires no assumptions about symmetry, shape, or tail behavior.
The real-life interpretation: When you don’t know the distribution but you know μ \mu μ and σ \sigma σ , Tchebysheff gives you a guaranteed minimum. An engineer who knows a component’s average lifetime is 1000 hours with SD 100 hours can guarantee — without knowing the distribution — that at least 75% of components last between 800 and 1200 hours. If the distribution is actually Normal, the true percentage is 95.4%, but 75% is the guaranteed floor .
The bound is conservative because it must hold for all distributions, including the worst-case ones. But conservative guarantees are still guarantees — and in engineering and quality control, guarantees matter.
10 Which Distribution Should I Use? (Optional — Can Be Skipped) ¶ We’ve now learned six named distributions. A natural question: when you encounter a real-world random variable, how do you decide which distribution to use? This optional section gives practical guidance — a decision framework based on the variable’s support, shape, and the context that generated it.
This matches Section 4.8 in the reference textbook (“Some General Comments”) and is worth reading even if your course skips it.
Choosing a distribution is a modeling decision , not a mathematical derivation. No real-world data follows any theoretical distribution exactly — the question is whether the model is useful enough for the inferences you need to make.
Here is a practical guide:
10.1 Step 1: What is the support? ¶ Support Candidate Distributions ( − ∞ , ∞ ) (-\infty, \infty) ( − ∞ , ∞ ) — any real numberNormal ( 0 , ∞ ) (0, \infty) ( 0 , ∞ ) — positive values onlyExponential, Gamma, Chi-Square [ 0 , 1 ] [0, 1] [ 0 , 1 ] — proportions/fractionsBeta, Uniform(0,1) ( a , b ) (a, b) ( a , b ) — bounded intervalUniform(a,b), Beta (rescaled)
10.2 Step 2: What is the shape? ¶ Shape Distribution Symmetric, bell-shaped Normal Right-skewed, one mode Gamma (with α > 1 \alpha > 1 α > 1 ) Decreasing from zero Exponential (or Gamma with α ≤ 1 \alpha \leq 1 α ≤ 1 ) Flat (all values equally likely) Uniform Flexible on [ 0 , 1 ] [0, 1] [ 0 , 1 ] Beta
10.3 Step 3: What is the context? ¶ Some distributions are linked to specific physical processes:
Poisson events in time? The count is Poisson, the wait time between events is Exponential , and the wait for the α \alpha α th event is Gamma .
Sum of many small independent effects? The result is approximately Normal (Central Limit Theorem).
Sum of squared standard Normals? The result is Chi-Square .
Measuring a proportion or percentage? Use Beta .
Complete ignorance within a known range? Use Uniform .
10.4 The Key Insight ¶ As the reference textbook emphasizes: a good model is not one that perfectly matches reality — it is one that yields good inferences about the population of interest. A Normal approximation that’s slightly off in the tails might still produce excellent confidence intervals and hypothesis tests.
Choosing a distribution involves three questions: what values can the variable take (support), what shape does the histogram have, and what physical process generated the data? No model is perfect, but a thoughtfully chosen one supports sound statistical inference — which is the ultimate goal.
11 The Weibull Distribution (Optional — Can Be Skipped) ¶ The Exponential distribution models lifetimes with a constant failure rate — the item is just as likely to fail in the next hour whether it’s brand new or ten years old. But many real-world items wear out : their failure rate increases with age (brake pads, tires, bearings). Others have decreasing failure rates due to early manufacturing defects being weeded out (“infant mortality” in electronics).
The Weibull distribution handles all three cases with a single family. It has a shape parameter α \alpha α that controls whether the failure rate is decreasing (α < 1 \alpha < 1 α < 1 ), constant (α = 1 \alpha = 1 α = 1 , which gives the Exponential), or increasing (α > 1 \alpha > 1 α > 1 ). This makes it the most widely used distribution in reliability engineering.
Real-life motivation: An automotive manufacturer needs to set warranty periods for brake pads. The pads wear out faster as they age — a classic increasing failure rate. The Weibull distribution models this perfectly, letting engineers compute “what fraction of brake pads will fail before 50,000 miles?” The reference textbook includes Weibull exercises in its supplementary problems.
11.1 Definition ¶ A random variable Y Y Y has a Weibull distribution with shape parameter α > 0 \alpha > 0 α > 0 and scale parameter β > 0 \beta > 0 β > 0 , written Y ∼ Weibull ( α , β ) Y \sim \text{Weibull}(\alpha, \beta) Y ∼ Weibull ( α , β ) , if and only if:
f ( y ) = { α β α y α − 1 e − ( y / β ) α , y > 0 0 , y ≤ 0 f(y) = \begin{cases} \dfrac{\alpha}{\beta^{\alpha}} y^{\alpha - 1} e^{-(y/\beta)^{\alpha}}, & y > 0 \\[8pt] 0, & y \leq 0 \end{cases} f ( y ) = ⎩ ⎨ ⎧ β α α y α − 1 e − ( y / β ) α , 0 , y > 0 y ≤ 0 Connection to the Exponential: When α = 1 \alpha = 1 α = 1 , the Weibull density becomes f ( y ) = 1 β e − y / β f(y) = \frac{1}{\beta}e^{-y/\beta} f ( y ) = β 1 e − y / β — exactly the Exponential( β ) (\beta) ( β ) density. So the Exponential is a special case of both the Gamma and the Weibull families.
The CDF has a closed form (just like the Exponential):
F ( y ) = 1 − e − ( y / β ) α , y > 0 F(y) = 1 - e^{-(y/\beta)^{\alpha}}, \qquad y > 0 F ( y ) = 1 − e − ( y / β ) α , y > 0 To integrate f ( y ) = α β α y α − 1 e − ( y / β ) α f(y) = \frac{\alpha}{\beta^{\alpha}}y^{\alpha-1}e^{-(y/\beta)^{\alpha}} f ( y ) = β α α y α − 1 e − ( y / β ) α , use the substitution u = ( y / β ) α u = (y/\beta)^{\alpha} u = ( y / β ) α , so d u = α β α y α − 1 d y du = \frac{\alpha}{\beta^{\alpha}}y^{\alpha-1} \, dy d u = β α α y α − 1 d y . The integrand becomes exactly e − u d u e^{-u} \, du e − u d u , which integrates to − e − u -e^{-u} − e − u . Evaluating: F ( y ) = [ − e − u ] 0 ( y / β ) α = 1 − e − ( y / β ) α F(y) = [-e^{-u}]_0^{(y/\beta)^{\alpha}} = 1 - e^{-(y/\beta)^{\alpha}} F ( y ) = [ − e − u ] 0 ( y / β ) α = 1 − e − ( y / β ) α .
11.2 Mean and Variance ¶ If Y ∼ Weibull ( α , β ) Y \sim \text{Weibull}(\alpha, \beta) Y ∼ Weibull ( α , β ) , then:
E ( Y ) = β Γ ( 1 + 1 α ) and V ( Y ) = β 2 [ Γ ( 1 + 2 α ) − ( Γ ( 1 + 1 α ) ) 2 ] E(Y) = \beta \, \Gamma\!\left(1 + \frac{1}{\alpha}\right) \qquad \text{and} \qquad V(Y) = \beta^2 \left[\Gamma\!\left(1 + \frac{2}{\alpha}\right) - \left(\Gamma\!\left(1 + \frac{1}{\alpha}\right)\right)^2\right] E ( Y ) = β Γ ( 1 + α 1 ) and V ( Y ) = β 2 [ Γ ( 1 + α 2 ) − ( Γ ( 1 + α 1 ) ) 2 ] Proof of E ( Y ) E(Y) E ( Y ) (sketch).
E ( Y ) = ∫ 0 ∞ y ⋅ α β α y α − 1 e − ( y / β ) α d y E(Y) = \int_0^{\infty} y \cdot \frac{\alpha}{\beta^{\alpha}}y^{\alpha-1}e^{-(y/\beta)^{\alpha}} \, dy E ( Y ) = ∫ 0 ∞ y ⋅ β α α y α − 1 e − ( y / β ) α d y Substitute u = ( y / β ) α u = (y/\beta)^{\alpha} u = ( y / β ) α , so y = β u 1 / α y = \beta u^{1/\alpha} y = β u 1/ α and d y = β α u 1 / α − 1 d u dy = \frac{\beta}{\alpha}u^{1/\alpha - 1} \, du d y = α β u 1/ α − 1 d u :
= ∫ 0 ∞ β u 1 / α ⋅ e − u d u = β ∫ 0 ∞ u ( 1 + 1 / α ) − 1 e − u d u = β Γ ( 1 + 1 α ) ■ = \int_0^{\infty} \beta u^{1/\alpha} \cdot e^{-u} \, du = \beta \int_0^{\infty} u^{(1 + 1/\alpha) - 1} e^{-u} \, du = \beta \, \Gamma\!\left(1 + \frac{1}{\alpha}\right) \qquad \blacksquare = ∫ 0 ∞ β u 1/ α ⋅ e − u d u = β ∫ 0 ∞ u ( 1 + 1/ α ) − 1 e − u d u = β Γ ( 1 + α 1 ) ■ Check: When α = 1 \alpha = 1 α = 1 (Exponential): E ( Y ) = β Γ ( 2 ) = β ⋅ 1 = β E(Y) = \beta \, \Gamma(2) = \beta \cdot 1 = \beta E ( Y ) = β Γ ( 2 ) = β ⋅ 1 = β ✓
11.3 The Hazard Function: Why Weibull Matters ¶ The hazard function (or failure rate) of a distribution is h ( y ) = f ( y ) / [ 1 − F ( y ) ] h(y) = f(y) / [1 - F(y)] h ( y ) = f ( y ) / [ 1 − F ( y )] — the instantaneous risk of failure at time y y y , given survival to y y y .
For the Weibull:
h ( y ) = α β α y α − 1 h(y) = \frac{\alpha}{\beta^{\alpha}} y^{\alpha - 1} h ( y ) = β α α y α − 1 α < 1 \alpha < 1 α < 1 : h ( y ) h(y) h ( y ) decreases — “infant mortality” (early failures dominate)
α = 1 \alpha = 1 α = 1 : h ( y ) = 1 / β h(y) = 1/\beta h ( y ) = 1/ β = constant — memoryless (Exponential)
α > 1 \alpha > 1 α > 1 : h ( y ) h(y) h ( y ) increases — wear-out (aging causes failure)
This is precisely why the Weibull is the workhorse of reliability engineering.
# Weibull shapes and hazard functions
par(mfrow = c(1, 3))
for (a in c(0.5, 1, 3)) {
curve(dweibull(x, shape = a, scale = 2), 0, 5, lwd = 2,
main = bquote(alpha == .(a)),
xlab = "y", ylab = "f(y)", col = "steelblue")
}The Problem.
The lifetime (in thousands of hours) of a bearing follows a Weibull distribution with α = 2 \alpha = 2 α = 2 and β = 5 \beta = 5 β = 5 .
(a) Find the probability the bearing lasts at least 4,000 hours.
(b) Find the mean lifetime.
(c) Find the median lifetime.
Solution.
(a) Using the closed-form CDF:
P ( Y > 4 ) = 1 − F ( 4 ) = e − ( 4 / 5 ) 2 = e − 0.64 ≈ 0.5273 P(Y > 4) = 1 - F(4) = e^{-(4/5)^2} = e^{-0.64} \approx 0.5273 P ( Y > 4 ) = 1 − F ( 4 ) = e − ( 4/5 ) 2 = e − 0.64 ≈ 0.5273 About 52.7% of bearings last at least 4,000 hours.
(b) E ( Y ) = 5 ⋅ Γ ( 1 + 1 / 2 ) = 5 ⋅ Γ ( 3 / 2 ) = 5 ⋅ π 2 ≈ 5 ( 0.8862 ) = 4.431 E(Y) = 5 \cdot \Gamma(1 + 1/2) = 5 \cdot \Gamma(3/2) = 5 \cdot \frac{\sqrt{\pi}}{2} \approx 5(0.8862) = 4.431 E ( Y ) = 5 ⋅ Γ ( 1 + 1/2 ) = 5 ⋅ Γ ( 3/2 ) = 5 ⋅ 2 π ≈ 5 ( 0.8862 ) = 4.431 thousand hours.
(c) Median: solve F ( ϕ 0.5 ) = 0.5 F(\phi_{0.5}) = 0.5 F ( ϕ 0.5 ) = 0.5 :
1 − e − ( ϕ 0.5 / 5 ) 2 = 0.5 ⟹ e − ( ϕ 0.5 / 5 ) 2 = 0.5 ⟹ ( ϕ 0.5 / 5 ) 2 = ln 2 1 - e^{-(\phi_{0.5}/5)^2} = 0.5 \implies e^{-(\phi_{0.5}/5)^2} = 0.5 \implies (\phi_{0.5}/5)^2 = \ln 2 1 − e − ( ϕ 0.5 /5 ) 2 = 0.5 ⟹ e − ( ϕ 0.5 /5 ) 2 = 0.5 ⟹ ( ϕ 0.5 /5 ) 2 = ln 2 ϕ 0.5 = 5 ln 2 ≈ 5 ( 0.8326 ) = 4.163 thousand hours \phi_{0.5} = 5\sqrt{\ln 2} \approx 5(0.8326) = 4.163 \text{ thousand hours} ϕ 0.5 = 5 ln 2 ≈ 5 ( 0.8326 ) = 4.163 thousand hours In R.
# Y ~ Weibull(shape = 2, scale = 5)
# (a) P(Y > 4)
pweibull(4, shape = 2, scale = 5, lower.tail = FALSE) # 0.5273
# (b) Mean
5 * gamma(1 + 1/2) # 4.4312
# (c) Median
qweibull(0.5, shape = 2, scale = 5) # 4.162811.4 Section 5.11 Exercises ¶ 5.11.1. The time to failure (in years) of a semiconductor device follows a Weibull distribution with α = 0.5 \alpha = 0.5 α = 0.5 and β = 3 \beta = 3 β = 3 .
(a) Is the failure rate increasing or decreasing? What does this mean physically?
(b) Find P ( Y > 2 ) P(Y > 2) P ( Y > 2 ) .
(c) Find the mean time to failure.
5.11.2. Show that when α = 1 \alpha = 1 α = 1 , the Weibull CDF F ( y ) = 1 − e − ( y / β ) α F(y) = 1 - e^{-(y/\beta)^{\alpha}} F ( y ) = 1 − e − ( y / β ) α reduces to the Exponential CDF F ( y ) = 1 − e − y / β F(y) = 1 - e^{-y/\beta} F ( y ) = 1 − e − y / β .
The Weibull distribution generalizes the Exponential by adding a shape parameter α \alpha α that controls whether failure rates increase, decrease, or remain constant. Its closed-form CDF F ( y ) = 1 − e − ( y / β ) α F(y) = 1 - e^{-(y/\beta)^{\alpha}} F ( y ) = 1 − e − ( y / β ) α makes probability calculations easy. When α = 1 \alpha = 1 α = 1 , it reduces to the Exponential — memoryless. When α > 1 \alpha > 1 α > 1 , the failure rate increases with age, modeling wear-out. When α < 1 \alpha < 1 α < 1 , it decreases — modeling infant mortality in manufactured products.
12 Normal Approximation to the Binomial (Optional — Can Be Skipped) ¶ In Chapter 4, we learned the Binomial distribution for counting successes. But computing Binomial probabilities for large n n n is painful — try evaluating ( 500 237 ) \binom{500}{237} ( 237 500 ) by hand! The Normal approximation to the Binomial saves us: when n n n is large enough, a Binomial ( n , p ) \text{Binomial}(n, p) Binomial ( n , p ) random variable is approximately N ( n p , n p ( 1 − p ) ) N(np, np(1-p)) N ( n p , n p ( 1 − p )) .
This is actually a preview of the Central Limit Theorem from Chapter 7, applied to the special case where we’re summing independent Bernoulli trials. The approximation includes a continuity correction to account for the fact that we’re approximating a discrete distribution (integer values) with a continuous one (all real values).
Real-life motivation: A polling firm surveys 1,200 voters. If the true proportion supporting Candidate A is p = 0.52 p = 0.52 p = 0.52 , what’s the probability the poll shows Candidate A with at least 55% support? This is a Binomial problem with n = 1200 n = 1200 n = 1200 , but using the Normal approximation makes it a simple Z Z Z -score calculation.
12.1 The Approximation ¶ If Y ∼ Binomial ( n , p ) Y \sim \text{Binomial}(n, p) Y ∼ Binomial ( n , p ) , then for large n n n :
Z = Y − n p n p ( 1 − p ) ≈ N ( 0 , 1 ) Z = \frac{Y - np}{\sqrt{np(1-p)}} \approx N(0, 1) Z = n p ( 1 − p ) Y − n p ≈ N ( 0 , 1 ) Rule of thumb: The approximation is adequate when n p ≥ 5 np \geq 5 n p ≥ 5 and n ( 1 − p ) ≥ 5 n(1-p) \geq 5 n ( 1 − p ) ≥ 5 .
12.2 The Continuity Correction ¶ Because the Binomial takes integer values but the Normal is continuous, we adjust by ± 0.5 \pm 0.5 ± 0.5 :
P ( Y ≤ k ) ≈ P ( Z ≤ k + 0.5 − n p n p ( 1 − p ) ) P(Y \leq k) \approx P\left(Z \leq \frac{k + 0.5 - np}{\sqrt{np(1-p)}}\right) P ( Y ≤ k ) ≈ P ( Z ≤ n p ( 1 − p ) k + 0.5 − n p ) — add 0.5 because the Normal must cover the full integer k k k
P ( Y ≥ k ) ≈ P ( Z ≥ k − 0.5 − n p n p ( 1 − p ) ) P(Y \geq k) \approx P\left(Z \geq \frac{k - 0.5 - np}{\sqrt{np(1-p)}}\right) P ( Y ≥ k ) ≈ P ( Z ≥ n p ( 1 − p ) k − 0.5 − n p ) — subtract 0.5
P ( Y = k ) ≈ P ( k − 0.5 − n p n p q ≤ Z ≤ k + 0.5 − n p n p q ) P(Y = k) \approx P\left(\frac{k - 0.5 - np}{\sqrt{npq}} \leq Z \leq \frac{k + 0.5 - np}{\sqrt{npq}}\right) P ( Y = k ) ≈ P ( n pq k − 0.5 − n p ≤ Z ≤ n pq k + 0.5 − n p )
The continuity correction improves accuracy, especially when n n n is moderate (20–100).
The Problem.
A fair coin is flipped 100 times. Find the probability of getting at least 60 heads.
Solution.
Y ∼ Binomial ( 100 , 0.5 ) Y \sim \text{Binomial}(100, 0.5) Y ∼ Binomial ( 100 , 0.5 ) . We have μ = n p = 50 \mu = np = 50 μ = n p = 50 and σ = n p ( 1 − p ) = 25 = 5 \sigma = \sqrt{np(1-p)} = \sqrt{25} = 5 σ = n p ( 1 − p ) = 25 = 5 .
Check: n p = 50 ≥ 5 np = 50 \geq 5 n p = 50 ≥ 5 ✓ and n ( 1 − p ) = 50 ≥ 5 n(1-p) = 50 \geq 5 n ( 1 − p ) = 50 ≥ 5 ✓. The approximation is valid.
With continuity correction: P ( Y ≥ 60 ) ≈ P ( Z ≥ 59.5 − 50 5 ) = P ( Z ≥ 1.90 ) = 0.0287 P(Y \geq 60) \approx P\left(Z \geq \frac{59.5 - 50}{5}\right) = P(Z \geq 1.90) = 0.0287 P ( Y ≥ 60 ) ≈ P ( Z ≥ 5 59.5 − 50 ) = P ( Z ≥ 1.90 ) = 0.0287
Without continuity correction: P ( Y ≥ 60 ) ≈ P ( Z ≥ 60 − 50 5 ) = P ( Z ≥ 2.00 ) = 0.0228 P(Y \geq 60) \approx P\left(Z \geq \frac{60 - 50}{5}\right) = P(Z \geq 2.00) = 0.0228 P ( Y ≥ 60 ) ≈ P ( Z ≥ 5 60 − 50 ) = P ( Z ≥ 2.00 ) = 0.0228
Exact (Binomial): P ( Y ≥ 60 ) = ∑ k = 60 100 ( 100 k ) ( 0.5 ) 100 = 0.0284 P(Y \geq 60) = \sum_{k=60}^{100}\binom{100}{k}(0.5)^{100} = 0.0284 P ( Y ≥ 60 ) = ∑ k = 60 100 ( k 100 ) ( 0.5 ) 100 = 0.0284
The continuity-corrected answer (0.0287) is very close to the exact value (0.0284). The uncorrected version (0.0228) is noticeably off.
In R.
# Exact Binomial
pbinom(59, 100, 0.5, lower.tail = FALSE) # 0.02844
# Normal approximation WITH continuity correction
pnorm(59.5, 50, 5, lower.tail = FALSE) # 0.02872
# Normal approximation WITHOUT continuity correction
pnorm(60, 50, 5, lower.tail = FALSE) # 0.02275Interpretation.
With 100 fair coin flips, there’s about a 2.8% chance of getting 60 or more heads. The Normal approximation with continuity correction nails this to within 0.03 percentage points. Without the correction, the error is about 0.6 percentage points — small but avoidable.
12.3 Section 5.12 Exercises ¶ 5.12.1. A manufacturer knows that 8% of parts are defective. In a batch of 200 parts, use the Normal approximation (with continuity correction) to find P ( Y ≥ 20 ) P(Y \geq 20) P ( Y ≥ 20 ) , where Y Y Y is the number of defective parts. Verify with R’s pbinom.
5.12.2. A polling firm surveys 1,500 voters. If the true proportion is p = 0.48 p = 0.48 p = 0.48 , find the probability the poll shows a majority (Y / n > 0.50 Y/n > 0.50 Y / n > 0.50 , i.e., Y > 750 Y > 750 Y > 750 ) using the Normal approximation.
When n n n is large and both n p ≥ 5 np \geq 5 n p ≥ 5 and n ( 1 − p ) ≥ 5 n(1-p) \geq 5 n ( 1 − p ) ≥ 5 , the Binomial( n , p ) (n, p) ( n , p ) distribution is well approximated by N ( n p , n p ( 1 − p ) ) N(np, np(1-p)) N ( n p , n p ( 1 − p )) . The continuity correction (± 0.5 \pm 0.5 ± 0.5 ) compensates for approximating integer values with a continuous curve. This is a powerful practical tool and a preview of the Central Limit Theorem (Chapter 7).
13 The Distribution Family Tree (Optional — Encouraged Reading) ¶ We’ve now studied 10 named distributions across Chapters 4 and 5 — and they are NOT isolated. They form a deeply connected family. This section maps every connection: which distributions are special cases of which, which arise from which processes, and which approximate which under certain conditions. Think of it as the “periodic table” of distributions.
This section has no new math. It’s pure synthesis — and it may be the most useful page in the chapter for organizing everything in your head.
13.1 The Connections ¶ BERNOULLI(p)
│
sum of n trials
│
BINOMIAL(n, p)
/ \
n→∞, p→0 n large
np = λ │
/ NORMAL(np, npq) ←── Central Limit Theorem
POISSON(λ) │
│ Z = (Y-μ)/σ
count events │
in time STANDARD NORMAL
│ │
time between Z² summed
events │
│ CHI-SQUARE(ν)
EXPONENTIAL(β) │
│ = Gamma(ν/2, 2)
= Gamma(1, β) │
│ │
wait for α ────┘
events
│
GAMMA(α, β)
UNIFORM(a, b)
│
= Beta(1,1)
when a=0, b=1
│
BETA(α, β)
WEIBULL(α, β)
│
= Exponential(β)
when α = 113.2 Master Reference Table ¶ Distribution PDF Support E ( Y ) E(Y) E ( Y ) V ( Y ) V(Y) V ( Y ) MGF M ( t ) M(t) M ( t ) R functions Uniform ( θ 1 , θ 2 ) \text{Uniform}(\theta_1, \theta_2) Uniform ( θ 1 , θ 2 ) 1 θ 2 − θ 1 \frac{1}{\theta_2 - \theta_1} θ 2 − θ 1 1 [ θ 1 , θ 2 ] [\theta_1, \theta_2] [ θ 1 , θ 2 ] θ 1 + θ 2 2 \frac{\theta_1+\theta_2}{2} 2 θ 1 + θ 2 ( θ 2 − θ 1 ) 2 12 \frac{(\theta_2-\theta_1)^2}{12} 12 ( θ 2 − θ 1 ) 2 e θ 2 t − e θ 1 t ( θ 2 − θ 1 ) t \frac{e^{\theta_2 t}-e^{\theta_1 t}}{(\theta_2-\theta_1)t} ( θ 2 − θ 1 ) t e θ 2 t − e θ 1 t dunif, punif, qunif, runifN ( μ , σ 2 ) N(\mu, \sigma^2) N ( μ , σ 2 ) 1 σ 2 π e − ( y − μ ) 2 / ( 2 σ 2 ) \frac{1}{\sigma\sqrt{2\pi}}e^{-(y-\mu)^2/(2\sigma^2)} σ 2 π 1 e − ( y − μ ) 2 / ( 2 σ 2 ) ( − ∞ , ∞ ) (-\infty,\infty) ( − ∞ , ∞ ) μ \mu μ σ 2 \sigma^2 σ 2 e μ t + σ 2 t 2 / 2 e^{\mu t + \sigma^2 t^2/2} e μ t + σ 2 t 2 /2 dnorm, pnorm, qnorm, rnormGamma ( α , β ) \text{Gamma}(\alpha, \beta) Gamma ( α , β ) y α − 1 e − y / β β α Γ ( α ) \frac{y^{\alpha-1}e^{-y/\beta}}{\beta^{\alpha}\Gamma(\alpha)} β α Γ ( α ) y α − 1 e − y / β ( 0 , ∞ ) (0, \infty) ( 0 , ∞ ) α β \alpha\beta α β α β 2 \alpha\beta^2 α β 2 ( 1 − β t ) − α (1-\beta t)^{-\alpha} ( 1 − βt ) − α dgamma, pgamma, qgamma, rgammaExponential ( β ) \text{Exponential}(\beta) Exponential ( β ) 1 β e − y / β \frac{1}{\beta}e^{-y/\beta} β 1 e − y / β ( 0 , ∞ ) (0, \infty) ( 0 , ∞ ) β \beta β β 2 \beta^2 β 2 ( 1 − β t ) − 1 (1-\beta t)^{-1} ( 1 − βt ) − 1 dexp, pexp, qexp, rexpχ 2 ( ν ) \chi^2(\nu) χ 2 ( ν ) y ν / 2 − 1 e − y / 2 2 ν / 2 Γ ( ν / 2 ) \frac{y^{\nu/2-1}e^{-y/2}}{2^{\nu/2}\Gamma(\nu/2)} 2 ν /2 Γ ( ν /2 ) y ν /2 − 1 e − y /2 ( 0 , ∞ ) (0, \infty) ( 0 , ∞ ) ν \nu ν 2 ν 2\nu 2 ν ( 1 − 2 t ) − ν / 2 (1-2t)^{-\nu/2} ( 1 − 2 t ) − ν /2 dchisq, pchisq, qchisq, rchisqBeta ( α , β ) \text{Beta}(\alpha, \beta) Beta ( α , β ) y α − 1 ( 1 − y ) β − 1 B ( α , β ) \frac{y^{\alpha-1}(1-y)^{\beta-1}}{B(\alpha,\beta)} B ( α , β ) y α − 1 ( 1 − y ) β − 1 [ 0 , 1 ] [0, 1] [ 0 , 1 ] α α + β \frac{\alpha}{\alpha+\beta} α + β α α β ( α + β ) 2 ( α + β + 1 ) \frac{\alpha\beta}{(\alpha+\beta)^2(\alpha+\beta+1)} ( α + β ) 2 ( α + β + 1 ) α β — dbeta, pbeta, qbeta, rbetaWeibull ( α , β ) \text{Weibull}(\alpha, \beta) Weibull ( α , β ) α β α y α − 1 e − ( y / β ) α \frac{\alpha}{\beta^{\alpha}}y^{\alpha-1}e^{-(y/\beta)^{\alpha}} β α α y α − 1 e − ( y / β ) α ( 0 , ∞ ) (0, \infty) ( 0 , ∞ ) β Γ ( 1 + 1 / α ) \beta\Gamma(1+1/\alpha) β Γ ( 1 + 1/ α ) (see §5.11) — dweibull, pweibull, qweibull, rweibull
13.3 Key Relationships Summary ¶ Exponential = Gamma(1 , β 1, \beta 1 , β ) = Weibull(1 , β 1, \beta 1 , β )
Chi-Square(ν \nu ν ) = Gamma(ν / 2 , 2 \nu/2, 2 ν /2 , 2 )
Uniform(0,1) = Beta(1 , 1 1, 1 1 , 1 )
Poisson count ↔ Exponential gap (same process, different views)
Binomial → Normal (when n n n large) and Binomial → Poisson (when n n n large, p p p small)
Sum of ν \nu ν independent Exponential( β ) (\beta) ( β ) = Gamma( ν , β ) (\nu, \beta) ( ν , β )
Sum of ν \nu ν independent χ 2 ( 1 ) \chi^2(1) χ 2 ( 1 ) = χ 2 ( ν ) \chi^2(\nu) χ 2 ( ν )
Z 2 ∼ χ 2 ( 1 ) Z^2 \sim \chi^2(1) Z 2 ∼ χ 2 ( 1 ) where Z ∼ N ( 0 , 1 ) Z \sim N(0,1) Z ∼ N ( 0 , 1 )
The distributions we’ve studied are not isolated — they form a connected family tree. The Exponential sits at the intersection of the Gamma and Weibull families. The Chi-Square bridges the Normal and Gamma worlds. The Uniform is a special case of the Beta. The Poisson process generates both Poisson counts and Exponential gaps.
Why this matters: When you encounter a new problem, you don’t pick a distribution at random. You reason from the physical process: “Events arrive at a constant rate → Poisson count → Exponential gap → Gamma for the k k k th event.” Or: “I’m modeling a proportion → Beta.” Or: “Wear-out failure → Weibull with α > 1 \alpha > 1 α > 1 .” The family tree is your navigation chart.
Keep this reference table handy — you’ll use it throughout mathematical statistics and beyond.
14 Solving Buffon’s Needle ¶ We now have all the tools to solve the problem from the chapter opening.
Setup: A needle of length ℓ \ell ℓ is dropped onto a floor with parallel lines spaced d d d apart (ℓ ≤ d \ell \leq d ℓ ≤ d ). Two random variables describe the needle’s position:
Θ \Theta Θ = the acute angle between the needle and the lines, with Θ ∼ Uniform ( 0 , π / 2 ) \Theta \sim \text{Uniform}(0, \pi/2) Θ ∼ Uniform ( 0 , π /2 )
D D D = the distance from the needle’s center to the nearest line, with D ∼ Uniform ( 0 , d / 2 ) D \sim \text{Uniform}(0, d/2) D ∼ Uniform ( 0 , d /2 )
We assume Θ \Theta Θ and D D D are independent (the angle and position of a randomly dropped needle are unrelated).
When does the needle cross a line? The needle crosses if and only if the vertical projection of its half-length exceeds D D D :
D ≤ ℓ 2 sin ( Θ ) D \leq \frac{\ell}{2}\sin(\Theta) D ≤ 2 ℓ sin ( Θ ) The probability: Since Θ \Theta Θ and D D D are independent Uniforms, the joint density is constant over the rectangle [ 0 , π / 2 ] × [ 0 , d / 2 ] [0, \pi/2] \times [0, d/2] [ 0 , π /2 ] × [ 0 , d /2 ] . The probability of crossing is the ratio of the area where D ≤ ( ℓ / 2 ) sin θ D \leq (\ell/2)\sin\theta D ≤ ( ℓ /2 ) sin θ to the total rectangle area:
P ( cross ) = ∫ 0 π / 2 ℓ 2 sin θ d θ π 2 ⋅ d 2 P(\text{cross}) = \frac{\int_0^{\pi/2} \frac{\ell}{2}\sin\theta \, d\theta}{\frac{\pi}{2} \cdot \frac{d}{2}} P ( cross ) = 2 π ⋅ 2 d ∫ 0 π /2 2 ℓ sin θ d θ ∫ sin θ d θ = − cos θ + C \int \sin\theta \, d\theta = -\cos\theta + C ∫ sin θ d θ = − cos θ + C , so ∫ 0 π / 2 sin θ d θ = [ − cos θ ] 0 π / 2 = − cos ( π / 2 ) + cos ( 0 ) = 0 + 1 = 1 \int_0^{\pi/2} \sin\theta \, d\theta = [-\cos\theta]_0^{\pi/2} = -\cos(\pi/2) + \cos(0) = 0 + 1 = 1 ∫ 0 π /2 sin θ d θ = [ − cos θ ] 0 π /2 = − cos ( π /2 ) + cos ( 0 ) = 0 + 1 = 1 .
P ( cross ) = ( ℓ / 2 ) ⋅ 1 π d / 4 = ℓ / 2 π d / 4 = 4 ℓ 2 π d = 2 ℓ π d P(\text{cross}) = \frac{(\ell/2) \cdot 1}{\pi d / 4} = \frac{\ell/2}{\pi d/4} = \frac{4\ell}{2\pi d} = \frac{2\ell}{\pi d} P ( cross ) = π d /4 ( ℓ /2 ) ⋅ 1 = π d /4 ℓ /2 = 2 π d 4 ℓ = π d 2 ℓ And there it is — π \pi π emerges from the integral of sin θ \sin\theta sin θ over [ 0 , π / 2 ] [0, \pi/2] [ 0 , π /2 ] . The circle was hiding in the rotation of the needle.
# Buffon's Needle simulation
set.seed(42)
n_drops <- 100000
ell <- 1; d <- 2 # needle length 1, line spacing 2
theta <- runif(n_drops, 0, pi/2)
D <- runif(n_drops, 0, d/2)
crosses <- sum(D <= (ell/2) * sin(theta))
pi_estimate <- (2 * ell * n_drops) / (crosses * d)
cat("Estimated pi:", pi_estimate, "\n")
cat("Actual pi: ", pi, "\n")
# Estimated pi: 3.143... (close!)Continuous random variables assign probability zero to every individual point. Probabilities exist only for intervals and are computed as areas under the probability density function via integration.
The PDF f ( y ) = F ′ ( y ) f(y) = F'(y) f ( y ) = F ′ ( y ) is the derivative of the CDF. It satisfies f ( y ) ≥ 0 f(y) \geq 0 f ( y ) ≥ 0 everywhere and ∫ − ∞ ∞ f ( y ) d y = 1 \int_{-\infty}^{\infty} f(y) \, dy = 1 ∫ − ∞ ∞ f ( y ) d y = 1 . The PDF is a density, not a probability — it can exceed 1.
Expected values for continuous RVs use integrals: E ( Y ) = ∫ y f ( y ) d y E(Y) = \int y \, f(y) \, dy E ( Y ) = ∫ y f ( y ) d y and V ( Y ) = E ( Y 2 ) − μ 2 V(Y) = E(Y^2) - \mu^2 V ( Y ) = E ( Y 2 ) − μ 2 . The linearity rules E ( a Y + b ) = a μ + b E(aY+b) = a\mu + b E ( aY + b ) = a μ + b and V ( a Y + b ) = a 2 σ 2 V(aY+b) = a^2\sigma^2 V ( aY + b ) = a 2 σ 2 carry over unchanged from Chapter 4.
The Uniform distribution on ( θ 1 , θ 2 ) (\theta_1, \theta_2) ( θ 1 , θ 2 ) has constant density 1 / ( θ 2 − θ 1 ) 1/(\theta_2 - \theta_1) 1/ ( θ 2 − θ 1 ) , mean ( θ 1 + θ 2 ) / 2 (\theta_1 + \theta_2)/2 ( θ 1 + θ 2 ) /2 , and variance ( θ 2 − θ 1 ) 2 / 12 (\theta_2 - \theta_1)^2/12 ( θ 2 − θ 1 ) 2 /12 . It is the engine of all random number generation.
The Normal distribution N ( μ , σ 2 ) N(\mu, \sigma^2) N ( μ , σ 2 ) is the bell curve. Standardize via Z = ( Y − μ ) / σ Z = (Y - \mu)/\sigma Z = ( Y − μ ) / σ to use one table for all Normal distributions. The 68-95-99.7 rule gives quick probability estimates.
The Gamma distribution Gamma ( α , β ) \text{Gamma}(\alpha, \beta) Gamma ( α , β ) models right-skewed positive quantities. The Exponential (α = 1 \alpha = 1 α = 1 ) has the memoryless property and connects to the Poisson process. The Chi-Square (α = ν / 2 \alpha = \nu/2 α = ν /2 , β = 2 \beta = 2 β = 2 ) connects to squared standard Normals.
The Beta distribution Beta ( α , β ) \text{Beta}(\alpha, \beta) Beta ( α , β ) models proportions on [ 0 , 1 ] [0, 1] [ 0 , 1 ] . Its two parameters give it extraordinary shape flexibility.
Moment generating functions M ( t ) = E ( e t Y ) M(t) = E(e^{tY}) M ( t ) = E ( e t Y ) provide moments via derivatives (E ( Y k ) = M ( k ) ( 0 ) E(Y^k) = M^{(k)}(0) E ( Y k ) = M ( k ) ( 0 ) ) and uniquely identify distributions.
Tchebysheff’s theorem guarantees at least 1 − 1 / k 2 1 - 1/k^2 1 − 1/ k 2 of probability within k k k standard deviations of the mean — for any distribution.
Buffon’s Needle connects continuous probability to geometry: the probability of a needle crossing a line involves the Uniform distribution, integration of sin θ \sin\theta sin θ , and π \pi π .
You’ve now learned six named continuous distributions — Uniform, Normal, Gamma, Exponential, Chi-Square, Beta — each designed to model a different type of randomness. But here’s something to sit with: why are there so many?
The real world doesn’t come labeled “this is a Gamma distribution.” A data scientist looking at hospital wait times doesn’t see a mathematical formula — she sees a histogram. The act of choosing a distribution is a modeling decision : “I believe this data behaves approximately like a Gamma(3, 2).” The model is never the truth. It’s a useful approximation — and the utility depends on whether the approximation is close enough for the decision at hand.
So when you see a real dataset, how do you decide which distribution fits? That question — the bridge between theoretical distributions and messy data — is the central challenge of statistical inference, and it’s what the sequel to this book (Mathematical Statistics from the Ground Up) is all about.
15 Chapter Refresh Exercises ¶ 5.R.1. A continuous random variable Y Y Y has the density function:
f ( y ) = { c ( 4 y − 2 y 2 ) , 0 ≤ y ≤ 2 0 , elsewhere f(y) = \begin{cases} c(4y - 2y^2), & 0 \leq y \leq 2 \\ 0, & \text{elsewhere} \end{cases} f ( y ) = { c ( 4 y − 2 y 2 ) , 0 , 0 ≤ y ≤ 2 elsewhere (a) Find c c c . (b) Find F ( y ) F(y) F ( y ) . (c) Find E ( Y ) E(Y) E ( Y ) and V ( Y ) V(Y) V ( Y ) . (d) Find the median.
5.R.2. The lifetime (in thousands of hours) of a type of electronic component follows an Exponential distribution with mean 4.
(a) Find P ( Y > 5 ) P(Y > 5) P ( Y > 5 ) . (b) Find P ( Y > 8 ∣ Y > 3 ) P(Y > 8 \mid Y > 3) P ( Y > 8 ∣ Y > 3 ) . (c) Find the 90th percentile of the lifetime distribution. (d) What is the probability the component lasts between 2 and 6 thousand hours?
5.R.3. Scores on a standardized test follow N ( 520 , 10000 ) N(520, 10000) N ( 520 , 10000 ) .
(a) What proportion of scores are above 700? (b) What score separates the bottom 15% from the top 85%? (c) Two students take the test independently. What is the probability that both score above 600?
5.R.4. A random variable Y Y Y has the density f ( y ) = 1 4 y e − y / 2 f(y) = \frac{1}{4}y e^{-y/2} f ( y ) = 4 1 y e − y /2 for y > 0 y > 0 y > 0 .
(a) Identify the Gamma parameters and verify the density is valid. (b) Find E ( Y ) E(Y) E ( Y ) and V ( Y ) V(Y) V ( Y ) . (c) Is this a Chi-Square distribution? If so, what are the degrees of freedom?
5.R.5. The fraction of a company’s daily output that meets quality standards follows a Beta ( 4 , 2 ) \text{Beta}(4, 2) Beta ( 4 , 2 ) distribution.
(a) Find the average fraction meeting standards. (b) Find the probability that more than 80% of the output meets standards on a given day. (c) If the revenue is R = 1000 Y − 200 R = 1000Y - 200 R = 1000 Y − 200 , find E ( R ) E(R) E ( R ) .
5.R.6. A random variable Y Y Y has E ( Y ) = 30 E(Y) = 30 E ( Y ) = 30 and σ = 4 \sigma = 4 σ = 4 . The distribution is unknown.
(a) Use Tchebysheff to bound P ( 22 < Y < 38 ) P(22 < Y < 38) P ( 22 < Y < 38 ) .
(b) If Y Y Y is actually N ( 30 , 16 ) N(30, 16) N ( 30 , 16 ) , find the exact probability and compare.
5.R.7. (Proof ) Show that if f ( y ) f(y) f ( y ) is a valid PDF on [ a , b ] [a, b] [ a , b ] , then E ( Y ) ∈ [ a , b ] E(Y) \in [a, b] E ( Y ) ∈ [ a , b ] . (Hint: Use the fact that a ≤ y ≤ b a \leq y \leq b a ≤ y ≤ b implies a ⋅ f ( y ) ≤ y ⋅ f ( y ) ≤ b ⋅ f ( y ) a \cdot f(y) \leq y \cdot f(y) \leq b \cdot f(y) a ⋅ f ( y ) ≤ y ⋅ f ( y ) ≤ b ⋅ f ( y ) , and integrate.)
5.R.8. Using the result from Buffon’s Needle (P = 2 ℓ / ( π d ) P = 2\ell/(\pi d) P = 2 ℓ / ( π d ) ), suppose you drop a needle with ℓ = 1 \ell = 1 ℓ = 1 cm on a floor with lines d = 2 d = 2 d = 2 cm apart. You drop it n = 2000 n = 2000 n = 2000 times, and it crosses a line c = 637 c = 637 c = 637 times.
(a) Estimate π \pi π using the formula π ^ = 2 ℓ n / ( c d ) \hat{\pi} = 2\ell n / (cd) π ^ = 2 ℓ n / ( c d ) .
(b) How close is your estimate to the true value?
(c) How many drops would you need for an estimate accurate to 2 decimal places (in expectation)?
5.R.9. A random variable has MGF M ( t ) = e 3 t + 2 t 2 M(t) = e^{3t + 2t^2} M ( t ) = e 3 t + 2 t 2 .
(a) Identify the distribution. (b) Find P ( Y > 7 ) P(Y > 7) P ( Y > 7 ) . (c) Find the interquartile range (IQR).
5.R.10. (Comprehensive ) A hospital models emergency room wait times (in hours) with the density:
f ( y ) = { 1 4 y e − y / 2 , y > 0 0 , y ≤ 0 f(y) = \begin{cases} \frac{1}{4}ye^{-y/2}, & y > 0 \\ 0, & y \leq 0 \end{cases} f ( y ) = { 4 1 y e − y /2 , 0 , y > 0 y ≤ 0 (a) Identify the distribution family and parameters.
(b) Find E ( Y ) E(Y) E ( Y ) , V ( Y ) V(Y) V ( Y ) , and σ \sigma σ .
(c) Find the probability a patient waits more than 6 hours.
(d) Find the median wait time using R.
(e) A patient has already waited 3 hours. Is the memoryless property applicable here? Why or why not?
(f) Use Tchebysheff to find a guaranteed upper bound on the probability of waiting more than 12 hours, and compare to the exact value.
16 Chapter 5 Quiz ¶ Test your understanding with this self-assessment quiz. 15 questions are randomly selected from a bank of 100. You need 80% (12/15) to earn the badge.