00:01
The intermediate value theorem can be used to approximate the root.
00:05
The following is an example of binary search computer science.
00:10
Suppose you want to approximate the square root of seven.
00:12
You know that it is between 2 and 3.
00:14
If you consider the function x squared minus 7, then note that f at 2 is negative and f at 3 is positive.
00:25
Therefore, by the intermediate value theorem, there is a value c between 2 and 3.
00:31
Such that f at c is zero.
00:37
So the continuity of the function and the change of sign at the endpoints of the close interval ensure us that there is a root of the equation f of x equals zero in that interval.
00:52
Next, choose the midpoint of these two values, in this case 2 .5, which is guaranteed to be within 0 .5 of the actual root because the length of the sub -intervals form 4 by taking a midpoint r, 0 .5.
01:12
That is we have 2, 3, we know the root is somewhere, and now we take the midpoint, 2 .5.
01:20
So here, you have 0 .5 length and here the same.
01:27
And with that, we can ensure that the root is within 0 .5 of the actual root.
01:39
That is the distance between the root and any.
01:42
Of these three points is less than 0 .5.
01:48
Okay, so we have that and now we evaluate the function at 2 .5 and stick or stick with the sub interval where the functions has a property of changing sign at the end points.
02:02
And we continue that process on and on.
02:06
And at each step we can say that is what is changing is which sub interval we choose in regarding the change of but we always take the midpoint of the new sub interval.
02:21
That means that at the first iteration here, we have 0 .5 length of the sub interval.
02:33
So the root is within 0 .5, or the, let's say the midpoint is within 0 .5 of the root at first iteration.
02:47
And when we take one of these two sub intervals and apply the thing, again, in this case, the subintel was much more.
02:55
What's choose is 0 .5, sorry, 2 .5, 3.
03:02
Because f at 0 .5 is negative.
03:07
And we knew already that f at 3 is positive.
03:10
So we have to take now this sub -interable.
03:15
When we take the midpoint here, this length here is just a half of this we have before...