Can you simulate from a cantor distribution?

929 Views Asked by At

Has someone run across a method for generating random variates from a Cantor Distribution? It seems like its abstract definition prevents this. In essence, can one "invert" the Cantor Function?

1

There are 1 best solutions below

2
On

One way of looking at a random variable with a Cantor distribution is to start with a sequence of iid random variables $X_n$ that take values 0 and one with probability $\frac{1}{2}$ (think random bits, or fair coins). Then our Cantor random variable is $$Z=2 \sum_{n=1}^\infty \frac{X_n}{3^n}.$$ A particularly nice source of independent random bits is the bits in a uniform (0,1) random variable.

Of course, given finite time you only get finite precision, but the same is true of standard simulated random numbers. Since the cantor distribution is continuous, you can get as close as you need to.