# Transforming discrete R.V. to uniform R.V.

Suppose that I can generate some random variable $X$ that is distributed according to the CDF $F$. If $F$ is continuous then $F(X)$ is uniform $[0,1]$ (can anyone explain this to me).

My question is if $F$ is a CDF of some discrete R.V. $X$, is there some method for generating a uniform $[0,1]$ random variable from $F$ in this case (references or sketch of proofs appreciated)?

This is purely from a probability theoretic perspective (the application is information theoretic cryptography) so I am not interesting in pseudo generation. I am looking for a way to transform $X$ to be a uniform R.V. on $[0,1]$. Thanks in advance.

• I get that. What if I can take an infinite number of draws from $F$? Then transform that random variable (the infinite sequence) to a uniform random? Commented Aug 6, 2014 at 15:56
• We can generate the binary expansion of a uniform on $[0,1]$ by sampling infinitely often. Commented Aug 6, 2014 at 16:10
(2) If you mean that you have a finite sample $x_1, x_2, ..., x_n$ of a continuous random variable $X$ with CDF $F$. Then $F(X)$ is uniformly distributed in $[0,1]$.
Since $F$ is non-decreasing and right-continuous then for $z \in [0,1]$
$$P[F(X) \leq z] = P[X \leq F^{-1}(z)]=F(F^{-1}(z)) = z.$$