Why Multiple Inverse Branches Matter
A function need not be one-to-one. For example, both \(x=2\) and \(x=-2\) give \(x^2=4\). When \(Y=g(X)\), the probability at or below a value \(y\) depends on all values of \(X\) that map into the relevant set of \(Y\)-values. For a continuous variable, the density at \(y\) likewise collects probability contributions from every valid input value that maps to \(y\).
A reliable starting point is the cumulative distribution function: \(F_Y(y)=P(Y\le y)=P(g(X)\le y)\). This event-based definition works whether \(X\) is discrete or continuous and whether \(g\) is increasing, decreasing, or nonmonotone. In the continuous case, inverse branches provide a convenient way to calculate the density, provided their contributions are all included.
The Distribution and Density Formulas
For any random variable \(X\) and function \(g\), the transformed cumulative distribution is
This is the general method: describe the set of input values satisfying the inequality, then calculate its probability. If \(X\) is discrete, sum the probabilities of all input values that map to the desired output. In particular, several input values may combine into a single atom of \(Y\).
For the continuous density formula, suppose \(X\) has density \(f_X\), and that for a given \(y\) the equation \(g(x)=y\) has distinct solutions \(x_1(y),\ldots,x_k(y)\) in the support of \(X\). Suppose also that \(g\) is differentiable near each solution and \(g'(x_j(y))\ne 0\). Then, at output values where these conditions hold,
Only solutions in the support of \(X\) are included. The absolute derivative accounts for whether an individual branch is increasing or decreasing. At a critical value where \(g'\) is zero, or where the number of branches changes, this pointwise density formula may not apply as written. The CDF method remains valid, and a density may still exist on either side of such a point.
Why the Branch Contributions Are Added
On a single one-to-one branch \(x=h(y)\), a small output interval of width \(dy\) corresponds approximately to an input interval of width \(|h'(y)|\,dy\). The probability in that input interval is approximately \(f_X(h(y))|h'(y)|\,dy\). Since \(h'(y)=1/g'(h(y))\), dividing by \(dy\) gives that branch’s density contribution. If several distinct input intervals map to the same small output interval, their probabilities add.
The same reasoning can be expressed by dividing the input support into intervals on which \(g\) is one-to-one, applying the ordinary change-of-variables rule on each interval, and adding the resulting densities. This also explains why counting branches is essential: each branch corresponds to a distinct part of the input probability.
Worked Example: An Absolute Value With Unequal Branch Ranges
Let \(X\sim\operatorname{Uniform}(-2,3)\), so \(f_X(x)=1/5\) for \(-2<x<3\). Set \(Y=|X|\). Find \(F_Y\), the density of \(Y\), and \(P(0.5<Y\le2.5)\).
Method. Start with the CDF event \(|X|\le y\). For \(0\le y\le2\), this event is \(-y\le X\le y\), and both endpoints lie in the support. Its interval has length \(2y\), so \(F_Y(y)=2y/5\). For \(2<y\le3\), the lower endpoint \(-y\) is below the support of \(X\); the event within the support is \(-2\le X\le y\), of length \(y+2\). Thus
For the density, the inverse branches are \(x=y\) and \(x=-y\). Both are in the support when \(0<y<2\); only \(x=y\) is in the support when \(2<y<3\). Each branch has \(|g'(x)|=1\). Therefore
Finally, \(F_Y(2.5)=(2.5+2)/5=0.9\) and \(F_Y(0.5)=2(0.5)/5=0.2\). Hence \(P(0.5<Y\le2.5)=0.9-0.2=0.7000\). The density also integrates to \((2)(2/5)+(1)(1/5)=1\), as required. The branch count changes at \(y=2\), which is why the density changes there.
Worked Example: Squaring a Continuous Uniform Variable
Let \(X\sim\operatorname{Uniform}(-2,2)\), so \(f_X(x)=1/4\) on its support, and let \(Y=X^2\). Find the support, CDF, and density of \(Y\), then calculate \(P(1\le Y\le9/4)\).
Method. Since \(-2\le X\le2\), the output satisfies \(0\le Y\le4\). For \(0\le y\le4\),
For \(0<y<4\), the two inverse branches are \(x_1(y)=\sqrt y\) and \(x_2(y)=-\sqrt y\). On either branch, \(|g'(x)|=|2x|=2\sqrt y\). Each branch contributes \((1/4)/(2\sqrt y)=1/(8\sqrt y)\), so together they give
The endpoints have probability zero because \(X\) is continuous. For the requested probability, \(F_Y(9/4)=\sqrt{9/4}/2=3/4\), while \(F_Y(1)=1/2\). Therefore \(P(1\le Y\le9/4)=3/4-1/2=0.2500\). As a check, the CDF rises from \(0\) to \(1\), and integrating the density gives \(\left[\sqrt y/2\right]_0^4=1\).
Worked Example: Combining Discrete Inputs That Map to the Same Output
A discrete random variable \(X\) has the following distribution: \(P(X=-3)=0.10\), \(P(X=-1)=0.25\), \(P(X=2)=0.40\), and \(P(X=4)=0.25\). Define \(Y=X^2\). Find the distribution of \(Y\), \(P(Y\le4)\), and \(E[Y]\).
Method. List each input and its image. The input \(-3\) maps to \(9\), \(-1\) maps to \(1\), \(2\) maps to \(4\), and \(4\) maps to \(16\). These four outputs are distinct here, so their probabilities carry over unchanged:
The probabilities sum to \(0.25+0.40+0.10+0.25=1.00\). The event \(Y\le4\) includes \(Y=1\) and \(Y=4\), so \(P(Y\le4)=0.25+0.40=0.6500\). The expectation is
The answer is checked by confirming that each possible input was included and that the transformed probabilities total one. If two inputs had produced the same square, their probabilities would have needed to be added at that output.
A General Quadratic Transformation
A concave quadratic illustrates how two branches can contribute throughout the output range and merge at a maximum. Suppose \(X\sim\operatorname{Uniform}(0,4)\) and \(Y=X(4-X)\). The function increases up to \(x=2\), reaches its maximum \(4\), and then decreases. Solving \(x(4-x)=y\) gives the two inverse branches \(x=2-\sqrt{4-y}\) and \(x=2+\sqrt{4-y}\), for \(0<y<4\).
Worked Example: A Concave Quadratic With Two Valid Branches
For the model above, derive the CDF and density of \(Y\), and find \(P(3<Y\le4)\).
Method. The inequality \(x(4-x)\le y\) holds near the two endpoints of the input interval. For \(0\le y\le4\), the boundary points are \(2-\sqrt{4-y}\) and \(2+\sqrt{4-y}\). The total length of the two qualifying intervals is
Dividing by the input interval length \(4\) gives
For the density, \(g'(x)=4-2x\). At either inverse branch, the absolute derivative is \(2\sqrt{4-y}\), and the input density is \(1/4\). Each branch contributes \(1/(8\sqrt{4-y})\); adding both gives
Now \(F_Y(3)=1-\sqrt{1}/2=0.5\) and \(F_Y(4)=1\). Thus \(P(3<Y\le4)=1-0.5=0.5000\). The density’s antiderivative on this interval is \(-\frac12\sqrt{4-y}\), so its integral is \(\left[-\frac12\sqrt{4-y}\right]_3^4=0-(-0.5)=0.5\), agreeing with the CDF calculation. The density grows without bound as \(y\) approaches \(4\), but the integral remains finite; the branch formula was used only for \(y<4\), where the derivatives are nonzero.
Common Exam Trap: Keeping Only One Root
For \(Y=X^2\), solving \(x^2=y\) gives two roots, \(+\sqrt y\) and \(-\sqrt y\), whenever both are in the support. Using only the positive root would give \(f_Y(y)=1/(8\sqrt y)\) in the uniform example, half the correct density \(1/(4\sqrt y)\). It would also make the density integrate to only \(1/2\), contradicting the requirement that total probability equal one.
The correction is to check the support for every root and add the contribution from each valid branch. A root outside the support contributes nothing; a root inside the support must not be omitted. At a discrete output, use the corresponding probability sum rather than a continuous density formula.
Check Your Understanding
Work from the support and all valid preimages before checking your answers.
- Let \(X\sim\operatorname{Uniform}(-1,2)\) and \(Y=|X|\). Find \(P(Y>1)\) and the density on \(0<y<1\) and \(1<y<2\). (Answer: \(P(Y>1)=0.3333\); \(f_Y(y)=2/3\) on \(0<y<1\), and \(f_Y(y)=1/3\) on \(1<y<2\).)
- Let \(X\sim\operatorname{Uniform}(-3,3)\) and \(Y=X^2\). Find \(P(Y\le4)\) and \(f_Y(1)\). (Answer: \(P(Y\le4)=0.6667\); \(f_Y(1)=0.1667\).)
- A discrete \(X\) has \(P(X=-2)=0.30\), \(P(X=1)=0.20\), and \(P(X=2)=0.50\). For \(Y=X^2\), find the probabilities at each possible value and \(E[Y]\). (Answer: \(P(Y=1)=0.2000\), \(P(Y=4)=0.8000\), \(E[Y]=3.4000\).)
- Let \(X\sim\operatorname{Uniform}(0,6)\) and \(Y=X(6-X)\). Find \(P(Y>8)\) and \(f_Y(5)\). (Answer: \(P(Y>8)=0.3333\); \(f_Y(5)=0.0833\).)
- Let \(X\sim\operatorname{Uniform}(0,5)\) and \(Y=(X-2)^2\). Find \(F_Y(1)\) and \(f_Y(1)\). (Answer: \(F_Y(1)=0.4000\); \(f_Y(1)=0.2000\).)