I want to know how to find the number of iterations in fixed point method.
The book that i have, gives me 2 ways to find the number of iterations.
The first one:
$|p_n – p| \leq k^n max ${ $p_0 – a$,$b – p_0$}
The second one:
$|p_n – p| \leq \frac {k^n}{1-k} |p_1 – p_0$| , for all n>=1
I don't know how to find the value of k, and which one of them i should use to find the number of iterations, because there give different results.
For example in this function:
$f(x)= 2 + sin (x) – x = 0 $, in [a=2, b=3]
Tolerance = $10^-5$
$p_0=2$
What is the value of k and n?
Best Answer
Correction: probably you want to write $\lvert p_1-p_0\rvert$ on the right-hand side of the second inequality.
Since $f'(x)=\cos x -1$, one can take $$ k=\max\bigl\{\lvert\cos x -1|:x\in[2,3]\bigr\}, $$ which is a Lipschitz constant for $f$ in the interval $[2,3]$. In order to determine $n$ you need to solve, respectively, $$ k^n \max \{ p_0 - a,b - p_0\}=10^{-5} $$ and $$ \frac{k^n}{1-k} |p_1-p_0|=10^{-5}. $$