[Math] the inverse of the cantor function? (if it exists)

inverse functionreal-analysis

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)

Best Answer

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.

Related Question