Mathwords logoMathwords

Cantor Distribution — Definition, Formula & Example

The Cantor distribution is the probability distribution of a random number between 0 and 1 whose base-3 digits are chosen by fair coin flips: each digit is 0 or 2, never 1. It has no jumps and no density curve, which makes it the standard example of a singular continuous distribution.

A random variable XX has the Cantor distribution if its cumulative distribution function is the Cantor function FF (the "devil's staircase"). FF is continuous and nondecreasing on [0,1][0,1], with F(0)=0F(0)=0 and F(1)=1F(1)=1, and F′(x)=0F'(x)=0 for almost every xx. The distribution assigns probability 1 to the Cantor set CC, which has Lebesgue measure 0, and probability 0 to every single point. So it is neither discrete nor absolutely continuous.

Key Formula

X=∑k=1∞2Bk3k,B1,B2,…∼iidBernoulli(12)X = \sum_{k=1}^{\infty} \frac{2B_k}{3^k}, \qquad B_1, B_2, \ldots \overset{\text{iid}}{\sim} \text{Bernoulli}\left(\tfrac{1}{2}\right)
Where:
  • XX = The Cantor-distributed random variable, taking values in the Cantor set inside [0,1][0,1]
  • BkB_k = Independent fair coin flips equal to 0 or 1, each with probability 12\tfrac{1}{2}
  • 2Bk2B_k = The kk-th base-3 digit of XX, which is always 0 or 2
  • 3k3^k = Place value of the kk-th digit after the ternary point

Worked Example

Problem: Use the self-similarity of the Cantor distribution to find its mean and variance.
Step 1: Split off the first ternary digit. The remaining digits form a scaled copy X′X' with the same Cantor distribution, independent of the first flip BB.
X=2B3+X′3,B∼Bernoulli(12)X = \frac{2B}{3} + \frac{X'}{3}, \qquad B \sim \text{Bernoulli}\left(\tfrac{1}{2}\right)
Step 2: Take expected values. Since E[B]=12E[B] = \tfrac{1}{2} and E[X′]=E[X]E[X'] = E[X], you get an equation in μ=E[X]\mu = E[X].
μ=23⋅12+μ3  ⟹  23μ=13  ⟹  μ=12\mu = \frac{2}{3}\cdot\frac{1}{2} + \frac{\mu}{3} \;\Longrightarrow\; \frac{2}{3}\mu = \frac{1}{3} \;\Longrightarrow\; \mu = \frac{1}{2}
Step 3: Take variances. Because BB and X′X' are independent, the variances add. Use Var(B)=14\text{Var}(B) = \tfrac{1}{4} and solve for v=Var(X)v = \text{Var}(X).
v=49⋅14+v9  ⟹  89v=19  ⟹  v=18v = \frac{4}{9}\cdot\frac{1}{4} + \frac{v}{9} \;\Longrightarrow\; \frac{8}{9}v = \frac{1}{9} \;\Longrightarrow\; v = \frac{1}{8}
Answer: The mean is 12\tfrac{1}{2} and the variance is 18\tfrac{1}{8}. That variance is larger than the uniform distribution's 112\tfrac{1}{12}, because the Cantor distribution never places mass in the middle third (13,23)\left(\tfrac{1}{3}, \tfrac{2}{3}\right).

Why It Matters

In a measure-theoretic probability or real analysis course, the Cantor distribution is the go-to counterexample showing that "continuous" does not mean "has a density." It is the concrete case behind the singular part of the Lebesgue decomposition, which splits every distribution into discrete, absolutely continuous, and singular continuous pieces. It also appears in fractal geometry as the natural measure on a self-similar set.

Common Mistakes

Mistake: Assuming that a continuous CDF always has a density, so you try to get one by differentiating the Cantor function.
Correction: The Cantor function has derivative 0 almost everywhere, so integrating that "density" over [0,1][0,1] gives 0, not 1. The distribution has no probability density function. Compute probabilities from the CDF or from the digit construction instead.

Related Terms