Function approximation

Camillo
I found this exercise interesting since a little unusual :

*Which constant function better approximate $f(x) = x^2 $ in $[0,1] $ ?

a) in the sense of $L^2$
b) in the sense of $ C^0 $
c) in the sense of $L^1 $

Risposte
gygabyte017
Thanks a lot gugo, you're right!

gugo82
The answer, though correct, is incomplete: in fact, gygabyte017 was assuming \(c\in [0,1]\) without justifying such an assumption.
To be more precise, while in cases (a) and (b) there is nothing to add to the given answer (because previuos computations don't really need assumption \(c\in [0,1]\) to work), there remains something to say in order to make the argument (c) complete.

Let us assume \(c\in \mathbb{R}\setminus [0,1]=]-\infty , 0[\cup ]1,\infty[\) and separate the two cases:

    [*:2fhhe223] \(c<0\): in such a case we get:
    \[
    \begin{split}
    \| f-c\|_1 &= \int_0^1|x^2-c|\ \text{d} x\\
    &= \int_0^1(x^2-c)\ \text{d} x\\
    &= \frac{1}{3} - c
    \end{split}
    \]

    [/*:m:2fhhe223]
    [*:2fhhe223] \(c>1\): in this case we get:
    \[
    \begin{split}
    \| f-c\|_1 &= \int_0^1|x^2-c|\ \text{d} x\\
    &= \int_0^1(c-x^2\ \text{d} x\\
    &= c-\frac{1}{3}
    \end{split}
    \][/*:m:2fhhe223][/list:u:2fhhe223]

    Therefore, in general, we get:
    \[
    \| f-c\|_1 = \begin{cases} \frac{1}{3} - c &\text{, if } c<0\\
    \frac{1}{3} - c + \frac{4}{3}\ c\sqrt{c} &\text{, if } 0\leq c\leq 1\\
    c-\frac{1}{3} &\text{, if } c>1
    \end{cases}
    \]
    and a simple graphical representation:
    [asvg]xmin=-3; xmax=4; ymin=-1; ymax=6;
    axes("","");
    strokewidth=2; stroke="red";
    plot("1/3 - x", -3,0); plot("1/3 - x + 4/3 x^(4/3)",0,1); plot("x - 1/3",1,5);[/asvg]
    shows that the minimum is assumed in \(c=1/4\), as gygabyte017 already correctly claimed. :wink:

Camillo
Right :D

gygabyte017
I'll give it a try, even though I'm not sure of what I did!



Bye :)

Rispondi
Per rispondere a questa discussione devi prima effettuare il login.