# interval halving

Interval halving is an efficient method for solving equations. The requirements for using this method are that we have an equation $f(x)=0$ where $f(x)$ is a continuous function, and two values $x_{1}$ and $x_{2}$ such that $f(x_{1})f(x_{2})<0$. Since $f(x_{1})$ and $f(x_{2})$ have opposite signs, we know by the intermediate value theorem that there exists a solution $\hat{x}$ and that $x_{1}\leq\hat{x}\leq x_{2}$, and with only $n+1$ function evaluations we can find a shorter interval of length $\epsilon=|x_{1}-x_{2}|2^{-n}$ that contains $\hat{x}$. If we take the solution $x_{s}=(x_{1}+x_{2})/2$ we get an error $|x_{s}-\hat{x}|<\epsilon$.

Algorithm IntervalHalving($x_{1},x_{2},f(x),\epsilon$)
Input: $x_{1},x_{2},f(x)$ as above. $\epsilon$ is the length of the desired interval
Output: A solution to the equation $f(x)=0$ that lies in an interval of length $<\epsilon$ . Requires $f(x_{1})f(x_{2})<0$

$start\leftarrow min(x_{1},x_{2})$
$end\leftarrow max(x_{1},x_{2})$
$middle\leftarrow(start+end)/2$

while $end-start<\epsilon$
begin

if $f(middle)f(start)<0$ then

$end\leftarrow middle$

else

$start\leftarrow middle$

$middle\leftarrow(start+end)/2$

end $x_{s}\leftarrow(start+end)/2$ // the solution

The algorithm works by taking an interval $[x_{1},x_{2}]$ and dividing it into two intervals of equal size. Look at a point in the middle, $x_{m}$. If the function changes sign in the interval $[x_{1},x_{m}]$, that is $f(x_{1})f(x_{m})<0$, then by the intermediate value theorem we have a solution in this interval. If not, then the solution is in the interval $[x_{m},x_{2}]$. Repeat this until you get a sufficiently smal interval.

Interval halving is very useful in that it only requires the function to be continuous. More efficient methods like Newton’s method require that the function is differentiable and that we have to have a good starting point. Interval halving has linear convergence while Newton’s method has quadratic convergence.

Title interval halving IntervalHalving 2013-03-22 14:20:02 2013-03-22 14:20:02 mathcam (2727) mathcam (2727) 12 mathcam (2727) Algorithm msc 49M15 bisection algorithm