# Example of non continuous random variable with continuous CDF

Can someone provide an example of $X$ being a non-continuous random variable with continuous cumulative distribution function?

For instance:

$X$ is discrete if it takes (at most) a countable number of values.

$X$ is continuous (or absolutely continuous) if its law $P^X$ admits a density $f(x)$.

Note: A random variable don't have to be necessarily discrete or continuous; just take a cumulative distribution function that is non-constant and continuous except in $0$. Then $X$ is neither continuous nor discrete.

I know that to ensure that $X$ is continuous, we need to ask $F_X \in C^1$, as $F_X \in C^0$ does not suffice.

I would then like to see a non continuous random variable with continuous cdf

## 1 Answer

A simple example is $X$ uniformly distributed on the usual Cantor set, in other words, $$X=\sum_{n\geqslant1}\frac{Y_n}{3^n},$$ for some i.i.d. sequence $(Y_n)$ with uniform distribution on $\{0,2\}$.

Other examples are based on binary expansions, say, $$X=\sum_{n\geqslant1}\frac{Z_n}{2^n},$$ for some i.i.d. sequence $(Z_n)$ with any nondegenerate distribution on $\{0,1\}$ except the uniform one.

These distributions have no density with respect to Lebesgue measure, even partly, since $P(X\in C)=1$ for some Borel set $C$ with zero Lebesgue measure. They have no atom either, in the sense that $P(X=x)=0$ for every $x$.

• This seems awesome. Can you add at least an hint (or a link) on how to compute their cdf, though? :) – Ant Jul 23 '14 at 16:36
• Which one? // Have you no idea how to do it? – Did Jul 23 '14 at 18:37
• For what concerns $X$: since $Y_n$ can only take the values $0, 1, 2$, it means that at every addition we make we are going to specify one of the $3^n$ partition of the cantor set. (of course, considering only $n$ cuts). As $n \to \infty$, the probability that $X$ lies in the cantor set is $1$, but it is known that the cantor set has measure $0$, so $X$ is not continuos. Why is $P(X=x) = 0$ though? – Ant Oct 4 '14 at 18:19
• Let me suggest to revise the construction of the Cantor set, which has 2^n parts, not 3^n, after n cuts. Relatedly, Y_n is never 1, only 0 or 2. – Did Oct 4 '14 at 19:16
• Oh right I got confused, thanks! . Can you offer an hint for $P(X=x)=0$? – Ant Oct 4 '14 at 21:10