Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.


Here’s the fundamental question of this chapter:

If we know the distribution of XX, and we define Y=g(X)Y = g(X), what is the distribution of YY?

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.

0.1Transformations Are Everywhere

Every time you apply a formula to a random variable, you create a new random variable. Consider these examples:

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.2Three Methods

We develop three distinct techniques, each with its own strengths:

MethodBest ForKey Idea
CDF Method (§7.2)Any transformation — the universal toolCompute FU(u)=P(Uu)F_U(u) = P(U \leq u) directly, then differentiate
Transformation Method (§7.3)One-to-one functions of continuous RVsUse the change-of-variables formula with the Jacobian
MGF Method (§7.4)Sums of independent RVs; identifying known distributionsIf MU(t)=Mknown(t)M_U(t) = M_{\text{known}}(t), then UU 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.


1The CDF Method (Method of Distribution Functions)

1.1The Core Idea

Suppose XX is a random variable with a known PDF fX(x)f_X(x) and CDF FX(x)F_X(x), and let U=g(X)U = g(X) for some function gg. The CDF method has exactly three steps:

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.2Worked Examples: One Variable

1.3Discrete Transformations

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\}, each with probability 1/61/6. Let U=(X3)2U = (X - 3)^2 — the squared deviation from 3.

The values of UU are: X=1U=4X = 1 \to U = 4, X=2U=1X = 2 \to U = 1, X=3U=0X = 3 \to U = 0, X=4U=1X = 4 \to U = 1, X=5U=4X = 5 \to U = 4, X=6U=9X = 6 \to U = 9.

Multiple XX-values map to the same UU: both X=2X = 2 and X=4X = 4 give U=1U = 1; both X=1X = 1 and X=5X = 5 give U=4U = 4. So we add their probabilities:

| uu | xx-values that produce it | pU(u)p_U(u) | |:

1.4Worked Examples: Continuous Transformations

1.5Worked Examples: Two Variables

The CDF method extends naturally to functions of two (or more) random variables.

1.6The Convolution Formula

The sum U=X+YU = X + Y of two independent continuous random variables appears so frequently that its PDF formula has a special name:

This is derived from the CDF method by differentiating P(X+Yu)=x+yufX(x)fY(y)dydxP(X + Y \leq u) = \int\int_{x+y \leq u} f_X(x)f_Y(y)\,dy\,dx under the integral sign (substituting y=uxy = 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.

1.7Section 7.2 Exercises

  1. Let XX have PDF fX(x)=3x2f_X(x) = 3x^2 for 0x10 \leq x \leq 1. Use the CDF method to find the PDF of U=1XU = 1 - X.

  2. Let XExponential(β=2)X \sim \text{Exponential}(\beta = 2), i.e., fX(x)=12ex/2f_X(x) = \frac{1}{2}e^{-x/2} for x>0x > 0. Find the PDF of U=XU = \sqrt{X} using the CDF method.

  3. Let XX have PDF fX(x)=12(x+1)f_X(x) = \frac{1}{2}(x+1) for 1x1-1 \leq x \leq 1. Find the PDF of U=XU = |X| using the CDF method.

  4. Let XX and YY be independent Exponential(1) random variables. Use the CDF method to find the PDF of U=X+YU = X + Y. (Hint: the region of integration for P(X+Yu)P(X + Y \leq u) is a triangle.)

  5. Let XUniform(0,1)X \sim \text{Uniform}(0, 1). Find the PDF of U=X(1X)U = X(1-X). (This is challenging — think carefully about the range and whether the function is one-to-one.)


2The Transformation Method (One Variable)

2.1The Theorem

PROOF

Strategy: We derive this directly from the CDF method. We compute FU(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: hh is strictly increasing.

When hh is increasing, h(X)uh(X) \leq u if and only if Xh1(u)X \leq h^{-1}(u). (Why? Because an increasing function preserves the direction of inequalities: if aba \leq b then h(a)h(b)h(a) \leq h(b), so h(X)u    Xh1(u)h(X) \leq u \iff X \leq h^{-1}(u).)

Therefore:

FU(u)=P(Uu)=P(h(X)u)=P(Xh1(u))=FX(h1(u))F_U(u) = P(U \leq u) = P(h(X) \leq u) = P(X \leq h^{-1}(u)) = F_X(h^{-1}(u))

Differentiating with respect to uu using the chain rule:

fU(u)=dduFX(h1(u))=fX(h1(u))dduh1(u)f_U(u) = \frac{d}{du} F_X(h^{-1}(u)) = f_X(h^{-1}(u)) \cdot \frac{d}{du}h^{-1}(u)

Since hh is increasing, h1h^{-1} is also increasing, so dduh1(u)>0\frac{d}{du}h^{-1}(u) > 0. The expression is already positive — no absolute value needed.

Case 2: hh is strictly decreasing.

When hh is decreasing, h(X)uh(X) \leq u if and only if Xh1(u)X \geq h^{-1}(u). (Why? Because a decreasing function reverses the direction of inequalities: if aba \leq b then h(a)h(b)h(a) \geq h(b). So h(X)uh(X) \leq u means XX is on the side where hh gives smaller values, which for a decreasing function is the right side — i.e., Xh1(u)X \geq h^{-1}(u).)

Therefore:

FU(u)=P(Uu)=P(h(X)u)=P(Xh1(u))=1FX(h1(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))

Differentiating with respect to uu using the chain rule:

fU(u)=ddu[1FX(h1(u))]=fX(h1(u))dduh1(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)

Now, since hh is decreasing, h1h^{-1} is also decreasing, so dduh1(u)<0\frac{d}{du}h^{-1}(u) < 0. The product of the negative sign out front and the negative derivative gives a positive result. This is exactly fX(h1(u))dduh1(u)f_X(h^{-1}(u)) \cdot \left|\frac{d}{du}h^{-1}(u)\right|.

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:

fU(u)=fX(h1(u))dduh1(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.}

WHY THIS MATTERS: The absolute value of the derivative dx/du|dx/du| acts as a “stretching factor.” It tells you how much the transformation compresses or expands probability density at each point. When hh stretches the xx-axis (large dx/du|dx/du|), probability density gets diluted; when it compresses (small dx/du|dx/du|), density gets concentrated.

2.2When the Transformation Is Not One-to-One

Theorem 7.1 requires hh to be one-to-one. But what if it isn’t? For example, U=X2U = X^2 when XX ranges over both positive and negative values — both x=0.5x = 0.5 and x=0.5x = -0.5 give U=0.25U = 0.25. We handled this with the CDF method in Example 7.2, but there’s also a direct formula:

2.3Worked Examples

2.4Section 7.3 Exercises

  1. Let XUniform(0,1)X \sim \text{Uniform}(0, 1). Use the transformation method to find the PDF of U=eXU = e^X.

  2. Let XX have PDF fX(x)=4x3f_X(x) = 4x^3 for 0x10 \leq x \leq 1. Use the transformation method to find the PDF of U=ln(X)U = -\ln(X).

  3. Let XExponential(β=1)X \sim \text{Exponential}(\beta = 1). Use the transformation method to find the PDF of U=eXU = e^{-X}. What well-known distribution is this?

  4. If YN(μ,σ2)Y \sim N(\mu, \sigma^2), show that Z=YμσN(0,1)Z = \frac{Y - \mu}{\sigma} \sim N(0, 1) using the transformation method.

  5. Let XGamma(α,β)X \sim \text{Gamma}(\alpha, \beta). Use the transformation method to find the PDF of U=cXU = cX for a positive constant cc. Verify that UGamma(α,cβ)U \sim \text{Gamma}(\alpha, c\beta).


3The Method of Moment-Generating Functions

3.1The Key Principle

The MGF method rests on one powerful theorem from Chapter 4:

This means: if we compute MU(t)M_U(t) and it matches the MGF of a known distribution, then UU has that distribution. No integration needed.

3.2The Recipe for Sums

The MGF method is especially powerful for sums of independent random variables, because of the multiplication property:

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 UU is:

MU(t)=E(etU)=E(et(X1+X2++Xn))M_U(t) = E(e^{tU}) = E\left(e^{t(X_1 + X_2 + \cdots + X_n)}\right)

(Calculus flashback: The exponent rule ea+b=eaebe^{a+b} = e^a \cdot e^b extends to sums: et(X1+X2++Xn)=etX1etX2etXne^{t(X_1 + X_2 + \cdots + X_n)} = e^{tX_1} \cdot e^{tX_2} \cdots e^{tX_n}. This is the key step — it converts a sum inside an exponent into a product of exponentials.)

Using this rule:

MU(t)=E(etX1etX2etXn)M_U(t) = E\left(e^{tX_1} \cdot e^{tX_2} \cdots e^{tX_n}\right)

Now we use independence. Recall from Chapter 6 that if X1,,XnX_1, \ldots, X_n are independent, then for any functions g1,,gng_1, \ldots, g_n:

E[g1(X1)g2(X2)gn(Xn)]=E[g1(X1)]E[g2(X2)]E[gn(Xn)]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)]

Applying this with gi(Xi)=etXig_i(X_i) = e^{tX_i}:

MU(t)=E(etX1)E(etX2)E(etXn)=MX1(t)MX2(t)MXn(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)

WHY THIS IS SO POWERFUL: Without this theorem, finding the PDF of a sum X1+X2++XnX_1 + X_2 + \cdots + X_n would require computing an (n1)(n-1)-fold convolution integral — a nightmare for n>2n > 2. This theorem reduces the problem to multiplying nn simple functions and recognizing the result. Multiplication is always easier than convolution.

3.3Worked Examples

3.4Section 7.4 Exercises

  1. Let X1N(5,4)X_1 \sim N(5, 4) and X2N(2,9)X_2 \sim N(2, 9) be independent. Find the distribution of U=X1X2U = X_1 - X_2. (Hint: X1X2=X1+(1)X2X_1 - X_2 = X_1 + (-1)X_2. Use the result from Example 7.10.)

  2. Let X1,X2,X3X_1, X_2, X_3 be iid Poisson(4)\text{Poisson}(4). Find the distribution of U=X1+X2+X3U = X_1 + X_2 + X_3.

  3. Let Xiχ2(3)X_i \sim \chi^2(3) for i=1,2,3,4i = 1, 2, 3, 4 (independent). Find the distribution of U=X1+X2+X3+X4U = X_1 + X_2 + X_3 + X_4.

  4. If Z1,Z2,,ZnZ_1, Z_2, \ldots, Z_n are iid N(0,1)N(0, 1), show that i=1nZi2χ2(n)\sum_{i=1}^n Z_i^2 \sim \chi^2(n). (Hint: Use Examples 7.14 and 7.11.)

  5. Let XX and YY be independent, XBinomial(10,0.3)X \sim \text{Binomial}(10, 0.3) and YBinomial(15,0.3)Y \sim \text{Binomial}(15, 0.3). Without computing any convolutions, find P(X+Y=8)P(X + Y = 8).


4Multivariable Transformations

4.1The Jacobian

This is the direct generalization of Theorem 7.1. In one variable, the “Jacobian” was just dx/du|dx/du|. In two variables, it’s the absolute value of the determinant of a 2×22 \times 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 BB in the (u1,u2)(u_1, u_2)-space, the probability that (U1,U2)B(U_1, U_2) \in B equals the probability that (X1,X2)A(X_1, X_2) \in A, where AA is the corresponding region in (x1,x2)(x_1, x_2)-space. That is:

P((U1,U2)B)=P((X1,X2)A)=AfX1,X2(x1,x2)dx1dx2P((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

By the multivariable change-of-variables theorem from calculus, when we substitute x1=g1(u1,u2)x_1 = g_1(u_1, u_2) and x2=g2(u1,u2)x_2 = g_2(u_1, u_2), the differential element transforms as:

dx1dx2=Jdu1du2dx_1 \, dx_2 = |J| \, du_1 \, du_2

where JJ 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:

AfX1,X2(x1,x2)dx1dx2=BfX1,X2(g1(u1,u2),g2(u1,u2))Jdu1du2\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

Since this holds for every region BB, the integrand must be the joint PDF of (U1,U2)(U_1, U_2):

fU1,U2(u1,u2)=fX1,X2(g1(u1,u2),g2(u1,u2))Jf_{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|

WHY THE JACOBIAN APPEARS: The Jacobian determinant J|J| measures how the transformation distorts area. If a small rectangle in (x1,x2)(x_1, x_2)-space gets stretched into a larger region in (u1,u2)(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=dx1dx2/(du1du2)|J| = dx_1 \, dx_2 / (du_1 \, du_2).

4.2Section 7.5 Exercises

  1. Let X1,X2X_1, X_2 be iid Exponential(1)\text{Exponential}(1). Use a multivariable transformation with U=X1+X2U = X_1 + X_2, V=X1/(X1+X2)V = X_1/(X_1 + X_2) to show that UU and VV are independent, and find their marginal distributions.

  2. Let X1X_1 and X2X_2 be independent with XiN(0,1)X_i \sim N(0, 1). Define U=X12+X22U = X_1^2 + X_2^2 and V=X1/X2V = X_1/X_2. Find the marginal distributions of UU and VV. (This is the derivation of the χ2(2)\chi^2(2) and Cauchy distributions from standard normals.)

  3. Let X1,X2X_1, X_2 be independent Uniform(0, 1). Find the joint PDF of U1=min(X1,X2)U_1 = \min(X_1, X_2) and U2=max(X1,X2)U_2 = \max(X_1, X_2) using the Jacobian method. (Hint: first condition on X1<X2X_1 < X_2 and X1>X2X_1 > X_2 separately.)


5Order Statistics

5.1The Distribution of the Maximum and Minimum

We start with the two most important order statistics: the maximum and minimum.

PROOF

Strategy: The maximum is y\leq y if and only if ALL values are y\leq y. Use independence.

FY(n)(y)=P(Y(n)y)=P(Y1y,Y2y,,Yny)F_{Y_{(n)}}(y) = P(Y_{(n)} \leq y) = P(Y_1 \leq y, Y_2 \leq y, \ldots, Y_n \leq y)

By independence:

=P(Y1y)P(Y2y)P(Yny)=[F(y)]n= P(Y_1 \leq y) \cdot P(Y_2 \leq y) \cdots P(Y_n \leq y) = [F(y)]^n

Differentiating to get the PDF:

(Calculus flashback: To differentiate [F(y)]n[F(y)]^n with respect to yy, use the Chain Rule. Let w=F(y)w = F(y), so ddywn=nwn1dwdy=n[F(y)]n1f(y)\frac{d}{dy}w^n = nw^{n-1} \cdot \frac{dw}{dy} = n[F(y)]^{n-1} \cdot f(y), since F(y)=f(y)F'(y) = f(y) by the Fundamental Theorem of Calculus.)

fY(n)(y)=n[F(y)]n1f(y)f_{Y_{(n)}}(y) = n[F(y)]^{n-1} f(y)

PROOF

Strategy: It’s easier to compute P(Y(1)>y)P(Y_{(1)} > y) — the minimum exceeds yy if and only if ALL values exceed yy.

P(Y(1)>y)=P(Y1>y,Y2>y,,Yn>y)=[1F(y)]nP(Y_{(1)} > y) = P(Y_1 > y, Y_2 > y, \ldots, Y_n > y) = [1 - F(y)]^n

So FY(1)(y)=1[1F(y)]nF_{Y_{(1)}}(y) = 1 - [1 - F(y)]^n. Differentiating gives the PDF. ∎

5.2The General kkth Order Statistic

PROOF

Strategy: We derive this rigorously using the CDF and the multinomial counting argument. For Y(k)Y_{(k)} to fall in an infinitesimal interval [y,y+dy)[y, y + dy), the nn observations must partition into three groups: exactly k1k - 1 below yy, exactly one in [y,y+dy)[y, y+dy), and exactly nkn - k above y+dyy + dy.

Step 1: Compute the CDF of Y(k)Y_{(k)}.

FY(k)(y)=P(Y(k)y)=P(at least k of the n observations arey)F_{Y_{(k)}}(y) = P(Y_{(k)} \leq y) = P(\text{at least } k \text{ of the } n \text{ observations are} \leq y)

Since the YiY_i are iid, each observation is y\leq y with probability p=F(y)p = F(y), independently. The number of observations y\leq y follows a Binomial(n,F(y))(n, F(y)) distribution:

FY(k)(y)=j=kn(nj)[F(y)]j[1F(y)]njF_{Y_{(k)}}(y) = \sum_{j=k}^{n} \binom{n}{j} [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)} falls in the infinitesimal interval [y,y+dy)[y, y + dy) is:

fY(k)(y)dy=P(Y(k)[y,y+dy))f_{Y_{(k)}}(y)\,dy = P(Y_{(k)} \in [y, y + dy))

For this to happen, we need exactly three things simultaneously:

The number of ways to assign nn observations into these three groups is the multinomial coefficient:

n!(k1)!1!(nk)!\frac{n!}{(k-1)! \cdot 1! \cdot (n-k)!}

This counts the number of ways to choose which k1k-1 observations are below, which 1 is “at” yy, and which nkn-k are above. Multiplying:

fY(k)(y)dy=n!(k1)!(nk)![F(y)]k1f(y)dy[1F(y)]nkf_{Y_{(k)}}(y)\,dy = \frac{n!}{(k-1)!(n-k)!} [F(y)]^{k-1} \cdot f(y)\,dy \cdot [1 - F(y)]^{n-k}

Dividing both sides by dydy:

fY(k)(y)=n!(k1)!(nk)![F(y)]k1[1F(y)]nkf(y)f_{Y_{(k)}}(y) = \frac{n!}{(k-1)!(n-k)!} [F(y)]^{k-1} [1 - F(y)]^{n-k} f(y)

Sanity check: Setting k=1k = 1: fY(1)(y)=n!0!(n1)![F(y)]0[1F(y)]n1f(y)=n[1F(y)]n1f(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) ✓ (matches Theorem 7.5).

Setting k=nk = n: fY(n)(y)=n!(n1)!0![F(y)]n1[1F(y)]0f(y)=n[F(y)]n1f(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) ✓ (matches Theorem 7.4).

5.3Joint Distribution of Order Statistics

PROOF

Strategy: The joint PDF of the original (unsorted) sample (Y1,,Yn)(Y_1, \ldots, Y_n) is f(yi)\prod 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:

fY1,,Yn(y1,,yn)=i=1nf(yi)f_{Y_1, \ldots, Y_n}(y_1, \ldots, y_n) = \prod_{i=1}^n f(y_i)

Step 2: Consider a specific sorted sequence y1<y2<<yny_1 < y_2 < \cdots < y_n. How many orderings of the original sample produce this exact sorted sequence as the order statistics? The answer is n!n! — any of the n!n! permutations of the indices maps to the same sorted order. (For example, if n=3n = 3 and the sorted values are 0.2<0.5<0.90.2 < 0.5 < 0.9, then (Y1,Y2,Y3)(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.9,0.5)(0.2, 0.9, 0.5), (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).)

Step 3: Since each of these n!n! permutations contributes probability density f(yi)\prod 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:

fY(1),,Y(n)(y1,,yn)=n!i=1nf(yi),y1<y2<<ynf_{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

The restriction y1<y2<<yny_1 < y_2 < \cdots < y_n is essential: order statistics are defined to be sorted, so the density is zero outside this region.

The factor n!n! accounts for the 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)} and Y(n)Y_{(n)} used in range problems).

5.4Section 7.6 Exercises

  1. Let Y1,Y2,Y3Y_1, Y_2, Y_3 be iid Uniform(0,θ)\text{Uniform}(0, \theta). Find the PDF of Y(3)=max(Y1,Y2,Y3)Y_{(3)} = \max(Y_1, Y_2, Y_3). Show that E(Y(3))=3θ4E(Y_{(3)}) = \frac{3\theta}{4}.

  2. Let Y1,,YnY_1, \ldots, Y_n be iid Exponential(β)\text{Exponential}(\beta). Show that Y(1)Exponential(β/n)Y_{(1)} \sim \text{Exponential}(\beta/n).

  3. Let Y1,Y2,Y3,Y4Y_1, Y_2, Y_3, Y_4 be iid Uniform(0,1)\text{Uniform}(0, 1). Find the PDF of the median, Y(2)Y_{(2)}, using the formula for the kkth order statistic.

  4. Five sensors independently measure a temperature. Each measurement follows a Uniform(98,102)\text{Uniform}(98, 102) distribution. Find the PDF of the range R=Y(5)Y(1)R = Y_{(5)} - Y_{(1)}. (Hint: use the joint distribution of Y(1)Y_{(1)} and Y(5)Y_{(5)} from Theorem 7.7 applied to the first and last order statistics, then transform.)

  5. Let Y1,,Y10Y_1, \ldots, Y_{10} be iid with CDF F(y)=1eyF(y) = 1 - e^{-y} for y>0y > 0. Find P(Y(10)>3)P(Y_{(10)} > 3).


6⭐ Bonus: The Probability Integral Transform

PROOF

Strategy: Apply the CDF method. Since FXF_X is a CDF, it maps from (,)(-\infty, \infty) to (0,1)(0, 1), so UU takes values in (0,1)(0, 1). We compute FU(u)F_U(u) directly.

Step 1: Since FXF_X is strictly increasing, it has an inverse FX1F_X^{-1}. So:

FU(u)=P(Uu)=P(FX(X)u)=P(XFX1(u))F_U(u) = P(U \leq u) = P(F_X(X) \leq u) = P(X \leq F_X^{-1}(u))

(Why? Because FXF_X is increasing, FX(X)uF_X(X) \leq u if and only if XFX1(u)X \leq F_X^{-1}(u).)

Step 2: By the definition of CDF:

P(XFX1(u))=FX(FX1(u))=uP(X \leq F_X^{-1}(u)) = F_X(F_X^{-1}(u)) = u

Step 3: So FU(u)=uF_U(u) = u for 0<u<10 < 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:


7⭐ Bonus: The Box-Muller Transform

PROOF

Strategy: Work backwards. Start with two independent 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 Z1,Z2iidN(0,1)Z_1, Z_2 \stackrel{\text{iid}}{\sim} N(0,1), their joint PDF is:

fZ1,Z2(z1,z2)=12πez12/212πez22/2=12πe(z12+z22)/2f_{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}

Notice: this depends on z1z_1 and z2z_2 only through z12+z22=r2z_1^2 + z_2^2 = r^2 — it’s rotationally symmetric. This is the key insight.

Step 2: Convert to polar coordinates.

Define R0R \geq 0 and 0Θ<2π0 \leq \Theta < 2\pi by Z1=RcosΘZ_1 = R\cos\Theta, Z2=RsinΘZ_2 = R\sin\Theta.

(Calculus flashback: The Jacobian of polar-to-Cartesian is J=r|J| = r. This comes from the area element dA=rdrdθdA = r\,dr\,d\theta. Specifically: z1r=cosθ\frac{\partial z_1}{\partial r} = \cos\theta, z1θ=rsinθ\frac{\partial z_1}{\partial \theta} = -r\sin\theta, z2r=sinθ\frac{\partial z_2}{\partial r} = \sin\theta, z2θ=rcosθ\frac{\partial z_2}{\partial \theta} = r\cos\theta. Determinant: rcos2θ+rsin2θ=rr\cos^2\theta + r\sin^2\theta = r.)

Applying Theorem 7.3 with J=r|J| = r:

fR,Θ(r,θ)=12πer2/2rf_{R, \Theta}(r, \theta) = \frac{1}{2\pi} e^{-r^2/2} \cdot r

for r>0r > 0, 0θ<2π0 \leq \theta < 2\pi.

Step 3: Factor into independent components.

fR,Θ(r,θ)=rer2/2PDF of R (Rayleigh)    12π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)}}

The joint PDF factors as g(r)h(θ)g(r) \cdot h(\theta), so RR and Θ\Theta are independent. ΘUniform(0,2π)\Theta \sim \text{Uniform}(0, 2\pi) and RR has the Rayleigh PDF fR(r)=rer2/2f_R(r) = re^{-r^2/2}.

Step 4: Express RR and Θ\Theta via Uniforms using the Inverse CDF Method.

For Θ\Theta: Since ΘUnif(0,2π)\Theta \sim \text{Unif}(0, 2\pi), set Θ=2πU2\Theta = 2\pi U_2 where U2Unif(0,1)U_2 \sim \text{Unif}(0,1).

For RR: The CDF is FR(r)=0rtet2/2dtF_R(r) = \int_0^r t\,e^{-t^2/2}\,dt. Using uu-substitution with w=t2/2w = t^2/2, dw=tdtdw = t\,dt:

FR(r)=0r2/2ewdw=1er2/2F_R(r) = \int_0^{r^2/2} e^{-w}\,dw = 1 - e^{-r^2/2}

Set U1=FR(R)=1eR2/2U_1 = F_R(R) = 1 - e^{-R^2/2} and solve for RR:

eR2/2=1U1    R2/2=ln(1U1)    R=2ln(1U1)e^{-R^2/2} = 1 - U_1 \implies R^2/2 = -\ln(1 - U_1) \implies R = \sqrt{-2\ln(1 - U_1)}

Since 1U1Unif(0,1)1 - U_1 \sim \text{Unif}(0,1) when U1Unif(0,1)U_1 \sim \text{Unif}(0,1), we simplify: R=2lnU1R = \sqrt{-2\ln U_1}.

Step 5: Substitute back into Z1=RcosΘZ_1 = R\cos\Theta, Z2=RsinΘZ_2 = R\sin\Theta:

Z1=2lnU1  cos(2πU2),Z2=2lnU1  sin(2πU2)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)

WHY THIS IS BEAUTIFUL: One result that uses every major idea from this chapter — the Jacobian (polar coordinates), the PIT (generating RR from U1U_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")





87.8* The Delta Method: Approximating Transformations (Optional Enrichment)

8.1The Key Idea

If YY is a random variable with mean μ\mu and variance σ2\sigma^2, and gg is a differentiable function, then we can approximate g(Y)g(Y) near μ\mu using a Taylor expansion:

g(Y)g(μ)+g(μ)(Yμ)g(Y) \approx g(\mu) + g'(\mu)(Y - \mu)

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)

Taking the variance:

Var(g(Y))[g(μ)]2Var(Y)=[g(μ)]2σ2\text{Var}(g(Y)) \approx [g'(\mu)]^2 \cdot \text{Var}(Y) = [g'(\mu)]^2 \sigma^2

8.2Why Is This Useful?

The exact distribution of g(Y)g(Y) can be very hard to find (try finding the density of g(Y)=ln(Y)g(Y) = \ln(Y) when YY is Gamma!). But the Delta Method gives you the mean and variance immediately, without any of the CDF/transformation machinery.

8.3Worked Examples

Example D.1 (Variance of a Reciprocal). Suppose YY has mean μ=10\mu = 10 and variance σ2=4\sigma^2 = 4. You need the variance of U=1/YU = 1/Y.

Here g(y)=1/yg(y) = 1/y and g(y)=1/y2g'(y) = -1/y^2, so g(μ)=1/100g'(\mu) = -1/100.

Var(1/Y)(1100)24=410,000=0.0004\text{Var}(1/Y) \approx \left(-\frac{1}{100}\right)^2 \cdot 4 = \frac{4}{10{,}000} = 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) where YY is the gross return. If YY has mean μ=1.08\mu = 1.08 and σ2=0.04\sigma^2 = 0.04:

g(y)=ln(y)g(y) = \ln(y), g(y)=1/yg'(y) = 1/y, g(μ)=1/1.080.926g'(\mu) = 1/1.08 \approx 0.926.

Var(lnY)(0.926)20.04=0.0343\text{Var}(\ln Y) \approx (0.926)^2 \cdot 0.04 = 0.0343

Compare with the exact answer (if YY were lognormal): ln(1+0.04/1.082)=ln(1.0343)=0.0337\ln(1 + 0.04/1.08^2) = \ln(1.0343) = 0.0337. The approximation is very close!

Example D.3 (Variance Stabilizing Transformation for Poisson). If XPoisson(λ)X \sim \text{Poisson}(\lambda) with large λ\lambda, then E[X]=λE[X] = \lambda and Var(X)=λ\text{Var}(X) = \lambda. The variance depends on the mean, which is inconvenient for many statistical procedures.

Let U=XU = \sqrt{X}. By the Delta Method with g(x)=xg(x) = \sqrt{x} and g(x)=12xg'(x) = \frac{1}{2\sqrt{x}}:

Var(X)(12λ)2λ=λ4λ=14\text{Var}(\sqrt{X}) \approx \left(\frac{1}{2\sqrt{\lambda}}\right)^2 \cdot \lambda = \frac{\lambda}{4\lambda} = \frac{1}{4}

The variance of X\sqrt{X} is approximately 1/41/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.



97.R The R Verification Lab


# ================================================================
# 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")


10Chapter 7 Refresh Exercises

These exercises integrate concepts from across the entire chapter.

  1. Let XUniform(0,2)X \sim \text{Uniform}(0, 2). Use the CDF method to find the PDF of U=X3U = X^3. Then verify your answer using the transformation method.

  2. Let XN(0,1)X \sim N(0, 1). Find the PDF of U=XU = |X| using the CDF method. (This is the “half-normal” distribution — used in Bayesian statistics as a prior for standard deviations.)

  3. Let X1,X2,,X10X_1, X_2, \ldots, X_{10} be iid Exponential(β=5)\text{Exponential}(\beta = 5). Find the distribution of U=2i=110Xi/βU = 2\sum_{i=1}^{10} X_i / \beta. (Hint: first find the distribution of the sum using MGFs, then apply the scaling property of the Gamma family.)

  4. Let XX and YY be independent Uniform(0,1)\text{Uniform}(0, 1). Define U=max(X,Y)U = \max(X, Y) and V=min(X,Y)V = \min(X, Y). Find the joint PDF of (U,V)(U, V) and the PDF of W=UVW = U - V (the range).

  5. Let X1Gamma(3,2)X_1 \sim \text{Gamma}(3, 2) and X2Gamma(5,2)X_2 \sim \text{Gamma}(5, 2) be independent. Find the distribution of R=X1/(X1+X2)R = X_1 / (X_1 + X_2).

  6. A reliability engineer tests 20 identical light bulbs. Each bulb’s lifetime is iid Exponential(β=1000)\text{Exponential}(\beta = 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(all 20 bulbs last at least 50 hours)).

  7. Let Z1,Z2,,Z8Z_1, Z_2, \ldots, Z_8 be iid N(0,1)N(0,1). Find the distribution of W=Z12+Z22++Z82W = Z_1^2 + Z_2^2 + \cdots + Z_8^2 and compute P(W>15.507)P(W > 15.507).

  8. Let Y1,Y2,Y3,Y4,Y5Y_1, Y_2, Y_3, Y_4, Y_5 be iid from a distribution with CDF F(y)=y3F(y) = y^3 for 0y10 \leq y \leq 1. Find the PDF of the median Y(3)Y_{(3)}.

  9. A factory makes resistors whose resistance (in ohms) follows a N(100,4)N(100, 4) distribution. Power dissipated is P=V2/RP = V^2/R, where voltage is a constant V=12V = 12 volts. Find the approximate distribution of PP using a first-order Taylor expansion: PV2/μR+(V2/μR2)(RμR)P \approx V^2/\mu_R + (-V^2/\mu_R^2)(R - \mu_R). (This is the “Delta Method” preview.)

  10. (Challenge) Let XX and YY be iid Exponential(1)\text{Exponential}(1). Use the transformation U=X/(X+Y)U = X/(X+Y), V=X+YV = X + Y to show that UUniform(0,1)U \sim \text{Uniform}(0, 1) and that UU and VV are independent. (This is a special case of Example 7.15 with α1=α2=1\alpha_1 = \alpha_2 = 1, and it explains why Beta(1,1)=Uniform(0,1)\text{Beta}(1, 1) = \text{Uniform}(0,1).)