# Conditions for $g(X)$ to be a uniform random variable

Let $X$ be a random variable with any continuous distribution, and CDF $F_x$. The probability integral transform is the statement that $F_x(X)$ is uniform on $[0,1]$.

However, $g(X) = 1 - F_x(X)$ is identically distributed. With this in mind, my question is the following:

If $g(X)$ is uniform, are $g(x) = 1 - F_x(x)$ and $g(x) = F_x(X)$ the only two possibilities for $g$? Does it make a difference whether $g$ is monotonic?

Generally speaking, what can be said about two functions $p$ and $q$ if $p(X)$ and $q(X)$ have the same distribution?

• Every $$F_x$$ should read $$F_X$$ – Did Nov 22 '17 at 9:35

Not much. Consider $X$ a uniform RV on the unit interval. Define $f$ to be the identity, and $$g(x) = \begin{cases} x + \frac{1}{2} & x < \frac{1}{2}\\ x - \frac{1}{2} & \frac{1}{2} \le x \le 1 \end{cases}$$ Then $f(X)$ and $g(X)$ are both identically distributed. In fact, if $g$ is any "piecewise shuffling" of the interval like this, you get the same result. And you can even let

$$g(x) = \begin{cases} 2x & x < \frac{1}{2}\\ 1 - 2(x - \frac{1}{2}) & \frac{1}{2} \le x \le 1 \end{cases}$$

to get a more interesting case, where $g$ is continuous, but not 1-1.

I've been sloppy about 1-1-ness, etc., but the main idea is "there are tons of such function pairs, even when one of the functions is the identity."

=====

You actually asked something interesting in the middle there:

Does it make a difference whether $g$ is monotonic?

Let's think about that: suppose that $f$ is the identity, so the question becomes, "Can $g(X)$ distributed uniformly on the unit interval when $X$ is, and $g$ is monotone increasing?"

If $g$ is monotone, then it has only countably many discontinuities, and any discontinuity must be a jump discontinuity (see this question for some detail). Suppose that $g$ has a jump discontinuity at $a$, so that for $x< a$, $g(x) < C$, but for $x > A$, $g(x) > D$, with $D$ strictly greater than $C$.

What's the probability that $g(X)$ is in $[C, D]$? It's zero.

What's the probability that $f(X)$ is in $[C, D]$? It's $D - C$.

Conclusion: $g$ can have no jump discontinuities, hence $g$ is continuous. But then it follows easily (by comparing probabilities) that $g(x) = x$ for every $x$. So in the monotone-increasing case of a warped uniform random variable, the answer is "$g$ must be the identity."

• How do you explicitly compare probabilities? $P(g(X) < t) = P(X < t) = t$ for $0 \leq t \leq 1$. How do you get from here to saying $g$ is the identity? – Drew N Nov 24 '17 at 10:17
• If you're willing to assume that $g(X)$ has a pdf, then it's easy, for the pdf is the derivative of the cdf, and we know that the pdf for f is just $1$. Hence the pdf for g also has derivative 1, so the cdf for g looks like $u(x) = x + C$ for some constant $C$. But since $u(0) = 0$, we know that $C = 0$. Short form: the fundamental theorem of calculus, at least for nice-enough distributions. – John Hughes Nov 24 '17 at 14:00
• Morally speaking, it feels to me like we shouldn't need to require $g$ to be differentiable... also, did you use the monotone $\textit{increasing}$ assumption? It seems what you've done will hold for monotone decreasing just as well, but then it gets the wrong answer, because then $g(x)$ feels like it should be $1 - x$. – Drew N Nov 25 '17 at 15:08
• I agree -- I don't like assuming differentiability either. But my real analysis isn't all that strong, and I'd have to go read some more to handle anything more general. You're right about the increasing/decreasing thing -- there must be something rotten in that argument. But I'm not sharp enough to see what it is right now. – John Hughes Nov 25 '17 at 15:29

In addition to the tons of such function pairs mentioned in John Hughes's answer are those that use compositions with Lebesgue measure preserving maps between the unit square and the unit interval, and so on. The map $f$ that sends the number $x=\sum_{n>0} b_n 2^n\in [0,1]$ to the point on the square $(u,v)=(\sum_{n>0} b_{2n}2^{-n}, \sum_{n>0} b_{2n+1} 2^{-n})$, where the $b_n\in\{0,1\}$ are the digits in the binary representation of $x$, for example, maps 1 dimensional Lebesgue measure to 2 dimensional Lebesgue measure. Let $D$ be a disk in the unit square. Let $g$ be the identity function on $[0,1]^2\setminus D$ and a rotation on $D$. Then $g$ preserves 2 dimensional Lebesgue measure. Finally, $f^{-1}\circ g\circ f$ preserves 1 dimensional Lebesgue measure. Compose it with anything of the sort given in Hughes's answer.