Number Of Iterations Formula – Bisection Method

calculusnumerical methods

I have saw few questions and few formulas so I just want make sure all is correct:
Using the bisection method to fins the root of a function $f(x)$ on the interval $[4,6]$, What is the number of iterations needed such that the approbation error will not exceed $2\cdot 10^{-9}$?

So we first start with the fact that the absolute error of the bisection method is:

$$|x_n-x|\leq \frac{b-a}{2^n}$$

where $x_n\to x^*$ is the approximate root, $x$ is the root, $[a,b]$ is the interval and in the $n$ step we divide by $2^n$, we then look for an upper bound $\varepsilon$ such that :

$$\frac{b-a}{2^n}\leq \varepsilon $$

Taking log:

$$log(\frac{b-a}{2^n}) \leq log(\varepsilon)\iff log({b-a})-nlog(2) \leq log(\varepsilon)\iff log({b-a})-log(\varepsilon) \leq nlog(2)\iff \frac{log({b-a})-log(\varepsilon)}{log(2)} \leq n$$

So:

$$\frac{log({6-4})-log(2*10^{-9})}{log(2)} \leq n\iff 29.89\leq n$$

So we take $n=30$

Best Answer

Your approach is fine. As I read it you are off by $1$ because with $0$ iterations you already know to root to $\frac {|b-a|}2$ if you take your estimate to be the center of the interval. The denominator should then be $2^{n+1}$ and you wind up subtracting $1$ at the end.