You are Here: Home

# Root Finding using Bisection Tweet

Maths and statistics discussion, revision, exam and homework help.

Announcements Posted on
Enter our travel-writing competition for the chance to win a Nikon 1 J3 camera 20-05-2013
IMPORTANT: You must wait until midnight (morning exams)/4.30AM (afternoon exams) to discuss Edexcel exams and until 1pm/6pm the following day for STEP and IB exams. Please read before posting, including for rules for practical and oral exams. 28-04-2013
1. Root Finding using Bisection
I am slighlty confused by this as i cant match the lecture slides approach to the past exam papers

exam question says :

Using the bisection method search for a root for the function 3^x - x^3 - 5 in the interval [3,4]. Show the next 4 approximation levels

Now as far as i can see (and to be honest i may need glasses as its not very far atm ) i need to make

f(x) = 3^x - x^3 - 5

i am guessing here that x will be replaced for 3 and 4 and i just write the results of substituting the numbers in to a table? Is this correct, and when do i stop, when the numbers get practically the same?
Last edited by jermaindefoe; 06-05-2010 at 14:18.
2. Re: Root Finding using Bisection
A root exists when f(x) = 0.
You need to work out f(3) and f(4) first and note the sign of each value.
Then work out f(3.5). What is the sign? What is the new interval?

The question asks to do this 4 times.
Last edited by miml; 06-05-2010 at 14:23.
3. Re: Root Finding using Bisection
(Original post by miml)
A root exists when f(x) = 0.
You need to work out f(3) and f(4) first and note the sign of each value.
Then work out f(3.5). What is the sign?

The question asks to do this 4 times.
can i just ask why we then go to 3.5?
4. Re: Root Finding using Bisection
Because the method is called 'root finding using bisection' and if you bisect 3 and 4 what do you get?
5. Re: Root Finding using Bisection
(Original post by jermaindefoe)
can i just ask why we then go to 3.5?
well, f(3) and f(4) straddle the root. you then take f(3.5), because it's in the middle of your interval (bisection). when you note the sign, you then take the new interval as f(3) to (3.5) or f(3.5) to f(4), depending on the sign on f(3.5) [bearing in mind that it will straddle the root, and so the signs must be different if there is a root between them]. just keep taking the value in the dead centre of your interval, and improving it by making new intervals and taking the centre of those. in your case, it must be done 4 times.
6. Re: Root Finding using Bisection
(Original post by jermaindefoe)
can i just ask why we then go to 3.5?
We are bisecting the interval.

We know there is a root somewhere between 3 and 4, because f(3)<0 and f(4)>0

The reason for going to 3.5 is because that's what the bisection method states. As an algorithm it says to create smaller intervals that are half the size of the previous one until we have an interval as small as required.
7. Re: Root Finding using Bisection
(Original post by ziedj)
well, f(3) and f(4) straddle the root. you then take f(3.5), because it's in the middle of your interval (bisection). when you note the sign, you then take the new interval as f(3) to (3.5) or f(3.5) to f(4), depending on the sign on f(3.5) [bearing in mind that it will straddle the root, and so the signs must be different if there is a root between them]. just keep taking the value in the dead centre of your interval, and improving it by making new intervals and taking the centre of those. in your case, it must be done 4 times.
so i guess the new interval, if result for 3.5 was a minus will be 3.25? as its the middle of 3 and 3.5?
8. Re: Root Finding using Bisection
(Original post by jermaindefoe)
so i guess the new interval, if result for 3.5 was a minus will be 3.25? as its the middle of 3 and 3.5?
3.25 is not an interval.

After calculating f(3.5), you've said that f(3.5)<0.

So from the information
f(3)<0, f(3.5)<0, f(4)>0

What two points does the root lie between?
9. Re: Root Finding using Bisection
(Original post by miml)
3.25 is not an interval.

After calculating f(3.5), you've said that f(3.5)<0.

So from the information
f(3)<0, f(3.5)<0, f(4)>0

What two points does the root lie between?
3.5 and 4?
10. Re: Root Finding using Bisection
(Original post by jermaindefoe)
3.5 and 4?
Yes

Now you can bisect this interval and find a smaller interval for the root.
11. Re: Root Finding using Bisection
(Original post by miml)
Yes

Now you can bisect this interval and find a smaller interval for the root.
so just rinse and repeat 4 times? if so thats easy?
12. Re: Root Finding using Bisection
(Original post by jermaindefoe)
so just rinse and repeat 4 times? if so thats easy?
Yup exactly.
13. Re: Root Finding using Bisection
(Original post by miml)
Yup exactly.
any idea of how this is terminated (as in, when we deem to have found a figure thats good enough) when working with floating points?
14. Re: Root Finding using Bisection
(Original post by jermaindefoe)
any idea of how this is terminated (as in, when we deem to have found a figure thats good enough) when working with floating points?
Hmm you've lost me there.

The question says 4 iterations so the intervals would be [3,4] , [3.5,4] , [3.5,3.75] , [3.5,3.625], [3.5625,3.625].

So my answer to the original question would be the root is in the interval [3.5625,3.625]

I don't know what floating point means so I can't help any more than that. Hopefully someone else can.
Last edited by miml; 06-05-2010 at 15:19.
15. Re: Root Finding using Bisection
(Original post by miml)
Hmm you've lost me there.

The question says 4 iterations so the intervals would be [3,4] , [3.5,4] , [3.5,3.75] , [3.5,3.625], [3.5625,3.625].

So my answer to the original question would be the root is in the interval [3.5625,3.625]

I don't know what floating point means so I can't help any more than that. Hopefully someone else can.
thanks

it wasnt an exam question that last one , but i thought i would ask as its closley related to what i am doing so thought i might try and see what you thought about it
. but if you dont no then it doesnt matter at all , thans for all of the help
16. Re: Root Finding using Bisection
Hi jermaindefoe,

Well following what Miml said, in this specific case we have to perform 4 iterations of this iterative process, because thats what it asks us to do. Now lets consider you are wanting to apply this more generally, i'm assume your intention or ultimate task would be to write a program to calculate the roots of a function.

So we start of by taking a educated quess at a starting inverval, the general idea would then be to perform the iteration untill the upper and lower bounds of the interval round to the same decimal number to a predetermined number of decimal places.

So lets take the case Miml gave, we have so far

[3,4] , [3.5,4] , [3.5,3.75] , [3.5,3.625], [3.5625,3.625]

now lets say we have decided we wanted to find this root to 2 decimal places, so we keep perfoming interations. note the ones below I just made up, I did bisect the intervals but I didnt actually calculate f(x) for them, so the intervals are probably wrong, but it is there simply to illistrate the point

[3.5625 , 3.625]
[3.5625 , 3.59375]
[3.578125 , 3.59375]
[3.5859375 , 3.59375]

as you can see the upper and lower bounds of the interval both round to 3.59 to 2 decimal places, so either you can use a built in function to the langauge your using or your own algorithm to check the number the upper and lower bounds of your interval round to, in this case to 2 decimal places, but as I said, it is for you to decide the number of deciamal places you want to find the root to, so some psudo code might be

Code:
```double x;

CheckBounds()
{
x = Math.Round( UpperBound , 2.d.p) - Math.Round( Lower Bound , 2.d.p)

if(x== double(0))
return Math.Round( UpperBound , 2.d.p)
else
perform another interation
}```
Hope that helps Jermaindefoe