Bisection method-numerical analysis

  • Context:
  • Thread starter Thread starter evinda
  • Start date Start date
  • Tags Tags
    Analysis
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
38 replies · 8K views
Could you explain it further to me?
Because I found this:
When the interval is [[tex]a_{k-1}[/tex],[tex]b_{k-1}[/tex]]

[tex]x_{k-1}[/tex]=[tex]\frac{a_{k-1}+b_{k-1}}{2}[/tex]

when the interval is [[tex]a_{k}[/tex],[tex]b_{k}[/tex]]

[tex]x_{k}=\frac{a_{k-1}+\frac{a_{k-1}+b_{k-1}}{2}}{2}=\frac{3a_{k-1}+b_{k-1}}{4}[/tex]

So,|[tex]x_{k}-x_{k-1}[/tex]|=|[tex]\frac{3a_{k-1}+b_{k-1}}{4}-(\frac{a_{k-1}+b_{k-1}}{2})[/tex]|=|[tex]\frac{a_{k-1}-b_{k-1}}{4}[/tex]|

But |[tex]a_{k}-b_{k}[/tex]|=|[tex]\frac{a_{k-1}-b_{k-1}}{2}[/tex]|

so they are not equal..what have I done wrong?
 
Physics news on Phys.org
evinda said:
Could you explain it further to me?
Because I found this:
When the interval is [[tex]a_{k-1}[/tex],[tex]b_{k-1}[/tex]]

[tex]x_{k-1}[/tex]=[tex]\frac{a_{k-1}+b_{k-1}}{2}[/tex]

when the interval is [[tex]a_{k}[/tex],[tex]b_{k}[/tex]]

[tex]x_{k}=\frac{a_{k-1}+\frac{a_{k-1}+b_{k-1}}{2}}{2}=\frac{3a_{k-1}+b_{k-1}}{4}[/tex]

So,|[tex]x_{k}-x_{k-1}[/tex]|=|[tex]\frac{3a_{k-1}+b_{k-1}}{4}-(\frac{a_{k-1}+b_{k-1}}{2})[/tex]|=|[tex]\frac{a_{k-1}-b_{k-1}}{4}[/tex]|

But |[tex]a_{k}-b_{k}[/tex]|=|[tex]\frac{a_{k-1}-b_{k-1}}{2}[/tex]|

so they are not equal..what have I done wrong?

I see nothing wrong.
That looks entirely correct! ;)

What you have matches with what I wrote:
I like Serena said:
$$| x_k - x_{k-1} | = \frac{b_{k-1} - a_{k-1}}{4} = \frac{b_{k} - a_{k}}{2} = b_{k+1} - a_{k+1}$$
 
I like Serena said:
I see nothing wrong.
That looks entirely correct! ;)

What you have matches with what I wrote:
|[tex]x_{k}-x_{k-1}[/tex]|=|[tex]\frac{3a_{k-1}+b_{k-1}}{4}-(\frac{a_{k-1}+b_{k-1}}{2})[/tex]|=|[tex]\frac{a_{k-1}-b_{k-1}}{4}[/tex]|

|[tex]a_{k}-b_{k}[/tex]|=|[tex]\frac{a_{k-1}-b_{k-1}}{2}[/tex]|

How can they be equal?I don't understand :confused::(:confused:
 
evinda said:
|[tex]x_{k}-x_{k-1}[/tex]|=|[tex]\frac{3a_{k-1}+b_{k-1}}{4}-(\frac{a_{k-1}+b_{k-1}}{2})[/tex]|=|[tex]\frac{a_{k-1}-b_{k-1}}{4}[/tex]|

|[tex]a_{k}-b_{k}[/tex]|=|[tex]\frac{a_{k-1}-b_{k-1}}{2}[/tex]|

How can they be equal?I don't understand :confused::(:confused:

They are not equal.
|[tex]x_{k}-x_{k-1}[/tex]| is half of |[tex]a_{k}-b_{k}[/tex]|.

If you want equality, pick |[tex]a_{k+1}-b_{k+1}[/tex]|.
 
So,if they are not equal,why do we use the termination criteria |a-b|<TOL?I don't get it... :(
 
evinda said:
So,if they are not equal,why do we use the termination criteria |a-b|<TOL?I don't get it... :(

We don't.
See your previous post:

evinda said:
Nice.. :o And..something else..I found implementations of the bisection method and there the termination criteria is
Code:
 while(fabs((b-a)/2)>TOL)
.

Why is it like that?? :confused:

See?
 
So,is it wrong when I write fabs(b-a)<TOL?
 
evinda said:
So,is it wrong when I write fabs(b-a)<TOL?

Depends on the rest of your algorithm.
If you return (a+b)/2, then your result will still be within TOL.
So then it is right!
 
Could you give me an example for this condition?
If for example the maximum number of iterations is 15,TOL is 0.001
and the initial interval is [0,2]

what is equal to the first

$\big|x_k-x_{k-1}\big|$ we have to use? :confused: :confused::confused: