# How we compute expectation of a singular random variable?

In probability (or measure) courses, we often see the Cantor distribution that is singular with respect to the Lebesgue measure. Its CDF is increasing but whenever its differentiable, the corresponding PDF is zero. But afterwards, we never use singular distributions. Sorry for my naive question but is it possible to work with them? Compute expectations? Variance? etc... Any book references?

In the case of any probability distribution of a non-negative random variable, including the Cantor distribution, we can compute $$F(x)=\mathrm{P}(X\gt x)$$ Then we can compute the expected value using $$\mathrm{E}(X)=\int_0^\infty F(x)\,\mathrm{d}x$$ and the variance using $$\mathrm{Var}(X)=\int_0^\infty2xF(x)\,\mathrm{d}x-\left(\int_0^\infty F(x)\,\mathrm{d}x\right)^2$$

• Thanks! Why this would not be true for all singular measures and not only the Cantor? If any monotone function can be integrated that would be the case right? May 15, 2014 at 2:35
• @SergioParreiras: It's true for all measures, yes. The question may become, if you don't have an explicit formula for $F$ (which you typically don't), how do you compute those integrals? May 15, 2014 at 2:44
• @SergioParreiras: It is true for more general random variables. I have extended the answer to cover the case of non-negative random variables. The general case is similar but the added complexity is not really that instructive.
– robjohn
May 15, 2014 at 3:19

It is certainly possible to "work with" such distributions, though sometimes you will need to use different methods than for continuous or discrete distributions. For example, the mean of the Cantor distribution is clearly $\frac{1}{2}$ by symmetry, and you can find more information (variance, mgf, etc) on its Wikipedia page.

Do they arise in practice? Yes, though certainly not as often as their continuous and discrete cousins. As a contrived example, consider the following game. Flip a fair coin. If it is heads, you win $\frac{2}{3}$ of a dollar; if it is tails you win nothing. On the next flip, heads wins you $\frac{2}{9}$ of a dollar and tails wins nothing. In general, on the $n$th flip, heads wins you $\frac{2}{3^n}$ dollars and tails wins nothing. Repeat indefinitely. How much money do you have at the end? Of course, it's a random variable, so call it $X$. What is the distribution of $X$? It's the Cantor distribution.

Written in symbols, if $\{\xi_n\}$ are iid Bernoulli, we have $X = \sum_{n=1}^\infty \frac{2}{3^n} \xi_n$, where the series converges with probability 1 by comparison with the geometric series.

This also makes it easy to compute the variance; since the $\xi_n$ are independent with $\newcommand{\Var}{\operatorname{Var}}\Var(\xi_n) = \frac{1}{4}$, we have $$\Var(X) = \sum_{n=1}^\infty \Var\left(\frac{2}{3^n} \xi_n\right) = \sum_{n=1}^\infty \left(\frac{2}{3^n}\right) \Var(\xi_n) = \sum_{n=1}^\infty \frac{4}{9^n} \cdot \frac{1}{4} = \sum_{n=1}^\infty \frac{1}{9^n}.$$ Summing the geometric series, we get $\Var(X) = \frac{1}{8}$.

• Thanks! You wrote "sometimes you will need to use different methods than for continuous or discrete distributions." do you know any book or articles that discuss these methods? May 15, 2014 at 1:54
• @SergioParreiras: I don't know that there are general techniques. You may have to use different methods for different distributions. May 15, 2014 at 2:44
• The construction above seems very interesting. If we define $X_n=\sum_{k=1}^n\frac{2}{3^k}\xi_k$ for any $n$ we have a discrete rv. But the limit (a.e.? prob.? dist.?) converges to a singular measure. If instead of $\frac 2{3^k}$ we had $\frac 1{2^k}$ we get the uniform right? This seems to give a recipe for constructing singular measures. Now I remember seeing something like that in Dudley's book centuries ago, must check. May 15, 2014 at 13:22
• I wish I could give two bounties instead of one. I feel robjohn answered the question as it is in the title but your comments were very helpful. May 15, 2014 at 15:50