Expected value of $\sin(X)$, where $X$ is a Cantor random variable

If your Cantor random variable $X$ had a PDF (probability distribution function) $f_X$ we would compute the integral $$E\bigl(\sin(X)\bigr)=\int_0^1\sin x \>f_X(x)\>dx\ .\tag{1}$$ Now $X$ does not have such a PDF, but a continuous CDF (cumulative distribution function) $F_X$, which is the so-called Cantor function $F_{\rm Cantor}:[0,1]\to[0,1]$, implemented in Mathematica as ${\tt CantorStaircase[x]}$. In order to introduce this function into $(1)$ we use partial integration and obtain $$\eqalign{E\bigl(\sin(X)\bigr)&=\int_0^1\sin x\>dF_X(x)=\bigl(\sin x\>F_X(x)\bigr)\biggr|_{x=0}^{x=1}-\int_0^1\cos x\> F_X(x)\>dx\cr &=\sin 1-\int_0^1\cos x\>F_{\rm Cantor}(x)\>dx\ .\cr}$$ Doing the last integral numerically Mathematica obtained $$E\bigl(\sin(X)\bigr)\doteq0.449158\ .$$


You are most probably asked for an exact formula and, as mentioned in a comment on main, the procedure to find it is indeed standard and based on characteristic functions as follows.

First, by definition, $X=\sum\limits_{n\geqslant1}X_n/3^n$ where $(X_n)$ is i.i.d. uniform on $\{0,2\}$, hence, for every real number $t$, $$E(e^{itX})=\prod\limits_{n\geqslant1}E(e^{itX_n/3^n})=\prod\limits_{n\geqslant1}\frac{1+e^{2it/3^n}}2=\prod\limits_{n\geqslant1}\left(e^{it/3^n}\cos(t/3^n)\right)$$ that is, $$E(e^{itX})=e^{it/2}\prod\limits_{n\geqslant1}\cos(t/3^n)$$ In particular, for $t=1$, $$E(\sin X)=\Im\left( E(e^{iX})\right)=\sin(1/2)\prod\limits_{n\geqslant1}\cos(1/3^n)$$ As regards numerical approximations, keeping only $N$ terms in the product of cosines yields a value overestimating the complete product by about $1/(16\cdot9^N)$, thus one can suggest the approximations $E(\sin X)\approx e_N$ with $$e_N=\left(1-\frac1{16\cdot9^N}\right)\cdot\sin(1/2)\prod\limits_{n=1}^N\cos(1/3^n)$$ One gets $$e_1=0.449890406\qquad e_2=0.449895438$$ $$e_3=0.449895499\qquad e_4=0.449895500$$ and $$E(\sin X)=0.449895500$$