Hello Internet. This is Oscar Veliz here showing you how to find roots using Bisection Method.
This is a good way to do things if you really don't want to have to solve a root by hand,
which for some equations is not really all that fun.
So here's how Bisection works.
You first find some interval that contains your root using points a and b. Then you're
gonna split the interval in two, right down the middle with the point c.
Now if your function changes signs between a and c then you're wanna gonna ahead and
pick that interval.
Or if it changes signs between b and c you'll pick that interval.
But what you're really going to do is pick either the right or left interval, the one
that contains the sign.
And you're gonna keep doing this until you find some value of your function that below
an acceptable error or zero if that's your acceptable error and then you'll say that's
you root.
So if you want to find the root of this function for example, the sine of cosine of e to the
x which really don't want to solve by hand...
...then you'll go ahead and say ok, I'm going to pick an a and a b, and then split it down
the middle with c.
Now it looks in this case that the root is between a and c so I'm going to pick the left
interval and try again.
So now, I've got a new a and b and I'll split that down the middle with c. And now the root
looks like its in the right interval.
So I'll do that again.
If we zoom in closer we can pick another c. And say you know what actual that f of c looks
like it's in the interval but you know it may not be or and uh we can repeat this over
and over again until we find something that looks like our actual answer.
Now the thing to note is that bisection does have a hard time if you have a very uh flat
function in a sense. If you have uh points that can be your root in a lot of different
cases.
So uh between a and b uh, I mean this function probably is an easy example because we know
the root is obviously five but if um you know just looking at it; it is hard to tell exactly
where the root is between there.
And so bisection has a little bit of trouble with this.
But, uh, let's calculate the order of bisection.
So the order what it is really trying to tell you is how fast is it going to converge on
our solution so how fast is it going to find our root.
And uh we have a formula that we're going to use here. It says uh the error, the next
error after an iteration is some constant times our previous error raised to an alpha
which we're going to say is our order.
And if we take that same equation and we go back a step so we say ok we'll find the previous
error is just uh how we have it here that e to the n is equal to that constant times
the previous error raised to the alpha.
Now that we have these two equations we can find the order by doing a little of division
to cancel out the M so we take we divide those two equations and if we do a little bit of
simple math we come out with this formula. That alpha is equal to... well you can read
it yourself.
And so if we use this formula on an example where we're given three different errors that
we found out using bisection method and if we go ahead and take those and plug them into
that equation that we had, then alpha is equal to about one which means that this equation
converges linearly, which you would expect the error is only going down by half every
time.
So how many iterations does it really take to find a root? Well it's just going to
depend on how accurate you want your uh this root to be, this uh what you find.
And since we know that the error is going down by half every time we can say the error
is equal to the quantity b minus a over two to the n.
And if we do some math on that we can say that therefore n is um the log base two b
minus a over e, where e, epsilon, was our error.
And if we apply that to bit of an example say we have a is zero b is one and our error
is um ten to the minus five then we say that our n is gonna be about 20.
So if this is our case it'll take about 20 iterations of bisection to find our root.
Hope you had fun, thanks for watching.