Hexa Scholar

How a density changes under a transformation

An unmarked rolling press with a short strip of clay resting in front of it.
A rolling press stands ready to reshape a strip of clay.

The question

Can you turn a uniform input into the target density by changing the map?

  1. 1 SeeDrag the map to match a density.
  2. 2 TryTrace where an output band comes from.
  3. 3 ProveBuild the change-of-variables proof.
  4. 4 ApplyTry conversions, folds, and a sensor cap.
Before you start · 3 quick checks on area, undoing a map, and slope

Two ideas before you start

2 ideas

Probability is the shaded area

A shaded interval under a constant density. Change its width with the buttons.

The rectangle's height stays fixed. The band with more area has more probability.

Exact definition

A variable \(X\) has a probability density \(f_X\) if \(f_X\) is nonnegative, has total integral one, and gives interval probabilities by area.

\[P(a\lt X\le b)=\int_a^b f_X(x)\,dx.\]

Here \(a\le b\). The cumulative distribution function, or CDF, is \(F_X(x)=P(X\le x)\). It adds the area up to \(x\), so \(F_X'(x)=f_X(x)\) where the density is continuous. A single point under a density has probability zero. See PMF, PDF, and CDF for the difference between density and point mass.

A map moves both ends of a band

Two equal input steps on a curved map. The guides mark the input and output changes.

The two input steps have equal width. Switch bands to compare the output steps.

Exact definition

A transformation \(Y=g(X)\) applies a fixed function \(g\) to the input value. If \(g\) is strictly increasing or strictly decreasing on an interval, each output there has one input, \(x=g^{-1}(y)\). The symbol \(g^{-1}\) means the inverse function. It undoes \(g\).

For a differentiable map, the ratio of a small output width to its input width tends to \(\lvert g'(x)\rvert\) as an interval with endpoint \(x\) shrinks. Width uses absolute value because a decreasing map reverses the order of the ends.

Refresher on derivatives and scale

The chain rule says that if \(u=h(y)\) and \(A\) is differentiable at \(u\), the derivative of \(A(h(y))\) is \(A'(h(y))h'(y)\). If \(g\) and its inverse \(h\) are differentiable, use \(A=g\) and \(g(h(y))=y\). The product of the two derivatives at the matching points is one.

In one dimension the Jacobian of a differentiable map is its derivative, and its magnitude measures local length scaling. This lesson uses that one-dimensional scale. The proof uses this scale by differentiating the CDF.

1 See

Shape the map to match the target

The top plot shows the map g. Below it, thin lines trace the horizontal movement of the shaded band edges. The dashed density outline is the target.
2 Try

Where does an output band come from?

3 Prove

Derive the density from the CDF

Theorem for a monotone map

Let \(X\) have density \(f_X\) with all its mass in a bounded open interval \(I=(a,b)\). Assume \(f_X\) is continuous and strictly positive on \(I\) and zero outside \(I\). Let \(g\) be continuously differentiable on \(I\), strictly increasing or strictly decreasing there, with \(g'(x)\ne0\) for every \(x\in I\). Set \(Y=g(X)\), \(J=g(I)\), and let \(h=g^{-1}\) on \(J\).

For \(y\in J\), the output has density

\[\begin{aligned} f_Y(y)&= f_X(h(y))\,|h'(y)|\\ &=\frac{f_X(h(y))}{|g'(h(y))|}.\end{aligned}\]

Use density zero outside \(J\). The endpoints, when finite, have no point mass. Their density values can be chosen without changing any probability.

Fix \(y\) inside \(J\). Choose the true statement in each line, using the stated direction of \(g\) in each case.

4 Apply

Problems

Decide first where the input can land. Give each answer as a fraction or a decimal. For density questions, use the units named in the prompt.

Key point For a density, scale each relevant branch's contribution by its local change of width. If a whole band collapses to one value, compute the probability of its preimage as a point mass.
Level Intro Prerequisites Densities, CDFs, and the chain rule Time ~30 min

Further reading