# If $f$ is a pdf can we construct $g$ such that $x\sim U[0,1)$ implies $g(x)\sim f$

Let $f$ be some pdf over $[0,1)$. Here is my question: does there always exist an infinite partition $\{X_{s}\}_{s\,\in\, \mathrm{support}(f)}$ of $[0,1)$ such that if we define $g(x):[0,1)\rightarrow [0,1)$, $g(x)=s$ if and only if $x\in X_{s}$, then we obtain that $x\sim U[0,1)$ implies $g(x)\sim f$?

It seems to me like it must be the case, but I am not sure if there are any weird examples of $f$ where this doesn't hold. Any references appreciated, thanks in advance.

• Is it perhaps the transformation of cumulative distribution functions you were thinking of? Aug 12, 2014 at 15:09
• Shouldn't the result for CDFs be equivalent to the result for PDFs? Aug 12, 2014 at 15:17

Let $F(x)=\int_{-\infty}^x f(u) du$ be the corresponding cdf of $f$. Let $F^{-1}(y)=\inf\{x\in\mathbb{R}: F(x)\geq y\}$ be the corresponding quantile function of $f$ or $F$. Then $F^{-1}$ is the function $g$ that you want. This is because $F^{-1}$ has the property that $F^{-1}(U)\sim f$ if $U$ is a uniform random variable on $[0,1]$. This is also how the inverse transform sampling method works (proof).
• If my understanding is correct, what you want is a function $g: [0,1)\to[0,1)$ such that if $U$ is a uniform random variable on $[0,1)$ then $g(U)$ has the same distribution as the one characterized by the given pdf $f$. So my answer is just set the function $g(x)=\inf\left\{y\in\text{support}(f):\int_{-\infty}^y f(u)du\geq x\right\}$. Then the partition of the support of $f$ can be constructed accordingly as $X_s=\{x\in\text{support}(f): g(x)=s\}$. Since the notations $\sim F$ and $\sim f$ have the same meaning, there is nothing about the derivative $\frac{d}{dx} F^{-1}$. Aug 12, 2014 at 18:13