# Approximation of Cantor function by piecewise constant function in $L^1$

Let $$c(x)$$ be Cantor function.

How can we prove that constant $$\frac{1}{2}$$ gives the best approximation in $$L^1$$ metric?

Let $$h(x)= \begin{cases} \frac14 \quad\text{for}\quad x\in[0,\frac13]\\ \frac12\quad\text{for}\quad x\in[\frac13,\frac23]\\ \frac34\quad\text{for}\quad x\in[\frac23,1] \end{cases}$$

Will this piecewise constant function $$h(x)$$ give the best approximation in $$L^1$$? If so how to prove that?

My thoughts on this are this piecewise constant function $$h(x)$$ will not give the best approximation. But then how can we get the best function with three constancy intervals. Or may be somehow express $$c(x)$$ to get explicitly extremal problem.

• What do you mean by "best" approximation? How can both $\frac{1}{2}$ and $h(x)$ give the "best" approximation? Is it not clear that one is much better? – Xander Henderson Nov 16 '18 at 19:11
• The question says "in $L_1$ metric", so the goodness of an approximation would be $\lVert h(x)-c(x)\rVert_1$ (where smaller is better) – Carmeister Nov 16 '18 at 19:17
• @XanderHenderson, best approximation means that $\inf_{r \in \mathbb{R}} \lVert c(x) - r \rVert_{L^1} = \lVert c(x)-r_0\rVert_{L^1}$, i.e. constant $r_0$ gives best approximation and it pretend to be $\frac12$. $h(x)$ is the function that has three constanty intervals, not just one. – ModeGen Nov 16 '18 at 19:33
• @Carmeister My confusion is not with the metric, but with the function(s?) approximating the Cantor function. Is the question "Is $x \mapsto \frac{1}{2}$ the best approximation?" or "Is $x \mapsto h(x)$ the best approximation?" "Best" in what sense? That is, what are the other candidate approximations against which these functions are being compared? Perhaps I am being dense, but I am having trouble parsing the question. – Xander Henderson Nov 16 '18 at 20:09
• @XanderHenderson, there are two questions actually: what is the best constant and what is the best 3 constanty interval function approximating $c(x)$. For example, best 3 constanty interval function $h(x)$ may has discontinuity points not in $\frac13$ and $\frac23$ or takes other values. – ModeGen Nov 16 '18 at 20:32