How to make error less than 0.01

171 Views Asked by At

The statement reads as follows: Let $f(x)=e^x$ and $I=[0,5]$. How many equidistant nodes have to be chosen such that the aprox. error $||f-p(f,t)||_\infty$ is less than 0.01.

What i've done so far is to go into matlab and create an array of nodes, like this: [0:0.28:5] and then evaluate the infinity norm which is bounded by $max_{y\in I} |f^{(n+1)}(y)| \frac{(t_n-t_0)^{n+1}}{(n+1)!}$

And my answer was something around 18 nodes, but I don't believe this is the right approach, can someone please point me in the right direction?

1

There are 1 best solutions below

0
On BEST ANSWER

Note that $f^{(n+1)}(y)=e^y$ for any $n \in \mathbb{N}$, and since $y\in I=[0,5]$, you get $\max_{y\in I} f^{(n+1)}(y)=e^5$.

Also, since $t_k \in I$ for all $k=0,\ldots,n$, you have $t_n-t_0\leq 5$, so the error is bounded by $$e^5 \cdot \tfrac{5^{n+1}}{(n+1)!}.$$

Then, if you find $n$ such that this bound is less than $0.01$ you will also have an error under $0.01$. (I think $n=20$ is the first such $n$, but of course, you're just working with bounds... the actual error can be way much smaller and so an $n$ smaller than $20$ might also work.)