estimate number of iterations to obtain an error

113 Views Asked by At

The function $$ f : [-\pi, \pi] \to [-\pi,\pi] ,~~ f(x)= \frac{\sin(x)}{2} $$ is a contraction. Hence the fixed point iteration $x_{k+1}= f(x_{k})$ starting from $x_{0}=\frac{\pi}{2} \in [-\pi , \pi]$ is converging to a fixed point $x^{*}$ How many iterations $k$ are at least necessary s.t. the error is guaranteed to satisfy $|x_{k}-x^{*}| \leq \frac{1}{1024}$

I hope I am not violating anything by reposting a question. I've come pretty close to solving the question I think. But I need the last trick which I haven't figured out yet. So far I am at

$|\bar{x}-x_{n}| \leq \frac{q^{n}}{1-q}|f(x_{0})-x_{0}|$. I have determined q as $|f'(x)| max \ x \in [- \pi , \pi]=\frac{1}{2}=q$

so I have to determine n such that

$\frac{q^{n}}{1-q}|f(x_{0})-x_{0}| \leq \frac{1}{1024}$

=$\frac{q^{n}}{1-q}|\frac{1}{2}-\frac{\pi}{2}| \leq \frac{1}{1024}$

=$\frac{q^{n}}{1-q}|\frac{1}{2}-\frac{\pi}{2}| \leq \frac{1}{1024}$

and then I am not sure how to determine this n