Tutorials › Statistical Theory I - Probability and Distribution Theory › Density Formula for Finite-To-One Transformations

Many-to-One Transformations · Tutorial 421 of 994

Density Formula for Finite-To-One Transformations

Learn how each regular inverse branch contributes to the density of a transformed random variable, and how to check the resulting formula.

Intermediate 10 min read

What You'll Learn

  • State the conditions under which a finite-to-one transformation has a density given by an inverse-branch sum.
  • Derive the density formula by applying one-to-one change of variables on each branch.
  • Compute transformed densities when multiple roots map to the same value.
  • Account for the absolute derivative and the contribution of every inverse root.
  • Check a derived density by verifying its support and total probability.

Why Multiple Inverse Branches Matter

For a one-to-one transformation \(Y=g(X)\), a value \(y\) of \(Y\) identifies one corresponding value of \(X\), namely \(g^{-1}(y)\). If \(g\) is not one-to-one, several different values of \(X\) can produce the same \(y\). Each such value contributes probability near \(y\), so the density of \(Y\) must add the contributions from all of them.

The size of a contribution also depends on how quickly \(g\) changes near the corresponding \(x\). A transformation that stretches an interval spreads its probability over a wider range of \(y\)-values, reducing density there; a transformation that compresses an interval increases density. The derivative accounts for this local change of scale, while the sum accounts for the multiple inverse branches.

Definition and Density Formula

Definition: Let \(X\) have density \(f\), and let \(Y=g(X)\). A value \(y\) is a regular value for \(g\) if every solution \(x\) of \(g(x)=y\) in the relevant support of \(X\) satisfies \(g'(x)\ne 0\). An inverse branch is the inverse of \(g\) restricted to an interval on which \(g\) is one-to-one.

Here is a useful version of the finite-to-one density formula. Suppose the density of \(X\) is supported on a union of finitely many disjoint open intervals \(I_1,\ldots,I_m\), up to a set having probability zero. Suppose \(g\) is continuously differentiable and strictly monotone on each \(I_j\), and \(g'(x)\ne 0\) there. Write \(J_j=g(I_j)\) and let \(h_j:J_j\to I_j\) denote the inverse on that branch. Then a density of \(Y=g(X)\) is

$$ f_Y(y)=\sum_{j:\,y\in J_j} \frac{f(h_j(y))}{|g'(h_j(y))|}. $$

Thus, at a regular value \(y\), the sum has one term for every inverse \(x\) in the support of \(X\) satisfying \(g(x)=y\). Equivalently, the formula can be written as

$$ f_Y(y)=\sum_{x:\,g(x)=y} \frac{f(x)}{|g'(x)|}, $$

where the sum is over the relevant inverse roots. A branch contributes only when \(y\) lies in its image. The formula specifies a density almost everywhere; its value at an individual point can be chosen arbitrarily without changing the distribution. In particular, a value where \(g'\) vanishes is not covered by the regular-value expression.

Why the Contributions Add

The proof is a change of variables on each one-to-one interval, followed by addition over the disjoint intervals. Let \(B\) be any Borel subset of the real line. The event \(g(X)\in B\) can be divided according to which interval contains \(X\). The part of the probability contributed by \(I_j\) is

$$ \int_{I_j} \mathbf{1}_{\{g(x)\in B\}} f(x)\,dx. $$

On \(I_j\), \(g\) is continuously differentiable, strictly monotone, and has nonzero derivative. Its inverse is differentiable on \(J_j\), with \(h_j'(y)=1/g'(h_j(y))\). Applying the one-dimensional change-of-variables formula to this branch gives

$$ \int_{I_j} \mathbf{1}_{\{g(x)\in B\}} f(x)\,dx = \int_{J_j} \mathbf{1}_{\{y\in B\}} \frac{f(h_j(y))}{|g'(h_j(y))|}\,dy. $$

The absolute value appears because the inverse branch may be decreasing, but probability is nonnegative and an integral over a transformed interval uses the absolute scale factor. Since the intervals are disjoint, their probabilities add. There are finitely many branches, so summing the integrals yields

$$ P(Y\in B) = \int_B \left( \sum_{j:\,y\in J_j} \frac{f(h_j(y))}{|g'(h_j(y))|} \right)dy. $$

This is exactly the defining integral property of a density of \(Y\), which proves the formula. Any excluded set of \(X\)-values has probability zero by assumption and therefore contributes nothing. \(\square\)

Worked Examples

Worked Example: A Tent-Shaped Transformation

Let \(X\sim\operatorname{Uniform}(0,2)\), so \(f(x)=1/2\) for \(0<x<2\). Define

$$ g(x)= \begin{cases} x, & 0<x<1,\\ 2-x, & 1<x<2. \end{cases} $$

The point \(x=1\) has probability zero, so its value does not affect the distribution. Both branches map onto \(0<y<1\). On the first branch, \(g(x)=y\) gives \(x=y\), with \(|g'(x)|=1\). On the second, \(g(x)=y\) gives \(x=2-y\), also with \(|g'(x)|=1\). Therefore, for \(0<y<1\),

$$ f_Y(y)=\frac{f(y)}{1}+\frac{f(2-y)}{1} =\frac12+\frac12=1. $$

Outside \((0,1)\), neither branch has an inverse, so the density is zero. Its total integral is \(\int_0^1 1\,dy=1\), as required. Omitting either inverse branch would give density \(1/2\) and total probability \(1/2\), revealing the error.

Worked Example: The Cosine of a Uniform Angle

Let \(X\sim\operatorname{Uniform}(0,2\pi)\), with density \(f(x)=1/(2\pi)\), and set \(Y=\cos X\). Divide the support at \(x=\pi\), where the derivative vanishes. The two open branches \((0,\pi)\) and \((\pi,2\pi)\) are strictly monotone and both map onto \((-1,1)\). For any \(-1<y<1\), put \(\alpha=\arccos(y)\), so \(0<\alpha<\pi\). The two roots are \(x_1=\alpha\) and \(x_2=2\pi-\alpha\).

Since \(g'(x)=-\sin x\), both roots have derivative magnitude \(\sqrt{1-y^2}\): indeed, \(\sin(\alpha)=\sqrt{1-y^2}\), and \(|\sin(2\pi-\alpha)|=\sin(\alpha)\). Each root contributes \(1/(2\pi\sqrt{1-y^2})\). Thus

$$ f_Y(y)= \begin{cases} \dfrac{1}{\pi\sqrt{1-y^2}}, & -1<y<1,\\[6pt] 0, & \text{otherwise}. \end{cases} $$

To check the normalization, use \(y=\sin t\), for \(-\pi/2<t<\pi/2\), or the standard integral of the arcsine density:

$$ \int_{-1}^{1}\frac{1}{\pi\sqrt{1-y^2}}\,dy =\frac{1}{\pi}\left[\arcsin(y)\right]_{-1}^{1} =1. $$

The endpoints \(y=-1\) and \(y=1\) correspond to single \(x\)-values, each having probability zero. The density formula is asserted almost everywhere, so its endpoint values do not affect the result.

Worked Example: Two Positive Roots of \(x+1/x=y\)

Let \(X\) have the exponential density \(f(x)=e^{-x}\) for \(x>0\), and define \(Y=X+1/X\). The derivative \(g'(x)=1-1/x^2\) is nonzero on each of \((0,1)\) and \((1,\infty)\). These branches have image \((2,\infty)\). For \(y>2\), solving \(x+1/x=y\) gives

$$ x^2-yx+1=0, \qquad x_-(y)=\frac{y-\sqrt{y^2-4}}{2}, \qquad x_+(y)=\frac{y+\sqrt{y^2-4}}{2}. $$

The roots are positive, and their product is \(1\), so \(0<x_-(y)<1<x_+(y)\): each belongs to a different branch. At either root,

$$ |g'(x)|=\left|1-\frac{1}{x^2}\right| =\frac{|x^2-1|}{x^2}. $$

Consequently, the contribution of a root \(x\) is \(e^{-x}x^2/|x^2-1|\). Adding both contributions gives

$$ f_Y(y)= \frac{e^{-x_-(y)}x_-(y)^2}{1-x_-(y)^2} + \frac{e^{-x_+(y)}x_+(y)^2}{x_+(y)^2-1}, \qquad y>2, $$

and \(f_Y(y)=0\) for \(y<2\). At \(y=2\), the roots merge at \(x=1\), where the derivative is zero, so the regular-value formula does not apply at that single value. This causes no probability mass there: \(P(Y=2)=P(X=1)=0\). The total integral of the displayed density is one by the proved change-of-variables result: the two branch integrals sum to \(\int_0^1 e^{-x}\,dx+\int_1^\infty e^{-x}\,dx=1\).

Common Pitfalls and a Practical Check

The most frequent mistake is to solve \(g(x)=y\), select one convenient root, and use only that root in the density. That calculation describes only the probability arriving from one branch. For the tent-shaped example, it produced \(1/2\) instead of the correct density \(1\). The correction is to list every root in the support and add every branch contribution.

  • Do not drop the absolute value. A decreasing branch has a negative derivative, but its density contribution is positive: the denominator is \(|g'(x)|\).
  • Do not include roots outside the support. An algebraic solution of \(g(x)=y\) contributes only if \(f(x)\) can be nonzero there.
  • Check the derivative at the roots. The regular-value formula requires a nonzero derivative on each branch. A value where roots merge or the derivative vanishes needs separate treatment; the formula as stated does not evaluate it.
  • Check support and total probability. The density must be zero outside the transformed support, and its integral must equal one.

The formula is useful because it reduces a many-to-one transformation to a collection of familiar one-to-one changes of variables. It also makes the geometry explicit: inverse roots identify the contributing locations, and the derivative at each root measures the local stretching or compression.

Check Your Understanding

For each question, identify the inverse branches before writing a density formula.

  1. Why must the finite-to-one formula add contributions from every inverse root in the support?
  2. For a decreasing inverse branch, why does the density formula still use a positive contribution?
  3. In the tent-shaped example, what incorrect density results if one of the two branches is omitted?
  4. For the cosine example, how many inverse roots correspond to a regular value \(y\in(-1,1)\), and what is the magnitude of the derivative at each?
  5. Why does the regular-value formula not apply directly at \(y=2\) for \(g(x)=x+1/x\), and why does that not imply an atom at \(Y=2\)?