Functions of Random Variables
After completing this chapter, you will be able to:
Explain why we need to find the distribution of a transformed random variable and identify real-world situations that require it
Find the distribution of a function of a random variable using the CDF method (method of distribution functions)
Apply the transformation method (change of variables with Jacobian) for one-to-one functions of a single continuous random variable
Use moment generating functions to identify the distribution of sums of independent random variables
Apply multivariable transformations using Jacobians to find joint distributions of transformed random vectors
Derive the distribution of order statistics — the smallest, largest, and k k k th-smallest values in a random sample
Prerequisites: Chapters 4–6. Calculus II (change of variables, Jacobians, double integrals). Builds on: All previous distribution theory — you will use PMFs, PDFs, CDFs, MGFs, joint distributions, marginals, and independence throughout.
Content current as of April 2026.
A Preview of the Central Limit Theorem. Take any distribution — uniform, exponential, Poisson, anything. Draw random samples of size n n n and compute the sample mean. As n n n grows, the distribution of that mean approaches a normal distribution, regardless of the original shape. This is the Central Limit Theorem, the most remarkable result in all of probability theory.
But here’s the thing: proving it requires knowing the distribution of a function of random variables. The sample mean Y ˉ = 1 n ∑ Y i \bar{Y} = \frac{1}{n}\sum Y_i Y ˉ = n 1 ∑ Y i is a function of n n n random variables. What distribution does it follow? The MGF method in Section 7.4 gives us the tool to answer this.
And the CLT is just the beginning. Every sampling distribution in mathematical statistics — the t t t -distribution, the F F F -distribution, the χ 2 \chi^2 χ 2 -distribution — is derived by transforming random variables. This chapter gives you the engine that powers all of statistical inference. By the end, you’ll have three powerful methods for finding the distribution of any function of random variables, plus a complete theory of order statistics.
This chapter uses calculus heavily . Before you begin, make sure these formulas are at your fingertips. Bookmark this box — you’ll refer back to it often.
Differentiation (finding PDFs from CDFs)
Power Rule: d d u u n = n u n − 1 \frac{d}{du} u^n = n u^{n-1} d u d u n = n u n − 1
Exponential: d d u e a u = a e a u \frac{d}{du} e^{au} = a e^{au} d u d e a u = a e a u
Chain Rule: d d u f ( g ( u ) ) = f ′ ( g ( u ) ) ⋅ g ′ ( u ) \frac{d}{du} f(g(u)) = f'(g(u)) \cdot g'(u) d u d f ( g ( u )) = f ′ ( g ( u )) ⋅ g ′ ( u ) . In words: differentiate the outside, then multiply by the derivative of the inside.
Example: d d u [ ( u + 1 ) 2 9 ] = 2 ( u + 1 ) 9 ⋅ 1 = 2 ( u + 1 ) 9 \frac{d}{du}\left[\frac{(u+1)^2}{9}\right] = \frac{2(u+1)}{9} \cdot 1 = \frac{2(u+1)}{9} d u d [ 9 ( u + 1 ) 2 ] = 9 2 ( u + 1 ) ⋅ 1 = 9 2 ( u + 1 ) (chain rule with inside = u + 1 = u + 1 = u + 1 , outside = ( ⋅ ) 2 / 9 = (\cdot)^2/9 = ( ⋅ ) 2 /9 )
Integration (finding CDFs and expected values)
Power Rule: ∫ x n d x = x n + 1 n + 1 + C \int x^n \, dx = \frac{x^{n+1}}{n+1} + C ∫ x n d x = n + 1 x n + 1 + C (for n ≠ − 1 n \neq -1 n = − 1 )
Exponential: ∫ e a x d x = 1 a e a x + C \int e^{ax} \, dx = \frac{1}{a} e^{ax} + C ∫ e a x d x = a 1 e a x + C
Integration by Parts: ∫ u d v = u v − ∫ v d u \int u \, dv = uv - \int v \, du ∫ u d v = uv − ∫ v d u . Choose u u u = the part that simplifies when differentiated, d v dv d v = the part you can integrate.
Fundamental Theorem: If F ( x ) = ∫ a x f ( t ) d t F(x) = \int_a^x f(t)\,dt F ( x ) = ∫ a x f ( t ) d t , then F ′ ( x ) = f ( x ) F'(x) = f(x) F ′ ( x ) = f ( x ) . This is why differentiating a CDF gives the PDF.
Key Definite Integrals (memorize these)
Gaussian Integral: ∫ − ∞ ∞ e − a x 2 d x = π a \int_{-\infty}^{\infty} e^{-ax^2}\,dx = \sqrt{\frac{\pi}{a}} ∫ − ∞ ∞ e − a x 2 d x = a π for a > 0 a > 0 a > 0
Gamma Integral: ∫ 0 ∞ x n − 1 e − x d x = Γ ( n ) = ( n − 1 ) ! \int_0^{\infty} x^{n-1} e^{-x}\,dx = \Gamma(n) = (n-1)! ∫ 0 ∞ x n − 1 e − x d x = Γ ( n ) = ( n − 1 )! for positive integers n n n
Generalized Gamma: ∫ 0 ∞ x n e − λ x d x = n ! λ n + 1 \int_0^{\infty} x^{n} e^{-\lambda x}\,dx = \frac{n!}{\lambda^{n+1}} ∫ 0 ∞ x n e − λ x d x = λ n + 1 n ! for λ > 0 \lambda > 0 λ > 0 and non-negative integer n n n
Absolute Value Inequalities
Exponent and Logarithm Rules
e a + b = e a ⋅ e b e^{a+b} = e^a \cdot e^b e a + b = e a ⋅ e b (splitting sums in exponents — used constantly in MGF proofs)
ln ( e a ) = a \ln(e^a) = a ln ( e a ) = a and e ln a = a e^{\ln a} = a e l n a = a (inverse relationship)
If − ln ( X ) ≤ u -\ln(X) \leq u − ln ( X ) ≤ u , then ln ( X ) ≥ − u \ln(X) \geq -u ln ( X ) ≥ − u , then X ≥ e − u X \geq e^{-u} X ≥ e − u (exponentiate both sides — used in CDF method)
Multivariable Calculus
2 × 2 2 \times 2 2 × 2 Determinant: det ( a b c d ) = a d − b c \det\begin{pmatrix} a & b \\ c & d \end{pmatrix} = ad - bc det ( a c b d ) = a d − b c
Partial Derivatives: ∂ ∂ u ( u ⋅ v ) = v \frac{\partial}{\partial u}(u \cdot v) = v ∂ u ∂ ( u ⋅ v ) = v (treat v v v as constant). ∂ ∂ u ( u 2 v ) = 2 u v \frac{\partial}{\partial u}(u^2 v) = 2uv ∂ u ∂ ( u 2 v ) = 2 uv .
In this section, we answer a simple question: why do we need to find the distribution of a transformed random variable? We’ll see that this isn’t an abstract exercise — it shows up every time we apply a formula to data. We’ll preview the three methods available (CDF, transformation, MGF) and explain when to use each one.
Real-Life Motivation: Suppose you’re an engineer who knows that the radius R R R of manufactured ball bearings follows a known distribution. Quality control doesn’t care about the radius — they care about the cross-sectional area A = π R 2 A = \pi R^2 A = π R 2 . What is the distribution of A A A ? You know the distribution of R R R , but you need the distribution of a function of R R R . That’s what this chapter is about.
Here’s the fundamental question of this chapter:
If we know the distribution of X X X , and we define Y = g ( X ) Y = g(X) Y = g ( X ) , what is the distribution of Y Y Y ?
This question seems simple, but it turns out to be one of the most powerful tools in all of probability theory. Let’s see why.
Every time you apply a formula to a random variable, you create a new random variable. Consider these examples:
Temperature conversion. If X X X is temperature in Celsius, then Y = 9 5 X + 32 Y = \frac{9}{5}X + 32 Y = 5 9 X + 32 is temperature in Fahrenheit. If you know the distribution of X X X , what’s the distribution of Y Y Y ?
Profit from revenue. If X X X is revenue and costs are fixed at c c c , then profit is Y = X − c Y = X - c Y = X − c . What’s the distribution of profit?
Signal strength. In telecommunications, signal power is often measured in decibels: Y = 10 log 10 ( X ) Y = 10 \log_{10}(X) Y = 10 log 10 ( X ) , where X X X is the raw power. If X X X follows a Gamma distribution, what distribution does Y Y Y follow?
Portfolio returns. If X 1 , X 2 , … , X n X_1, X_2, \ldots, X_n X 1 , X 2 , … , X n are the returns on n n n stocks, the portfolio return is Y = w 1 X 1 + w 2 X 2 + ⋯ + w n X n Y = w_1 X_1 + w_2 X_2 + \cdots + w_n X_n Y = w 1 X 1 + w 2 X 2 + ⋯ + w n X n , where w i w_i w i are portfolio weights. What’s the distribution of Y Y Y ?
Sample mean. The most important statistic in all of statistics is Y ˉ = 1 n ∑ i = 1 n Y i \bar{Y} = \frac{1}{n}\sum_{i=1}^n Y_i Y ˉ = n 1 ∑ i = 1 n Y i . It’s a function of n n n random variables. What’s its distribution?
In every case, we know the distribution of the input(s), and we need the distribution of the output. This chapter gives you the tools to solve all of these.
0.2 Three Methods ¶ We develop three distinct techniques, each with its own strengths:
Method Best For Key Idea CDF Method (§7.2)Any transformation — the universal tool Compute F U ( u ) = P ( U ≤ u ) F_U(u) = P(U \leq u) F U ( u ) = P ( U ≤ u ) directly, then differentiate Transformation Method (§7.3)One-to-one functions of continuous RVs Use the change-of-variables formula with the Jacobian MGF Method (§7.4)Sums of independent RVs; identifying known distributions If M U ( t ) = M known ( t ) M_U(t) = M_{\text{known}}(t) M U ( t ) = M known ( t ) , then U U U has that known distribution
There is no single “best” method. The CDF method always works but can involve tricky integration. The transformation method is elegant but requires a one-to-one function. The MGF method is the fastest when it works but only applies to sums and requires the MGF to match a known distribution.
The strategy: Try the simplest method first. If the function is a sum of independent RVs, try the MGF method. If the function is one-to-one and differentiable, try the transformation method. If neither works, fall back on the CDF method — it always works.
We learned that every formula applied to a random variable creates a new random variable whose distribution we may need. This isn’t abstract — it’s what happens every time an engineer converts units, a financial analyst computes profit, or a statistician calculates a sample mean. We have three tools to find these distributions: the CDF method (universal), the transformation method (elegant for one-to-one functions), and the MGF method (powerful for sums). The rest of this chapter develops each one in full detail.
1 The CDF Method (Method of Distribution Functions) ¶ In this section, we learn the most general technique for finding the distribution of a transformed random variable: the CDF method . The idea is beautifully simple — we compute P ( U ≤ u ) P(U \leq u) P ( U ≤ u ) directly using the known distribution of X X X , and then differentiate to get the PDF of U U U . This method always works, even when the transformation is not one-to-one.
Real-Life Motivation: A meteorologist models relative humidity Y Y Y at a weather station with the PDF f Y ( y ) = 2 ( 1 − y ) f_Y(y) = 2(1 - y) f Y ( y ) = 2 ( 1 − y ) for 0 ≤ y ≤ 1 0 \leq y \leq 1 0 ≤ y ≤ 1 . Atmospheric pressure U U U at the station is related to humidity by the formula U = − 400 Y + 1000 U = -400Y + 1000 U = − 400 Y + 1000 , giving pressure in hectopascals. The meteorologist needs the distribution of U U U to set warning thresholds for extreme weather events. The CDF method gives us the answer.
1.1 The Core Idea ¶ Suppose X X X is a random variable with a known PDF f X ( x ) f_X(x) f X ( x ) and CDF F X ( x ) F_X(x) F X ( x ) , and let U = g ( X ) U = g(X) U = g ( X ) for some function g g g . The CDF method has exactly three steps:
Step 1. Find the range of U U U . (What values can U U U take?)
Step 2. Write F U ( u ) = P ( U ≤ u ) F_U(u) = P(U \leq u) F U ( u ) = P ( U ≤ u ) . Replace U U U by g ( X ) g(X) g ( X ) and solve the inequality for X X X using the known CDF of X X X .
Step 3. Differentiate: f U ( u ) = d d u F U ( u ) f_U(u) = \frac{d}{du} F_U(u) f U ( u ) = d u d F U ( u ) .
That’s it. The method is universal — it works for any transformation, whether it’s linear, quadratic, logarithmic, or involves multiple variables. Let’s see it in action.
1.2 Worked Examples: One Variable ¶ Before diving into continuous examples, note that the CDF method also works for discrete random variables — just use summation instead of integration.
Example 6.0 (Discrete Transformation). A fair die is rolled: X ∈ { 1 , 2 , 3 , 4 , 5 , 6 } X \in \{1, 2, 3, 4, 5, 6\} X ∈ { 1 , 2 , 3 , 4 , 5 , 6 } , each with probability 1 / 6 1/6 1/6 . Let U = ( X − 3 ) 2 U = (X - 3)^2 U = ( X − 3 ) 2 — the squared deviation from 3.
The values of U U U are: X = 1 → U = 4 X = 1 \to U = 4 X = 1 → U = 4 , X = 2 → U = 1 X = 2 \to U = 1 X = 2 → U = 1 , X = 3 → U = 0 X = 3 \to U = 0 X = 3 → U = 0 , X = 4 → U = 1 X = 4 \to U = 1 X = 4 → U = 1 , X = 5 → U = 4 X = 5 \to U = 4 X = 5 → U = 4 , X = 6 → U = 9 X = 6 \to U = 9 X = 6 → U = 9 .
Multiple X X X -values map to the same U U U : both X = 2 X = 2 X = 2 and X = 4 X = 4 X = 4 give U = 1 U = 1 U = 1 ; both X = 1 X = 1 X = 1 and X = 5 X = 5 X = 5 give U = 4 U = 4 U = 4 . So we add their probabilities:
| u u u | x x x -values that produce it | p U ( u ) p_U(u) p U ( u ) |
|:
The Problem.
Let X X X have the PDF f X ( x ) = 2 x f_X(x) = 2x f X ( x ) = 2 x for 0 ≤ x ≤ 1 0 \leq x \leq 1 0 ≤ x ≤ 1 . Find the PDF of U = 3 X − 1 U = 3X - 1 U = 3 X − 1 using the CDF method.
Solution.
Step 1: Find the range of U U U .
When x = 0 x = 0 x = 0 : U = 3 ( 0 ) − 1 = − 1 U = 3(0) - 1 = -1 U = 3 ( 0 ) − 1 = − 1 . When x = 1 x = 1 x = 1 : U = 3 ( 1 ) − 1 = 2 U = 3(1) - 1 = 2 U = 3 ( 1 ) − 1 = 2 . Since g ( x ) = 3 x − 1 g(x) = 3x - 1 g ( x ) = 3 x − 1 is increasing, the range of U U U is [ − 1 , 2 ] [-1, 2] [ − 1 , 2 ] .
Step 2: Compute F U ( u ) = P ( U ≤ u ) F_U(u) = P(U \leq u) F U ( u ) = P ( U ≤ u ) .
F U ( u ) = P ( U ≤ u ) = P ( 3 X − 1 ≤ u ) = P ( X ≤ u + 1 3 ) = F X ( u + 1 3 ) F_U(u) = P(U \leq u) = P(3X - 1 \leq u) = P\!\left(X \leq \frac{u + 1}{3}\right) = F_X\!\left(\frac{u + 1}{3}\right) F U ( u ) = P ( U ≤ u ) = P ( 3 X − 1 ≤ u ) = P ( X ≤ 3 u + 1 ) = F X ( 3 u + 1 ) We need F X ( x ) F_X(x) F X ( x ) . Since f X ( x ) = 2 x f_X(x) = 2x f X ( x ) = 2 x for 0 ≤ x ≤ 1 0 \leq x \leq 1 0 ≤ x ≤ 1 :
F X ( x ) = ∫ 0 x 2 t d t = 2 ⋅ t 2 2 ∣ 0 x = x 2 , 0 ≤ x ≤ 1 F_X(x) = \int_0^x 2t \, dt = 2 \cdot \frac{t^2}{2}\Big|_0^x = x^2, \quad 0 \leq x \leq 1 F X ( x ) = ∫ 0 x 2 t d t = 2 ⋅ 2 t 2 ∣ ∣ 0 x = x 2 , 0 ≤ x ≤ 1 (Calculus flashback: we used the power rule ∫ t n d t = t n + 1 / ( n + 1 ) \int t^n\,dt = t^{n+1}/(n+1) ∫ t n d t = t n + 1 / ( n + 1 ) with n = 1 n = 1 n = 1 .)
So:
F U ( u ) = F X ( u + 1 3 ) = ( u + 1 3 ) 2 = ( u + 1 ) 2 9 , − 1 ≤ u ≤ 2 F_U(u) = F_X\!\left(\frac{u+1}{3}\right) = \left(\frac{u+1}{3}\right)^2 = \frac{(u+1)^2}{9}, \quad -1 \leq u \leq 2 F U ( u ) = F X ( 3 u + 1 ) = ( 3 u + 1 ) 2 = 9 ( u + 1 ) 2 , − 1 ≤ u ≤ 2 Step 3: Differentiate to get f U ( u ) f_U(u) f U ( u ) .
f U ( u ) = d d u [ ( u + 1 ) 2 9 ] f_U(u) = \frac{d}{du}\left[\frac{(u+1)^2}{9}\right] f U ( u ) = d u d [ 9 ( u + 1 ) 2 ] (Calculus flashback: Chain Rule. Let w = u + 1 w = u + 1 w = u + 1 , so d d u w 2 = 2 w ⋅ d w d u = 2 ( u + 1 ) ⋅ 1 \frac{d}{du}w^2 = 2w \cdot \frac{dw}{du} = 2(u+1) \cdot 1 d u d w 2 = 2 w ⋅ d u d w = 2 ( u + 1 ) ⋅ 1 .)
= 2 ( u + 1 ) 9 , − 1 ≤ u ≤ 2 = \frac{2(u+1)}{9}, \quad -1 \leq u \leq 2 = 9 2 ( u + 1 ) , − 1 ≤ u ≤ 2 Verification.
Let’s verify: ∫ − 1 2 2 ( u + 1 ) 9 d u = 1 9 [ ( u + 1 ) 2 ] − 1 2 = 1 9 ( 9 − 0 ) = 1 \int_{-1}^{2} \frac{2(u+1)}{9} \, du = \frac{1}{9}\left[(u+1)^2\right]_{-1}^{2} = \frac{1}{9}(9 - 0) = 1 ∫ − 1 2 9 2 ( u + 1 ) d u = 9 1 [ ( u + 1 ) 2 ] − 1 2 = 9 1 ( 9 − 0 ) = 1 ✓
In R.
# Simulate X from f(x) = 2x on [0,1] using inverse CDF: F(x) = x^2, so X = sqrt(U(0,1))
set.seed(42)
n <- 100000
x_sim <- sqrt(runif(n)) # Simulated X values
u_sim <- 3 * x_sim - 1 # Transformed: U = 3X - 1
# Compare simulation to derived PDF
hist(u_sim, breaks = 50, freq = FALSE,
main = "PDF of U = 3X - 1",
xlab = "u", ylab = "Density",
col = "steelblue", border = "white")
curve(2*(x + 1)/9, from = -1, to = 2, add = TRUE, col = "red", lwd = 2)
legend("topleft", "Derived PDF", col = "red", lwd = 2)Run this code and watch the histogram match the derived PDF perfectly.
The Problem.
Let X X X have the PDF f X ( x ) = x + 1 2 f_X(x) = \frac{x + 1}{2} f X ( x ) = 2 x + 1 for − 1 ≤ x ≤ 1 -1 \leq x \leq 1 − 1 ≤ x ≤ 1 . Find the PDF of U = X 2 U = X^2 U = X 2 using the CDF method.
Solution.
Why the CDF method? The function g ( x ) = x 2 g(x) = x^2 g ( x ) = x 2 is not one-to-one on [ − 1 , 1 ] [-1, 1] [ − 1 , 1 ] : both x = 0.5 x = 0.5 x = 0.5 and x = − 0.5 x = -0.5 x = − 0.5 give U = 0.25 U = 0.25 U = 0.25 . The transformation method (Section 7.3) won’t apply directly. But the CDF method handles this beautifully.
Step 1: Find the range of U U U .
Since x ∈ [ − 1 , 1 ] x \in [-1, 1] x ∈ [ − 1 , 1 ] , we have x 2 ∈ [ 0 , 1 ] x^2 \in [0, 1] x 2 ∈ [ 0 , 1 ] . The range of U U U is [ 0 , 1 ] [0, 1] [ 0 , 1 ] .
Step 2: Compute F U ( u ) = P ( U ≤ u ) F_U(u) = P(U \leq u) F U ( u ) = P ( U ≤ u ) .
F U ( u ) = P ( X 2 ≤ u ) = P ( − u ≤ X ≤ u ) F_U(u) = P(X^2 \leq u) = P(-\sqrt{u} \leq X \leq \sqrt{u}) F U ( u ) = P ( X 2 ≤ u ) = P ( − u ≤ X ≤ u ) (Calculus flashback: X 2 ≤ u X^2 \leq u X 2 ≤ u is equivalent to ∣ X ∣ ≤ u |X| \leq \sqrt{u} ∣ X ∣ ≤ u , which means − u ≤ X ≤ u -\sqrt{u} \leq X \leq \sqrt{u} − u ≤ X ≤ u . Both the positive and negative square roots matter!)
F U ( u ) = ∫ − u u x + 1 2 d x = 1 2 [ x 2 2 + x ] − u u F_U(u) = \int_{-\sqrt{u}}^{\sqrt{u}} \frac{x + 1}{2} \, dx = \frac{1}{2}\left[\frac{x^2}{2} + x\right]_{-\sqrt{u}}^{\sqrt{u}} F U ( u ) = ∫ − u u 2 x + 1 d x = 2 1 [ 2 x 2 + x ] − u u (Calculus flashback: ∫ x + 1 2 d x = 1 2 ( x 2 2 + x ) \int \frac{x+1}{2}\,dx = \frac{1}{2}\left(\frac{x^2}{2} + x\right) ∫ 2 x + 1 d x = 2 1 ( 2 x 2 + x ) using the power rule and constant rule.)
Now we evaluate at the limits. At x = u x = \sqrt{u} x = u : u 2 + u \frac{u}{2} + \sqrt{u} 2 u + u . At x = − u x = -\sqrt{u} x = − u : u 2 − u \frac{u}{2} - \sqrt{u} 2 u − u .
= 1 2 [ ( u 2 + u ) − ( u 2 − u ) ] = 1 2 ⋅ 2 u = u = \frac{1}{2}\left[\left(\frac{u}{2} + \sqrt{u}\right) - \left(\frac{u}{2} - \sqrt{u}\right)\right] = \frac{1}{2}\cdot 2\sqrt{u} = \sqrt{u} = 2 1 [ ( 2 u + u ) − ( 2 u − u ) ] = 2 1 ⋅ 2 u = u Step 3: Differentiate.
f U ( u ) = d d u u = 1 2 u , 0 < u ≤ 1 f_U(u) = \frac{d}{du}\sqrt{u} = \frac{1}{2\sqrt{u}}, \quad 0 < u \leq 1 f U ( u ) = d u d u = 2 u 1 , 0 < u ≤ 1 This is a Beta(1/2, 1) distribution!
Common Mistake.
When X 2 ≤ u X^2 \leq u X 2 ≤ u , students often write P ( X ≤ u ) P(X \leq \sqrt{u}) P ( X ≤ u ) and forget the negative root. The correct inequality is − u ≤ X ≤ u -\sqrt{u} \leq X \leq \sqrt{u} − u ≤ X ≤ u . Always sketch the function g ( x ) = x 2 g(x) = x^2 g ( x ) = x 2 and think about which x x x -values map to U ≤ u U \leq u U ≤ u .
In R.
set.seed(42)
n <- 100000
# Simulate X from f(x) = (x+1)/2 on [-1, 1] using inverse CDF
# F(x) = (x+1)^2 / 4, so x = 2*sqrt(V) - 1 where V ~ Unif(0,1)
v <- runif(n)
x_sim <- 2 * sqrt(v) - 1
u_sim <- x_sim^2
hist(u_sim, breaks = 50, freq = FALSE,
main = "PDF of U = X² (non-one-to-one transform)",
xlab = "u", ylab = "Density",
col = "steelblue", border = "white")
curve(1 / (2 * sqrt(x)), from = 0.001, to = 1, add = TRUE, col = "red", lwd = 2)
legend("topright", "f(u) = 1/(2√u)", col = "red", lwd = 2)The Problem.
Let X X X have the PDF f X ( x ) = 2 ( 1 − x ) f_X(x) = 2(1-x) f X ( x ) = 2 ( 1 − x ) for 0 ≤ x ≤ 1 0 \leq x \leq 1 0 ≤ x ≤ 1 . Find the PDF of U = − ln ( X ) U = -\ln(X) U = − ln ( X ) using the CDF method.
Solution.
Step 1: Find the range of U U U .
When x = 1 x = 1 x = 1 : U = − ln ( 1 ) = 0 U = -\ln(1) = 0 U = − ln ( 1 ) = 0 . When x → 0 + x \to 0^+ x → 0 + : U = − ln ( x ) → + ∞ U = -\ln(x) \to +\infty U = − ln ( x ) → + ∞ . Since − ln ( x ) -\ln(x) − ln ( x ) is decreasing, the range of U U U is [ 0 , ∞ ) [0, \infty) [ 0 , ∞ ) .
Step 2: Compute F U ( u ) = P ( U ≤ u ) F_U(u) = P(U \leq u) F U ( u ) = P ( U ≤ u ) .
F U ( u ) = P ( − ln X ≤ u ) = P ( ln X ≥ − u ) = P ( X ≥ e − u ) F_U(u) = P(-\ln X \leq u) = P(\ln X \geq -u) = P(X \geq e^{-u}) F U ( u ) = P ( − ln X ≤ u ) = P ( ln X ≥ − u ) = P ( X ≥ e − u ) (Calculus flashback: Starting from − ln X ≤ u -\ln X \leq u − ln X ≤ u , multiply both sides by -1 to get ln X ≥ − u \ln X \geq -u ln X ≥ − u — note the inequality flips! Then exponentiate both sides: since e x e^x e x is an increasing function, the inequality direction is preserved, giving X ≥ e − u X \geq e^{-u} X ≥ e − u .)
Careful! The inequality flips because − ln ( x ) -\ln(x) − ln ( x ) is a decreasing function. We have:
F U ( u ) = P ( X ≥ e − u ) = 1 − P ( X < e − u ) = 1 − F X ( e − u ) F_U(u) = P(X \geq e^{-u}) = 1 - P(X < e^{-u}) = 1 - F_X(e^{-u}) F U ( u ) = P ( X ≥ e − u ) = 1 − P ( X < e − u ) = 1 − F X ( e − u ) Now, F X ( x ) = ∫ 0 x 2 ( 1 − t ) d t = [ 2 t − t 2 ] 0 x = 2 x − x 2 F_X(x) = \int_0^x 2(1-t)\,dt = \left[2t - t^2\right]_0^x = 2x - x^2 F X ( x ) = ∫ 0 x 2 ( 1 − t ) d t = [ 2 t − t 2 ] 0 x = 2 x − x 2 for 0 ≤ x ≤ 1 0 \leq x \leq 1 0 ≤ x ≤ 1 . So:
F U ( u ) = 1 − ( 2 e − u − e − 2 u ) , u ≥ 0 F_U(u) = 1 - (2e^{-u} - e^{-2u}), \quad u \geq 0 F U ( u ) = 1 − ( 2 e − u − e − 2 u ) , u ≥ 0 Step 3: Differentiate.
f U ( u ) = d d u [ 1 − 2 e − u + e − 2 u ] f_U(u) = \frac{d}{du}\left[1 - 2e^{-u} + e^{-2u}\right] f U ( u ) = d u d [ 1 − 2 e − u + e − 2 u ] (Calculus flashback: d d u e − u = − e − u \frac{d}{du}e^{-u} = -e^{-u} d u d e − u = − e − u and d d u e − 2 u = − 2 e − 2 u \frac{d}{du}e^{-2u} = -2e^{-2u} d u d e − 2 u = − 2 e − 2 u by the chain rule with inside function − u -u − u and − 2 u -2u − 2 u respectively.)
= 0 − 2 ( − e − u ) + ( − 2 e − 2 u ) = 2 e − u − 2 e − 2 u , u ≥ 0 = 0 - 2(-e^{-u}) + (-2e^{-2u}) = 2e^{-u} - 2e^{-2u}, \quad u \geq 0 = 0 − 2 ( − e − u ) + ( − 2 e − 2 u ) = 2 e − u − 2 e − 2 u , u ≥ 0 We can factor: f U ( u ) = 2 e − u ( 1 − e − u ) f_U(u) = 2e^{-u}(1 - e^{-u}) f U ( u ) = 2 e − u ( 1 − e − u ) for u ≥ 0 u \geq 0 u ≥ 0 .
Key Lesson.
When g ( x ) g(x) g ( x ) is decreasing , the inequality flips: P ( g ( X ) ≤ u ) P(g(X) \leq u) P ( g ( X ) ≤ u ) becomes P ( X ≥ g − 1 ( u ) ) P(X \geq g^{-1}(u)) P ( X ≥ g − 1 ( u )) . Students who forget to flip the inequality get the wrong CDF and therefore the wrong PDF. Always think about whether g g g is increasing or decreasing.
The Problem.
Let X X X have the piecewise PDF:
f X ( x ) = { x 0 ≤ x ≤ 1 1 1 < x ≤ 1.5 0 otherwise f_X(x) = \begin{cases} x & 0 \leq x \leq 1 \\ 1 & 1 < x \leq 1.5 \\ 0 & \text{otherwise} \end{cases} f X ( x ) = ⎩ ⎨ ⎧ x 1 0 0 ≤ x ≤ 1 1 < x ≤ 1.5 otherwise Find the PDF of U = 10 X − 4 U = 10X - 4 U = 10 X − 4 using the CDF method.
Solution.
Why this example matters: Real-world distributions are often piecewise (e.g., a density that increases up to a point then stays flat). The CDF method handles piecewise PDFs — you just need to track which piece applies.
Step 1: Find the range of U U U .
When x = 0 x = 0 x = 0 : U = − 4 U = -4 U = − 4 . When x = 1.5 x = 1.5 x = 1.5 : U = 11 U = 11 U = 11 . Since g ( x ) = 10 x − 4 g(x) = 10x - 4 g ( x ) = 10 x − 4 is increasing, the range of U U U is [ − 4 , 11 ] [-4, 11] [ − 4 , 11 ] .
Step 2: Compute the CDF of X X X .
We need F X ( x ) F_X(x) F X ( x ) in all regions:
For 0 ≤ x ≤ 1 0 \leq x \leq 1 0 ≤ x ≤ 1 : F X ( x ) = ∫ 0 x t d t = x 2 2 \;F_X(x) = \int_0^x t\,dt = \frac{x^2}{2} F X ( x ) = ∫ 0 x t d t = 2 x 2
For 1 < x ≤ 1.5 1 < x \leq 1.5 1 < x ≤ 1.5 : F X ( x ) = ∫ 0 1 t d t ⏟ = 1 / 2 + ∫ 1 x 1 d t = 1 2 + ( x − 1 ) \;F_X(x) = \underbrace{\int_0^1 t\,dt}_{= 1/2} + \int_1^x 1\,dt = \frac{1}{2} + (x - 1) F X ( x ) = = 1/2 ∫ 0 1 t d t + ∫ 1 x 1 d t = 2 1 + ( x − 1 )
(Calculus flashback: When the PDF is piecewise, the CDF is built by integrating each piece in order — the CDF accumulates probability from left to right.)
Step 3: Compute F U ( u ) = P ( U ≤ u ) = P ( X ≤ u + 4 10 ) = F X ( u + 4 10 ) F_U(u) = P(U \leq u) = P(X \leq \frac{u+4}{10}) = F_X(\frac{u+4}{10}) F U ( u ) = P ( U ≤ u ) = P ( X ≤ 10 u + 4 ) = F X ( 10 u + 4 ) .
When x = u + 4 10 x = \frac{u+4}{10} x = 10 u + 4 , note that x ∈ [ 0 , 1 ] x \in [0, 1] x ∈ [ 0 , 1 ] corresponds to u ∈ [ − 4 , 6 ] u \in [-4, 6] u ∈ [ − 4 , 6 ] , and x ∈ ( 1 , 1.5 ] x \in (1, 1.5] x ∈ ( 1 , 1.5 ] corresponds to u ∈ ( 6 , 11 ] u \in (6, 11] u ∈ ( 6 , 11 ] .
Case 1: − 4 ≤ u ≤ 6 -4 \leq u \leq 6 − 4 ≤ u ≤ 6 : F U ( u ) = 1 2 ( u + 4 10 ) 2 = ( u + 4 ) 2 200 \quad F_U(u) = \frac{1}{2}\left(\frac{u+4}{10}\right)^2 = \frac{(u+4)^2}{200} F U ( u ) = 2 1 ( 10 u + 4 ) 2 = 200 ( u + 4 ) 2
Case 2: 6 < u ≤ 11 6 < u \leq 11 6 < u ≤ 11 : F U ( u ) = 1 2 + ( u + 4 10 − 1 ) = u − 6 10 + 1 2 \quad F_U(u) = \frac{1}{2} + \left(\frac{u+4}{10} - 1\right) = \frac{u - 6}{10} + \frac{1}{2} F U ( u ) = 2 1 + ( 10 u + 4 − 1 ) = 10 u − 6 + 2 1
Step 4: Differentiate.
f U ( u ) = { 2 ( u + 4 ) 200 = u + 4 100 − 4 ≤ u ≤ 6 1 10 6 < u ≤ 11 f_U(u) = \begin{cases} \dfrac{2(u+4)}{200} = \dfrac{u+4}{100} & -4 \leq u \leq 6 \\[6pt] \dfrac{1}{10} & 6 < u \leq 11 \end{cases} f U ( u ) = ⎩ ⎨ ⎧ 200 2 ( u + 4 ) = 100 u + 4 10 1 − 4 ≤ u ≤ 6 6 < u ≤ 11 (Calculus flashback: differentiate each piece separately. In Case 1, d d u ( u + 4 ) 2 200 = 2 ( u + 4 ) 200 \frac{d}{du}\frac{(u+4)^2}{200} = \frac{2(u+4)}{200} d u d 200 ( u + 4 ) 2 = 200 2 ( u + 4 ) by the chain rule. In Case 2, d d u ( u − 6 10 + 1 2 ) = 1 10 \frac{d}{du}\left(\frac{u-6}{10} + \frac{1}{2}\right) = \frac{1}{10} d u d ( 10 u − 6 + 2 1 ) = 10 1 .)
Verification.
∫ − 4 6 u + 4 100 d u + ∫ 6 11 1 10 d u = 1 100 ⋅ ( u + 4 ) 2 2 ∣ − 4 6 + 1 10 ⋅ 5 = 1 100 ⋅ 100 2 + 1 2 = 1 2 + 1 2 = 1 \int_{-4}^{6} \frac{u+4}{100}\,du + \int_6^{11}\frac{1}{10}\,du = \frac{1}{100}\cdot\frac{(u+4)^2}{2}\Big|_{-4}^{6} + \frac{1}{10}\cdot 5 = \frac{1}{100}\cdot\frac{100}{2} + \frac{1}{2} = \frac{1}{2} + \frac{1}{2} = 1 ∫ − 4 6 100 u + 4 d u + ∫ 6 11 10 1 d u = 100 1 ⋅ 2 ( u + 4 ) 2 ∣ ∣ − 4 6 + 10 1 ⋅ 5 = 100 1 ⋅ 2 100 + 2 1 = 2 1 + 2 1 = 1 ✓
Notice the output PDF is also piecewise — a piecewise input produces a piecewise output. The slopes and breakpoints change, but the structure carries through.
1.5 Worked Examples: Two Variables ¶ The CDF method extends naturally to functions of two (or more) random variables.
The Problem.
Let X X X and Y Y Y be independent, both Uniform(0, 1). Find the PDF of U = X + Y U = X + Y U = X + Y using the CDF method.
Solution.
Step 1: Range of U U U .
Since 0 ≤ X ≤ 1 0 \leq X \leq 1 0 ≤ X ≤ 1 and 0 ≤ Y ≤ 1 0 \leq Y \leq 1 0 ≤ Y ≤ 1 , we have 0 ≤ U ≤ 2 0 \leq U \leq 2 0 ≤ U ≤ 2 .
Step 2: Compute F U ( u ) = P ( X + Y ≤ u ) F_U(u) = P(X + Y \leq u) F U ( u ) = P ( X + Y ≤ u ) .
The joint PDF is f ( x , y ) = 1 f(x, y) = 1 f ( x , y ) = 1 on the unit square [ 0 , 1 ] × [ 0 , 1 ] [0,1] \times [0,1] [ 0 , 1 ] × [ 0 , 1 ] (since X X X and Y Y Y are independent Uniform(0,1)).
We need to integrate f ( x , y ) = 1 f(x,y) = 1 f ( x , y ) = 1 over the region where x + y ≤ u x + y \leq u x + y ≤ u and 0 ≤ x ≤ 1 0 \leq x \leq 1 0 ≤ x ≤ 1 , 0 ≤ y ≤ 1 0 \leq y \leq 1 0 ≤ y ≤ 1 . This region depends on whether 0 ≤ u ≤ 1 0 \leq u \leq 1 0 ≤ u ≤ 1 or 1 < u ≤ 2 1 < u \leq 2 1 < u ≤ 2 .
Case 1: 0 ≤ u ≤ 1 0 \leq u \leq 1 0 ≤ u ≤ 1 .
The region x + y ≤ u x + y \leq u x + y ≤ u within the unit square is a triangle with vertices ( 0 , 0 ) (0, 0) ( 0 , 0 ) , ( u , 0 ) (u, 0) ( u , 0 ) , ( 0 , u ) (0, u) ( 0 , u ) .
F U ( u ) = ∫ 0 u ∫ 0 u − x 1 d y d x = ∫ 0 u ( u − x ) d x = [ u x − x 2 2 ] 0 u = u 2 2 F_U(u) = \int_0^u \int_0^{u - x} 1 \, dy \, dx = \int_0^u (u - x) \, dx = \left[ux - \frac{x^2}{2}\right]_0^u = \frac{u^2}{2} F U ( u ) = ∫ 0 u ∫ 0 u − x 1 d y d x = ∫ 0 u ( u − x ) d x = [ ux − 2 x 2 ] 0 u = 2 u 2 Case 2: 1 < u ≤ 2 1 < u \leq 2 1 < u ≤ 2 .
Now the line x + y = u x + y = u x + y = u cuts across the upper-right corner of the unit square. The region x + y ≤ u x + y \leq u x + y ≤ u within the square is the entire square minus the triangle above the line. We integrate directly:
F U ( u ) = ∫ 0 1 ∫ 0 min ( u − x , 1 ) 1 d y d x F_U(u) = \int_0^1 \int_0^{\min(u-x, \, 1)} 1 \, dy \, dx F U ( u ) = ∫ 0 1 ∫ 0 m i n ( u − x , 1 ) 1 d y d x When x < u − 1 x < u - 1 x < u − 1 : the upper limit for y y y is min ( u − x , 1 ) = 1 \min(u - x, 1) = 1 min ( u − x , 1 ) = 1 (since u − x > 1 u - x > 1 u − x > 1 ), so the inner integral is 1.
When x ≥ u − 1 x \geq u - 1 x ≥ u − 1 : the upper limit is min ( u − x , 1 ) = u − x \min(u - x, 1) = u - x min ( u − x , 1 ) = u − x (since u − x ≤ 1 u - x \leq 1 u − x ≤ 1 ), so the inner integral is u − x u - x u − x .
F U ( u ) = ∫ 0 u − 1 1 d x + ∫ u − 1 1 ( u − x ) d x F_U(u) = \int_0^{u-1} 1 \, dx + \int_{u-1}^1 (u - x) \, dx F U ( u ) = ∫ 0 u − 1 1 d x + ∫ u − 1 1 ( u − x ) d x = ( u − 1 ) + [ u x − x 2 2 ] u − 1 1 = ( u − 1 ) + [ ( u − 1 2 ) − ( u ( u − 1 ) − ( u − 1 ) 2 2 ) ] = (u - 1) + \left[ux - \frac{x^2}{2}\right]_{u-1}^1 = (u - 1) + \left[\left(u - \frac{1}{2}\right) - \left(u(u-1) - \frac{(u-1)^2}{2}\right)\right] = ( u − 1 ) + [ ux − 2 x 2 ] u − 1 1 = ( u − 1 ) + [ ( u − 2 1 ) − ( u ( u − 1 ) − 2 ( u − 1 ) 2 ) ] = ( u − 1 ) + u − 1 2 − u 2 + u + u 2 − 2 u + 1 2 = ( u − 1 ) + u − 1 2 − u 2 + u + u 2 2 − u + 1 2 = (u - 1) + u - \frac{1}{2} - u^2 + u + \frac{u^2 - 2u + 1}{2} = (u-1) + u - \frac{1}{2} - u^2 + u + \frac{u^2}{2} - u + \frac{1}{2} = ( u − 1 ) + u − 2 1 − u 2 + u + 2 u 2 − 2 u + 1 = ( u − 1 ) + u − 2 1 − u 2 + u + 2 u 2 − u + 2 1 After simplifying (collecting terms carefully):
F U ( u ) = 1 − ( 2 − u ) 2 2 F_U(u) = 1 - \frac{(2-u)^2}{2} F U ( u ) = 1 − 2 ( 2 − u ) 2 Step 3: Differentiate.
f U ( u ) = { u 0 ≤ u ≤ 1 2 − u 1 < u ≤ 2 0 otherwise f_U(u) = \begin{cases} u & 0 \leq u \leq 1 \\ 2 - u & 1 < u \leq 2 \\ 0 & \text{otherwise} \end{cases} f U ( u ) = ⎩ ⎨ ⎧ u 2 − u 0 0 ≤ u ≤ 1 1 < u ≤ 2 otherwise This is a triangular distribution — a tent-shaped PDF centered at 1.
Why This Matters.
This result is the simplest example of a convolution : the PDF of the sum of two independent continuous random variables is the convolution of their individual PDFs. The triangular shape is your first glimpse of the Central Limit Theorem in action — even adding just two uniform random variables produces something more “bell-shaped” than either input.
In R.
set.seed(42)
n <- 100000
u_sim <- runif(n) + runif(n)
hist(u_sim, breaks = 50, freq = FALSE,
main = "PDF of U = X + Y, where X, Y ~ Unif(0,1)",
xlab = "u", ylab = "Density",
col = "steelblue", border = "white")
# Overlay derived PDF
u_vals <- seq(0, 2, length.out = 1000)
f_vals <- ifelse(u_vals <= 1, u_vals, 2 - u_vals)
lines(u_vals, f_vals, col = "red", lwd = 2)
legend("topright", "Derived PDF (triangle)", col = "red", lwd = 2)The Problem.
The total time from arrival to completion of service at a drive-through, X 1 X_1 X 1 , and the time spent waiting in line before reaching the window, X 2 X_2 X 2 , have joint density:
f ( x 1 , x 2 ) = e − x 1 , 0 ≤ x 2 ≤ x 1 < ∞ f(x_1, x_2) = e^{-x_1}, \quad 0 \leq x_2 \leq x_1 < \infty f ( x 1 , x 2 ) = e − x 1 , 0 ≤ x 2 ≤ x 1 < ∞ Find the PDF of U = X 1 − X 2 U = X_1 - X_2 U = X 1 − X 2 (the actual service time) using the CDF method.
Solution.
Step 1: Range of U U U .
Since x 2 ≤ x 1 x_2 \leq x_1 x 2 ≤ x 1 , we have U = X 1 − X 2 ≥ 0 U = X_1 - X_2 \geq 0 U = X 1 − X 2 ≥ 0 . Also, X 1 X_1 X 1 can be arbitrarily large, so U ∈ [ 0 , ∞ ) U \in [0, \infty) U ∈ [ 0 , ∞ ) .
Step 2: Compute F U ( u ) = P ( X 1 − X 2 ≤ u ) F_U(u) = P(X_1 - X_2 \leq u) F U ( u ) = P ( X 1 − X 2 ≤ u ) .
We need to integrate f ( x 1 , x 2 ) = e − x 1 f(x_1, x_2) = e^{-x_1} f ( x 1 , x 2 ) = e − x 1 over the region where x 1 − x 2 ≤ u x_1 - x_2 \leq u x 1 − x 2 ≤ u , 0 ≤ x 2 ≤ x 1 0 \leq x_2 \leq x_1 0 ≤ x 2 ≤ x 1 :
F U ( u ) = ∫ ∫ { 0 ≤ x 2 ≤ x 1 , x 1 − x 2 ≤ u } e − x 1 d x 2 d x 1 F_U(u) = \int \int_{\{0 \leq x_2 \leq x_1, \; x_1 - x_2 \leq u\}} e^{-x_1} \, dx_2 \, dx_1 F U ( u ) = ∫ ∫ { 0 ≤ x 2 ≤ x 1 , x 1 − x 2 ≤ u } e − x 1 d x 2 d x 1 The constraint x 1 − x 2 ≤ u x_1 - x_2 \leq u x 1 − x 2 ≤ u rearranges to x 2 ≥ x 1 − u x_2 \geq x_1 - u x 2 ≥ x 1 − u . Combined with the original constraint 0 ≤ x 2 ≤ x 1 0 \leq x_2 \leq x_1 0 ≤ x 2 ≤ x 1 , the lower bound for x 2 x_2 x 2 is max ( 0 , x 1 − u ) \max(0, x_1 - u) max ( 0 , x 1 − u ) .
This creates two regions depending on whether x 1 ≤ u x_1 \leq u x 1 ≤ u or x 1 > u x_1 > u x 1 > u :
When x 1 ≤ u x_1 \leq u x 1 ≤ u : we have x 1 − u ≤ 0 x_1 - u \leq 0 x 1 − u ≤ 0 , so max ( 0 , x 1 − u ) = 0 \max(0, x_1 - u) = 0 max ( 0 , x 1 − u ) = 0 . The condition x 2 ≥ x 1 − u x_2 \geq x_1 - u x 2 ≥ x 1 − u is automatically satisfied for all valid x 2 ≥ 0 x_2 \geq 0 x 2 ≥ 0 . The integral over x 2 x_2 x 2 runs from 0 to x 1 x_1 x 1 , covering the entire conditional range.
When x 1 > u x_1 > u x 1 > u : we have x 1 − u > 0 x_1 - u > 0 x 1 − u > 0 , so max ( 0 , x 1 − u ) = x 1 − u \max(0, x_1 - u) = x_1 - u max ( 0 , x 1 − u ) = x 1 − u . The integral over x 2 x_2 x 2 runs from x 1 − u x_1 - u x 1 − u to x 1 x_1 x 1 , a strip of width u u u .
Therefore:
F U ( u ) = ∫ 0 u ∫ 0 x 1 e − x 1 d x 2 d x 1 ⏟ region where x 1 ≤ u + ∫ u ∞ ∫ x 1 − u x 1 e − x 1 d x 2 d x 1 ⏟ region where x 1 > u F_U(u) = \underbrace{\int_0^u \int_0^{x_1} e^{-x_1} \, dx_2 \, dx_1}_{\text{region where } x_1 \leq u} + \underbrace{\int_u^\infty \int_{x_1 - u}^{x_1} e^{-x_1} \, dx_2 \, dx_1}_{\text{region where } x_1 > u} F U ( u ) = region where x 1 ≤ u ∫ 0 u ∫ 0 x 1 e − x 1 d x 2 d x 1 + region where x 1 > u ∫ u ∞ ∫ x 1 − u x 1 e − x 1 d x 2 d x 1 First integral: The inner integral gives ∫ 0 x 1 d x 2 = x 1 \int_0^{x_1} dx_2 = x_1 ∫ 0 x 1 d x 2 = x 1 , so:
∫ 0 u x 1 e − x 1 d x 1 \int_0^u x_1 e^{-x_1} \, dx_1 ∫ 0 u x 1 e − x 1 d x 1 We evaluate this using integration by parts with v = x 1 v = x_1 v = x 1 , d w = e − x 1 d x 1 dw = e^{-x_1}\,dx_1 d w = e − x 1 d x 1 , so d v = d x 1 dv = dx_1 d v = d x 1 , w = − e − x 1 w = -e^{-x_1} w = − e − x 1 :
∫ 0 u x 1 e − x 1 d x 1 = [ − x 1 e − x 1 ] 0 u + ∫ 0 u e − x 1 d x 1 = − u e − u + [ − e − x 1 ] 0 u = − u e − u − e − u + 1 = 1 − ( u + 1 ) e − u \int_0^u x_1 e^{-x_1}\,dx_1 = \left[-x_1 e^{-x_1}\right]_0^u + \int_0^u e^{-x_1}\,dx_1 = -ue^{-u} + \left[-e^{-x_1}\right]_0^u = -ue^{-u} - e^{-u} + 1 = 1 - (u+1)e^{-u} ∫ 0 u x 1 e − x 1 d x 1 = [ − x 1 e − x 1 ] 0 u + ∫ 0 u e − x 1 d x 1 = − u e − u + [ − e − x 1 ] 0 u = − u e − u − e − u + 1 = 1 − ( u + 1 ) e − u Second integral: The inner integral gives ∫ x 1 − u x 1 d x 2 = u \int_{x_1-u}^{x_1} dx_2 = u ∫ x 1 − u x 1 d x 2 = u , so:
∫ u ∞ u e − x 1 d x 1 = u [ − e − x 1 ] u ∞ = u ⋅ e − u \int_u^\infty u \, e^{-x_1} \, dx_1 = u \left[-e^{-x_1}\right]_u^\infty = u \cdot e^{-u} ∫ u ∞ u e − x 1 d x 1 = u [ − e − x 1 ] u ∞ = u ⋅ e − u Combining:
F U ( u ) = [ 1 − ( u + 1 ) e − u ] + u e − u = 1 − ( u + 1 ) e − u + u e − u = 1 − e − u F_U(u) = \left[1 - (u+1)e^{-u}\right] + ue^{-u} = 1 - (u+1)e^{-u} + ue^{-u} = 1 - e^{-u} F U ( u ) = [ 1 − ( u + 1 ) e − u ] + u e − u = 1 − ( u + 1 ) e − u + u e − u = 1 − e − u Step 3: Differentiate.
f U ( u ) = e − u , u ≥ 0 f_U(u) = e^{-u}, \quad u \geq 0 f U ( u ) = e − u , u ≥ 0 The service time U = X 1 − X 2 U = X_1 - X_2 U = X 1 − X 2 follows an Exponential(1) distribution!
Interpretation.
This is a lovely result: regardless of the joint distribution of total time and wait time (as long as it has this specific exponential joint density), the actual service time is exponentially distributed with mean 1 unit. In queueing theory, results like this allow managers to model service times separately from wait times.
The sum U = X + Y U = X + Y U = X + Y of two independent continuous random variables appears so frequently that its PDF formula has a special name:
If X X X and Y Y Y are independent continuous random variables with PDFs f X f_X f X and f Y f_Y f Y , then the PDF of U = X + Y U = X + Y U = X + Y is:
f U ( u ) = ∫ − ∞ ∞ f X ( x ) ⋅ f Y ( u − x ) d x = ( f X ∗ f Y ) ( u ) f_U(u) = \int_{-\infty}^{\infty} f_X(x) \cdot f_Y(u - x) \, dx = (f_X * f_Y)(u) f U ( u ) = ∫ − ∞ ∞ f X ( x ) ⋅ f Y ( u − x ) d x = ( f X ∗ f Y ) ( u ) The symbol ∗ * ∗ denotes convolution . In words: to find f U ( u ) f_U(u) f U ( u ) , slide f Y f_Y f Y across f X f_X f X and integrate their product at each shift u u u .
This is derived from the CDF method by differentiating P ( X + Y ≤ u ) = ∫ ∫ x + y ≤ u f X ( x ) f Y ( y ) d y d x P(X + Y \leq u) = \int\int_{x+y \leq u} f_X(x)f_Y(y)\,dy\,dx P ( X + Y ≤ u ) = ∫ ∫ x + y ≤ u f X ( x ) f Y ( y ) d y d x under the integral sign (substituting y = u − x y = u - x y = u − x ). We used it implicitly in Examples 7.4 and 7.5 — now it has a name.
Why “convolution”? The operation is the continuous analog of multiplying two polynomials: the coefficients of the product are convolutions of the individual coefficients. In signal processing, convolution appears when a signal passes through a filter. In probability, it appears when independent random quantities add.
Forgetting to flip the inequality for decreasing functions. If g ( x ) g(x) g ( x ) is decreasing, then P ( g ( X ) ≤ u ) = P ( X ≥ g − 1 ( u ) ) P(g(X) \leq u) = P(X \geq g^{-1}(u)) P ( g ( X ) ≤ u ) = P ( X ≥ g − 1 ( u )) . Students who don’t flip get 1 − f U ( u ) 1 - f_U(u) 1 − f U ( u ) instead of f U ( u ) f_U(u) f U ( u ) .
Not splitting cases for non-monotone functions. For U = X 2 U = X^2 U = X 2 , both positive and negative values of X X X contribute. You need P ( − u ≤ X ≤ u ) P(-\sqrt{u} \leq X \leq \sqrt{u}) P ( − u ≤ X ≤ u ) , not just P ( X ≤ u ) P(X \leq \sqrt{u}) P ( X ≤ u ) .
Forgetting to find the range of U U U first. If X ∈ [ 0 , 1 ] X \in [0, 1] X ∈ [ 0 , 1 ] and U = 3 X − 1 U = 3X - 1 U = 3 X − 1 , then U ∈ [ − 1 , 2 ] U \in [-1, 2] U ∈ [ − 1 , 2 ] . The PDF of U U U is zero outside this range. Students who don’t determine the range first often get CDFs that are negative or exceed 1.
Differentiating incorrectly when the CDF has cases. If F U ( u ) F_U(u) F U ( u ) has different formulas for different ranges of u u u , you must differentiate each piece separately.
Forgetting to verify the PDF integrates to 1. This is the quickest sanity check and catches most errors.
Let X ∼ Uniform ( 0 , 1 ) X \sim \text{Uniform}(0, 1) X ∼ Uniform ( 0 , 1 ) and U = − 2 ln ( X ) U = -2\ln(X) U = − 2 ln ( X ) . Use the CDF method to find the PDF of U U U .
Hint: − 2 ln ( x ) -2\ln(x) − 2 ln ( x ) is a decreasing function. Find the range of U U U , compute P ( U ≤ u ) P(U \leq u) P ( U ≤ u ) , and differentiate.
Range: When x = 1 x = 1 x = 1 : U = 0 U = 0 U = 0 . When x → 0 + x \to 0^+ x → 0 + : U → ∞ U \to \infty U → ∞ . So U ∈ [ 0 , ∞ ) U \in [0, \infty) U ∈ [ 0 , ∞ ) .
CDF: F U ( u ) = P ( − 2 ln X ≤ u ) = P ( ln X ≥ − u / 2 ) = P ( X ≥ e − u / 2 ) = 1 − e − u / 2 F_U(u) = P(-2\ln X \leq u) = P(\ln X \geq -u/2) = P(X \geq e^{-u/2}) = 1 - e^{-u/2} F U ( u ) = P ( − 2 ln X ≤ u ) = P ( ln X ≥ − u /2 ) = P ( X ≥ e − u /2 ) = 1 − e − u /2
PDF: f U ( u ) = 1 2 e − u / 2 f_U(u) = \frac{1}{2}e^{-u/2} f U ( u ) = 2 1 e − u /2 , for u ≥ 0 u \geq 0 u ≥ 0 .
This is an Exponential distribution with β = 2 \beta = 2 β = 2 , or equivalently a Gamma(1, 2) , or equivalently a χ 2 ( 2 ) \chi^2(2) χ 2 ( 2 ) distribution. This is actually a famous result used in random number generation: if X ∼ Unif ( 0 , 1 ) X \sim \text{Unif}(0,1) X ∼ Unif ( 0 , 1 ) , then − 2 ln ( X ) ∼ χ 2 ( 2 ) -2\ln(X) \sim \chi^2(2) − 2 ln ( X ) ∼ χ 2 ( 2 ) .
The CDF method is the universal tool for finding distributions of transformed random variables. It works for any function — linear, quadratic, logarithmic, involving one variable or many. The recipe is always the same: (1) find the range, (2) compute P ( U ≤ u ) P(U \leq u) P ( U ≤ u ) using the known distribution, (3) differentiate. The key pitfall is flipping inequalities when the function is decreasing or splitting into cases when it’s not one-to-one. In real life, this is how we go from knowing the distribution of an input (like humidity, raw power, or individual arrival times) to knowing the distribution of an output (like pressure, decibels, or total service time).
1.7 Section 7.2 Exercises ¶ Let X X X have PDF f X ( x ) = 3 x 2 f_X(x) = 3x^2 f X ( x ) = 3 x 2 for 0 ≤ x ≤ 1 0 \leq x \leq 1 0 ≤ x ≤ 1 . Use the CDF method to find the PDF of U = 1 − X U = 1 - X U = 1 − X .
Let X ∼ Exponential ( β = 2 ) X \sim \text{Exponential}(\beta = 2) X ∼ Exponential ( β = 2 ) , i.e., f X ( x ) = 1 2 e − x / 2 f_X(x) = \frac{1}{2}e^{-x/2} f X ( x ) = 2 1 e − x /2 for x > 0 x > 0 x > 0 . Find the PDF of U = X U = \sqrt{X} U = X using the CDF method.
Let X X X have PDF f X ( x ) = 1 2 ( x + 1 ) f_X(x) = \frac{1}{2}(x+1) f X ( x ) = 2 1 ( x + 1 ) for − 1 ≤ x ≤ 1 -1 \leq x \leq 1 − 1 ≤ x ≤ 1 . Find the PDF of U = ∣ X ∣ U = |X| U = ∣ X ∣ using the CDF method.
Let X X X and Y Y Y be independent Exponential(1) random variables. Use the CDF method to find the PDF of U = X + Y U = X + Y U = X + Y . (Hint: the region of integration for P ( X + Y ≤ u ) P(X + Y \leq u) P ( X + Y ≤ u ) is a triangle. )
Let X ∼ Uniform ( 0 , 1 ) X \sim \text{Uniform}(0, 1) X ∼ Uniform ( 0 , 1 ) . Find the PDF of U = X ( 1 − X ) U = X(1-X) U = X ( 1 − X ) . (This is challenging — think carefully about the range and whether the function is one-to-one. )
The CDF method always works, but it requires computing a CDF and then differentiating. When the transformation is one-to-one and differentiable , there’s a slicker approach: the transformation method (also called the change-of-variables method). It gives us the PDF of U U U directly from the PDF of X X X in a single formula — no CDF needed.
Real-Life Motivation: A pharmaceutical company knows that the half-life T T T of a drug in the bloodstream follows an Exponential distribution with rate λ \lambda λ . Pharmacologists don’t work with half-lives directly — they work with the decay rate R = 1 / T R = 1/T R = 1/ T . If we know the distribution of T T T , what’s the distribution of R R R ? Since R = 1 / T R = 1/T R = 1/ T is a one-to-one function, the transformation method gives us the answer in one step.
2.1 The Theorem ¶ Statement: Let X X X be a continuous random variable with PDF f X ( x ) f_X(x) f X ( x ) . Let U = h ( X ) U = h(X) U = h ( X ) , where h h h is a differentiable, one-to-one function over the support of X X X . Let h − 1 h^{-1} h − 1 denote the inverse function, so X = h − 1 ( U ) X = h^{-1}(U) X = h − 1 ( U ) . Then:
f U ( u ) = f X ( h − 1 ( u ) ) ⋅ ∣ d d u h − 1 ( u ) ∣ f_U(u) = f_X\!\left(h^{-1}(u)\right) \cdot \left|\frac{d}{du} h^{-1}(u)\right| f U ( u ) = f X ( h − 1 ( u ) ) ⋅ ∣ ∣ d u d h − 1 ( u ) ∣ ∣ Equivalently, if we write x = h − 1 ( u ) x = h^{-1}(u) x = h − 1 ( u ) :
f U ( u ) = f X ( x ) ⋅ ∣ d x d u ∣ f_U(u) = f_X(x) \cdot \left|\frac{dx}{du}\right| f U ( u ) = f X ( x ) ⋅ ∣ ∣ d u d x ∣ ∣ PROOF
Strategy: We derive this directly from the CDF method. We compute F U ( u ) F_U(u) F U ( u ) in each case, then differentiate using the chain rule. The absolute value naturally emerges from handling both increasing and decreasing functions.
Case 1: h h h is strictly increasing.
When h h h is increasing, h ( X ) ≤ u h(X) \leq u h ( X ) ≤ u if and only if X ≤ h − 1 ( u ) X \leq h^{-1}(u) X ≤ h − 1 ( u ) . (Why? Because an increasing function preserves the direction of inequalities: if a ≤ b a \leq b a ≤ b then h ( a ) ≤ h ( b ) h(a) \leq h(b) h ( a ) ≤ h ( b ) , so h ( X ) ≤ u ⟺ X ≤ h − 1 ( u ) h(X) \leq u \iff X \leq h^{-1}(u) h ( X ) ≤ u ⟺ X ≤ h − 1 ( u ) .)
Therefore:
F U ( u ) = P ( U ≤ u ) = P ( h ( X ) ≤ u ) = P ( X ≤ h − 1 ( u ) ) = F X ( h − 1 ( u ) ) F_U(u) = P(U \leq u) = P(h(X) \leq u) = P(X \leq h^{-1}(u)) = F_X(h^{-1}(u)) F U ( u ) = P ( U ≤ u ) = P ( h ( X ) ≤ u ) = P ( X ≤ h − 1 ( u )) = F X ( h − 1 ( u )) Differentiating with respect to u u u using the chain rule:
f U ( u ) = d d u F X ( h − 1 ( u ) ) = f X ( h − 1 ( u ) ) ⋅ d d u h − 1 ( u ) f_U(u) = \frac{d}{du} F_X(h^{-1}(u)) = f_X(h^{-1}(u)) \cdot \frac{d}{du}h^{-1}(u) f U ( u ) = d u d F X ( h − 1 ( u )) = f X ( h − 1 ( u )) ⋅ d u d h − 1 ( u ) Since h h h is increasing, h − 1 h^{-1} h − 1 is also increasing, so d d u h − 1 ( u ) > 0 \frac{d}{du}h^{-1}(u) > 0 d u d h − 1 ( u ) > 0 . The expression is already positive — no absolute value needed.
Case 2: h h h is strictly decreasing.
When h h h is decreasing, h ( X ) ≤ u h(X) \leq u h ( X ) ≤ u if and only if X ≥ h − 1 ( u ) X \geq h^{-1}(u) X ≥ h − 1 ( u ) . (Why? Because a decreasing function reverses the direction of inequalities: if a ≤ b a \leq b a ≤ b then h ( a ) ≥ h ( b ) h(a) \geq h(b) h ( a ) ≥ h ( b ) . So h ( X ) ≤ u h(X) \leq u h ( X ) ≤ u means X X X is on the side where h h h gives smaller values, which for a decreasing function is the right side — i.e., X ≥ h − 1 ( u ) X \geq h^{-1}(u) X ≥ h − 1 ( u ) .)
Therefore:
F U ( u ) = P ( U ≤ u ) = P ( h ( X ) ≤ u ) = P ( X ≥ h − 1 ( u ) ) = 1 − F X ( h − 1 ( u ) ) F_U(u) = P(U \leq u) = P(h(X) \leq u) = P(X \geq h^{-1}(u)) = 1 - F_X(h^{-1}(u)) F U ( u ) = P ( U ≤ u ) = P ( h ( X ) ≤ u ) = P ( X ≥ h − 1 ( u )) = 1 − F X ( h − 1 ( u )) Differentiating with respect to u u u using the chain rule:
f U ( u ) = d d u [ 1 − F X ( h − 1 ( u ) ) ] = − f X ( h − 1 ( u ) ) ⋅ d d u h − 1 ( u ) f_U(u) = \frac{d}{du}\left[1 - F_X(h^{-1}(u))\right] = -f_X(h^{-1}(u)) \cdot \frac{d}{du}h^{-1}(u) f U ( u ) = d u d [ 1 − F X ( h − 1 ( u )) ] = − f X ( h − 1 ( u )) ⋅ d u d h − 1 ( u ) Now, since h h h is decreasing, h − 1 h^{-1} h − 1 is also decreasing, so d d u h − 1 ( u ) < 0 \frac{d}{du}h^{-1}(u) < 0 d u d h − 1 ( u ) < 0 . The product of the negative sign out front and the negative derivative gives a positive result. This is exactly f X ( h − 1 ( u ) ) ⋅ ∣ d d u h − 1 ( u ) ∣ f_X(h^{-1}(u)) \cdot \left|\frac{d}{du}h^{-1}(u)\right| f X ( h − 1 ( u )) ⋅ ∣ ∣ d u d h − 1 ( u ) ∣ ∣ .
Combining both cases: In Case 1, the derivative is positive and equals its own absolute value. In Case 2, the negative signs cancel and again produce the absolute value. Therefore:
f U ( u ) = f X ( h − 1 ( u ) ) ⋅ ∣ d d u h − 1 ( u ) ∣ in both cases. f_U(u) = f_X(h^{-1}(u)) \cdot \left|\frac{d}{du}h^{-1}(u)\right| \quad \text{in both cases.} f U ( u ) = f X ( h − 1 ( u )) ⋅ ∣ ∣ d u d h − 1 ( u ) ∣ ∣ in both cases. ∎
WHY THIS MATTERS: The absolute value of the derivative ∣ d x / d u ∣ |dx/du| ∣ d x / d u ∣ acts as a “stretching factor.” It tells you how much the transformation compresses or expands probability density at each point. When h h h stretches the x x x -axis (large ∣ d x / d u ∣ |dx/du| ∣ d x / d u ∣ ), probability density gets diluted ; when it compresses (small ∣ d x / d u ∣ |dx/du| ∣ d x / d u ∣ ), density gets concentrated .
Theorem 7.1 requires h h h to be one-to-one. But what if it isn’t? For example, U = X 2 U = X^2 U = X 2 when X X X ranges over both positive and negative values — both x = 0.5 x = 0.5 x = 0.5 and x = − 0.5 x = -0.5 x = − 0.5 give U = 0.25 U = 0.25 U = 0.25 . We handled this with the CDF method in Example 7.2, but there’s also a direct formula:
Let X X X have PDF f X ( x ) f_X(x) f X ( x ) with support that can be partitioned into k k k intervals A 1 , A 2 , … , A k A_1, A_2, \ldots, A_k A 1 , A 2 , … , A k such that h h h is one-to-one on each A i A_i A i . Let h i − 1 ( u ) h_i^{-1}(u) h i − 1 ( u ) denote the inverse of h h h restricted to A i A_i A i . Then:
f U ( u ) = ∑ i = 1 k f X ( h i − 1 ( u ) ) ⋅ ∣ d d u h i − 1 ( u ) ∣ f_U(u) = \sum_{i=1}^k f_X(h_i^{-1}(u)) \cdot \left|\frac{d}{du}h_i^{-1}(u)\right| f U ( u ) = i = 1 ∑ k f X ( h i − 1 ( u )) ⋅ ∣ ∣ d u d h i − 1 ( u ) ∣ ∣ In words: split the domain into pieces where h h h is one-to-one, apply Theorem 7.1 to each piece, and add the results.
The Problem.
Let X ∼ Uniform ( − 1 , 1 ) X \sim \text{Uniform}(-1, 1) X ∼ Uniform ( − 1 , 1 ) , so f X ( x ) = 1 / 2 f_X(x) = 1/2 f X ( x ) = 1/2 for − 1 ≤ x ≤ 1 -1 \leq x \leq 1 − 1 ≤ x ≤ 1 . Find the PDF of U = X 2 U = X^2 U = X 2 .
Solution.
The function h ( x ) = x 2 h(x) = x^2 h ( x ) = x 2 is not one-to-one on [ − 1 , 1 ] [-1, 1] [ − 1 , 1 ] . But we can split the domain into two pieces where it IS one-to-one:
A 1 = [ − 1 , 0 ) A_1 = [-1, 0) A 1 = [ − 1 , 0 ) : here h h h is decreasing, and h 1 − 1 ( u ) = − u h_1^{-1}(u) = -\sqrt{u} h 1 − 1 ( u ) = − u , so d d u ( − u ) = − 1 2 u \frac{d}{du}(-\sqrt{u}) = \frac{-1}{2\sqrt{u}} d u d ( − u ) = 2 u − 1
A 2 = ( 0 , 1 ] A_2 = (0, 1] A 2 = ( 0 , 1 ] : here h h h is increasing, and h 2 − 1 ( u ) = + u h_2^{-1}(u) = +\sqrt{u} h 2 − 1 ( u ) = + u , so d d u ( u ) = 1 2 u \frac{d}{du}(\sqrt{u}) = \frac{1}{2\sqrt{u}} d u d ( u ) = 2 u 1
Applying Theorem 7.1b:
f U ( u ) = f X ( − u ) ⋅ ∣ − 1 2 u ∣ + f X ( u ) ⋅ ∣ 1 2 u ∣ f_U(u) = f_X(-\sqrt{u}) \cdot \left|\frac{-1}{2\sqrt{u}}\right| + f_X(\sqrt{u}) \cdot \left|\frac{1}{2\sqrt{u}}\right| f U ( u ) = f X ( − u ) ⋅ ∣ ∣ 2 u − 1 ∣ ∣ + f X ( u ) ⋅ ∣ ∣ 2 u 1 ∣ ∣ = 1 2 ⋅ 1 2 u + 1 2 ⋅ 1 2 u = 1 2 u , 0 < u ≤ 1 = \frac{1}{2} \cdot \frac{1}{2\sqrt{u}} + \frac{1}{2} \cdot \frac{1}{2\sqrt{u}} = \frac{1}{2\sqrt{u}}, \quad 0 < u \leq 1 = 2 1 ⋅ 2 u 1 + 2 1 ⋅ 2 u 1 = 2 u 1 , 0 < u ≤ 1 This matches the Beta(1/2, 1) distribution, and we can verify: ∫ 0 1 1 2 u d u = [ u ] 0 1 = 1 \int_0^1 \frac{1}{2\sqrt{u}}\,du = \left[\sqrt{u}\right]_0^1 = 1 ∫ 0 1 2 u 1 d u = [ u ] 0 1 = 1 ✓
When to Use Which.
For not-one-to-one functions, you have two options: the CDF method (Example 7.2) or the split-domain formula (this example). Both give the same answer. Use whichever feels more natural — the CDF method requires less memorization, while the split-domain formula is faster once you’re comfortable with it.
2.3 Worked Examples ¶ The Problem.
Let X X X have PDF f X ( x ) = 2 x f_X(x) = 2x f X ( x ) = 2 x for 0 ≤ x ≤ 1 0 \leq x \leq 1 0 ≤ x ≤ 1 . Find the PDF of U = 3 X − 1 U = 3X - 1 U = 3 X − 1 using the transformation method. (This is the same as Example 7.1 — we verify the methods agree.)
Solution.
Step 1: Solve for X X X in terms of U U U .
U = 3 X − 1 ⟹ X = h − 1 ( U ) = U + 1 3 U = 3X - 1 \implies X = h^{-1}(U) = \frac{U + 1}{3} U = 3 X − 1 ⟹ X = h − 1 ( U ) = 3 U + 1
Step 2: Compute ∣ d x / d u ∣ |dx/du| ∣ d x / d u ∣ .
∣ d x d u ∣ = ∣ d d u u + 1 3 ∣ = 1 3 \left|\frac{dx}{du}\right| = \left|\frac{d}{du}\frac{u+1}{3}\right| = \frac{1}{3} ∣ ∣ d u d x ∣ ∣ = ∣ ∣ d u d 3 u + 1 ∣ ∣ = 3 1 Step 3: Apply the formula.
f U ( u ) = f X ( u + 1 3 ) ⋅ 1 3 = 2 ⋅ u + 1 3 ⋅ 1 3 = 2 ( u + 1 ) 9 , − 1 ≤ u ≤ 2 f_U(u) = f_X\!\left(\frac{u+1}{3}\right) \cdot \frac{1}{3} = 2 \cdot \frac{u+1}{3} \cdot \frac{1}{3} = \frac{2(u+1)}{9}, \quad -1 \leq u \leq 2 f U ( u ) = f X ( 3 u + 1 ) ⋅ 3 1 = 2 ⋅ 3 u + 1 ⋅ 3 1 = 9 2 ( u + 1 ) , − 1 ≤ u ≤ 2 This matches Example 7.1 exactly. ✓
The Problem.
Let X ∼ Beta ( 6 , 2 ) X \sim \text{Beta}(6, 2) X ∼ Beta ( 6 , 2 ) , and let U = 1 − X U = 1 - X U = 1 − X . Find the PDF of U U U using the transformation method.
Solution.
The PDF of X ∼ Beta ( 6 , 2 ) X \sim \text{Beta}(6, 2) X ∼ Beta ( 6 , 2 ) is:
f X ( x ) = Γ ( 8 ) Γ ( 6 ) Γ ( 2 ) x 5 ( 1 − x ) 1 = 7 ! 5 ! ⋅ 1 ! x 5 ( 1 − x ) = 42 x 5 ( 1 − x ) , 0 ≤ x ≤ 1 f_X(x) = \frac{\Gamma(8)}{\Gamma(6)\Gamma(2)} x^5(1-x)^1 = \frac{7!}{5! \cdot 1!} x^5(1-x) = 42 x^5(1-x), \quad 0 \leq x \leq 1 f X ( x ) = Γ ( 6 ) Γ ( 2 ) Γ ( 8 ) x 5 ( 1 − x ) 1 = 5 ! ⋅ 1 ! 7 ! x 5 ( 1 − x ) = 42 x 5 ( 1 − x ) , 0 ≤ x ≤ 1 Step 1: U = 1 − X ⟹ X = 1 − U U = 1 - X \implies X = 1 - U U = 1 − X ⟹ X = 1 − U , so h − 1 ( u ) = 1 − u h^{-1}(u) = 1 - u h − 1 ( u ) = 1 − u .
Step 2: ∣ d x d u ∣ = ∣ − 1 ∣ = 1 \left|\frac{dx}{du}\right| = |-1| = 1 ∣ ∣ d u d x ∣ ∣ = ∣ − 1∣ = 1 .
Step 3:
f U ( u ) = 42 ( 1 − u ) 5 ⋅ u ⋅ 1 = 42 u ( 1 − u ) 5 , 0 ≤ u ≤ 1 f_U(u) = 42(1-u)^5 \cdot u \cdot 1 = 42 u(1-u)^5, \quad 0 \leq u \leq 1 f U ( u ) = 42 ( 1 − u ) 5 ⋅ u ⋅ 1 = 42 u ( 1 − u ) 5 , 0 ≤ u ≤ 1 This is a Beta(2, 6) distribution! The transformation U = 1 − X U = 1 - X U = 1 − X swaps the two parameters of the Beta distribution. This is a general result: if X ∼ Beta ( α , β ) X \sim \text{Beta}(\alpha, \beta) X ∼ Beta ( α , β ) , then 1 − X ∼ Beta ( β , α ) 1 - X \sim \text{Beta}(\beta, \alpha) 1 − X ∼ Beta ( β , α ) .
The Problem.
Let X ∼ Exponential ( β ) X \sim \text{Exponential}(\beta) X ∼ Exponential ( β ) , with PDF f X ( x ) = 1 β e − x / β f_X(x) = \frac{1}{\beta}e^{-x/\beta} f X ( x ) = β 1 e − x / β for x > 0 x > 0 x > 0 . Find the PDF of U = X U = \sqrt{X} U = X using the transformation method.
Solution.
Step 1: U = X ⟹ X = U 2 U = \sqrt{X} \implies X = U^2 U = X ⟹ X = U 2 , so h − 1 ( u ) = u 2 h^{-1}(u) = u^2 h − 1 ( u ) = u 2 .
Step 2: ∣ d x d u ∣ = ∣ 2 u ∣ = 2 u \left|\frac{dx}{du}\right| = |2u| = 2u ∣ ∣ d u d x ∣ ∣ = ∣2 u ∣ = 2 u (since u > 0 u > 0 u > 0 ).
Step 3:
f U ( u ) = 1 β e − u 2 / β ⋅ 2 u = 2 u β e − u 2 / β , u > 0 f_U(u) = \frac{1}{\beta} e^{-u^2/\beta} \cdot 2u = \frac{2u}{\beta} e^{-u^2/\beta}, \quad u > 0 f U ( u ) = β 1 e − u 2 / β ⋅ 2 u = β 2 u e − u 2 / β , u > 0 This is a Weibull distribution with shape parameter 2 and scale parameter β \sqrt{\beta} β , sometimes called the Rayleigh distribution (up to parameterization). In engineering, it models wind speeds and the magnitude of 2D vectors with independent normal components.
The Problem.
Let X ∼ Uniform ( 1 , 5 ) X \sim \text{Uniform}(1, 5) X ∼ Uniform ( 1 , 5 ) . Find the PDF of U = 2 X 2 + 3 U = 2X^2 + 3 U = 2 X 2 + 3 using the transformation method.
Solution.
Since X ∈ [ 1 , 5 ] X \in [1, 5] X ∈ [ 1 , 5 ] (all positive), h ( x ) = 2 x 2 + 3 h(x) = 2x^2 + 3 h ( x ) = 2 x 2 + 3 is one-to-one (strictly increasing) on this domain.
Step 1: U = 2 X 2 + 3 ⟹ X 2 = U − 3 2 ⟹ X = U − 3 2 U = 2X^2 + 3 \implies X^2 = \frac{U - 3}{2} \implies X = \sqrt{\frac{U-3}{2}} U = 2 X 2 + 3 ⟹ X 2 = 2 U − 3 ⟹ X = 2 U − 3 (positive root, since X > 0 X > 0 X > 0 ).
Range of U U U : When x = 1 x = 1 x = 1 : U = 5 U = 5 U = 5 . When x = 5 x = 5 x = 5 : U = 53 U = 53 U = 53 . So U ∈ [ 5 , 53 ] U \in [5, 53] U ∈ [ 5 , 53 ] .
Step 2: We need d x d u \frac{dx}{du} d u d x where x = u − 3 2 = ( u − 3 2 ) 1 / 2 x = \sqrt{\frac{u-3}{2}} = \left(\frac{u-3}{2}\right)^{1/2} x = 2 u − 3 = ( 2 u − 3 ) 1/2 .
(Calculus flashback: This requires the Chain Rule on a composite function. Let w = u − 3 2 w = \frac{u-3}{2} w = 2 u − 3 , so x = w 1 / 2 x = w^{1/2} x = w 1/2 . Then d x d u = d x d w ⋅ d w d u = 1 2 w − 1 / 2 ⋅ 1 2 \frac{dx}{du} = \frac{dx}{dw} \cdot \frac{dw}{du} = \frac{1}{2}w^{-1/2} \cdot \frac{1}{2} d u d x = d w d x ⋅ d u d w = 2 1 w − 1/2 ⋅ 2 1 .)
d x d u = 1 2 ( u − 3 2 ) − 1 / 2 ⋅ 1 2 = 1 4 ( u − 3 ) / 2 \frac{dx}{du} = \frac{1}{2}\left(\frac{u-3}{2}\right)^{-1/2} \cdot \frac{1}{2} = \frac{1}{4\sqrt{(u-3)/2}} d u d x = 2 1 ( 2 u − 3 ) − 1/2 ⋅ 2 1 = 4 ( u − 3 ) /2 1 To simplify: 1 4 ( u − 3 ) / 2 = 1 4 ⋅ 2 u − 3 = 2 4 u − 3 = 1 2 2 u − 3 = 1 2 2 ( u − 3 ) \frac{1}{4\sqrt{(u-3)/2}} = \frac{1}{4} \cdot \frac{\sqrt{2}}{\sqrt{u-3}} = \frac{\sqrt{2}}{4\sqrt{u-3}} = \frac{1}{2\sqrt{2}\sqrt{u-3}} = \frac{1}{2\sqrt{2(u-3)}} 4 ( u − 3 ) /2 1 = 4 1 ⋅ u − 3 2 = 4 u − 3 2 = 2 2 u − 3 1 = 2 2 ( u − 3 ) 1
Step 3: f X ( x ) = 1 4 f_X(x) = \frac{1}{4} f X ( x ) = 4 1 (Uniform on [ 1 , 5 ] [1,5] [ 1 , 5 ] ), so:
f U ( u ) = 1 4 ⋅ 1 2 2 ( u − 3 ) = 1 8 2 ( u − 3 ) , 5 ≤ u ≤ 53 f_U(u) = \frac{1}{4} \cdot \frac{1}{2\sqrt{2(u-3)}} = \frac{1}{8\sqrt{2(u-3)}}, \quad 5 \leq u \leq 53 f U ( u ) = 4 1 ⋅ 2 2 ( u − 3 ) 1 = 8 2 ( u − 3 ) 1 , 5 ≤ u ≤ 53 Let Z ∼ N ( 0 , 1 ) Z \sim N(0, 1) Z ∼ N ( 0 , 1 ) (standard normal). Show that U = Z 2 ∼ χ 2 ( 1 ) U = Z^2 \sim \chi^2(1) U = Z 2 ∼ χ 2 ( 1 ) .
Hint: Since Z Z Z ranges over ( − ∞ , ∞ ) (-\infty, \infty) ( − ∞ , ∞ ) and g ( z ) = z 2 g(z) = z^2 g ( z ) = z 2 is not one-to-one, you can’t use the transformation method directly. Use the CDF method instead, being careful with P ( Z 2 ≤ u ) = P ( − u ≤ Z ≤ u ) P(Z^2 \leq u) = P(-\sqrt{u} \leq Z \leq \sqrt{u}) P ( Z 2 ≤ u ) = P ( − u ≤ Z ≤ u ) . Then recognize the resulting PDF as a Gamma distribution.
F U ( u ) = P ( Z 2 ≤ u ) = P ( − u ≤ Z ≤ u ) = Φ ( u ) − Φ ( − u ) = 2 Φ ( u ) − 1 F_U(u) = P(Z^2 \leq u) = P(-\sqrt{u} \leq Z \leq \sqrt{u}) = \Phi(\sqrt{u}) - \Phi(-\sqrt{u}) = 2\Phi(\sqrt{u}) - 1 F U ( u ) = P ( Z 2 ≤ u ) = P ( − u ≤ Z ≤ u ) = Φ ( u ) − Φ ( − u ) = 2Φ ( u ) − 1
where Φ \Phi Φ is the standard normal CDF.
Differentiating (using the chain rule and Φ ′ ( z ) = ϕ ( z ) = 1 2 π e − z 2 / 2 \Phi'(z) = \phi(z) = \frac{1}{\sqrt{2\pi}}e^{-z^2/2} Φ ′ ( z ) = ϕ ( z ) = 2 π 1 e − z 2 /2 ):
f U ( u ) = 2 ⋅ 1 2 π e − u / 2 ⋅ 1 2 u = 1 2 π u − 1 / 2 e − u / 2 , u > 0 f_U(u) = 2 \cdot \frac{1}{\sqrt{2\pi}} e^{-u/2} \cdot \frac{1}{2\sqrt{u}} = \frac{1}{\sqrt{2\pi}} u^{-1/2} e^{-u/2}, \quad u > 0 f U ( u ) = 2 ⋅ 2 π 1 e − u /2 ⋅ 2 u 1 = 2 π 1 u − 1/2 e − u /2 , u > 0 This can be written as f U ( u ) = 1 2 1 / 2 Γ ( 1 / 2 ) u 1 / 2 − 1 e − u / 2 f_U(u) = \frac{1}{2^{1/2}\Gamma(1/2)} u^{1/2 - 1} e^{-u/2} f U ( u ) = 2 1/2 Γ ( 1/2 ) 1 u 1/2 − 1 e − u /2 , which is the PDF of a Gamma ( 1 / 2 , 2 ) \text{Gamma}(1/2, 2) Gamma ( 1/2 , 2 ) distribution.
Since χ 2 ( ν ) \chi^2(\nu) χ 2 ( ν ) is defined as Gamma ( ν / 2 , 2 ) \text{Gamma}(\nu/2, 2) Gamma ( ν /2 , 2 ) , and here ν / 2 = 1 / 2 \nu/2 = 1/2 ν /2 = 1/2 gives ν = 1 \nu = 1 ν = 1 , we have U ∼ χ 2 ( 1 ) U \sim \chi^2(1) U ∼ χ 2 ( 1 ) . ∎
This result is foundational for mathematical statistics — the entire χ 2 \chi^2 χ 2 distribution family is built from it.
The transformation method gives us a one-step formula for the PDF of U = h ( X ) U = h(X) U = h ( X ) when h h h is one-to-one: just evaluate the original PDF at the inverse, and multiply by the absolute value of the derivative of the inverse (the Jacobian). The Jacobian acts as a stretching/compression factor for probability density. In practice, this is the fastest method for unit conversions (Celsius → Fahrenheit), parameter reparameterizations (half-life → decay rate), and any one-to-one transformation. The key limitation: it requires h h h to be one-to-one. When it isn’t (like U = X 2 U = X^2 U = X 2 on a domain that includes both positive and negative values), we fall back to the CDF method.
2.4 Section 7.3 Exercises ¶ Let X ∼ Uniform ( 0 , 1 ) X \sim \text{Uniform}(0, 1) X ∼ Uniform ( 0 , 1 ) . Use the transformation method to find the PDF of U = e X U = e^X U = e X .
Let X X X have PDF f X ( x ) = 4 x 3 f_X(x) = 4x^3 f X ( x ) = 4 x 3 for 0 ≤ x ≤ 1 0 \leq x \leq 1 0 ≤ x ≤ 1 . Use the transformation method to find the PDF of U = − ln ( X ) U = -\ln(X) U = − ln ( X ) .
Let X ∼ Exponential ( β = 1 ) X \sim \text{Exponential}(\beta = 1) X ∼ Exponential ( β = 1 ) . Use the transformation method to find the PDF of U = e − X U = e^{-X} U = e − X . What well-known distribution is this?
If Y ∼ N ( μ , σ 2 ) Y \sim N(\mu, \sigma^2) Y ∼ N ( μ , σ 2 ) , show that Z = Y − μ σ ∼ N ( 0 , 1 ) Z = \frac{Y - \mu}{\sigma} \sim N(0, 1) Z = σ Y − μ ∼ N ( 0 , 1 ) using the transformation method.
Let X ∼ Gamma ( α , β ) X \sim \text{Gamma}(\alpha, \beta) X ∼ Gamma ( α , β ) . Use the transformation method to find the PDF of U = c X U = cX U = c X for a positive constant c c c . Verify that U ∼ Gamma ( α , c β ) U \sim \text{Gamma}(\alpha, c\beta) U ∼ Gamma ( α , c β ) .
3 The Method of Moment-Generating Functions ¶ The CDF and transformation methods work by directly computing the new PDF. The MGF method takes a completely different approach: instead of finding the PDF, we find the moment generating function of U U U and then recognize it as the MGF of a known distribution. Since MGFs uniquely determine distributions (Theorem 4.11 from Chapter 4), this identification is rigorous.
Real-Life Motivation: An airline wants to model the total delay across 5 independent flight segments, where each segment’s delay follows a Gamma distribution. The total delay is a sum: U = X 1 + X 2 + ⋯ + X 5 U = X_1 + X_2 + \cdots + X_5 U = X 1 + X 2 + ⋯ + X 5 . Computing the PDF of this sum via the CDF method would require a 5-fold convolution integral — nightmarish. But the MGF method reduces it to multiplying five simple functions and recognizing the result. Two lines of algebra instead of five pages of calculus.
3.1 The Key Principle ¶ The MGF method rests on one powerful theorem from Chapter 4:
If two random variables U U U and V V V have the same moment generating function, M U ( t ) = M V ( t ) M_U(t) = M_V(t) M U ( t ) = M V ( t ) , for all t t t in an open interval containing 0, then U U U and V V V have the same distribution.
This means: if we compute M U ( t ) M_U(t) M U ( t ) and it matches the MGF of a known distribution, then U U U has that distribution. No integration needed.
3.2 The Recipe for Sums ¶ The MGF method is especially powerful for sums of independent random variables , because of the multiplication property:
If X 1 , X 2 , … , X n X_1, X_2, \ldots, X_n X 1 , X 2 , … , X n are independent random variables and U = X 1 + X 2 + ⋯ + X n U = X_1 + X_2 + \cdots + X_n U = X 1 + X 2 + ⋯ + X n , then:
M U ( t ) = M X 1 ( t ) ⋅ M X 2 ( t ) ⋯ M X n ( t ) = ∏ i = 1 n M X i ( t ) M_U(t) = M_{X_1}(t) \cdot M_{X_2}(t) \cdots M_{X_n}(t) = \prod_{i=1}^n M_{X_i}(t) M U ( t ) = M X 1 ( t ) ⋅ M X 2 ( t ) ⋯ M X n ( t ) = i = 1 ∏ n M X i ( t ) PROOF
Strategy: Use the definition of the MGF and the fact that independence lets us factor a joint expectation into a product of individual expectations.
By definition, the MGF of U U U is:
M U ( t ) = E ( e t U ) = E ( e t ( X 1 + X 2 + ⋯ + X n ) ) M_U(t) = E(e^{tU}) = E\left(e^{t(X_1 + X_2 + \cdots + X_n)}\right) M U ( t ) = E ( e t U ) = E ( e t ( X 1 + X 2 + ⋯ + X n ) ) (Calculus flashback: The exponent rule e a + b = e a ⋅ e b e^{a+b} = e^a \cdot e^b e a + b = e a ⋅ e b extends to sums: e t ( X 1 + X 2 + ⋯ + X n ) = e t X 1 ⋅ e t X 2 ⋯ e t X n e^{t(X_1 + X_2 + \cdots + X_n)} = e^{tX_1} \cdot e^{tX_2} \cdots e^{tX_n} e t ( X 1 + X 2 + ⋯ + X n ) = e t X 1 ⋅ e t X 2 ⋯ e t X n . This is the key step — it converts a sum inside an exponent into a product of exponentials.)
Using this rule:
M U ( t ) = E ( e t X 1 ⋅ e t X 2 ⋯ e t X n ) M_U(t) = E\left(e^{tX_1} \cdot e^{tX_2} \cdots e^{tX_n}\right) M U ( t ) = E ( e t X 1 ⋅ e t X 2 ⋯ e t X n ) Now we use independence. Recall from Chapter 6 that if X 1 , … , X n X_1, \ldots, X_n X 1 , … , X n are independent, then for any functions g 1 , … , g n g_1, \ldots, g_n g 1 , … , g n :
E [ g 1 ( X 1 ) ⋅ g 2 ( X 2 ) ⋯ g n ( X n ) ] = E [ g 1 ( X 1 ) ] ⋅ E [ g 2 ( X 2 ) ] ⋯ E [ g n ( X n ) ] E\left[g_1(X_1) \cdot g_2(X_2) \cdots g_n(X_n)\right] = E[g_1(X_1)] \cdot E[g_2(X_2)] \cdots E[g_n(X_n)] E [ g 1 ( X 1 ) ⋅ g 2 ( X 2 ) ⋯ g n ( X n ) ] = E [ g 1 ( X 1 )] ⋅ E [ g 2 ( X 2 )] ⋯ E [ g n ( X n )] Applying this with g i ( X i ) = e t X i g_i(X_i) = e^{tX_i} g i ( X i ) = e t X i :
M U ( t ) = E ( e t X 1 ) ⋅ E ( e t X 2 ) ⋯ E ( e t X n ) = M X 1 ( t ) ⋅ M X 2 ( t ) ⋯ M X n ( t ) M_U(t) = E(e^{tX_1}) \cdot E(e^{tX_2}) \cdots E(e^{tX_n}) = M_{X_1}(t) \cdot M_{X_2}(t) \cdots M_{X_n}(t) M U ( t ) = E ( e t X 1 ) ⋅ E ( e t X 2 ) ⋯ E ( e t X n ) = M X 1 ( t ) ⋅ M X 2 ( t ) ⋯ M X n ( t ) ∎
WHY THIS IS SO POWERFUL: Without this theorem, finding the PDF of a sum X 1 + X 2 + ⋯ + X n X_1 + X_2 + \cdots + X_n X 1 + X 2 + ⋯ + X n would require computing an ( n − 1 ) (n-1) ( n − 1 ) -fold convolution integral — a nightmare for n > 2 n > 2 n > 2 . This theorem reduces the problem to multiplying n n n simple functions and recognizing the result. Multiplication is always easier than convolution.
3.3 Worked Examples ¶ The Problem.
Let X 1 , X 2 , … , X n X_1, X_2, \ldots, X_n X 1 , X 2 , … , X n be independent with X i ∼ N ( μ i , σ i 2 ) X_i \sim N(\mu_i, \sigma_i^2) X i ∼ N ( μ i , σ i 2 ) . Let a 1 , a 2 , … , a n a_1, a_2, \ldots, a_n a 1 , a 2 , … , a n be constants. Show that:
U = ∑ i = 1 n a i X i ∼ N ( ∑ i = 1 n a i μ i , ∑ i = 1 n a i 2 σ i 2 ) U = \sum_{i=1}^n a_i X_i \sim N\!\left(\sum_{i=1}^n a_i \mu_i, \; \sum_{i=1}^n a_i^2 \sigma_i^2\right) U = i = 1 ∑ n a i X i ∼ N ( i = 1 ∑ n a i μ i , i = 1 ∑ n a i 2 σ i 2 ) Solution.
Recall from Chapter 5 that the MGF of X i ∼ N ( μ i , σ i 2 ) X_i \sim N(\mu_i, \sigma_i^2) X i ∼ N ( μ i , σ i 2 ) is:
M X i ( t ) = exp ( μ i t + σ i 2 t 2 2 ) M_{X_i}(t) = \exp\!\left(\mu_i t + \frac{\sigma_i^2 t^2}{2}\right) M X i ( t ) = exp ( μ i t + 2 σ i 2 t 2 ) The MGF of a i X i a_i X_i a i X i is obtained by evaluating M X i M_{X_i} M X i at a i t a_i t a i t (since E ( e t ⋅ a i X i ) = E ( e ( a i t ) X i ) = M X i ( a i t ) E(e^{t \cdot a_i X_i}) = E(e^{(a_i t) X_i}) = M_{X_i}(a_i t) E ( e t ⋅ a i X i ) = E ( e ( a i t ) X i ) = M X i ( a i t ) ):
M a i X i ( t ) = M X i ( a i t ) = exp ( μ i ( a i t ) + σ i 2 ( a i t ) 2 2 ) = exp ( a i μ i t + a i 2 σ i 2 t 2 2 ) M_{a_i X_i}(t) = M_{X_i}(a_i t) = \exp\!\left(\mu_i (a_i t) + \frac{\sigma_i^2 (a_i t)^2}{2}\right) = \exp\!\left(a_i \mu_i t + \frac{a_i^2 \sigma_i^2 t^2}{2}\right) M a i X i ( t ) = M X i ( a i t ) = exp ( μ i ( a i t ) + 2 σ i 2 ( a i t ) 2 ) = exp ( a i μ i t + 2 a i 2 σ i 2 t 2 ) By Theorem 7.2 (independence):
M U ( t ) = ∏ i = 1 n M a i X i ( t ) = ∏ i = 1 n exp ( a i μ i t + a i 2 σ i 2 t 2 2 ) M_U(t) = \prod_{i=1}^n M_{a_i X_i}(t) = \prod_{i=1}^n \exp\!\left(a_i \mu_i t + \frac{a_i^2 \sigma_i^2 t^2}{2}\right) M U ( t ) = i = 1 ∏ n M a i X i ( t ) = i = 1 ∏ n exp ( a i μ i t + 2 a i 2 σ i 2 t 2 ) (Calculus flashback: When we multiply exponentials, the exponents add: e A 1 ⋅ e A 2 ⋯ e A n = e A 1 + A 2 + ⋯ + A n e^{A_1} \cdot e^{A_2} \cdots e^{A_n} = e^{A_1 + A_2 + \cdots + A_n} e A 1 ⋅ e A 2 ⋯ e A n = e A 1 + A 2 + ⋯ + A n . So the product above becomes a single exponential whose exponent is the sum of all the individual exponents.)
= exp ( ∑ i = 1 n ( a i μ i t + a i 2 σ i 2 t 2 2 ) ) = exp ( ( ∑ i = 1 n a i μ i ) t + ( ∑ i = 1 n a i 2 σ i 2 ) t 2 2 ) = \exp\!\left(\sum_{i=1}^n \left(a_i \mu_i t + \frac{a_i^2 \sigma_i^2 t^2}{2}\right)\right) = \exp\!\left(\left(\sum_{i=1}^n a_i \mu_i\right) t + \frac{\left(\sum_{i=1}^n a_i^2 \sigma_i^2\right) t^2}{2}\right) = exp ( i = 1 ∑ n ( a i μ i t + 2 a i 2 σ i 2 t 2 ) ) = exp ( ( i = 1 ∑ n a i μ i ) t + 2 ( ∑ i = 1 n a i 2 σ i 2 ) t 2 ) This is the MGF of a N ( ∑ a i μ i , ∑ a i 2 σ i 2 ) N\!\left(\sum a_i \mu_i, \sum a_i^2 \sigma_i^2\right) N ( ∑ a i μ i , ∑ a i 2 σ i 2 ) distribution. By the uniqueness theorem, U U U has this distribution. ∎
Why This Matters.
This result is used constantly in statistics and finance. Any linear combination of independent normal random variables is normal. This means: if stock returns are normally distributed and independent, any portfolio’s return is also normal. If measurement errors are normal and independent, the total error is normal. The normal family is closed under linear combination — this is one of the properties that makes it so central to statistical theory.
In R.
# Verify: if X1 ~ N(3, 4) and X2 ~ N(-1, 9), then U = 2X1 + 3X2 ~ N(2(3)+3(-1), 4(4)+9(9)) = N(3, 97)
set.seed(42)
n <- 100000
x1 <- rnorm(n, mean = 3, sd = 2) # N(3, 4)
x2 <- rnorm(n, mean = -1, sd = 3) # N(-1, 9)
u <- 2*x1 + 3*x2
cat("Theoretical: N(3, 97), i.e., mean = 3, sd =", sqrt(97), "\n")
cat("Simulated: mean =", round(mean(u), 3), "sd =", round(sd(u), 3), "\n")
hist(u, breaks = 60, freq = FALSE, col = "steelblue", border = "white",
main = "U = 2X₁ + 3X₂ is Normal")
curve(dnorm(x, mean = 3, sd = sqrt(97)), add = TRUE, col = "red", lwd = 2)The Problem.
Let X 1 , X 2 , … , X n X_1, X_2, \ldots, X_n X 1 , X 2 , … , X n be independent with X i ∼ Gamma ( α i , β ) X_i \sim \text{Gamma}(\alpha_i, \beta) X i ∼ Gamma ( α i , β ) (same scale β \beta β ). Show that:
U = X 1 + X 2 + ⋯ + X n ∼ Gamma ( α 1 + α 2 + ⋯ + α n , β ) U = X_1 + X_2 + \cdots + X_n \sim \text{Gamma}(\alpha_1 + \alpha_2 + \cdots + \alpha_n, \; \beta) U = X 1 + X 2 + ⋯ + X n ∼ Gamma ( α 1 + α 2 + ⋯ + α n , β ) Solution.
The MGF of X i ∼ Gamma ( α i , β ) X_i \sim \text{Gamma}(\alpha_i, \beta) X i ∼ Gamma ( α i , β ) is M X i ( t ) = ( 1 − β t ) − α i M_{X_i}(t) = (1 - \beta t)^{-\alpha_i} M X i ( t ) = ( 1 − βt ) − α i for t < 1 / β t < 1/\beta t < 1/ β .
M U ( t ) = ∏ i = 1 n ( 1 − β t ) − α i M_U(t) = \prod_{i=1}^n (1 - \beta t)^{-\alpha_i} M U ( t ) = i = 1 ∏ n ( 1 − βt ) − α i (Calculus flashback: When we multiply powers with the same base, the exponents add: a m ⋅ a n = a m + n a^m \cdot a^n = a^{m+n} a m ⋅ a n = a m + n . Here the base is ( 1 − β t ) (1 - \beta t) ( 1 − βt ) and the exponents are − α 1 , − α 2 , … , − α n -\alpha_1, -\alpha_2, \ldots, -\alpha_n − α 1 , − α 2 , … , − α n .)
= ( 1 − β t ) − α 1 ⋅ ( 1 − β t ) − α 2 ⋯ ( 1 − β t ) − α n = ( 1 − β t ) − ( α 1 + α 2 + ⋯ + α n ) = (1 - \beta t)^{-\alpha_1} \cdot (1 - \beta t)^{-\alpha_2} \cdots (1 - \beta t)^{-\alpha_n} = (1 - \beta t)^{-(\alpha_1 + \alpha_2 + \cdots + \alpha_n)} = ( 1 − βt ) − α 1 ⋅ ( 1 − βt ) − α 2 ⋯ ( 1 − βt ) − α n = ( 1 − βt ) − ( α 1 + α 2 + ⋯ + α n ) This is the MGF of Gamma ( α 1 + ⋯ + α n , β ) \text{Gamma}(\alpha_1 + \cdots + \alpha_n, \beta) Gamma ( α 1 + ⋯ + α n , β ) . By uniqueness, U U U has this distribution. ∎
Important Special Cases.
Since Exponential ( β ) = Gamma ( 1 , β ) \text{Exponential}(\beta) = \text{Gamma}(1, \beta) Exponential ( β ) = Gamma ( 1 , β ) and χ 2 ( ν ) = Gamma ( ν / 2 , 2 ) \chi^2(\nu) = \text{Gamma}(\nu/2, 2) χ 2 ( ν ) = Gamma ( ν /2 , 2 ) :
If X 1 , … , X n X_1, \ldots, X_n X 1 , … , X n are iid Exponential ( β ) \text{Exponential}(\beta) Exponential ( β ) , then U = ∑ X i ∼ Gamma ( n , β ) U = \sum X_i \sim \text{Gamma}(n, \beta) U = ∑ X i ∼ Gamma ( n , β ) .
If X 1 , … , X n X_1, \ldots, X_n X 1 , … , X n are independent with X i ∼ χ 2 ( ν i ) X_i \sim \chi^2(\nu_i) X i ∼ χ 2 ( ν i ) , then U = ∑ X i ∼ χ 2 ( ν 1 + ⋯ + ν n ) U = \sum X_i \sim \chi^2(\nu_1 + \cdots + \nu_n) U = ∑ X i ∼ χ 2 ( ν 1 + ⋯ + ν n ) .
The first result tells us that the sum of n n n iid exponential waiting times has a Gamma distribution — this is used in reliability engineering and queueing theory. The second result is essential for constructing test statistics in mathematical statistics.
The Problem.
Let X 1 , X 2 , … , X k X_1, X_2, \ldots, X_k X 1 , X 2 , … , X k be independent with X i ∼ Binomial ( n i , p ) X_i \sim \text{Binomial}(n_i, p) X i ∼ Binomial ( n i , p ) (same p p p ). Show that:
U = X 1 + X 2 + ⋯ + X k ∼ Binomial ( n 1 + n 2 + ⋯ + n k , p ) U = X_1 + X_2 + \cdots + X_k \sim \text{Binomial}(n_1 + n_2 + \cdots + n_k, \; p) U = X 1 + X 2 + ⋯ + X k ∼ Binomial ( n 1 + n 2 + ⋯ + n k , p ) Solution.
The MGF of X i ∼ Bin ( n i , p ) X_i \sim \text{Bin}(n_i, p) X i ∼ Bin ( n i , p ) is M X i ( t ) = ( p e t + 1 − p ) n i M_{X_i}(t) = (pe^t + 1 - p)^{n_i} M X i ( t ) = ( p e t + 1 − p ) n i .
M U ( t ) = ∏ i = 1 k ( p e t + 1 − p ) n i = ( p e t + 1 − p ) n 1 + n 2 + ⋯ + n k M_U(t) = \prod_{i=1}^k (pe^t + 1 - p)^{n_i} = (pe^t + 1 - p)^{n_1 + n_2 + \cdots + n_k} M U ( t ) = i = 1 ∏ k ( p e t + 1 − p ) n i = ( p e t + 1 − p ) n 1 + n 2 + ⋯ + n k This is the MGF of Bin ( n 1 + ⋯ + n k , p ) \text{Bin}(n_1 + \cdots + n_k, p) Bin ( n 1 + ⋯ + n k , p ) . ∎
Interpretation.
This makes intuitive sense: if you flip coins in k k k independent groups, each group contributing a binomial count, the total is just a binomial with the total number of trials. The MGF proof confirms what intuition suggests, with mathematical rigor.
The Problem.
Let X 1 X_1 X 1 and X 2 X_2 X 2 be independent Poisson random variables with means λ 1 \lambda_1 λ 1 and λ 2 \lambda_2 λ 2 .
(a) Find the distribution of U = X 1 + X 2 U = X_1 + X_2 U = X 1 + X 2 .
(b) Find the conditional distribution of X 1 X_1 X 1 given X 1 + X 2 = m X_1 + X_2 = m X 1 + X 2 = m .
Solution.
(a) The MGF of X i ∼ Poisson ( λ i ) X_i \sim \text{Poisson}(\lambda_i) X i ∼ Poisson ( λ i ) is M X i ( t ) = e λ i ( e t − 1 ) M_{X_i}(t) = e^{\lambda_i(e^t - 1)} M X i ( t ) = e λ i ( e t − 1 ) .
M U ( t ) = e λ 1 ( e t − 1 ) ⋅ e λ 2 ( e t − 1 ) = e ( λ 1 + λ 2 ) ( e t − 1 ) M_U(t) = e^{\lambda_1(e^t - 1)} \cdot e^{\lambda_2(e^t - 1)} = e^{(\lambda_1 + \lambda_2)(e^t - 1)} M U ( t ) = e λ 1 ( e t − 1 ) ⋅ e λ 2 ( e t − 1 ) = e ( λ 1 + λ 2 ) ( e t − 1 ) This is the MGF of Poisson ( λ 1 + λ 2 ) \text{Poisson}(\lambda_1 + \lambda_2) Poisson ( λ 1 + λ 2 ) . ∎
(b) For k = 0 , 1 , … , m k = 0, 1, \ldots, m k = 0 , 1 , … , m :
P ( X 1 = k ∣ X 1 + X 2 = m ) = P ( X 1 = k , X 2 = m − k ) P ( X 1 + X 2 = m ) P(X_1 = k \mid X_1 + X_2 = m) = \frac{P(X_1 = k, X_2 = m - k)}{P(X_1 + X_2 = m)} P ( X 1 = k ∣ X 1 + X 2 = m ) = P ( X 1 + X 2 = m ) P ( X 1 = k , X 2 = m − k ) By independence:
= e − λ 1 λ 1 k k ! ⋅ e − λ 2 λ 2 m − k ( m − k ) ! e − ( λ 1 + λ 2 ) ( λ 1 + λ 2 ) m m ! = \frac{\frac{e^{-\lambda_1}\lambda_1^k}{k!} \cdot \frac{e^{-\lambda_2}\lambda_2^{m-k}}{(m-k)!}}{\frac{e^{-(\lambda_1+\lambda_2)}(\lambda_1+\lambda_2)^m}{m!}} = m ! e − ( λ 1 + λ 2 ) ( λ 1 + λ 2 ) m k ! e − λ 1 λ 1 k ⋅ ( m − k )! e − λ 2 λ 2 m − k = ( m k ) ( λ 1 λ 1 + λ 2 ) k ( λ 2 λ 1 + λ 2 ) m − k = \binom{m}{k} \left(\frac{\lambda_1}{\lambda_1 + \lambda_2}\right)^k \left(\frac{\lambda_2}{\lambda_1 + \lambda_2}\right)^{m-k} = ( k m ) ( λ 1 + λ 2 λ 1 ) k ( λ 1 + λ 2 λ 2 ) m − k This is the PMF of a Binomial ( m , λ 1 λ 1 + λ 2 ) \text{Binomial}\!\left(m, \frac{\lambda_1}{\lambda_1 + \lambda_2}\right) Binomial ( m , λ 1 + λ 2 λ 1 ) distribution.
Interpretation.
Given that the total count is m m m , each individual count comes from splitting m m m events, each independently assigned to source 1 with probability proportional to its rate. If a hospital emergency room sees two types of patients (medical and surgical) arriving at independent Poisson rates λ 1 \lambda_1 λ 1 and λ 2 \lambda_2 λ 2 , and you know the total arrivals in an hour was m m m , then the number of medical patients is Binomial with probability λ 1 / ( λ 1 + λ 2 ) \lambda_1/(\lambda_1 + \lambda_2) λ 1 / ( λ 1 + λ 2 ) .
The Problem.
Let Z ∼ N ( 0 , 1 ) Z \sim N(0, 1) Z ∼ N ( 0 , 1 ) . Use the MGF method to confirm that U = Z 2 ∼ χ 2 ( 1 ) U = Z^2 \sim \chi^2(1) U = Z 2 ∼ χ 2 ( 1 ) .
Solution.
M U ( t ) = E ( e t Z 2 ) = ∫ − ∞ ∞ e t z 2 ⋅ 1 2 π e − z 2 / 2 d z M_U(t) = E(e^{tZ^2}) = \int_{-\infty}^{\infty} e^{tz^2} \cdot \frac{1}{\sqrt{2\pi}} e^{-z^2/2} \, dz M U ( t ) = E ( e t Z 2 ) = ∫ − ∞ ∞ e t z 2 ⋅ 2 π 1 e − z 2 /2 d z Combining the exponents: t z 2 − z 2 / 2 = − z 2 ( 1 − 2 t ) / 2 tz^2 - z^2/2 = -z^2(1 - 2t)/2 t z 2 − z 2 /2 = − z 2 ( 1 − 2 t ) /2 . So:
M U ( t ) = 1 2 π ∫ − ∞ ∞ e − z 2 ( 1 − 2 t ) / 2 d z M_U(t) = \frac{1}{\sqrt{2\pi}} \int_{-\infty}^{\infty} e^{-z^2(1-2t)/2} \, dz M U ( t ) = 2 π 1 ∫ − ∞ ∞ e − z 2 ( 1 − 2 t ) /2 d z For this integral to converge, we need 1 − 2 t > 0 1 - 2t > 0 1 − 2 t > 0 , i.e., t < 1 / 2 t < 1/2 t < 1/2 . Under this condition, the integrand is a Gaussian kernel. We use the standard Gaussian integral formula: ∫ − ∞ ∞ e − a z 2 d z = π / a \int_{-\infty}^{\infty} e^{-az^2}\,dz = \sqrt{\pi/a} ∫ − ∞ ∞ e − a z 2 d z = π / a for a > 0 a > 0 a > 0 . Here a = ( 1 − 2 t ) / 2 a = (1-2t)/2 a = ( 1 − 2 t ) /2 , so:
∫ − ∞ ∞ e − z 2 ( 1 − 2 t ) / 2 d z = π ( 1 − 2 t ) / 2 = 2 π 1 − 2 t \int_{-\infty}^{\infty} e^{-z^2(1-2t)/2} \, dz = \sqrt{\frac{\pi}{(1-2t)/2}} = \sqrt{\frac{2\pi}{1-2t}} ∫ − ∞ ∞ e − z 2 ( 1 − 2 t ) /2 d z = ( 1 − 2 t ) /2 π = 1 − 2 t 2 π Substituting back:
M U ( t ) = 1 2 π ⋅ 2 π 1 − 2 t = 1 1 − 2 t = ( 1 − 2 t ) − 1 / 2 M_U(t) = \frac{1}{\sqrt{2\pi}} \cdot \sqrt{\frac{2\pi}{1-2t}} = \frac{1}{\sqrt{1-2t}} = (1-2t)^{-1/2} M U ( t ) = 2 π 1 ⋅ 1 − 2 t 2 π = 1 − 2 t 1 = ( 1 − 2 t ) − 1/2 Now we identify this MGF. Recall that the MGF of Gamma ( α , β ) \text{Gamma}(\alpha, \beta) Gamma ( α , β ) is ( 1 − β t ) − α (1 - \beta t)^{-\alpha} ( 1 − βt ) − α . Matching: β = 2 \beta = 2 β = 2 and α = 1 / 2 \alpha = 1/2 α = 1/2 , so this is the MGF of Gamma ( 1 / 2 , 2 ) \text{Gamma}(1/2, 2) Gamma ( 1/2 , 2 ) . Since χ 2 ( ν ) \chi^2(\nu) χ 2 ( ν ) is defined as Gamma ( ν / 2 , 2 ) \text{Gamma}(\nu/2, 2) Gamma ( ν /2 , 2 ) with ν = 1 \nu = 1 ν = 1 , we conclude U = Z 2 ∼ χ 2 ( 1 ) U = Z^2 \sim \chi^2(1) U = Z 2 ∼ χ 2 ( 1 ) . ∎
Let X 1 , X 2 , X 3 , X 4 , X 5 X_1, X_2, X_3, X_4, X_5 X 1 , X 2 , X 3 , X 4 , X 5 be iid Exponential ( β = 3 ) \text{Exponential}(\beta = 3) Exponential ( β = 3 ) . Use the MGF method to find the distribution of U = X 1 + X 2 + X 3 + X 4 + X 5 U = X_1 + X_2 + X_3 + X_4 + X_5 U = X 1 + X 2 + X 3 + X 4 + X 5 .
M X i ( t ) = ( 1 − 3 t ) − 1 M_{X_i}(t) = (1 - 3t)^{-1} M X i ( t ) = ( 1 − 3 t ) − 1 (MGF of Exponential(3) = Gamma(1, 3)).
M U ( t ) = [ ( 1 − 3 t ) − 1 ] 5 = ( 1 − 3 t ) − 5 M_U(t) = [(1-3t)^{-1}]^5 = (1-3t)^{-5} M U ( t ) = [( 1 − 3 t ) − 1 ] 5 = ( 1 − 3 t ) − 5
This is the MGF of Gamma ( 5 , 3 ) \text{Gamma}(5, 3) Gamma ( 5 , 3 ) . So U ∼ Gamma ( 5 , 3 ) U \sim \text{Gamma}(5, 3) U ∼ Gamma ( 5 , 3 ) .
E ( U ) = 5 ⋅ 3 = 15 E(U) = 5 \cdot 3 = 15 E ( U ) = 5 ⋅ 3 = 15 , V ( U ) = 5 ⋅ 9 = 45 V(U) = 5 \cdot 9 = 45 V ( U ) = 5 ⋅ 9 = 45 .
The MGF method is a shortcut that turns hard integration problems into simple algebra. Instead of computing a convolution integral to find the PDF of a sum, we multiply MGFs and recognize the result. This only works when the resulting MGF matches a known distribution, but for the distributions we care about most — Normal, Gamma (including Exponential and χ 2 \chi^2 χ 2 ), Binomial, Poisson — it works beautifully. The key results: normal + normal = normal, gamma + gamma (same β \beta β ) = gamma, binomial + binomial (same p p p ) = binomial, Poisson + Poisson = Poisson. These “closure” properties are the foundation of sampling distribution theory in mathematical statistics.
3.4 Section 7.4 Exercises ¶ Let X 1 ∼ N ( 5 , 4 ) X_1 \sim N(5, 4) X 1 ∼ N ( 5 , 4 ) and X 2 ∼ N ( 2 , 9 ) X_2 \sim N(2, 9) X 2 ∼ N ( 2 , 9 ) be independent. Find the distribution of U = X 1 − X 2 U = X_1 - X_2 U = X 1 − X 2 . (Hint: X 1 − X 2 = X 1 + ( − 1 ) X 2 X_1 - X_2 = X_1 + (-1)X_2 X 1 − X 2 = X 1 + ( − 1 ) X 2 . Use the result from Example 7.10. )
Let X 1 , X 2 , X 3 X_1, X_2, X_3 X 1 , X 2 , X 3 be iid Poisson ( 4 ) \text{Poisson}(4) Poisson ( 4 ) . Find the distribution of U = X 1 + X 2 + X 3 U = X_1 + X_2 + X_3 U = X 1 + X 2 + X 3 .
Let X i ∼ χ 2 ( 3 ) X_i \sim \chi^2(3) X i ∼ χ 2 ( 3 ) for i = 1 , 2 , 3 , 4 i = 1, 2, 3, 4 i = 1 , 2 , 3 , 4 (independent). Find the distribution of U = X 1 + X 2 + X 3 + X 4 U = X_1 + X_2 + X_3 + X_4 U = X 1 + X 2 + X 3 + X 4 .
If Z 1 , Z 2 , … , Z n Z_1, Z_2, \ldots, Z_n Z 1 , Z 2 , … , Z n are iid N ( 0 , 1 ) N(0, 1) N ( 0 , 1 ) , show that ∑ i = 1 n Z i 2 ∼ χ 2 ( n ) \sum_{i=1}^n Z_i^2 \sim \chi^2(n) ∑ i = 1 n Z i 2 ∼ χ 2 ( n ) . (Hint: Use Examples 7.14 and 7.11. )
Let X X X and Y Y Y be independent, X ∼ Binomial ( 10 , 0.3 ) X \sim \text{Binomial}(10, 0.3) X ∼ Binomial ( 10 , 0.3 ) and Y ∼ Binomial ( 15 , 0.3 ) Y \sim \text{Binomial}(15, 0.3) Y ∼ Binomial ( 15 , 0.3 ) . Without computing any convolutions, find P ( X + Y = 8 ) P(X + Y = 8) P ( X + Y = 8 ) .
In this section, we extend the transformation method to two or more random variables simultaneously. When we have a joint PDF f ( x 1 , x 2 ) f(x_1, x_2) f ( x 1 , x 2 ) and define two new variables U 1 = h 1 ( X 1 , X 2 ) U_1 = h_1(X_1, X_2) U 1 = h 1 ( X 1 , X 2 ) and U 2 = h 2 ( X 1 , X 2 ) U_2 = h_2(X_1, X_2) U 2 = h 2 ( X 1 , X 2 ) , we can find the joint PDF of ( U 1 , U 2 ) (U_1, U_2) ( U 1 , U 2 ) using a Jacobian matrix — the multivariable version of ∣ d x / d u ∣ |dx/du| ∣ d x / d u ∣ .
Real-Life Motivation: Two components in a system have lifetimes Y 1 Y_1 Y 1 and Y 2 Y_2 Y 2 with a known joint distribution. An engineer cares about the total system lifetime U 1 = Y 1 + Y 2 U_1 = Y_1 + Y_2 U 1 = Y 1 + Y 2 and the proportion of time spent on the first component U 2 = Y 1 / ( Y 1 + Y 2 ) U_2 = Y_1/(Y_1 + Y_2) U 2 = Y 1 / ( Y 1 + Y 2 ) . To find the joint distribution of ( U 1 , U 2 ) (U_1, U_2) ( U 1 , U 2 ) — and especially the marginal distribution of U 2 U_2 U 2 — we need the multivariable transformation method.
4.1 The Jacobian ¶ Let X 1 X_1 X 1 and X 2 X_2 X 2 have joint PDF f X 1 , X 2 ( x 1 , x 2 ) f_{X_1, X_2}(x_1, x_2) f X 1 , X 2 ( x 1 , x 2 ) . Define:
U 1 = h 1 ( X 1 , X 2 ) , U 2 = h 2 ( X 1 , X 2 ) U_1 = h_1(X_1, X_2), \quad U_2 = h_2(X_1, X_2) U 1 = h 1 ( X 1 , X 2 ) , U 2 = h 2 ( X 1 , X 2 ) Assume the transformation is one-to-one with inverse:
X 1 = g 1 ( U 1 , U 2 ) , X 2 = g 2 ( U 1 , U 2 ) X_1 = g_1(U_1, U_2), \quad X_2 = g_2(U_1, U_2) X 1 = g 1 ( U 1 , U 2 ) , X 2 = g 2 ( U 1 , U 2 ) The joint PDF of ( U 1 , U 2 ) (U_1, U_2) ( U 1 , U 2 ) is:
f U 1 , U 2 ( u 1 , u 2 ) = f X 1 , X 2 ( g 1 ( u 1 , u 2 ) , g 2 ( u 1 , u 2 ) ) ⋅ ∣ J ∣ f_{U_1, U_2}(u_1, u_2) = f_{X_1, X_2}\!\left(g_1(u_1, u_2), \; g_2(u_1, u_2)\right) \cdot |J| f U 1 , U 2 ( u 1 , u 2 ) = f X 1 , X 2 ( g 1 ( u 1 , u 2 ) , g 2 ( u 1 , u 2 ) ) ⋅ ∣ J ∣ where J J J is the Jacobian determinant :
J = det ( ∂ x 1 ∂ u 1 ∂ x 1 ∂ u 2 ∂ x 2 ∂ u 1 ∂ x 2 ∂ u 2 ) = ∂ x 1 ∂ u 1 ⋅ ∂ x 2 ∂ u 2 − ∂ x 1 ∂ u 2 ⋅ ∂ x 2 ∂ u 1 J = \det \begin{pmatrix} \frac{\partial x_1}{\partial u_1} & \frac{\partial x_1}{\partial u_2} \\ \frac{\partial x_2}{\partial u_1} & \frac{\partial x_2}{\partial u_2} \end{pmatrix} = \frac{\partial x_1}{\partial u_1} \cdot \frac{\partial x_2}{\partial u_2} - \frac{\partial x_1}{\partial u_2} \cdot \frac{\partial x_2}{\partial u_1} J = det ( ∂ u 1 ∂ x 1 ∂ u 1 ∂ x 2 ∂ u 2 ∂ x 1 ∂ u 2 ∂ x 2 ) = ∂ u 1 ∂ x 1 ⋅ ∂ u 2 ∂ x 2 − ∂ u 2 ∂ x 1 ⋅ ∂ u 1 ∂ x 2 This is the direct generalization of Theorem 7.1. In one variable, the “Jacobian” was just ∣ d x / d u ∣ |dx/du| ∣ d x / d u ∣ . In two variables, it’s the absolute value of the determinant of a 2 × 2 2 \times 2 2 × 2 matrix of partial derivatives.
PROOF
Strategy: We generalize the one-variable proof. The key idea is the same — we express probabilities as integrals, then apply the multivariable change-of-variables theorem from calculus.
For any region B B B in the ( u 1 , u 2 ) (u_1, u_2) ( u 1 , u 2 ) -space, the probability that ( U 1 , U 2 ) ∈ B (U_1, U_2) \in B ( U 1 , U 2 ) ∈ B equals the probability that ( X 1 , X 2 ) ∈ A (X_1, X_2) \in A ( X 1 , X 2 ) ∈ A , where A A A is the corresponding region in ( x 1 , x 2 ) (x_1, x_2) ( x 1 , x 2 ) -space. That is:
P ( ( U 1 , U 2 ) ∈ B ) = P ( ( X 1 , X 2 ) ∈ A ) = ∬ A f X 1 , X 2 ( x 1 , x 2 ) d x 1 d x 2 P((U_1, U_2) \in B) = P((X_1, X_2) \in A) = \iint_A f_{X_1, X_2}(x_1, x_2) \, dx_1 \, dx_2 P (( U 1 , U 2 ) ∈ B ) = P (( X 1 , X 2 ) ∈ A ) = ∬ A f X 1 , X 2 ( x 1 , x 2 ) d x 1 d x 2 By the multivariable change-of-variables theorem from calculus, when we substitute x 1 = g 1 ( u 1 , u 2 ) x_1 = g_1(u_1, u_2) x 1 = g 1 ( u 1 , u 2 ) and x 2 = g 2 ( u 1 , u 2 ) x_2 = g_2(u_1, u_2) x 2 = g 2 ( u 1 , u 2 ) , the differential element transforms as:
d x 1 d x 2 = ∣ J ∣ d u 1 d u 2 dx_1 \, dx_2 = |J| \, du_1 \, du_2 d x 1 d x 2 = ∣ J ∣ d u 1 d u 2 where J J J is the Jacobian determinant of the inverse transformation. (This is the same change-of-variables rule you used for double integrals in Calculus III — the Jacobian accounts for how the transformation distorts area elements.) Substituting:
∬ A f X 1 , X 2 ( x 1 , x 2 ) d x 1 d x 2 = ∬ B f X 1 , X 2 ( g 1 ( u 1 , u 2 ) , g 2 ( u 1 , u 2 ) ) ∣ J ∣ d u 1 d u 2 \iint_A f_{X_1, X_2}(x_1, x_2) \, dx_1 \, dx_2 = \iint_B f_{X_1, X_2}(g_1(u_1, u_2), \, g_2(u_1, u_2)) \, |J| \, du_1 \, du_2 ∬ A f X 1 , X 2 ( x 1 , x 2 ) d x 1 d x 2 = ∬ B f X 1 , X 2 ( g 1 ( u 1 , u 2 ) , g 2 ( u 1 , u 2 )) ∣ J ∣ d u 1 d u 2 Since this holds for every region B B B , the integrand must be the joint PDF of ( U 1 , U 2 ) (U_1, U_2) ( U 1 , U 2 ) :
f U 1 , U 2 ( u 1 , u 2 ) = f X 1 , X 2 ( g 1 ( u 1 , u 2 ) , g 2 ( u 1 , u 2 ) ) ⋅ ∣ J ∣ f_{U_1, U_2}(u_1, u_2) = f_{X_1, X_2}(g_1(u_1, u_2), \, g_2(u_1, u_2)) \cdot |J| f U 1 , U 2 ( u 1 , u 2 ) = f X 1 , X 2 ( g 1 ( u 1 , u 2 ) , g 2 ( u 1 , u 2 )) ⋅ ∣ J ∣ ∎
WHY THE JACOBIAN APPEARS: The Jacobian determinant ∣ J ∣ |J| ∣ J ∣ measures how the transformation distorts area . If a small rectangle in ( x 1 , x 2 ) (x_1, x_2) ( x 1 , x 2 ) -space gets stretched into a larger region in ( u 1 , u 2 ) (u_1, u_2) ( u 1 , u 2 ) -space, the probability density must decrease proportionally to keep the total probability equal to 1. The Jacobian captures exactly this stretching/compression factor — it is the ratio of infinitesimal areas: ∣ J ∣ = d x 1 d x 2 / ( d u 1 d u 2 ) |J| = dx_1 \, dx_2 / (du_1 \, du_2) ∣ J ∣ = d x 1 d x 2 / ( d u 1 d u 2 ) .
The Problem.
Let Y 1 ∼ Gamma ( α 1 , 1 ) Y_1 \sim \text{Gamma}(\alpha_1, 1) Y 1 ∼ Gamma ( α 1 , 1 ) and Y 2 ∼ Gamma ( α 2 , 1 ) Y_2 \sim \text{Gamma}(\alpha_2, 1) Y 2 ∼ Gamma ( α 2 , 1 ) , independent. Define:
U 1 = Y 1 Y 1 + Y 2 , U 2 = Y 1 + Y 2 U_1 = \frac{Y_1}{Y_1 + Y_2}, \quad U_2 = Y_1 + Y_2 U 1 = Y 1 + Y 2 Y 1 , U 2 = Y 1 + Y 2 Find the joint distribution of ( U 1 , U 2 ) (U_1, U_2) ( U 1 , U 2 ) and the marginal distribution of U 1 U_1 U 1 .
Solution.
Step 1: Find the inverse transformation.
From the definitions: Y 1 = U 1 U 2 Y_1 = U_1 U_2 Y 1 = U 1 U 2 and Y 2 = U 2 − U 1 U 2 = U 2 ( 1 − U 1 ) Y_2 = U_2 - U_1 U_2 = U_2(1 - U_1) Y 2 = U 2 − U 1 U 2 = U 2 ( 1 − U 1 ) .
Step 2: Compute the Jacobian.
(Calculus flashback: The Jacobian is the 2 × 2 2 \times 2 2 × 2 determinant det ( a b c d ) = a d − b c \det\begin{pmatrix} a & b \\ c & d \end{pmatrix} = ad - bc det ( a c b d ) = a d − b c . The matrix entries are the partial derivatives of y 1 y_1 y 1 and y 2 y_2 y 2 with respect to u 1 u_1 u 1 and u 2 u_2 u 2 . Since y 1 = u 1 u 2 y_1 = u_1 u_2 y 1 = u 1 u 2 : ∂ y 1 ∂ u 1 = u 2 \frac{\partial y_1}{\partial u_1} = u_2 ∂ u 1 ∂ y 1 = u 2 (treat u 2 u_2 u 2 as constant) and ∂ y 1 ∂ u 2 = u 1 \frac{\partial y_1}{\partial u_2} = u_1 ∂ u 2 ∂ y 1 = u 1 (treat u 1 u_1 u 1 as constant). Since y 2 = u 2 ( 1 − u 1 ) y_2 = u_2(1 - u_1) y 2 = u 2 ( 1 − u 1 ) : ∂ y 2 ∂ u 1 = − u 2 \frac{\partial y_2}{\partial u_1} = -u_2 ∂ u 1 ∂ y 2 = − u 2 and ∂ y 2 ∂ u 2 = 1 − u 1 \frac{\partial y_2}{\partial u_2} = 1 - u_1 ∂ u 2 ∂ y 2 = 1 − u 1 .)
J = det ( ∂ y 1 ∂ u 1 ∂ y 1 ∂ u 2 ∂ y 2 ∂ u 1 ∂ y 2 ∂ u 2 ) = det ( u 2 u 1 − u 2 1 − u 1 ) J = \det \begin{pmatrix} \frac{\partial y_1}{\partial u_1} & \frac{\partial y_1}{\partial u_2} \\ \frac{\partial y_2}{\partial u_1} & \frac{\partial y_2}{\partial u_2} \end{pmatrix} = \det \begin{pmatrix} u_2 & u_1 \\ -u_2 & 1 - u_1 \end{pmatrix} J = det ( ∂ u 1 ∂ y 1 ∂ u 1 ∂ y 2 ∂ u 2 ∂ y 1 ∂ u 2 ∂ y 2 ) = det ( u 2 − u 2 u 1 1 − u 1 ) = ( u 2 ) ( 1 − u 1 ) − ( u 1 ) ( − u 2 ) = u 2 ( 1 − u 1 ) + u 1 u 2 = u 2 − u 1 u 2 + u 1 u 2 = u 2 = (u_2)(1 - u_1) - (u_1)(-u_2) = u_2(1 - u_1) + u_1 u_2 = u_2 - u_1 u_2 + u_1 u_2 = u_2 = ( u 2 ) ( 1 − u 1 ) − ( u 1 ) ( − u 2 ) = u 2 ( 1 − u 1 ) + u 1 u 2 = u 2 − u 1 u 2 + u 1 u 2 = u 2 So ∣ J ∣ = u 2 |J| = u_2 ∣ J ∣ = u 2 (positive since u 2 > 0 u_2 > 0 u 2 > 0 ).
Step 3: Write the joint PDF of ( Y 1 , Y 2 ) (Y_1, Y_2) ( Y 1 , Y 2 ) .
Since Y 1 Y_1 Y 1 and Y 2 Y_2 Y 2 are independent Gammas with β = 1 \beta = 1 β = 1 :
f Y 1 , Y 2 ( y 1 , y 2 ) = y 1 α 1 − 1 e − y 1 Γ ( α 1 ) ⋅ y 2 α 2 − 1 e − y 2 Γ ( α 2 ) f_{Y_1, Y_2}(y_1, y_2) = \frac{y_1^{\alpha_1 - 1} e^{-y_1}}{\Gamma(\alpha_1)} \cdot \frac{y_2^{\alpha_2 - 1} e^{-y_2}}{\Gamma(\alpha_2)} f Y 1 , Y 2 ( y 1 , y 2 ) = Γ ( α 1 ) y 1 α 1 − 1 e − y 1 ⋅ Γ ( α 2 ) y 2 α 2 − 1 e − y 2 Step 4: Substitute and multiply by ∣ J ∣ |J| ∣ J ∣ .
Substituting y 1 = u 1 u 2 y_1 = u_1 u_2 y 1 = u 1 u 2 , y 2 = u 2 ( 1 − u 1 ) y_2 = u_2(1 - u_1) y 2 = u 2 ( 1 − u 1 ) :
f U 1 , U 2 ( u 1 , u 2 ) = ( u 1 u 2 ) α 1 − 1 ⋅ [ u 2 ( 1 − u 1 ) ] α 2 − 1 Γ ( α 1 ) Γ ( α 2 ) ⋅ e − u 2 ⋅ u 2 f_{U_1, U_2}(u_1, u_2) = \frac{(u_1 u_2)^{\alpha_1 - 1} \cdot [u_2(1-u_1)]^{\alpha_2 - 1}}{\Gamma(\alpha_1) \Gamma(\alpha_2)} \cdot e^{-u_2} \cdot u_2 f U 1 , U 2 ( u 1 , u 2 ) = Γ ( α 1 ) Γ ( α 2 ) ( u 1 u 2 ) α 1 − 1 ⋅ [ u 2 ( 1 − u 1 ) ] α 2 − 1 ⋅ e − u 2 ⋅ u 2 = u 1 α 1 − 1 ( 1 − u 1 ) α 2 − 1 Γ ( α 1 ) Γ ( α 2 ) ⋅ u 2 α 1 + α 2 − 1 e − u 2 = \frac{u_1^{\alpha_1 - 1}(1-u_1)^{\alpha_2 - 1}}{\Gamma(\alpha_1)\Gamma(\alpha_2)} \cdot u_2^{\alpha_1 + \alpha_2 - 1} e^{-u_2} = Γ ( α 1 ) Γ ( α 2 ) u 1 α 1 − 1 ( 1 − u 1 ) α 2 − 1 ⋅ u 2 α 1 + α 2 − 1 e − u 2 for 0 < u 1 < 1 0 < u_1 < 1 0 < u 1 < 1 , u 2 > 0 u_2 > 0 u 2 > 0 .
Step 5: Recognize the structure.
We need to show this factors into a product of a function of u 1 u_1 u 1 alone and a function of u 2 u_2 u 2 alone. Rearranging the expression from Step 4:
f U 1 , U 2 ( u 1 , u 2 ) = u 1 α 1 − 1 ( 1 − u 1 ) α 2 − 1 Γ ( α 1 ) Γ ( α 2 ) ⋅ u 2 α 1 + α 2 − 1 e − u 2 f_{U_1, U_2}(u_1, u_2) = \frac{u_1^{\alpha_1 - 1}(1-u_1)^{\alpha_2 - 1}}{\Gamma(\alpha_1)\Gamma(\alpha_2)} \cdot u_2^{\alpha_1 + \alpha_2 - 1} e^{-u_2} f U 1 , U 2 ( u 1 , u 2 ) = Γ ( α 1 ) Γ ( α 2 ) u 1 α 1 − 1 ( 1 − u 1 ) α 2 − 1 ⋅ u 2 α 1 + α 2 − 1 e − u 2 Now, we use a key identity from the theory of the Gamma function. The Beta function is defined as:
B ( α 1 , α 2 ) = ∫ 0 1 t α 1 − 1 ( 1 − t ) α 2 − 1 d t = Γ ( α 1 ) Γ ( α 2 ) Γ ( α 1 + α 2 ) B(\alpha_1, \alpha_2) = \int_0^1 t^{\alpha_1 - 1}(1-t)^{\alpha_2 - 1}\,dt = \frac{\Gamma(\alpha_1)\Gamma(\alpha_2)}{\Gamma(\alpha_1 + \alpha_2)} B ( α 1 , α 2 ) = ∫ 0 1 t α 1 − 1 ( 1 − t ) α 2 − 1 d t = Γ ( α 1 + α 2 ) Γ ( α 1 ) Γ ( α 2 ) This means 1 Γ ( α 1 ) Γ ( α 2 ) = 1 Γ ( α 1 + α 2 ) ⋅ B ( α 1 , α 2 ) = 1 Γ ( α 1 + α 2 ) ⋅ Γ ( α 1 + α 2 ) Γ ( α 1 ) Γ ( α 2 ) \frac{1}{\Gamma(\alpha_1)\Gamma(\alpha_2)} = \frac{1}{\Gamma(\alpha_1 + \alpha_2) \cdot B(\alpha_1, \alpha_2)} = \frac{1}{\Gamma(\alpha_1 + \alpha_2)} \cdot \frac{\Gamma(\alpha_1 + \alpha_2)}{\Gamma(\alpha_1)\Gamma(\alpha_2)} Γ ( α 1 ) Γ ( α 2 ) 1 = Γ ( α 1 + α 2 ) ⋅ B ( α 1 , α 2 ) 1 = Γ ( α 1 + α 2 ) 1 ⋅ Γ ( α 1 ) Γ ( α 2 ) Γ ( α 1 + α 2 ) .
We can therefore multiply and divide by Γ ( α 1 + α 2 ) \Gamma(\alpha_1 + \alpha_2) Γ ( α 1 + α 2 ) to factor the joint PDF as:
f U 1 , U 2 ( u 1 , u 2 ) = Γ ( α 1 + α 2 ) Γ ( α 1 ) Γ ( α 2 ) u 1 α 1 − 1 ( 1 − u 1 ) α 2 − 1 ⏟ Beta ( α 1 , α 2 ) density in u 1 ⋅ u 2 α 1 + α 2 − 1 e − u 2 Γ ( α 1 + α 2 ) ⏟ Gamma ( α 1 + α 2 , 1 ) density in u 2 f_{U_1, U_2}(u_1, u_2) = \underbrace{\frac{\Gamma(\alpha_1 + \alpha_2)}{\Gamma(\alpha_1)\Gamma(\alpha_2)} u_1^{\alpha_1 - 1}(1-u_1)^{\alpha_2 - 1}}_{\text{Beta}(\alpha_1, \alpha_2) \text{ density in } u_1} \cdot \underbrace{\frac{u_2^{\alpha_1 + \alpha_2 - 1} e^{-u_2}}{\Gamma(\alpha_1 + \alpha_2)}}_{\text{Gamma}(\alpha_1 + \alpha_2, 1) \text{ density in } u_2} f U 1 , U 2 ( u 1 , u 2 ) = Beta ( α 1 , α 2 ) density in u 1 Γ ( α 1 ) Γ ( α 2 ) Γ ( α 1 + α 2 ) u 1 α 1 − 1 ( 1 − u 1 ) α 2 − 1 ⋅ Gamma ( α 1 + α 2 , 1 ) density in u 2 Γ ( α 1 + α 2 ) u 2 α 1 + α 2 − 1 e − u 2 Each factor is a valid, normalized PDF (you can verify by checking that each integrates to 1 over its support). Since the joint PDF factors as a function of u 1 u_1 u 1 alone times a function of u 2 u_2 u 2 alone, U 1 U_1 U 1 and U 2 U_2 U 2 are independent (by the factorization criterion from Chapter 6). Moreover:
U 1 ∼ Beta ( α 1 , α 2 ) U_1 \sim \text{Beta}(\alpha_1, \alpha_2) U 1 ∼ Beta ( α 1 , α 2 )
U 2 ∼ Gamma ( α 1 + α 2 , 1 ) U_2 \sim \text{Gamma}(\alpha_1 + \alpha_2, 1) U 2 ∼ Gamma ( α 1 + α 2 , 1 )
Why This Matters.
This is one of the most important results in mathematical statistics. It says that if Y 1 Y_1 Y 1 and Y 2 Y_2 Y 2 are independent Gammas with the same scale parameter, then the ratio Y 1 / ( Y 1 + Y 2 ) Y_1/(Y_1 + Y_2) Y 1 / ( Y 1 + Y 2 ) follows a Beta distribution and is independent of the sum Y 1 + Y 2 Y_1 + Y_2 Y 1 + Y 2 . This result is the foundation of the F F F -distribution in ANOVA and regression.
The Problem.
Two independent components have lifetimes Y 1 Y_1 Y 1 and Y 2 Y_2 Y 2 with joint density:
f ( y 1 , y 2 ) = 1 8 y 1 e − ( y 1 + y 2 ) / 2 , y 1 > 0 , y 2 > 0 f(y_1, y_2) = \frac{1}{8} y_1 e^{-(y_1 + y_2)/2}, \quad y_1 > 0, \; y_2 > 0 f ( y 1 , y 2 ) = 8 1 y 1 e − ( y 1 + y 2 ) /2 , y 1 > 0 , y 2 > 0 Find the PDF of the ratio U = Y 2 / Y 1 U = Y_2 / Y_1 U = Y 2 / Y 1 .
Solution.
To find the marginal PDF of U = Y 2 / Y 1 U = Y_2/Y_1 U = Y 2 / Y 1 , we introduce an auxiliary variable V = Y 1 V = Y_1 V = Y 1 :
U = Y 2 / Y 1 , V = Y 1 ⟹ Y 1 = V , Y 2 = U V U = Y_2/Y_1, \quad V = Y_1 \implies Y_1 = V, \quad Y_2 = UV U = Y 2 / Y 1 , V = Y 1 ⟹ Y 1 = V , Y 2 = U V Jacobian:
J = det ( ∂ y 1 ∂ u ∂ y 1 ∂ v ∂ y 2 ∂ u ∂ y 2 ∂ v ) = det ( 0 1 v u ) = 0 ⋅ u − 1 ⋅ v = − v J = \det \begin{pmatrix} \frac{\partial y_1}{\partial u} & \frac{\partial y_1}{\partial v} \\ \frac{\partial y_2}{\partial u} & \frac{\partial y_2}{\partial v} \end{pmatrix} = \det \begin{pmatrix} 0 & 1 \\ v & u \end{pmatrix} = 0 \cdot u - 1 \cdot v = -v J = det ( ∂ u ∂ y 1 ∂ u ∂ y 2 ∂ v ∂ y 1 ∂ v ∂ y 2 ) = det ( 0 v 1 u ) = 0 ⋅ u − 1 ⋅ v = − v So ∣ J ∣ = v |J| = v ∣ J ∣ = v .
Joint PDF of ( U , V ) (U, V) ( U , V ) :
f U , V ( u , v ) = 1 8 v ⋅ e − ( v + u v ) / 2 ⋅ v = v 2 8 e − v ( 1 + u ) / 2 , u > 0 , v > 0 f_{U,V}(u, v) = \frac{1}{8} v \cdot e^{-(v + uv)/2} \cdot v = \frac{v^2}{8} e^{-v(1+u)/2}, \quad u > 0, \; v > 0 f U , V ( u , v ) = 8 1 v ⋅ e − ( v + uv ) /2 ⋅ v = 8 v 2 e − v ( 1 + u ) /2 , u > 0 , v > 0 Marginal PDF of U U U : Integrate out v v v :
f U ( u ) = ∫ 0 ∞ v 2 8 e − v ( 1 + u ) / 2 d v f_U(u) = \int_0^\infty \frac{v^2}{8} e^{-v(1+u)/2} \, dv f U ( u ) = ∫ 0 ∞ 8 v 2 e − v ( 1 + u ) /2 d v (Calculus flashback: This is a Gamma integral in disguise. The general formula is ∫ 0 ∞ v n e − λ v d v = n ! λ n + 1 \int_0^\infty v^n e^{-\lambda v}\,dv = \frac{n!}{\lambda^{n+1}} ∫ 0 ∞ v n e − λ v d v = λ n + 1 n ! for λ > 0 \lambda > 0 λ > 0 and non-negative integer n n n . Here n = 2 n = 2 n = 2 and λ = ( 1 + u ) / 2 \lambda = (1+u)/2 λ = ( 1 + u ) /2 , so ∫ 0 ∞ v 2 e − λ v d v = 2 ! λ 3 = 2 λ 3 \int_0^\infty v^2 e^{-\lambda v}\,dv = \frac{2!}{\lambda^3} = \frac{2}{\lambda^3} ∫ 0 ∞ v 2 e − λ v d v = λ 3 2 ! = λ 3 2 .)
Applying with λ = ( 1 + u ) / 2 \lambda = (1+u)/2 λ = ( 1 + u ) /2 :
f U ( u ) = 1 8 ⋅ 2 ( 1 + u 2 ) 3 = 1 8 ⋅ 2 ⋅ 2 3 ( 1 + u ) 3 = 1 8 ⋅ 16 ( 1 + u ) 3 = 2 ( 1 + u ) 3 , u > 0 f_U(u) = \frac{1}{8} \cdot \frac{2}{\left(\frac{1+u}{2}\right)^3} = \frac{1}{8} \cdot \frac{2 \cdot 2^3}{(1+u)^3} = \frac{1}{8} \cdot \frac{16}{(1+u)^3} = \frac{2}{(1+u)^3}, \quad u > 0 f U ( u ) = 8 1 ⋅ ( 2 1 + u ) 3 2 = 8 1 ⋅ ( 1 + u ) 3 2 ⋅ 2 3 = 8 1 ⋅ ( 1 + u ) 3 16 = ( 1 + u ) 3 2 , u > 0 Let X 1 X_1 X 1 and X 2 X_2 X 2 be iid Uniform ( 0 , 1 ) \text{Uniform}(0, 1) Uniform ( 0 , 1 ) . Define U 1 = X 1 + X 2 U_1 = X_1 + X_2 U 1 = X 1 + X 2 and U 2 = X 1 − X 2 U_2 = X_1 - X_2 U 2 = X 1 − X 2 . Find the joint PDF of ( U 1 , U 2 ) (U_1, U_2) ( U 1 , U 2 ) and verify that U 1 U_1 U 1 and U 2 U_2 U 2 are NOT independent.
Hint: X 1 = ( U 1 + U 2 ) / 2 X_1 = (U_1 + U_2)/2 X 1 = ( U 1 + U 2 ) /2 , X 2 = ( U 1 − U 2 ) / 2 X_2 = (U_1 - U_2)/2 X 2 = ( U 1 − U 2 ) /2 . Compute ∣ J ∣ |J| ∣ J ∣ and carefully determine the support in ( u 1 , u 2 ) (u_1, u_2) ( u 1 , u 2 ) coordinates.
J = det ( 1 / 2 1 / 2 1 / 2 − 1 / 2 ) = − 1 / 2 J = \det\begin{pmatrix} 1/2 & 1/2 \\ 1/2 & -1/2 \end{pmatrix} = -1/2 J = det ( 1/2 1/2 1/2 − 1/2 ) = − 1/2 , so ∣ J ∣ = 1 / 2 |J| = 1/2 ∣ J ∣ = 1/2 .
f U 1 , U 2 ( u 1 , u 2 ) = 1 ⋅ 1 2 = 1 2 f_{U_1, U_2}(u_1, u_2) = 1 \cdot \frac{1}{2} = \frac{1}{2} f U 1 , U 2 ( u 1 , u 2 ) = 1 ⋅ 2 1 = 2 1 on the support.
The support is the region where 0 ≤ ( u 1 + u 2 ) / 2 ≤ 1 0 \leq (u_1 + u_2)/2 \leq 1 0 ≤ ( u 1 + u 2 ) /2 ≤ 1 and 0 ≤ ( u 1 − u 2 ) / 2 ≤ 1 0 \leq (u_1 - u_2)/2 \leq 1 0 ≤ ( u 1 − u 2 ) /2 ≤ 1 , which is the diamond (rotated square) with vertices ( 0 , 0 ) (0, 0) ( 0 , 0 ) , ( 1 , 1 ) (1, 1) ( 1 , 1 ) , ( 2 , 0 ) (2, 0) ( 2 , 0 ) , ( 1 , − 1 ) (1, -1) ( 1 , − 1 ) .
The joint PDF is 1 / 2 1/2 1/2 over this diamond-shaped region. Since the support is not a rectangle, the joint PDF does not factor as g ( u 1 ) ⋅ h ( u 2 ) g(u_1) \cdot h(u_2) g ( u 1 ) ⋅ h ( u 2 ) , so U 1 U_1 U 1 and U 2 U_2 U 2 are dependent.
The multivariable transformation method generalizes the one-variable formula to two (or more) random variables using a Jacobian determinant — the absolute value of the determinant of the matrix of partial derivatives. The standard trick for finding the marginal distribution of a single function of two variables (like a ratio Y 2 / Y 1 Y_2/Y_1 Y 2 / Y 1 ) is to introduce an auxiliary variable, compute the joint PDF, and then integrate out the auxiliary. The most important result is the Gamma-to-Beta transformation (Example 7.15), which underpins the F F F -distribution and much of the theory of analysis of variance.
4.2 Section 7.5 Exercises ¶ Let X 1 , X 2 X_1, X_2 X 1 , X 2 be iid Exponential ( 1 ) \text{Exponential}(1) Exponential ( 1 ) . Use a multivariable transformation with U = X 1 + X 2 U = X_1 + X_2 U = X 1 + X 2 , V = X 1 / ( X 1 + X 2 ) V = X_1/(X_1 + X_2) V = X 1 / ( X 1 + X 2 ) to show that U U U and V V V are independent, and find their marginal distributions.
Let X 1 X_1 X 1 and X 2 X_2 X 2 be independent with X i ∼ N ( 0 , 1 ) X_i \sim N(0, 1) X i ∼ N ( 0 , 1 ) . Define U = X 1 2 + X 2 2 U = X_1^2 + X_2^2 U = X 1 2 + X 2 2 and V = X 1 / X 2 V = X_1/X_2 V = X 1 / X 2 . Find the marginal distributions of U U U and V V V . (This is the derivation of the χ 2 ( 2 ) \chi^2(2) χ 2 ( 2 ) and Cauchy distributions from standard normals. )
Let X 1 , X 2 X_1, X_2 X 1 , X 2 be independent Uniform(0, 1). Find the joint PDF of U 1 = min ( X 1 , X 2 ) U_1 = \min(X_1, X_2) U 1 = min ( X 1 , X 2 ) and U 2 = max ( X 1 , X 2 ) U_2 = \max(X_1, X_2) U 2 = max ( X 1 , X 2 ) using the Jacobian method. (Hint: first condition on X 1 < X 2 X_1 < X_2 X 1 < X 2 and X 1 > X 2 X_1 > X_2 X 1 > X 2 separately. )
5 Order Statistics ¶ In this section, we study the order statistics — the sorted values of a random sample. If Y 1 , Y 2 , … , Y n Y_1, Y_2, \ldots, Y_n Y 1 , Y 2 , … , Y n is a random sample, we sort them: Y ( 1 ) ≤ Y ( 2 ) ≤ ⋯ ≤ Y ( n ) Y_{(1)} \leq Y_{(2)} \leq \cdots \leq Y_{(n)} Y ( 1 ) ≤ Y ( 2 ) ≤ ⋯ ≤ Y ( n ) . The smallest value Y ( 1 ) Y_{(1)} Y ( 1 ) is the minimum , the largest Y ( n ) Y_{(n)} Y ( n ) is the maximum , and the middle one is the median . We derive the exact distribution of each order statistic.
Real-Life Motivation: A coastal engineer is designing a seawall to withstand extreme wave heights. Data on wave heights Y 1 , … , Y n Y_1, \ldots, Y_n Y 1 , … , Y n are collected over a year. The engineer doesn’t care about the average wave — they care about the maximum Y ( n ) Y_{(n)} Y ( n ) . What is the probability that the maximum wave height exceeds the design threshold? To answer this, we need the distribution of the maximum order statistic. Similarly, an electronics manufacturer tests a batch of n n n light bulbs. The first bulb to fail has lifetime Y ( 1 ) = min ( Y 1 , … , Y n ) Y_{(1)} = \min(Y_1, \ldots, Y_n) Y ( 1 ) = min ( Y 1 , … , Y n ) . How long until the first failure? That’s the distribution of the minimum order statistic.
5.1 The Distribution of the Maximum and Minimum ¶ We start with the two most important order statistics: the maximum and minimum.
Let Y 1 , Y 2 , … , Y n Y_1, Y_2, \ldots, Y_n Y 1 , Y 2 , … , Y n be iid with CDF F ( y ) F(y) F ( y ) and PDF f ( y ) f(y) f ( y ) . The CDF and PDF of Y ( n ) = max ( Y 1 , … , Y n ) Y_{(n)} = \max(Y_1, \ldots, Y_n) Y ( n ) = max ( Y 1 , … , Y n ) are:
F Y ( n ) ( y ) = [ F ( y ) ] n , f Y ( n ) ( y ) = n [ F ( y ) ] n − 1 f ( y ) F_{Y_{(n)}}(y) = [F(y)]^n, \qquad f_{Y_{(n)}}(y) = n[F(y)]^{n-1} f(y) F Y ( n ) ( y ) = [ F ( y ) ] n , f Y ( n ) ( y ) = n [ F ( y ) ] n − 1 f ( y ) PROOF
Strategy: The maximum is ≤ y \leq y ≤ y if and only if ALL values are ≤ y \leq y ≤ y . Use independence.
F Y ( n ) ( y ) = P ( Y ( n ) ≤ y ) = P ( Y 1 ≤ y , Y 2 ≤ y , … , Y n ≤ y ) F_{Y_{(n)}}(y) = P(Y_{(n)} \leq y) = P(Y_1 \leq y, Y_2 \leq y, \ldots, Y_n \leq y) F Y ( n ) ( y ) = P ( Y ( n ) ≤ y ) = P ( Y 1 ≤ y , Y 2 ≤ y , … , Y n ≤ y ) By independence:
= P ( Y 1 ≤ y ) ⋅ P ( Y 2 ≤ y ) ⋯ P ( Y n ≤ y ) = [ F ( y ) ] n = P(Y_1 \leq y) \cdot P(Y_2 \leq y) \cdots P(Y_n \leq y) = [F(y)]^n = P ( Y 1 ≤ y ) ⋅ P ( Y 2 ≤ y ) ⋯ P ( Y n ≤ y ) = [ F ( y ) ] n Differentiating to get the PDF:
(Calculus flashback: To differentiate [ F ( y ) ] n [F(y)]^n [ F ( y ) ] n with respect to y y y , use the Chain Rule. Let w = F ( y ) w = F(y) w = F ( y ) , so d d y w n = n w n − 1 ⋅ d w d y = n [ F ( y ) ] n − 1 ⋅ f ( y ) \frac{d}{dy}w^n = nw^{n-1} \cdot \frac{dw}{dy} = n[F(y)]^{n-1} \cdot f(y) d y d w n = n w n − 1 ⋅ d y d w = n [ F ( y ) ] n − 1 ⋅ f ( y ) , since F ′ ( y ) = f ( y ) F'(y) = f(y) F ′ ( y ) = f ( y ) by the Fundamental Theorem of Calculus.)
f Y ( n ) ( y ) = n [ F ( y ) ] n − 1 f ( y ) f_{Y_{(n)}}(y) = n[F(y)]^{n-1} f(y) f Y ( n ) ( y ) = n [ F ( y ) ] n − 1 f ( y ) ∎
Let Y 1 , Y 2 , … , Y n Y_1, Y_2, \ldots, Y_n Y 1 , Y 2 , … , Y n be iid with CDF F ( y ) F(y) F ( y ) and PDF f ( y ) f(y) f ( y ) . The CDF and PDF of Y ( 1 ) = min ( Y 1 , … , Y n ) Y_{(1)} = \min(Y_1, \ldots, Y_n) Y ( 1 ) = min ( Y 1 , … , Y n ) are:
F Y ( 1 ) ( y ) = 1 − [ 1 − F ( y ) ] n , f Y ( 1 ) ( y ) = n [ 1 − F ( y ) ] n − 1 f ( y ) F_{Y_{(1)}}(y) = 1 - [1 - F(y)]^n, \qquad f_{Y_{(1)}}(y) = n[1 - F(y)]^{n-1} f(y) F Y ( 1 ) ( y ) = 1 − [ 1 − F ( y ) ] n , f Y ( 1 ) ( y ) = n [ 1 − F ( y ) ] n − 1 f ( y ) PROOF
Strategy: It’s easier to compute P ( Y ( 1 ) > y ) P(Y_{(1)} > y) P ( Y ( 1 ) > y ) — the minimum exceeds y y y if and only if ALL values exceed y y y .
P ( Y ( 1 ) > y ) = P ( Y 1 > y , Y 2 > y , … , Y n > y ) = [ 1 − F ( y ) ] n P(Y_{(1)} > y) = P(Y_1 > y, Y_2 > y, \ldots, Y_n > y) = [1 - F(y)]^n P ( Y ( 1 ) > y ) = P ( Y 1 > y , Y 2 > y , … , Y n > y ) = [ 1 − F ( y ) ] n So F Y ( 1 ) ( y ) = 1 − [ 1 − F ( y ) ] n F_{Y_{(1)}}(y) = 1 - [1 - F(y)]^n F Y ( 1 ) ( y ) = 1 − [ 1 − F ( y ) ] n . Differentiating gives the PDF. ∎
The Problem.
Let Y 1 Y_1 Y 1 and Y 2 Y_2 Y 2 be independent Uniform ( 0 , 1 ) \text{Uniform}(0, 1) Uniform ( 0 , 1 ) . Find the PDF of U = Y ( 1 ) = min ( Y 1 , Y 2 ) U = Y_{(1)} = \min(Y_1, Y_2) U = Y ( 1 ) = min ( Y 1 , Y 2 ) .
Solution.
For Unif ( 0 , 1 ) \text{Unif}(0,1) Unif ( 0 , 1 ) : F ( y ) = y F(y) = y F ( y ) = y and f ( y ) = 1 f(y) = 1 f ( y ) = 1 for 0 ≤ y ≤ 1 0 \leq y \leq 1 0 ≤ y ≤ 1 .
f Y ( 1 ) ( y ) = 2 [ 1 − y ] 2 − 1 ⋅ 1 = 2 ( 1 − y ) , 0 ≤ y ≤ 1 f_{Y_{(1)}}(y) = 2[1 - y]^{2-1} \cdot 1 = 2(1 - y), \quad 0 \leq y \leq 1 f Y ( 1 ) ( y ) = 2 [ 1 − y ] 2 − 1 ⋅ 1 = 2 ( 1 − y ) , 0 ≤ y ≤ 1 This is a Beta ( 1 , 2 ) \text{Beta}(1, 2) Beta ( 1 , 2 ) distribution. The minimum of two independent Uniform(0, 1) variables is more likely to be near 0 than near 1 — which makes intuitive sense.
In R.
set.seed(42)
n <- 100000
min_sim <- pmin(runif(n), runif(n)) # pmin gives element-wise minimum
hist(min_sim, breaks = 50, freq = FALSE,
main = "PDF of min(Y₁, Y₂) where Yᵢ ~ Unif(0,1)",
xlab = "y", ylab = "Density",
col = "steelblue", border = "white")
curve(2*(1-x), from = 0, to = 1, add = TRUE, col = "red", lwd = 2)
legend("topright", "f(y) = 2(1-y)", col = "red", lwd = 2)5.2 The General k k k th Order Statistic ¶ Let Y 1 , … , Y n Y_1, \ldots, Y_n Y 1 , … , Y n be iid with PDF f ( y ) f(y) f ( y ) and CDF F ( y ) F(y) F ( y ) . The PDF of Y ( k ) Y_{(k)} Y ( k ) (the k k k th smallest value) is:
f Y ( k ) ( y ) = n ! ( k − 1 ) ! ( n − k ) ! [ F ( y ) ] k − 1 [ 1 − F ( y ) ] n − k f ( y ) f_{Y_{(k)}}(y) = \frac{n!}{(k-1)!(n-k)!} [F(y)]^{k-1} [1 - F(y)]^{n-k} f(y) f Y ( k ) ( y ) = ( k − 1 )! ( n − k )! n ! [ F ( y ) ] k − 1 [ 1 − F ( y ) ] n − k f ( y ) PROOF
Strategy: We derive this rigorously using the CDF and the multinomial counting argument. For Y ( k ) Y_{(k)} Y ( k ) to fall in an infinitesimal interval [ y , y + d y ) [y, y + dy) [ y , y + d y ) , the n n n observations must partition into three groups: exactly k − 1 k - 1 k − 1 below y y y , exactly one in [ y , y + d y ) [y, y+dy) [ y , y + d y ) , and exactly n − k n - k n − k above y + d y y + dy y + d y .
Step 1: Compute the CDF of Y ( k ) Y_{(k)} Y ( k ) .
F Y ( k ) ( y ) = P ( Y ( k ) ≤ y ) = P ( at least k of the n observations are ≤ y ) F_{Y_{(k)}}(y) = P(Y_{(k)} \leq y) = P(\text{at least } k \text{ of the } n \text{ observations are} \leq y) F Y ( k ) ( y ) = P ( Y ( k ) ≤ y ) = P ( at least k of the n observations are ≤ y ) Since the Y i Y_i Y i are iid, each observation is ≤ y \leq y ≤ y with probability p = F ( y ) p = F(y) p = F ( y ) , independently. The number of observations ≤ y \leq y ≤ y follows a Binomial( n , F ( y ) ) (n, F(y)) ( n , F ( y )) distribution:
F Y ( k ) ( y ) = ∑ j = k n ( n j ) [ F ( y ) ] j [ 1 − F ( y ) ] n − j F_{Y_{(k)}}(y) = \sum_{j=k}^{n} \binom{n}{j} [F(y)]^j [1 - F(y)]^{n-j} F Y ( k ) ( y ) = j = k ∑ n ( j n ) [ F ( y ) ] j [ 1 − F ( y ) ] n − j Step 2: Differentiate to get the PDF.
Rather than differentiating this sum directly (which is possible but tedious), we use a more elegant argument. The probability that Y ( k ) Y_{(k)} Y ( k ) falls in the infinitesimal interval [ y , y + d y ) [y, y + dy) [ y , y + d y ) is:
f Y ( k ) ( y ) d y = P ( Y ( k ) ∈ [ y , y + d y ) ) f_{Y_{(k)}}(y)\,dy = P(Y_{(k)} \in [y, y + dy)) f Y ( k ) ( y ) d y = P ( Y ( k ) ∈ [ y , y + d y )) For this to happen, we need exactly three things simultaneously:
Exactly k − 1 k - 1 k − 1 of the n n n observations fall below y y y . Each does so with probability F ( y ) F(y) F ( y ) .
Exactly 1 observation falls in [ y , y + d y ) [y, y + dy) [ y , y + d y ) . Each does so with probability f ( y ) d y f(y)\,dy f ( y ) d y .
Exactly n − k n - k n − k observations fall above y + d y ≈ y y + dy \approx y y + d y ≈ y . Each does so with probability 1 − F ( y ) 1 - F(y) 1 − F ( y ) .
The number of ways to assign n n n observations into these three groups is the multinomial coefficient:
n ! ( k − 1 ) ! ⋅ 1 ! ⋅ ( n − k ) ! \frac{n!}{(k-1)! \cdot 1! \cdot (n-k)!} ( k − 1 )! ⋅ 1 ! ⋅ ( n − k )! n ! This counts the number of ways to choose which k − 1 k-1 k − 1 observations are below, which 1 is “at” y y y , and which n − k n-k n − k are above. Multiplying:
f Y ( k ) ( y ) d y = n ! ( k − 1 ) ! ( n − k ) ! [ F ( y ) ] k − 1 ⋅ f ( y ) d y ⋅ [ 1 − F ( y ) ] n − k f_{Y_{(k)}}(y)\,dy = \frac{n!}{(k-1)!(n-k)!} [F(y)]^{k-1} \cdot f(y)\,dy \cdot [1 - F(y)]^{n-k} f Y ( k ) ( y ) d y = ( k − 1 )! ( n − k )! n ! [ F ( y ) ] k − 1 ⋅ f ( y ) d y ⋅ [ 1 − F ( y ) ] n − k Dividing both sides by d y dy d y :
f Y ( k ) ( y ) = n ! ( k − 1 ) ! ( n − k ) ! [ F ( y ) ] k − 1 [ 1 − F ( y ) ] n − k f ( y ) f_{Y_{(k)}}(y) = \frac{n!}{(k-1)!(n-k)!} [F(y)]^{k-1} [1 - F(y)]^{n-k} f(y) f Y ( k ) ( y ) = ( k − 1 )! ( n − k )! n ! [ F ( y ) ] k − 1 [ 1 − F ( y ) ] n − k f ( y ) ∎
Sanity check: Setting k = 1 k = 1 k = 1 : f Y ( 1 ) ( y ) = n ! 0 ! ( n − 1 ) ! [ F ( y ) ] 0 [ 1 − F ( y ) ] n − 1 f ( y ) = n [ 1 − F ( y ) ] n − 1 f ( y ) f_{Y_{(1)}}(y) = \frac{n!}{0!(n-1)!}[F(y)]^0[1-F(y)]^{n-1}f(y) = n[1-F(y)]^{n-1}f(y) f Y ( 1 ) ( y ) = 0 ! ( n − 1 )! n ! [ F ( y ) ] 0 [ 1 − F ( y ) ] n − 1 f ( y ) = n [ 1 − F ( y ) ] n − 1 f ( y ) ✓ (matches Theorem 7.5).
Setting k = n k = n k = n : f Y ( n ) ( y ) = n ! ( n − 1 ) ! 0 ! [ F ( y ) ] n − 1 [ 1 − F ( y ) ] 0 f ( y ) = n [ F ( y ) ] n − 1 f ( y ) f_{Y_{(n)}}(y) = \frac{n!}{(n-1)!0!}[F(y)]^{n-1}[1-F(y)]^0 f(y) = n[F(y)]^{n-1}f(y) f Y ( n ) ( y ) = ( n − 1 )! 0 ! n ! [ F ( y ) ] n − 1 [ 1 − F ( y ) ] 0 f ( y ) = n [ F ( y ) ] n − 1 f ( y ) ✓ (matches Theorem 7.4).
The Problem.
In a psychology experiment, the proportion of rats that complete a maze is modeled as a Beta(2, 1) random variable. The experiment is replicated in n = 10 n = 10 n = 10 independent rooms. Let Y 1 , … , Y 10 Y_1, \ldots, Y_{10} Y 1 , … , Y 10 be the proportions. Find:
(a) The PDF of the largest proportion Y ( 10 ) Y_{(10)} Y ( 10 ) .
(b) P ( Y ( 10 ) > 0.90 ) P(Y_{(10)} > 0.90) P ( Y ( 10 ) > 0.90 ) .
(c) The PDF of the second smallest proportion Y ( 2 ) Y_{(2)} Y ( 2 ) .
Solution.
For Beta ( 2 , 1 ) \text{Beta}(2, 1) Beta ( 2 , 1 ) : f ( y ) = 2 y f(y) = 2y f ( y ) = 2 y and F ( y ) = y 2 F(y) = y^2 F ( y ) = y 2 on [ 0 , 1 ] [0, 1] [ 0 , 1 ] .
(a) By Theorem 7.4:
f Y ( 10 ) ( y ) = 10 [ F ( y ) ] 9 f ( y ) = 10 ( y 2 ) 9 ⋅ 2 y = 20 y 19 , 0 ≤ y ≤ 1 f_{Y_{(10)}}(y) = 10[F(y)]^9 f(y) = 10(y^2)^9 \cdot 2y = 20 y^{19}, \quad 0 \leq y \leq 1 f Y ( 10 ) ( y ) = 10 [ F ( y ) ] 9 f ( y ) = 10 ( y 2 ) 9 ⋅ 2 y = 20 y 19 , 0 ≤ y ≤ 1 (b)
P ( Y ( 10 ) > 0.90 ) = 1 − P ( Y ( 10 ) ≤ 0.90 ) = 1 − [ F ( 0.90 ) ] 10 = 1 − ( 0.81 ) 10 P(Y_{(10)} > 0.90) = 1 - P(Y_{(10)} \leq 0.90) = 1 - [F(0.90)]^{10} = 1 - (0.81)^{10} P ( Y ( 10 ) > 0.90 ) = 1 − P ( Y ( 10 ) ≤ 0.90 ) = 1 − [ F ( 0.90 ) ] 10 = 1 − ( 0.81 ) 10 = 1 − 0.1216 = 0.8784 = 1 - 0.1216 = 0.8784 = 1 − 0.1216 = 0.8784 There’s an 87.84% chance the best room has more than 90% completion rate.
(c) Using Theorem 7.6 with k = 2 k = 2 k = 2 , n = 10 n = 10 n = 10 :
f Y ( 2 ) ( y ) = 10 ! 1 ! ⋅ 8 ! [ y 2 ] 1 [ 1 − y 2 ] 8 ⋅ 2 y = 90 ⋅ 2 y 3 ( 1 − y 2 ) 8 = 180 y 3 ( 1 − y 2 ) 8 f_{Y_{(2)}}(y) = \frac{10!}{1! \cdot 8!} [y^2]^1 [1 - y^2]^8 \cdot 2y = 90 \cdot 2y^3(1-y^2)^8 = 180 y^3(1-y^2)^8 f Y ( 2 ) ( y ) = 1 ! ⋅ 8 ! 10 ! [ y 2 ] 1 [ 1 − y 2 ] 8 ⋅ 2 y = 90 ⋅ 2 y 3 ( 1 − y 2 ) 8 = 180 y 3 ( 1 − y 2 ) 8 for 0 ≤ y ≤ 1 0 \leq y \leq 1 0 ≤ y ≤ 1 .
5.3 Joint Distribution of Order Statistics ¶ Let Y 1 , … , Y n Y_1, \ldots, Y_n Y 1 , … , Y n be iid with PDF f ( y ) f(y) f ( y ) . The joint PDF of the order statistics ( Y ( 1 ) , Y ( 2 ) , … , Y ( n ) ) (Y_{(1)}, Y_{(2)}, \ldots, Y_{(n)}) ( Y ( 1 ) , Y ( 2 ) , … , Y ( n ) ) is:
f Y ( 1 ) , … , Y ( n ) ( y 1 , … , y n ) = n ! ∏ i = 1 n f ( y i ) , y 1 < y 2 < ⋯ < y n f_{Y_{(1)}, \ldots, Y_{(n)}}(y_1, \ldots, y_n) = n! \prod_{i=1}^n f(y_i), \quad y_1 < y_2 < \cdots < y_n f Y ( 1 ) , … , Y ( n ) ( y 1 , … , y n ) = n ! i = 1 ∏ n f ( y i ) , y 1 < y 2 < ⋯ < y n and zero otherwise.
PROOF
Strategy: The joint PDF of the original (unsorted) sample ( Y 1 , … , Y n ) (Y_1, \ldots, Y_n) ( Y 1 , … , Y n ) is ∏ f ( y i ) \prod f(y_i) ∏ f ( y i ) by independence. The order statistics are a specific sorted arrangement. We count how many original orderings produce the same sorted result.
Step 1: The joint PDF of the original iid sample is:
f Y 1 , … , Y n ( y 1 , … , y n ) = ∏ i = 1 n f ( y i ) f_{Y_1, \ldots, Y_n}(y_1, \ldots, y_n) = \prod_{i=1}^n f(y_i) f Y 1 , … , Y n ( y 1 , … , y n ) = i = 1 ∏ n f ( y i ) Step 2: Consider a specific sorted sequence y 1 < y 2 < ⋯ < y n y_1 < y_2 < \cdots < y_n y 1 < y 2 < ⋯ < y n . How many orderings of the original sample produce this exact sorted sequence as the order statistics? The answer is n ! n! n ! — any of the n ! n! n ! permutations of the indices maps to the same sorted order. (For example, if n = 3 n = 3 n = 3 and the sorted values are 0.2 < 0.5 < 0.9 0.2 < 0.5 < 0.9 0.2 < 0.5 < 0.9 , then ( Y 1 , Y 2 , Y 3 ) (Y_1, Y_2, Y_3) ( Y 1 , Y 2 , Y 3 ) could be any of the 6 permutations ( 0.2 , 0.5 , 0.9 ) (0.2, 0.5, 0.9) ( 0.2 , 0.5 , 0.9 ) , ( 0.2 , 0.9 , 0.5 ) (0.2, 0.9, 0.5) ( 0.2 , 0.9 , 0.5 ) , ( 0.5 , 0.2 , 0.9 ) (0.5, 0.2, 0.9) ( 0.5 , 0.2 , 0.9 ) , etc., and all six produce the same order statistics ( Y ( 1 ) , Y ( 2 ) , Y ( 3 ) ) = ( 0.2 , 0.5 , 0.9 ) (Y_{(1)}, Y_{(2)}, Y_{(3)}) = (0.2, 0.5, 0.9) ( Y ( 1 ) , Y ( 2 ) , Y ( 3 ) ) = ( 0.2 , 0.5 , 0.9 ) .)
Step 3: Since each of these n ! n! n ! permutations contributes probability density ∏ f ( y i ) \prod f(y_i) ∏ f ( y i ) to the sorted sequence, and they are mutually exclusive (continuous random variables have probability 0 of ties), the total density at the sorted point is:
f Y ( 1 ) , … , Y ( n ) ( y 1 , … , y n ) = n ! ∏ i = 1 n f ( y i ) , y 1 < y 2 < ⋯ < y n f_{Y_{(1)}, \ldots, Y_{(n)}}(y_1, \ldots, y_n) = n! \prod_{i=1}^n f(y_i), \quad y_1 < y_2 < \cdots < y_n f Y ( 1 ) , … , Y ( n ) ( y 1 , … , y n ) = n ! i = 1 ∏ n f ( y i ) , y 1 < y 2 < ⋯ < y n The restriction y 1 < y 2 < ⋯ < y n y_1 < y_2 < \cdots < y_n y 1 < y 2 < ⋯ < y n is essential: order statistics are defined to be sorted, so the density is zero outside this region.
∎
The factor n ! n! n ! accounts for the n ! n! n ! ways the original random sample could have produced this sorted order. This result is the foundation for deriving the joint distribution of any subset of order statistics (e.g., the joint distribution of Y ( 1 ) Y_{(1)} Y ( 1 ) and Y ( n ) Y_{(n)} Y ( n ) used in range problems).
Order statistics answer questions about extremes and rankings in random samples. The maximum Y ( n ) Y_{(n)} Y ( n ) has CDF [ F ( y ) ] n [F(y)]^n [ F ( y ) ] n — the probability that the maximum is below y y y equals the probability that ALL observations are below y y y . The minimum Y ( 1 ) Y_{(1)} Y ( 1 ) has survival function [ 1 − F ( y ) ] n [1-F(y)]^n [ 1 − F ( y ) ] n . The general k k k th order statistic has a combinatorial formula that counts the ways to place observations above, at, and below the value y y y . In practice, order statistics model the strongest wave (coastal engineering), the first failure (reliability), the fastest runner (sports), and the median observation (robust statistics). For Exponential lifetimes, the minimum of n n n independent Exp(β \beta β ) is Exp(β / n \beta/n β / n ) — redundancy shortens expected system lifetime linearly.
5.4 Section 7.6 Exercises ¶ Let Y 1 , Y 2 , Y 3 Y_1, Y_2, Y_3 Y 1 , Y 2 , Y 3 be iid Uniform ( 0 , θ ) \text{Uniform}(0, \theta) Uniform ( 0 , θ ) . Find the PDF of Y ( 3 ) = max ( Y 1 , Y 2 , Y 3 ) Y_{(3)} = \max(Y_1, Y_2, Y_3) Y ( 3 ) = max ( Y 1 , Y 2 , Y 3 ) . Show that E ( Y ( 3 ) ) = 3 θ 4 E(Y_{(3)}) = \frac{3\theta}{4} E ( Y ( 3 ) ) = 4 3 θ .
Let Y 1 , … , Y n Y_1, \ldots, Y_n Y 1 , … , Y n be iid Exponential ( β ) \text{Exponential}(\beta) Exponential ( β ) . Show that Y ( 1 ) ∼ Exponential ( β / n ) Y_{(1)} \sim \text{Exponential}(\beta/n) Y ( 1 ) ∼ Exponential ( β / n ) .
Let Y 1 , Y 2 , Y 3 , Y 4 Y_1, Y_2, Y_3, Y_4 Y 1 , Y 2 , Y 3 , Y 4 be iid Uniform ( 0 , 1 ) \text{Uniform}(0, 1) Uniform ( 0 , 1 ) . Find the PDF of the median, Y ( 2 ) Y_{(2)} Y ( 2 ) , using the formula for the k k k th order statistic.
Five sensors independently measure a temperature. Each measurement follows a Uniform ( 98 , 102 ) \text{Uniform}(98, 102) Uniform ( 98 , 102 ) distribution. Find the PDF of the range R = Y ( 5 ) − Y ( 1 ) R = Y_{(5)} - Y_{(1)} R = Y ( 5 ) − Y ( 1 ) . (Hint: use the joint distribution of Y ( 1 ) Y_{(1)} Y ( 1 ) and Y ( 5 ) Y_{(5)} Y ( 5 ) from Theorem 7.7 applied to the first and last order statistics, then transform. )
Let Y 1 , … , Y 10 Y_1, \ldots, Y_{10} Y 1 , … , Y 10 be iid with CDF F ( y ) = 1 − e − y F(y) = 1 - e^{-y} F ( y ) = 1 − e − y for y > 0 y > 0 y > 0 . Find P ( Y ( 10 ) > 3 ) P(Y_{(10)} > 3) P ( Y ( 10 ) > 3 ) .
This section is enrichment material. Your instructor may skip it if time is limited, but the ideas here are used throughout simulation, statistics, and data science.
We prove a beautiful result: if X X X is any continuous random variable with CDF F F F , then F ( X ) ∼ Uniform ( 0 , 1 ) F(X) \sim \text{Uniform}(0, 1) F ( X ) ∼ Uniform ( 0 , 1 ) . This is the Probability Integral Transform (PIT). Its reverse — the Inverse CDF Method — lets us generate random samples from any distribution using only Uniform(0, 1) random numbers. This is how every statistical software package simulates random variables.
Let X X X be a continuous random variable with strictly increasing CDF F X F_X F X . Define U = F X ( X ) U = F_X(X) U = F X ( X ) . Then U ∼ Uniform ( 0 , 1 ) U \sim \text{Uniform}(0, 1) U ∼ Uniform ( 0 , 1 ) .
PROOF
Strategy: Apply the CDF method. Since F X F_X F X is a CDF, it maps from ( − ∞ , ∞ ) (-\infty, \infty) ( − ∞ , ∞ ) to ( 0 , 1 ) (0, 1) ( 0 , 1 ) , so U U U takes values in ( 0 , 1 ) (0, 1) ( 0 , 1 ) . We compute F U ( u ) F_U(u) F U ( u ) directly.
Step 1: Since F X F_X F X is strictly increasing, it has an inverse F X − 1 F_X^{-1} F X − 1 . So:
F U ( u ) = P ( U ≤ u ) = P ( F X ( X ) ≤ u ) = P ( X ≤ F X − 1 ( u ) ) F_U(u) = P(U \leq u) = P(F_X(X) \leq u) = P(X \leq F_X^{-1}(u)) F U ( u ) = P ( U ≤ u ) = P ( F X ( X ) ≤ u ) = P ( X ≤ F X − 1 ( u )) (Why? Because F X F_X F X is increasing, F X ( X ) ≤ u F_X(X) \leq u F X ( X ) ≤ u if and only if X ≤ F X − 1 ( u ) X \leq F_X^{-1}(u) X ≤ F X − 1 ( u ) .)
Step 2: By the definition of CDF:
P ( X ≤ F X − 1 ( u ) ) = F X ( F X − 1 ( u ) ) = u P(X \leq F_X^{-1}(u)) = F_X(F_X^{-1}(u)) = u P ( X ≤ F X − 1 ( u )) = F X ( F X − 1 ( u )) = u Step 3: So F U ( u ) = u F_U(u) = u F U ( u ) = u for 0 < u < 1 0 < u < 1 0 < u < 1 , which is the CDF of Uniform(0, 1).
∎
WHY THIS MATTERS: The PIT says that every continuous distribution, when passed through its own CDF, becomes Uniform(0, 1) . This is remarkable — it means that behind every distribution lurks a uniform random variable. Running the process in reverse gives us a simulation method:
To generate a random value X X X from any continuous distribution with CDF F X F_X F X :
Step 1: Generate U ∼ Uniform ( 0 , 1 ) U \sim \text{Uniform}(0, 1) U ∼ Uniform ( 0 , 1 ) (every programming language can do this).
Step 2: Compute X = F X − 1 ( U ) X = F_X^{-1}(U) X = F X − 1 ( U ) .
Then X X X has the desired distribution.
The Problem.
Use the inverse CDF method to generate random values from an Exponential ( β ) \text{Exponential}(\beta) Exponential ( β ) distribution.
Solution.
The CDF of Exponential ( β ) \text{Exponential}(\beta) Exponential ( β ) is F ( x ) = 1 − e − x / β F(x) = 1 - e^{-x/\beta} F ( x ) = 1 − e − x / β for x > 0 x > 0 x > 0 .
Step 1: Set u = F ( x ) = 1 − e − x / β u = F(x) = 1 - e^{-x/\beta} u = F ( x ) = 1 − e − x / β and solve for x x x :
u = 1 − e − x / β ⟹ e − x / β = 1 − u ⟹ − x / β = ln ( 1 − u ) ⟹ x = − β ln ( 1 − u ) u = 1 - e^{-x/\beta} \implies e^{-x/\beta} = 1 - u \implies -x/\beta = \ln(1 - u) \implies x = -\beta\ln(1 - u) u = 1 − e − x / β ⟹ e − x / β = 1 − u ⟹ − x / β = ln ( 1 − u ) ⟹ x = − β ln ( 1 − u ) (Calculus flashback: to solve e − x / β = 1 − u e^{-x/\beta} = 1 - u e − x / β = 1 − u , take ln \ln ln of both sides: − x / β = ln ( 1 − u ) -x/\beta = \ln(1-u) − x / β = ln ( 1 − u ) , then multiply by − β -\beta − β .)
Step 2: Since U ∼ Unif ( 0 , 1 ) U \sim \text{Unif}(0,1) U ∼ Unif ( 0 , 1 ) implies 1 − U ∼ Unif ( 0 , 1 ) 1 - U \sim \text{Unif}(0,1) 1 − U ∼ Unif ( 0 , 1 ) (by symmetry), we can simplify to X = − β ln ( U ) X = -\beta \ln(U) X = − β ln ( U ) .
So: generate U ∼ Unif ( 0 , 1 ) U \sim \text{Unif}(0, 1) U ∼ Unif ( 0 , 1 ) , then X = − β ln ( U ) X = -\beta \ln(U) X = − β ln ( U ) gives X ∼ Exponential ( β ) X \sim \text{Exponential}(\beta) X ∼ Exponential ( β ) .
In R.
# Generate 10000 Exponential(3) values using inverse CDF method
set.seed(42)
beta <- 3
u <- runif(10000)
x_manual <- -beta * log(u) # Our method
x_builtin <- rexp(10000, rate = 1/beta) # R's built-in
# Compare
par(mfrow = c(1, 2))
hist(x_manual, breaks = 40, freq = FALSE, main = "Inverse CDF Method",
col = "steelblue", border = "white", xlab = "x")
curve(dexp(x, rate = 1/beta), add = TRUE, col = "red", lwd = 2)
hist(x_builtin, breaks = 40, freq = FALSE, main = "R's rexp()",
col = "steelblue", border = "white", xlab = "x")
curve(dexp(x, rate = 1/beta), add = TRUE, col = "red", lwd = 2)Both histograms match the theoretical Exponential PDF — our hand-built method is identical to what R does internally.
The Probability Integral Transform is one of the most elegant results in probability: passing any continuous random variable through its own CDF yields a Uniform(0, 1). Running this in reverse — the Inverse CDF Method — is how computers generate random variables from any distribution. Every call to rexp(), rnorm(), rgamma() in R ultimately relies on this idea (sometimes with additional tricks for efficiency). This connects the abstract theory of Chapter 7 to the practical simulations you’ve been running since Chapter 1.
This section ties together the PIT (Section 7.7), the multivariable Jacobian (Section 7.5), and polar coordinates into one of the most elegant results in computational statistics.
The Inverse CDF Method generates random variables from any distribution — if you can invert the CDF. But the Normal distribution has no closed-form CDF inverse. So how does your computer generate rnorm() values? The Box-Muller Transform (1958): generate two independent N ( 0 , 1 ) N(0,1) N ( 0 , 1 ) from two independent Unif ( 0 , 1 ) \text{Unif}(0,1) Unif ( 0 , 1 ) .
Let U 1 , U 2 U_1, U_2 U 1 , U 2 be independent Uniform ( 0 , 1 ) \text{Uniform}(0, 1) Uniform ( 0 , 1 ) . Define:
Z 1 = − 2 ln U 1 cos ( 2 π U 2 ) , Z 2 = − 2 ln U 1 sin ( 2 π U 2 ) Z_1 = \sqrt{-2\ln U_1}\;\cos(2\pi U_2), \qquad Z_2 = \sqrt{-2\ln U_1}\;\sin(2\pi U_2) Z 1 = − 2 ln U 1 cos ( 2 π U 2 ) , Z 2 = − 2 ln U 1 sin ( 2 π U 2 ) Then Z 1 Z_1 Z 1 and Z 2 Z_2 Z 2 are independent N ( 0 , 1 ) N(0, 1) N ( 0 , 1 ) random variables.
PROOF
Strategy: Work backwards. Start with two independent N ( 0 , 1 ) N(0,1) N ( 0 , 1 ) variables, convert to polar coordinates using a Jacobian, and show the polar components are functions of Uniform random variables.
Step 1: Joint density of two independent standard normals.
If Z 1 , Z 2 ∼ iid N ( 0 , 1 ) Z_1, Z_2 \stackrel{\text{iid}}{\sim} N(0,1) Z 1 , Z 2 ∼ iid N ( 0 , 1 ) , their joint PDF is:
f Z 1 , Z 2 ( z 1 , z 2 ) = 1 2 π e − z 1 2 / 2 ⋅ 1 2 π e − z 2 2 / 2 = 1 2 π e − ( z 1 2 + z 2 2 ) / 2 f_{Z_1, Z_2}(z_1, z_2) = \frac{1}{\sqrt{2\pi}}e^{-z_1^2/2} \cdot \frac{1}{\sqrt{2\pi}}e^{-z_2^2/2} = \frac{1}{2\pi} e^{-(z_1^2 + z_2^2)/2} f Z 1 , Z 2 ( z 1 , z 2 ) = 2 π 1 e − z 1 2 /2 ⋅ 2 π 1 e − z 2 2 /2 = 2 π 1 e − ( z 1 2 + z 2 2 ) /2 Notice: this depends on z 1 z_1 z 1 and z 2 z_2 z 2 only through z 1 2 + z 2 2 = r 2 z_1^2 + z_2^2 = r^2 z 1 2 + z 2 2 = r 2 — it’s rotationally symmetric . This is the key insight.
Step 2: Convert to polar coordinates.
Define R ≥ 0 R \geq 0 R ≥ 0 and 0 ≤ Θ < 2 π 0 \leq \Theta < 2\pi 0 ≤ Θ < 2 π by Z 1 = R cos Θ Z_1 = R\cos\Theta Z 1 = R cos Θ , Z 2 = R sin Θ Z_2 = R\sin\Theta Z 2 = R sin Θ .
(Calculus flashback: The Jacobian of polar-to-Cartesian is ∣ J ∣ = r |J| = r ∣ J ∣ = r . This comes from the area element d A = r d r d θ dA = r\,dr\,d\theta d A = r d r d θ . Specifically: ∂ z 1 ∂ r = cos θ \frac{\partial z_1}{\partial r} = \cos\theta ∂ r ∂ z 1 = cos θ , ∂ z 1 ∂ θ = − r sin θ \frac{\partial z_1}{\partial \theta} = -r\sin\theta ∂ θ ∂ z 1 = − r sin θ , ∂ z 2 ∂ r = sin θ \frac{\partial z_2}{\partial r} = \sin\theta ∂ r ∂ z 2 = sin θ , ∂ z 2 ∂ θ = r cos θ \frac{\partial z_2}{\partial \theta} = r\cos\theta ∂ θ ∂ z 2 = r cos θ . Determinant: r cos 2 θ + r sin 2 θ = r r\cos^2\theta + r\sin^2\theta = r r cos 2 θ + r sin 2 θ = r .)
Applying Theorem 7.3 with ∣ J ∣ = r |J| = r ∣ J ∣ = r :
f R , Θ ( r , θ ) = 1 2 π e − r 2 / 2 ⋅ r f_{R, \Theta}(r, \theta) = \frac{1}{2\pi} e^{-r^2/2} \cdot r f R , Θ ( r , θ ) = 2 π 1 e − r 2 /2 ⋅ r for r > 0 r > 0 r > 0 , 0 ≤ θ < 2 π 0 \leq \theta < 2\pi 0 ≤ θ < 2 π .
Step 3: Factor into independent components.
f R , Θ ( r , θ ) = r e − r 2 / 2 ⏟ PDF of R (Rayleigh) ⋅ 1 2 π ⏟ PDF of Θ (Uniform) f_{R, \Theta}(r, \theta) = \underbrace{r \, e^{-r^2/2}}_{\text{PDF of } R \text{ (Rayleigh)}} \;\cdot\; \underbrace{\frac{1}{2\pi}}_{\text{PDF of } \Theta \text{ (Uniform)}} f R , Θ ( r , θ ) = PDF of R (Rayleigh) r e − r 2 /2 ⋅ PDF of Θ (Uniform) 2 π 1 The joint PDF factors as g ( r ) ⋅ h ( θ ) g(r) \cdot h(\theta) g ( r ) ⋅ h ( θ ) , so R R R and Θ \Theta Θ are independent . Θ ∼ Uniform ( 0 , 2 π ) \Theta \sim \text{Uniform}(0, 2\pi) Θ ∼ Uniform ( 0 , 2 π ) and R R R has the Rayleigh PDF f R ( r ) = r e − r 2 / 2 f_R(r) = re^{-r^2/2} f R ( r ) = r e − r 2 /2 .
Step 4: Express R R R and Θ \Theta Θ via Uniforms using the Inverse CDF Method.
For Θ \Theta Θ : Since Θ ∼ Unif ( 0 , 2 π ) \Theta \sim \text{Unif}(0, 2\pi) Θ ∼ Unif ( 0 , 2 π ) , set Θ = 2 π U 2 \Theta = 2\pi U_2 Θ = 2 π U 2 where U 2 ∼ Unif ( 0 , 1 ) U_2 \sim \text{Unif}(0,1) U 2 ∼ Unif ( 0 , 1 ) .
For R R R : The CDF is F R ( r ) = ∫ 0 r t e − t 2 / 2 d t F_R(r) = \int_0^r t\,e^{-t^2/2}\,dt F R ( r ) = ∫ 0 r t e − t 2 /2 d t . Using u u u -substitution with w = t 2 / 2 w = t^2/2 w = t 2 /2 , d w = t d t dw = t\,dt d w = t d t :
F R ( r ) = ∫ 0 r 2 / 2 e − w d w = 1 − e − r 2 / 2 F_R(r) = \int_0^{r^2/2} e^{-w}\,dw = 1 - e^{-r^2/2} F R ( r ) = ∫ 0 r 2 /2 e − w d w = 1 − e − r 2 /2 Set U 1 = F R ( R ) = 1 − e − R 2 / 2 U_1 = F_R(R) = 1 - e^{-R^2/2} U 1 = F R ( R ) = 1 − e − R 2 /2 and solve for R R R :
e − R 2 / 2 = 1 − U 1 ⟹ R 2 / 2 = − ln ( 1 − U 1 ) ⟹ R = − 2 ln ( 1 − U 1 ) e^{-R^2/2} = 1 - U_1 \implies R^2/2 = -\ln(1 - U_1) \implies R = \sqrt{-2\ln(1 - U_1)} e − R 2 /2 = 1 − U 1 ⟹ R 2 /2 = − ln ( 1 − U 1 ) ⟹ R = − 2 ln ( 1 − U 1 ) Since 1 − U 1 ∼ Unif ( 0 , 1 ) 1 - U_1 \sim \text{Unif}(0,1) 1 − U 1 ∼ Unif ( 0 , 1 ) when U 1 ∼ Unif ( 0 , 1 ) U_1 \sim \text{Unif}(0,1) U 1 ∼ Unif ( 0 , 1 ) , we simplify: R = − 2 ln U 1 R = \sqrt{-2\ln U_1} R = − 2 ln U 1 .
Step 5: Substitute back into Z 1 = R cos Θ Z_1 = R\cos\Theta Z 1 = R cos Θ , Z 2 = R sin Θ Z_2 = R\sin\Theta Z 2 = R sin Θ :
Z 1 = − 2 ln U 1 cos ( 2 π U 2 ) , Z 2 = − 2 ln U 1 sin ( 2 π U 2 ) Z_1 = \sqrt{-2\ln U_1}\;\cos(2\pi U_2), \qquad Z_2 = \sqrt{-2\ln U_1}\;\sin(2\pi U_2) Z 1 = − 2 ln U 1 cos ( 2 π U 2 ) , Z 2 = − 2 ln U 1 sin ( 2 π U 2 ) ∎
WHY THIS IS BEAUTIFUL: One result that uses every major idea from this chapter — the Jacobian (polar coordinates), the PIT (generating R R R from U 1 U_1 U 1 ), independence via factorization (Step 3), and the rotational symmetry of the Normal distribution. This is how GPU-based scientific computing generates billions of normal random numbers.
# Box-Muller in action
set.seed(42)
n <- 10000
u1 <- runif(n); u2 <- runif(n)
z1 <- sqrt(-2 * log(u1)) * cos(2 * pi * u2)
z2 <- sqrt(-2 * log(u1)) * sin(2 * pi * u2)
cat("Z1: mean =", round(mean(z1), 3), " sd =", round(sd(z1), 3), "\n")
cat("Z2: mean =", round(mean(z2), 3), " sd =", round(sd(z2), 3), "\n")
cat("Cor(Z1,Z2) =", round(cor(z1, z2), 4), "\n")CDF Method: Forgetting to flip the inequality for decreasing transformations. P ( g ( X ) ≤ u ) = P ( X ≥ g − 1 ( u ) ) P(g(X) \leq u) = P(X \geq g^{-1}(u)) P ( g ( X ) ≤ u ) = P ( X ≥ g − 1 ( u )) when g g g is decreasing.
Transformation Method: Forgetting the absolute value. The formula is f U ( u ) = f X ( h − 1 ( u ) ) ⋅ ∣ d h − 1 / d u ∣ f_U(u) = f_X(h^{-1}(u)) \cdot |dh^{-1}/du| f U ( u ) = f X ( h − 1 ( u )) ⋅ ∣ d h − 1 / d u ∣ . Without the absolute value, you can get a negative PDF.
MGF Method: Applying it to sums with different scale parameters. The Gamma summation result requires the same β \beta β . You cannot directly add Gamma ( α 1 , β 1 ) \text{Gamma}(\alpha_1, \beta_1) Gamma ( α 1 , β 1 ) and Gamma ( α 2 , β 2 ) \text{Gamma}(\alpha_2, \beta_2) Gamma ( α 2 , β 2 ) when β 1 ≠ β 2 \beta_1 \neq \beta_2 β 1 = β 2 — the result is not Gamma.
Jacobian: Computing the wrong determinant. The Jacobian matrix has ∂ x i / ∂ u j \partial x_i / \partial u_j ∂ x i / ∂ u j , not ∂ u i / ∂ x j \partial u_i / \partial x_j ∂ u i / ∂ x j . If you compute the “forward” Jacobian (∂ u / ∂ x \partial u / \partial x ∂ u / ∂ x ) instead of the “inverse” Jacobian (∂ x / ∂ u \partial x / \partial u ∂ x / ∂ u ), you get 1 / ∣ J ∣ 1/|J| 1/∣ J ∣ instead of ∣ J ∣ |J| ∣ J ∣ .
Order Statistics: Confusing F ( y ) F(y) F ( y ) and f ( y ) f(y) f ( y ) . The order statistic formulas use both the CDF and the PDF. Students who plug in f ( y ) f(y) f ( y ) where F ( y ) F(y) F ( y ) should go (or vice versa) get the wrong answer.
The central question of this chapter: if X X X has a known distribution and U = g ( X ) U = g(X) U = g ( X ) , what is the distribution of U U U ? Three methods answer this question.
The CDF Method is universal: compute F U ( u ) = P ( U ≤ u ) F_U(u) = P(U \leq u) F U ( u ) = P ( U ≤ u ) by substituting g ( X ) g(X) g ( X ) for U U U , solve for X X X , and differentiate. It works for any transformation, including non-one-to-one functions like X 2 X^2 X 2 .
The Transformation Method gives a direct formula for one-to-one functions: f U ( u ) = f X ( h − 1 ( u ) ) ⋅ ∣ d h − 1 / d u ∣ f_U(u) = f_X(h^{-1}(u)) \cdot |dh^{-1}/du| f U ( u ) = f X ( h − 1 ( u )) ⋅ ∣ d h − 1 / d u ∣ . The absolute derivative acts as a “probability density stretching factor.”
The MGF Method exploits the fact that MGFs of sums of independent variables multiply : M U ( t ) = ∏ M X i ( t ) M_U(t) = \prod M_{X_i}(t) M U ( t ) = ∏ M X i ( t ) . If the product matches a known MGF, the distribution is identified. Key closure results: Normal + Normal = Normal; Gamma + Gamma (same β \beta β ) = Gamma; Binomial + Binomial (same p p p ) = Binomial; Poisson + Poisson = Poisson.
Multivariable transformations use a Jacobian determinant: f U 1 , U 2 ( u 1 , u 2 ) = f X 1 , X 2 ( g 1 , g 2 ) ⋅ ∣ J ∣ f_{U_1, U_2}(u_1, u_2) = f_{X_1, X_2}(g_1, g_2) \cdot |J| f U 1 , U 2 ( u 1 , u 2 ) = f X 1 , X 2 ( g 1 , g 2 ) ⋅ ∣ J ∣ , where J J J is the determinant of the matrix of partial derivatives of the inverse transformation.
Order statistics — the sorted values Y ( 1 ) ≤ Y ( 2 ) ≤ ⋯ ≤ Y ( n ) Y_{(1)} \leq Y_{(2)} \leq \cdots \leq Y_{(n)} Y ( 1 ) ≤ Y ( 2 ) ≤ ⋯ ≤ Y ( n ) — have explicit PDFs. The maximum has CDF [ F ( y ) ] n [F(y)]^n [ F ( y ) ] n . The minimum has survival function [ 1 − F ( y ) ] n [1-F(y)]^n [ 1 − F ( y ) ] n . The k k k th order statistic has PDF involving binomial coefficients.
The Gamma-to-Beta transformation (Example 7.15) is arguably the most important result in this chapter: if Y 1 ∼ Gamma ( α 1 , 1 ) Y_1 \sim \text{Gamma}(\alpha_1, 1) Y 1 ∼ Gamma ( α 1 , 1 ) and Y 2 ∼ Gamma ( α 2 , 1 ) Y_2 \sim \text{Gamma}(\alpha_2, 1) Y 2 ∼ Gamma ( α 2 , 1 ) are independent, then Y 1 / ( Y 1 + Y 2 ) ∼ Beta ( α 1 , α 2 ) Y_1/(Y_1+Y_2) \sim \text{Beta}(\alpha_1, \alpha_2) Y 1 / ( Y 1 + Y 2 ) ∼ Beta ( α 1 , α 2 ) and is independent of Y 1 + Y 2 ∼ Gamma ( α 1 + α 2 , 1 ) Y_1 + Y_2 \sim \text{Gamma}(\alpha_1 + \alpha_2, 1) Y 1 + Y 2 ∼ Gamma ( α 1 + α 2 , 1 ) .
Everything in mathematical statistics depends on this chapter. Sampling distributions, confidence intervals, hypothesis tests, ANOVA — they all require finding the distribution of functions of random variables. You now have the tools.
💭 Tell Your Brain
You’ve just learned three methods for finding the distribution of a transformed random variable. Here’s the deep question: why do we need three methods instead of just one?
The CDF method always works — so why bother with the others? Because mathematics rewards having multiple perspectives on the same problem. The transformation method reveals that probability density stretches and compresses like a physical material. The MGF method reveals that adding independent random variables corresponds to multiplying their characteristic functions — a duality between addition and multiplication that runs through all of mathematics.
The real lesson isn’t the formulas. It’s this: knowing the distribution of an input is not the same as knowing the distribution of an output. Every model, every formula, every algorithm transforms data. And every transformation changes the distribution. The next time someone tells you “the data is normally distributed,” ask: “the raw data, or the data after your transformation?” The answer matters. That’s what this chapter taught you to see.
Sometimes you do not need the exact distribution of U = g ( Y ) U = g(Y) U = g ( Y ) — you just need a good approximation of its mean and variance . The Delta Method provides exactly this, using nothing more than a first-order Taylor series approximation. It is one of the most frequently used tools in mathematical statistics and applied work.
This section previews material from Mathematical Statistics (MATH 4200). You can skip it without losing continuity, but it will give you a head start when you encounter it next semester.
8.1 The Key Idea ¶ If Y Y Y is a random variable with mean μ \mu μ and variance σ 2 \sigma^2 σ 2 , and g g g is a differentiable function, then we can approximate g ( Y ) g(Y) g ( Y ) near μ \mu μ using a Taylor expansion:
g ( Y ) ≈ g ( μ ) + g ′ ( μ ) ( Y − μ ) g(Y) \approx g(\mu) + g'(\mu)(Y - \mu) g ( Y ) ≈ g ( μ ) + g ′ ( μ ) ( Y − μ ) This is a linear approximation. Taking the expectation of both sides:
E [ g ( Y ) ] ≈ g ( μ ) + g ′ ( μ ) ⋅ E [ Y − μ ] ⏟ = 0 = g ( μ ) E[g(Y)] \approx g(\mu) + g'(\mu) \cdot \underbrace{E[Y - \mu]}_{= 0} = g(\mu) E [ g ( Y )] ≈ g ( μ ) + g ′ ( μ ) ⋅ = 0 E [ Y − μ ] = g ( μ ) Taking the variance:
Var ( g ( Y ) ) ≈ [ g ′ ( μ ) ] 2 ⋅ Var ( Y ) = [ g ′ ( μ ) ] 2 σ 2 \text{Var}(g(Y)) \approx [g'(\mu)]^2 \cdot \text{Var}(Y) = [g'(\mu)]^2 \sigma^2 Var ( g ( Y )) ≈ [ g ′ ( μ ) ] 2 ⋅ Var ( Y ) = [ g ′ ( μ ) ] 2 σ 2 If Y Y Y has mean μ \mu μ and variance σ 2 \sigma^2 σ 2 , and g g g is differentiable with g ′ ( μ ) ≠ 0 g'(\mu) \ne 0 g ′ ( μ ) = 0 , then:
E [ g ( Y ) ] ≈ g ( μ ) , Var ( g ( Y ) ) ≈ [ g ′ ( μ ) ] 2 σ 2 E[g(Y)] \approx g(\mu), \qquad \text{Var}(g(Y)) \approx [g'(\mu)]^2 \sigma^2 E [ g ( Y )] ≈ g ( μ ) , Var ( g ( Y )) ≈ [ g ′ ( μ ) ] 2 σ 2 In words: The mean of the transformed variable is approximately the function applied to the mean. The variance of the transformed variable is the original variance multiplied by the square of the derivative evaluated at the mean.
8.2 Why Is This Useful? ¶ The exact distribution of g ( Y ) g(Y) g ( Y ) can be very hard to find (try finding the density of g ( Y ) = ln ( Y ) g(Y) = \ln(Y) g ( Y ) = ln ( Y ) when Y Y Y is Gamma!). But the Delta Method gives you the mean and variance immediately , without any of the CDF/transformation machinery.
8.3 Worked Examples ¶ Example D.1 (Variance of a Reciprocal). Suppose Y Y Y has mean μ = 10 \mu = 10 μ = 10 and variance σ 2 = 4 \sigma^2 = 4 σ 2 = 4 . You need the variance of U = 1 / Y U = 1/Y U = 1/ Y .
Here g ( y ) = 1 / y g(y) = 1/y g ( y ) = 1/ y and g ′ ( y ) = − 1 / y 2 g'(y) = -1/y^2 g ′ ( y ) = − 1/ y 2 , so g ′ ( μ ) = − 1 / 100 g'(\mu) = -1/100 g ′ ( μ ) = − 1/100 .
Var ( 1 / Y ) ≈ ( − 1 100 ) 2 ⋅ 4 = 4 10 , 000 = 0.0004 \text{Var}(1/Y) \approx \left(-\frac{1}{100}\right)^2 \cdot 4 = \frac{4}{10{,}000} = 0.0004 Var ( 1/ Y ) ≈ ( − 100 1 ) 2 ⋅ 4 = 10 , 000 4 = 0.0004 No transformation theorem needed — just one line of calculus.
Example D.2 (Variance of a Log-Return). Stock returns are often analyzed as U = ln ( Y ) U = \ln(Y) U = ln ( Y ) where Y Y Y is the gross return. If Y Y Y has mean μ = 1.08 \mu = 1.08 μ = 1.08 and σ 2 = 0.04 \sigma^2 = 0.04 σ 2 = 0.04 :
g ( y ) = ln ( y ) g(y) = \ln(y) g ( y ) = ln ( y ) , g ′ ( y ) = 1 / y g'(y) = 1/y g ′ ( y ) = 1/ y , g ′ ( μ ) = 1 / 1.08 ≈ 0.926 g'(\mu) = 1/1.08 \approx 0.926 g ′ ( μ ) = 1/1.08 ≈ 0.926 .
Var ( ln Y ) ≈ ( 0.926 ) 2 ⋅ 0.04 = 0.0343 \text{Var}(\ln Y) \approx (0.926)^2 \cdot 0.04 = 0.0343 Var ( ln Y ) ≈ ( 0.926 ) 2 ⋅ 0.04 = 0.0343 Compare with the exact answer (if Y Y Y were lognormal): ln ( 1 + 0.04 / 1.0 8 2 ) = ln ( 1.0343 ) = 0.0337 \ln(1 + 0.04/1.08^2) = \ln(1.0343) = 0.0337 ln ( 1 + 0.04/1.0 8 2 ) = ln ( 1.0343 ) = 0.0337 . The approximation is very close!
Example D.3 (Variance Stabilizing Transformation for Poisson). If X ∼ Poisson ( λ ) X \sim \text{Poisson}(\lambda) X ∼ Poisson ( λ ) with large λ \lambda λ , then E [ X ] = λ E[X] = \lambda E [ X ] = λ and Var ( X ) = λ \text{Var}(X) = \lambda Var ( X ) = λ . The variance depends on the mean, which is inconvenient for many statistical procedures.
Let U = X U = \sqrt{X} U = X . By the Delta Method with g ( x ) = x g(x) = \sqrt{x} g ( x ) = x and g ′ ( x ) = 1 2 x g'(x) = \frac{1}{2\sqrt{x}} g ′ ( x ) = 2 x 1 :
Var ( X ) ≈ ( 1 2 λ ) 2 ⋅ λ = λ 4 λ = 1 4 \text{Var}(\sqrt{X}) \approx \left(\frac{1}{2\sqrt{\lambda}}\right)^2 \cdot \lambda = \frac{\lambda}{4\lambda} = \frac{1}{4} Var ( X ) ≈ ( 2 λ 1 ) 2 ⋅ λ = 4 λ λ = 4 1 The variance of X \sqrt{X} X is approximately 1 / 4 1/4 1/4 , regardless of λ \lambda λ ! This is why the square root transformation is used to “stabilize” the variance of Poisson data — a result you will use extensively in regression analysis and ANOVA.
The Delta Method approximates E [ g ( Y ) ] ≈ g ( μ ) E[g(Y)] \approx g(\mu) E [ g ( Y )] ≈ g ( μ ) and Var ( g ( Y ) ) ≈ [ g ′ ( μ ) ] 2 σ 2 \text{Var}(g(Y)) \approx [g'(\mu)]^2 \sigma^2 Var ( g ( Y )) ≈ [ g ′ ( μ ) ] 2 σ 2 using a first-order Taylor expansion.
When to use it: When you need the mean and variance of a transformation but finding the exact distribution is too difficult or unnecessary.
Key applications:
Approximating standard errors of transformed estimators (confidence intervals in the next course)
Variance stabilizing transformations (X \sqrt{X} X for Poisson, arcsin p \arcsin\sqrt{p} arcsin p for proportions)
Quick approximations in applied work when an exact answer is overkill
Connection to this chapter: The Delta Method and the transformation method answer related but different questions. The transformation method finds the exact distribution . The Delta Method finds approximate mean and variance . When the exact distribution is available, use it. When it is not, the Delta Method is your best friend.
9 7.R The R Verification Lab ¶ Throughout this chapter, we derived densities by hand using four methods. In this mini-lab, we bring all four methods together in one comprehensive simulation that verifies every major result of the chapter. Run this code and watch the math come alive.
# ================================================================
# CHAPTER 6 GRAND VERIFICATION: Functions of Random Variables
# ================================================================
set.seed(2026)
n <- 200000 # simulation size
cat("========================================\n")
cat(" CHAPTER 6: ALL METHODS VERIFIED IN R \n")
cat("========================================\n\n")
# ------ METHOD 1: CDF Method (Max of two uniforms) ------
Y1 <- runif(n); Y2 <- runif(n)
U_max <- pmax(Y1, Y2)
cat("CDF Method — Max of 2 Uniform(0,1):\n")
cat(" Theoretical E[max] = 2/3 =", round(2/3, 4), "\n")
cat(" Simulated E[max] =", round(mean(U_max), 4), "\n\n")
# ------ METHOD 2: Transformation (Lognormal) ------
X <- rnorm(n, mean = 1, sd = 0.5)
S <- exp(X)
cat("Transformation — exp(N(1, 0.25)) = Lognormal:\n")
cat(" Theoretical mean = exp(mu + sigma^2/2) =", round(exp(1 + 0.25/2), 4), "\n")
cat(" Simulated mean =", round(mean(S), 4), "\n\n")
# ------ METHOD 3: MGF (Sum of independent normals) ------
Y_sum <- rnorm(n, 3, 1) + rnorm(n, -1, 2) + rnorm(n, 5, 0.5)
cat("MGF Method — Sum of N(3,1) + N(-1,4) + N(5,0.25):\n")
cat(" Theoretical: N(7, 5.25), sd =", round(sqrt(5.25), 4), "\n")
cat(" Simulated mean =", round(mean(Y_sum), 4), " sd =", round(sd(Y_sum), 4), "\n\n")
# ------ METHOD 4: Jacobian (Beta from Gamma ratio) ------
alpha1 <- 3; alpha2 <- 5; beta_param <- 2
G1 <- rgamma(n, shape = alpha1, scale = beta_param)
G2 <- rgamma(n, shape = alpha2, scale = beta_param)
U_ratio <- G1 / (G1 + G2)
cat("Jacobian — Gamma(3,2)/(Gamma(3,2)+Gamma(5,2)) = Beta(3,5):\n")
cat(" Theoretical mean = alpha1/(alpha1+alpha2) =", round(alpha1/(alpha1+alpha2), 4), "\n")
cat(" Simulated mean =", round(mean(U_ratio), 4), "\n\n")
# ------ ORDER STATISTICS ------
# 7 draws from Exponential(100), find min
Y_mat <- matrix(rexp(7 * n, rate = 1/100), nrow = 7)
Y_min <- apply(Y_mat, 2, min)
Y_max <- apply(Y_mat, 2, max)
cat("Order Statistics — 7 draws from Exp(100):\n")
cat(" Min: theoretical mean = 100/7 =", round(100/7, 2),
" simulated =", round(mean(Y_min), 2), "\n")
cat(" Max: simulated mean =", round(mean(Y_max), 2), "\n\n")
# ------ PROBABILITY INTEGRAL TRANSFORM ------
Y_gamma <- rgamma(n, shape = 4, rate = 1/3)
U_pit <- pgamma(Y_gamma, shape = 4, rate = 1/3)
ks_result <- ks.test(U_pit, "punif")
cat("Probability Integral Transform (Gamma → Uniform):\n")
cat(" KS test p-value =", round(ks_result$p.value, 4),
"(large p = uniform confirmed)\n\n")
cat("All results match theory. The math works!\n")10 Chapter 7 Refresh Exercises ¶ These exercises integrate concepts from across the entire chapter.
Let X ∼ Uniform ( 0 , 2 ) X \sim \text{Uniform}(0, 2) X ∼ Uniform ( 0 , 2 ) . Use the CDF method to find the PDF of U = X 3 U = X^3 U = X 3 . Then verify your answer using the transformation method.
Let X ∼ N ( 0 , 1 ) X \sim N(0, 1) X ∼ N ( 0 , 1 ) . Find the PDF of U = ∣ X ∣ U = |X| U = ∣ X ∣ using the CDF method. (This is the “half-normal” distribution — used in Bayesian statistics as a prior for standard deviations. )
Let X 1 , X 2 , … , X 10 X_1, X_2, \ldots, X_{10} X 1 , X 2 , … , X 10 be iid Exponential ( β = 5 ) \text{Exponential}(\beta = 5) Exponential ( β = 5 ) . Find the distribution of U = 2 ∑ i = 1 10 X i / β U = 2\sum_{i=1}^{10} X_i / \beta U = 2 ∑ i = 1 10 X i / β . (Hint: first find the distribution of the sum using MGFs, then apply the scaling property of the Gamma family. )
Let X X X and Y Y Y be independent Uniform ( 0 , 1 ) \text{Uniform}(0, 1) Uniform ( 0 , 1 ) . Define U = max ( X , Y ) U = \max(X, Y) U = max ( X , Y ) and V = min ( X , Y ) V = \min(X, Y) V = min ( X , Y ) . Find the joint PDF of ( U , V ) (U, V) ( U , V ) and the PDF of W = U − V W = U - V W = U − V (the range).
Let X 1 ∼ Gamma ( 3 , 2 ) X_1 \sim \text{Gamma}(3, 2) X 1 ∼ Gamma ( 3 , 2 ) and X 2 ∼ Gamma ( 5 , 2 ) X_2 \sim \text{Gamma}(5, 2) X 2 ∼ Gamma ( 5 , 2 ) be independent. Find the distribution of R = X 1 / ( X 1 + X 2 ) R = X_1 / (X_1 + X_2) R = X 1 / ( X 1 + X 2 ) .
A reliability engineer tests 20 identical light bulbs. Each bulb’s lifetime is iid Exponential ( β = 1000 ) \text{Exponential}(\beta = 1000) Exponential ( β = 1000 ) hours.
(a) Find the distribution of the time until the first bulb fails.
(b) What is the expected time until the first failure?
(c) Find P ( P( P ( all 20 bulbs last at least 50 hours) ) ) .
Let Z 1 , Z 2 , … , Z 8 Z_1, Z_2, \ldots, Z_8 Z 1 , Z 2 , … , Z 8 be iid N ( 0 , 1 ) N(0,1) N ( 0 , 1 ) . Find the distribution of W = Z 1 2 + Z 2 2 + ⋯ + Z 8 2 W = Z_1^2 + Z_2^2 + \cdots + Z_8^2 W = Z 1 2 + Z 2 2 + ⋯ + Z 8 2 and compute P ( W > 15.507 ) P(W > 15.507) P ( W > 15.507 ) .
Let Y 1 , Y 2 , Y 3 , Y 4 , Y 5 Y_1, Y_2, Y_3, Y_4, Y_5 Y 1 , Y 2 , Y 3 , Y 4 , Y 5 be iid from a distribution with CDF F ( y ) = y 3 F(y) = y^3 F ( y ) = y 3 for 0 ≤ y ≤ 1 0 \leq y \leq 1 0 ≤ y ≤ 1 . Find the PDF of the median Y ( 3 ) Y_{(3)} Y ( 3 ) .
A factory makes resistors whose resistance (in ohms) follows a N ( 100 , 4 ) N(100, 4) N ( 100 , 4 ) distribution. Power dissipated is P = V 2 / R P = V^2/R P = V 2 / R , where voltage is a constant V = 12 V = 12 V = 12 volts. Find the approximate distribution of P P P using a first-order Taylor expansion: P ≈ V 2 / μ R + ( − V 2 / μ R 2 ) ( R − μ R ) P \approx V^2/\mu_R + (-V^2/\mu_R^2)(R - \mu_R) P ≈ V 2 / μ R + ( − V 2 / μ R 2 ) ( R − μ R ) . (This is the “Delta Method” preview. )
(Challenge) Let X X X and Y Y Y be iid Exponential ( 1 ) \text{Exponential}(1) Exponential ( 1 ) . Use the transformation U = X / ( X + Y ) U = X/(X+Y) U = X / ( X + Y ) , V = X + Y V = X + Y V = X + Y to show that U ∼ Uniform ( 0 , 1 ) U \sim \text{Uniform}(0, 1) U ∼ Uniform ( 0 , 1 ) and that U U U and V V V are independent. (This is a special case of Example 7.15 with α 1 = α 2 = 1 \alpha_1 = \alpha_2 = 1 α 1 = α 2 = 1 , and it explains why Beta ( 1 , 1 ) = Uniform ( 0 , 1 ) \text{Beta}(1, 1) = \text{Uniform}(0,1) Beta ( 1 , 1 ) = Uniform ( 0 , 1 ) . )