In this segment, we'll talk about the definition of truncation error.
To talk about truncation errors, we should talk about where do the errors come from
so far as the inherent errors are concerned in numerical methods. They come from two sources;
one is called truncation error, and the other one is called round off error.
Although this segment is talking about truncation error, it's important to mention both the sources
of error because some of some people use them interchangeably which is not a good thing.
Truncation error is when you're approximating a mathematical procedure an error is going to
be taking place. When a round of error is only associated with numbers when you're approximating
a number, then whatever is the error associated with that is called the round off error.
So, let's talk about truncation error, and then we will talk about some examples of that. So, the
definition of truncation error is straightforward. It is the error caused by approximating
uh mathematical uh let's call it a process.
So, what does this mean is that if we want to calculate the truncation error
it will be simply equal to the true value, or the exact value, minus the approximate value which we
get by approximating a mathematical process. So, let's go and look at a few examples here
and I think that will make it clear where the truncation error is coming from.
Let's take the example e^x; e^x in Maclaurin series is given by this infinite summation.
And let’s suppose = somebody says hey go ahead and calculate e^2;
I would say okay it is this quantity right here,
and so on and so forth. But if i was going to calculate part 2 by using this
infinite Maclaurin series right here then I would have to take only a finite number of terms. So,
let's suppose if I say hey, I’m going to take only first three terms the series to calculate e^2,
then whatever is left over right here is the truncation error.
And the reason why it's called truncation error is not because I’m taking,
I’m truncating this series no. Because I’m approximating a series by only the first
three terms of this series. And whatever is left over is called the truncation error,
I’m approximating a mathematical procedure or mathematical process in this case.
So, years ago I used to stop here this particular lesson here because it's enough
to give one example of truncation error, but then people started thinking about that hey
truncation error is only about truncating or cutting off a series at a certain number of terms.
So, there would be some confusion which would take place that hey
truncation is only related to series. So, let's take some couple of other examples.
Let's take another example from your differential calculus class; you must have come across this
definition of the derivative of a function which looks like this right. So, if you graphically look
at this particular definition right here then, let's suppose if I’m trying to find the value of
the derivative of the function right here and let's suppose this is x plus delta x.
And what I'm going to do is I'm going to draw a secant line here,
and then I'm going to see that hey this data point is x plus delta x, and the corresponding
value of the function will be the y value. Same thing here this x and this is f(x).
So, this rise here will be the difference between the two function values as follows.
And this run here of course is delta x. So, what you can very well see is that it is the rise
over run which is going to give me the slope of the secant line, the slope of
this line right here. But that'll be only an approximation of the derivative of the function,
only if delta x approaches 0 as is the case here will this definition here or will this formula
become the exact value of the derivative of the function. So, what am I doing here?
I cannot afford to choose delta x approaching 0 because every time I choose a certain delta
x I can always choose half of that to be smaller than that and so on and so forth.
So that means that this process will never finish if I was going to do this problem numerically.
So, what I have to do instead I have to choose delta x to be a finite number. So,
when I’m choosing delta x to be a finite number what I've basically done is I’ve approximated
this math procedure procedural process by choosing delta x to be finite. And that is
going to create a truncation error. So whatever number I get from here and whatever number I get
from here the difference between the two will be the truncation error. Hey, go ahead and
find this integral. So graphically, let's suppose this is my function and I want to integrate from
a to b, and i will say okay hey what I’m going to do is I’m going to use the left-hand Riemann sum,
which you are familiar with, and this is what I’m going to get
so I’m going to this is going to be this rectangle area here,
this rectangle area here, this rectangle area here, and this rectangle area here. So, I have
four rectangles and what I’ll do is if I calculate the sum of the area of the four rectangles,
I’ll get only an approximate value of this integral.
And we know from our integral calculus class that if I would choose infinite such rectangles
going from a to b, then I’ll get the exact value. So that's where the truncation
is coming from. The truncation error is coming from approximating a math procedure
the exact math procedure which requires us to use infinite rectangles, but then I’m using only a
finite number of rectangles. So, I have approximated a mathematical procedure
which require infinite rectangles to a finite number of rectangles because that's all I can
do I cannot have infinite rectangles because that would take infinite amount of time
to calculate. So that those these are the things which uh you need to consider when you think about
truncation error. Please don't only think about that hey it is related to a summation of a series.
So, whenever you're approximating a math procedure there's bound to be an error and
that error is called the truncation error. And this is the end of this segment.