2

The cantor function can be defined in $c(x) : [0,1] \rightarrow [0,1]$ by

  1. Express $x$ in base 3.
  2. If $x$ contains a 1, replace every digit after the first 1 by 0.
  3. Replace all 2s with 1s.
  4. Interpret the result as a binary number. The result is $c(x)$.

or, equivalently, by the cumulative function of the cantor set.

How do I compute its inverse, $c^{-1}(y)$? does it exists?

(this problem was motivated by trying to sample from the cantor set using inverse transforming sampling)

Jorge Leitao
  • 585
  • 3
  • 20
  • 2
    What would you say $c^{-1}(\frac{1}{2})$ is? https://en.wikipedia.org/wiki/Cantor_function the graph is horizontal at y=1/2 – rikhavshah Aug 26 '16 at 05:14

1 Answers1

3

The Cantor function is continuous and monotone increasing. It is constant on each middle ternary interval with a value which is a dyadic rational. Any inverse is therefore discontinuous at dyadic rationals and you have to decide what the value of the inverse should be on those points. Some possible choices: $$ \phi_-(y) = \sup \{x\in[0,1]: c(x)<y \} \leq \phi_+(y)= \inf \{x\in [0,1] : c(x) >y \} $$ which pick respectively the minimum and maximum possible inverse value at dyadic rationals.

H. H. Rugh
  • 35,992