Continuous random variables that are deterministic functions of one another

probabilityprobability distributionsrandom variables

I am reading the book Deep Learning from Ian Goodfellow. When discussing the technical details of continuous variables (page 69). It states the following:

Suppose we have two random variables $x$ and $y$, such that $y=g(x)$, where $g$ is an invertible, continuous, differentiable transformation. One might expect that $p_y = p_x(g^{-1}(y))$. This is actually not the case.

As a simple example, we have scalar random variables $x$ and $y$. Suppose $y=\frac{x}{2}$ and $x\sim U(0,1)$. If we use the rule $p_y(y)=p_x(2y)$ then $p_y$ will be $0$ everywhere except the interval $[0,\frac{1}{2}]$, an it will be $1$ on this interval. This means

$\int p_y(y)dy=\frac{1}{2}$,

which violates the definition of a probability distribution.

I understand the last statement. It is not a valid probability distribution because the integral of the PDF over the interval $[0,1]$ does not sum up to 1.

However, I do not understand how to come to the conclusion that $p_y$ will be 1 in the interval $[0,\frac{1}{2}]$ and $0$ everywhere else. Could you please explain the math behind this?

I saw a similar post, but the answer does not clarify my question.

Best Answer

Notice that if $p_y(y)= p_x(2y)$ then $p_y(y) = 1 \iff p_x(2y) = 1 \iff 2y\in [0,1] \iff y \in \left[0,\dfrac{1}{2}\right] $, showing that $p_y \equiv 1$ in $\left[0,\dfrac{1}{2}\right]$ and $0$ everywhere else.

Related Question