# Cantor distribution

Parameters Probability mass function Cumulative distribution functionFile:CantorFunction.png Cumulative distribution function of the Cantor distribution none Cantor set none Cantor function 1/2 anywhere in [1/3, 2/3] n/a 1/8 0 -8/5 ${\displaystyle e^{t/2}\prod _{i=1}^{\infty }\cosh {\left({\frac {t}{3^{i}}}\right)}}$ ${\displaystyle e^{\mathrm {i} \,t/2}\prod _{i=1}^{\infty }\cos {\left({\frac {t}{3^{i}}}\right)}}$

The Cantor distribution is the probability distribution whose cumulative distribution function is the Cantor function.

This distribution has neither a probability density function nor a probability mass function, as it is not absolutely continuous with respect to Lebesgue measure, nor has it any point-masses. It is thus neither a discrete nor a continuous probability distribution, nor is it a mixture of these. Rather it is an example of a singular distribution.

Its cumulative distribution function is sometimes referred to as the Devil's staircase, although that term has a more general meaning.

## Characterization

The support of the Cantor distribution is the Cantor set, itself the (countably infinite) intersection of the sets

{\displaystyle {\begin{aligned}C_{0}=&[0,1]\\C_{1}=&[0,1/3]\cup [2/3,1]\\C_{2}=&[0,1/9]\cup [2/9,1/3]\cup [2/3,7/9]\cup [8/9,1]\\C_{3}=&[0,1/27]\cup [2/27,1/9]\cup [2/9,7/27]\cup [8/27,1/3]\cup \\&[2/3,19/27]\cup [20/27,7/9]\cup [8/9,25/27]\cup [26/27,1]\\C_{4}=&\cdots .\end{aligned}}}

The Cantor distribution is the unique probability distribution for which for any Ct (t ∈ { 0, 1, 2, 3, ... }), the probability of a particular interval in Ct containing the Cantor-distributed random variable is identically 2-t on each one of the 2t intervals.

## Moments

It is easy to see by symmetry that for a random variable X having this distribution, its expected value E(X) = 1/2, and that all odd central moments of X are 0.

The law of total variance can be used to find the variance var(X), as follows. For the above set C1, let Y = 0 if X ∈ [0,1/3], and 1 if X ∈ [2/3,1]. Then:

{\displaystyle {\begin{aligned}\operatorname {var} (X)&=\operatorname {E} (\operatorname {var} (X\mid Y))+\operatorname {var} (\operatorname {E} (X\mid Y))\\&={\frac {1}{9}}\operatorname {var} (X)+\operatorname {var} \left\{{\begin{matrix}1/6&{\mbox{with probability}}\ 1/2\\5/6&{\mbox{with probability}}\ 1/2\end{matrix}}\right\}\\&={\frac {1}{9}}\operatorname {var} (X)+{\frac {1}{9}}\end{aligned}}}

From this we get:

${\displaystyle \operatorname {var} (X)={\frac {1}{8}}.}$

A closed form expression for any even central moment can be found by first obtaining the even cumulants[1]

${\displaystyle \kappa _{2n}={\frac {2^{2n-1}(2^{2n}-1)B_{2n}}{n(3^{2n}-1)}},}$

where B2n is the 2nth Bernoulli number, and then expressing the moments as functions of the cumulants.