Before you readX is uniform between 0 and 1. Is X2 uniform too?
Watch: The determinant · 3Blue1Brown · Essence of Linear Algebra, ch. 6: the stretch factor below is the determinant in one dimension
Let Y=g(X) for a smooth function g that only goes up or only goes down. Probability is conserved: the mass in a small interval dx around x moves to an interval dy around y. So pY(y)∣dy∣=pX(x)∣dx∣, which gives
pY(y)=pX(g−1(y))dydg−1(y).
Where g squashes values together, the density piles up; where it stretches them, the density thins out. For Y=X2 with X uniform, g−1(y)=y, so pY(y)=2y1. That is not uniform, which answers the question above.
A linear map Y=aX+b gives pY(y)=∣a∣1pX(ay−b). That is why a shifted and scaled Gaussian is still Gaussian, and why z=(x−μ)/σ is standard normal.
For vectors, y=g(x), the derivative becomes the Jacobian matrix J of g−1, and the stretch factor becomes ∣detJ∣, the area scaling from Linear algebra. Machine learning uses this to sample from a model by transforming simple noise, as in variational autoencoders and normalising flows.
p_Y(0.5) = 0.71
X is uniform on [0, 1]: the dashed line at height 1. The bars are 4,000 evenly spread values of X, pushed through Y = Xᵏ. For k above 1 the map squashes values near 0 together, so they pile up there; the curve from the change-of-variables formula predicts the pile exactly.
Recall
Give the density of Y=g(X) for a monotone g.
Recall
Why does the change-of-variables formula have a derivative in it?
Recall
What is the density of Y=aX+b?
Exercise
X is uniform on [0,1] and Y=X2. Find pY(0.04).
Exercise
X is uniform on [0,1] and Y=3X+1. What is pY(y) for 1≤y≤4?
Exercise
X has density pX(x)=2x on [0,1], and Y=X2. Find pY(0.5).