Intuition What this page is for
The parent note 4.9.14 gave you the machine:
f Y ( y ) = f X ( g − 1 ( y ) ) d y d x , (non-monotonic) f Y ( y ) = ∑ i f X ( x i ) d y d x i .
Here we run that machine on every kind of input it can meet — increasing maps, decreasing maps, folding maps, a map that squeezes a whole ray into a point, boundary/limit behaviour, a word problem, and an exam twist. Nothing new is introduced ; we make sure no scenario surprises you.
Before we start, three plain-word reminders so every symbol below is earned:
Definition The three names you'll keep seeing
X is the input random variable — the number that comes out of some random process, whose density f X you already know. "Density" = probability per unit length: how thickly the jam is spread on the ruler.
g is the transformation — the function you apply, Y = g ( X ) .
g − 1 is the inverse — the function that undoes g . If g sends x ↦ y , then g − 1 sends y ↦ x . The symbol d y d x is how much a tiny sliver of y -axis is stretched back into the x -axis: the stretch factor (Jacobian).
Every problem this topic throws lives in one of these cells. The right column names the worked example that hits it.
#
Case class
What is special about it
Hit by
A
g strictly increasing
inequalities keep their direction; d y d x > 0
Example 1
B
g strictly decreasing
inequalities flip ; d y d x < 0 , the $
\cdot
C
g non-monotonic / folding (two branches)
must sum over both roots ±
Example 3
D
g maps a whole ray to a point / degenerate & discrete mix
classic Y = max ( X , 0 ) : an atom appears
Example 4
E
Support / range boundary matters; density blows up at an edge (limiting behaviour)
Example 5
F
Word problem (real-world units) — voltage → power
Example 6
G
Exam twist : composite / affine-then-square, sign of a both ways
Example 7
We work all seven. Each begins with a Forecast — commit to a guess before reading the steps.
Worked example Increasing affine:
Y = 2 X + 1 , with X ∼ Uniform ( 0 , 1 )
Forecast: The uniform density is a flat block of height 1 on [ 0 , 1 ] . Stretch the axis by 2 . Will the new block be taller or shorter , and on what interval?
Step 1 — Find the inverse g − 1 . Why this step? The formula feeds on g − 1 ( y ) , so solve y = 2 x + 1 for x : x = 2 y − 1 .
Step 2 — Differentiate the inverse. Why this step? The stretch factor is d y d x , not g ′ . Here d y d x = 2 1 , magnitude 2 1 .
Step 3 — Find the new support. Why this step? f Y = 0 outside the range of g . As x runs over ( 0 , 1 ) , y = 2 x + 1 runs over ( 1 , 3 ) .
Step 4 — Assemble. With f X ≡ 1 on ( 0 , 1 ) :
f Y ( y ) = 1 ⋅ 2 1 = 2 1 , 1 < y < 3.
Verify: integrate: ∫ 1 3 2 1 d y = 2 1 ⋅ 2 = 1 . ✓ The block got shorter (height 2 1 ) and wider (length 2 ) — forecast confirmed: stretching by 2 dilutes the density by 2 .
Because the inequality never flipped, this is the textbook increasing case: F Y ( y ) = F X ( g − 1 ( y )) directly. See Cumulative Distribution Function for why the CDF route always works.
Worked example Decreasing affine:
Y = 1 − X , with X ∼ Uniform ( 0 , 1 )
Forecast: Y = 1 − X just reflects the interval ( 0 , 1 ) about 2 1 . Will the density change shape at all?
Step 1 — Inverse. Why? Solve y = 1 − x : x = 1 − y .
Step 2 — Derivative of inverse. Why? d y d x = − 1 . This is negative — a decreasing map. The raw formula through the CDF gives a minus sign because the inequality flips: g ( X ) ≤ y ⟺ X ≥ 1 − y , so F Y ( y ) = 1 − F X ( 1 − y ) . Differentiating: f Y ( y ) = − f X ( 1 − y ) ⋅ ( − 1 ) = f X ( 1 − y ) . The two minus signs cancel — exactly what d y d x = 1 packages for us.
Step 3 — Support. x ∈ ( 0 , 1 ) ⇒ y = 1 − x ∈ ( 0 , 1 ) .
Step 4 — Assemble. f Y ( y ) = 1 ⋅ ∣ − 1∣ = 1 , 0 < y < 1.
Verify: ∫ 0 1 1 d y = 1 . ✓ A reflection is length-preserving (stretch factor 1 ), so the density is unchanged — forecast confirmed.
Common mistake The trap this cell is designed to expose
If you forgot the absolute value and used the signed derivative − 1 , you'd get a negative density f Y = − 1 . Densities can never be negative — the ∣ ⋅ ∣ is what protects you.
This is the classic two-root case. Picture the parabola.
Worked example Square of a uniform:
Y = X 2 , with X ∼ Uniform ( − 1 , 1 )
Forecast: Squaring folds both x = + 0.5 and x = − 0.5 onto the same y = 0.25 . Two strips pour into one. Should f Y near y = 0 be large or small ?
Step 1 — List all roots of g ( x ) = y . Why this step? g is not one-to-one, so we sum over every preimage. For 0 < y < 1 , x 2 = y gives x = + y and x = − y ; both lie in the support ( − 1 , 1 ) .
Step 2 — Stretch factor per branch. Why? Each root x = ± y has d y d x = ± 2 y 1 , magnitude 2 y 1 for both.
Step 3 — Sum the two pourings. With f X ( x ) = 2 1 on ( − 1 , 1 ) :
f Y ( y ) = branch + 2 1 ⋅ 2 y 1 + branch − 2 1 ⋅ 2 y 1 = 2 y 1 , 0 < y < 1.
Step 4 — Support. Y = X 2 ∈ [ 0 , 1 ) , so f Y = 0 elsewhere.
Verify: ∫ 0 1 2 y 1 d y = [ y ] 0 1 = 1 . ✓ It blows up near y = 0 — small x -values crowd near 0 after squaring. Forecast: large near y = 0 , confirmed.
Compare with the parent's Example 2 (a normal squared → chi-square ): same folding mechanic, different f X .
Worked example Rectifier:
Y = max ( X , 0 ) , with X ∼ Uniform ( − 1 , 1 )
Forecast: Everything with x < 0 gets mapped to y = 0 . That is a whole interval of probability landing on a single point . Can a density describe that?
Step 1 — Split the input's behaviour. Why this step? g is not invertible: on x ≥ 0 it is the identity (nice), but on x < 0 it collapses to 0 (degenerate). Handle the two regions separately.
Step 2 — The collapsed part becomes an atom. Why? The event { Y = 0 } equals { X ≤ 0 } , which has probability
P ( Y = 0 ) = P ( X ≤ 0 ) = ∫ − 1 0 2 1 d x = 2 1 .
A finite probability sitting on one point is a point mass (atom), not something a density can carry. So Y is a mix : an atom of weight 2 1 at 0 , plus a continuous piece.
Step 3 — The identity part keeps its density. Why? On x > 0 , y = x , so d y d x = 1 and f Y ( y ) = f X ( y ) ⋅ 1 = 2 1 for 0 < y < 1 .
Step 4 — Write the full law.
Y = { 0 density 2 1 with probability 2 1 (atom) on ( 0 , 1 ) .
Verify: total mass = atom 2 1 + = 1/2 ∫ 0 1 2 1 d y = 1 . ✓ Forecast confirmed: a pure density cannot describe it — the change-of-variable formula only applies to the smooth branch, and the degenerate branch must be counted as an atom.
Common mistake The degenerate-input trap
Blindly writing f Y ( y ) = f X ( y ) on [ 0 , 1 ) loses the 2 1 atom at 0 — your "density" would only integrate to 2 1 . Whenever g is constant on a set of positive probability , expect an atom.
Worked example Log of a uniform:
Y = − ln X , with X ∼ Uniform ( 0 , 1 )
Forecast: As x → 0 + , − ln x → + ∞ ; as x → 1 − , − ln x → 0 + . So Y ranges over ( 0 , ∞ ) . Near which end will density pile up?
Step 1 — Inverse. Why? Solve y = − ln x : exponentiate both sides, x = e − y .
Step 2 — Stretch factor. Why d y d x and not g ′ ? The formula needs the derivative of the inverse : d y d x = − e − y , magnitude e − y .
Step 3 — Support / limits. Why check limits? Cell E is all about the edges. x ∈ ( 0 , 1 ) ⇒ y ∈ ( 0 , ∞ ) . As y → 0 + , f Y → 1 (finite); as y → ∞ , f Y → 0 (dies exponentially) — no blow-up here, unlike Example 3.
Step 4 — Assemble. With f X ≡ 1 :
f Y ( y ) = 1 ⋅ e − y = e − y , y > 0.
This is Exp ( 1 ) — the same Inverse Transform Sampling mechanic as the parent's Example 3.
Verify: ∫ 0 ∞ e − y d y = 1 . ✓ Density is heaviest near y = 0 and decays; the infinite tail carries vanishing mass. Forecast confirmed.
Worked example Voltage to power. A noisy voltage
V (volts) across a 1 Ω resistor is V ∼ N ( 0 , 1 ) . The power dissipated is P = V 2 (watts). Find f P .
Forecast: Physically P ≥ 0 always, and tiny voltages (near 0 ) are the most common. Where does power density concentrate?
Step 1 — Identify the transform. Why? P = g ( V ) = V 2 — folding, two branches v = ± p for p > 0 . Same machinery as Example 3, different f X .
Step 2 — Stretch factor per branch. v = ± p ⇒ d p d v = ± 2 p 1 , magnitude 2 p 1 .
Step 3 — Sum the branches. With f V ( v ) = 2 π 1 e − v 2 /2 (even in v , so both roots give equal terms):
f P ( p ) = 2 ⋅ 2 π 1 e − p /2 ⋅ 2 p 1 = 2 π p 1 e − p /2 , p > 0.
That is exactly χ 1 2 — squaring a standard normal voltage yields chi-square power.
Step 4 — Units sanity. p is in watts; f P ( p ) has units of 1/ watt (density = probability per watt), matching p 1 's dimension. ✓
Verify: ∫ 0 ∞ 2 π p 1 e − p /2 d p = 1 . ✓ Also the mean power is E [ P ] = E [ V 2 ] = Var ( V ) = 1 watt (this is LOTUS in action). Forecast confirmed: density piles up near p = 0 (small voltages are common) and has a heavy tail.
Worked example Composite transform:
Y = ( a X ) 2 = a 2 X 2 with a = 0 and X ∼ N ( 0 , 1 ) . Show the answer does not depend on the sign of a , and find f Y .
Forecast: Does flipping a → − a change the distribution of Y ? Squaring kills signs — guess before computing.
Step 1 — Reduce to a known case. Why? Y = a 2 X 2 . Let Z = X 2 ; from Example 6 / parent, Z ∼ χ 1 2 with f Z ( z ) = 2 π z 1 e − z /2 . Then Y = a 2 Z is an increasing affine map (since a 2 > 0 always) — Cell A machinery.
Step 2 — Inverse of the scaling. Why? y = a 2 z ⇒ z = a 2 y , and d y d z = a 2 1 , magnitude a 2 1 . Note a 2 is the same for + a and − a — the sign is already gone.
Step 3 — Assemble.
f Y ( y ) = f Z ( a 2 y ) ⋅ a 2 1 = 2 π ⋅ y / a 2 1 e − y / ( 2 a 2 ) ⋅ a 2 1 = 2 π a 2 y 1 e − y / ( 2 a 2 ) , y > 0.
Step 4 — Sign check. Why? Everywhere a appears it is as a 2 = ∣ a ∣ 2 . So f Y for a and − a are identical.
Verify: with a = 2 (so a 2 = 4 ): f Y ( y ) = 8 π y 1 e − y /8 and ∫ 0 ∞ f Y = 1 . ✓ Forecast confirmed: the sign of a is irrelevant; only a 2 (the variance scale) matters — this is exactly a scaled chi-square, i.e. the law of N ( 0 , a 2 ) squared.
Cell B: flip then abs value
Cell E: check edges and limits
Recall Self-test before you leave
Cover the table. For each, name the cell and the one thing that could go wrong.
Y = 3 X − 2 ::: Cell A (increasing); don't forget new support.
Y = 5 − X ::: Cell B (decreasing); keep the absolute value or density goes negative.
Y = X 2 , X symmetric ::: Cell C; sum both roots or you halve the density.
Y = max ( X , 0 ) ::: Cell D; a positive-probability collapse creates an atom.
Y = − ln X ::: Cell E; state the range ( 0 , ∞ ) and check the tail integrates.
Y = ( a X ) 2 ::: Cell G; only a 2 survives, sign of a irrelevant.
Mnemonic The scenario checklist
"Roots, Range, Reciprocal, |Abs|, Atoms?" — list all roots , fix the range , use the reciprocal derivative d y d x , take absolute value , and ask whether any branch collapses to an atom .