CHAPTER 01.02: MEASURING ERRORS : True Error

 

 In this segment we are going to talk about true errors. If you look at the definition of true error, true error is the defined as follows: It is denoted by (upper case) E, subscript t. (Uppercase) E standing for error and t standing for true. It is defined as the exact value minus the approximate value. So the questions arises that, why do we need to learn about true errors, then we do need the exact value for calculating the true error. So because we are going to be using approximate, because numerical methods are approximate methods, so if I want to use numerical methods to find the approximate value of some quantity, I will not have the privilege of knowing the exact value is. And if I had the privilege of knowing what the exact value is, then I wouldn't be calculating the approximate value in the first place. Well, the reason why you want to learn about true error and do need to know the concept of true error is because if you are developing a numerical method to be able to calculate this approximate value you do need to test it out against something which you know. So, for example, if you have developed an approximate way of differentiating a function, you would like to compare it with something which you have learned in your differential calculus class with some exact value. We are going to take an example of that to be able to explain it. So let's go ahead and do that, let's go ahead and take an example and see what we mean by calculating the true errors. So for example, somebody says that hey, I want you to use this formula for calculating the derivative of a function. Now, if you remember your differential calculus class, this approximate formula for calculating the derivative of a function is very similar to what you learned in your differential calculus class. The only difference was your f'(x) was defined exactly equal to, by taking delta x approaching zero. So this is the definition from your differential calculus class and if you want to calculate the derivative of a function, you have to choose delta x to be approaching zero. But if I am going to, I cannot choose delta x approaching zero in numerical method because every time I choose a delta x, I'll have to choose one smaller than that because that will mean, that will only mean the delta x approaching zero. So the approximation, what you do is rather than choosing delta x approaching zero, you choose delta x to be a finite number. So what I am going to do is I am going to compare the values which we will get from this approximate way of finding a derivative of a function and the exact way of finding the derivative of a function. So because we need both numbers to be able to calculate whatever the true error is. So let's go ahead and put some functions and numbers which we are interested in.

 

So let's suppose somebody says hey, the function is given to you as f(x)=7e^0.5x and you are also given that hey, you want to calculate f'(2) and you are going to choose a delta x equal to 0.3, let's suppose. So you are given the function, you are given where you want to calculate the derivative of the function. Thatís what you are to find and you are given that you are choosing a finite value of delta x in this case being 0.3. So let's go ahead and see that what we get from, because we need two things. We need the exact value and we need the approximate value. So let's calculate the exact value first. So the exact value, we have f(x)=7e^0.5x. f'(x) from my differential calculus class is 7*(0.5)e^0.5x so that gives me 3.5e^0.5x. The formula which I used to calculate the derivative of the function is from my differential calculus class where is says d/dx(e^ax) is defined as a*e^ax where a is a constant. So that's where we get that from. So from here I can calculate my f'(2) to be 3.5e^0.5(2) and that value turns out to be 9.5140 and thatís the exact value. Now, you will get the same number if you would have used the, used the definition, the exact definition of a derivative which is a little bit lengthy so I am not showing you that. I am just directly the application of the formula which you learned in your differential calculus class. So let's go and now calculate our approximate value based on the formula which we just, was given to us. What is the approximate value? So I will show it here. Approximate value again was defined as f'(x) is approximately equal to, the numerator being this, and the denominator being delta x, just like in the exact definition of your derivative function. The only difference being that delta x is not a finite number as opposed to being, approaching zero. So we again are going to calculate f'(2) so that gives us [f(2+dx) - f(2)]/dx. Now also we are given that delta x is 0.3 so I am going to substitute that. So I am showing you separate steps here so that you understand what each step means. So that is the approximate derivative of the function at 2.3, which is basically obtained from finding the value of the function at 2.3, finding the value of the function at 2, and dividing by 0.3. So what is the value of the function at 0.3? 7e^(0.5*2.3) minus 7e^(0.5*2) divided by 0.3 and this number here turns out to be equal to 10.265. So that is the approximate value of the derivative of the function we are getting at the value of x equal to 2. In order to be able to calculate what is the true error associated with this approximate value we do need to know the exact value which we just calculated a few minutes ago. So let's go ahead and take those two numbers and see what the true error is. So, the true error, again is defined as true value minus approximate value and the true value which we calculated was 9.5140 and the approximate value which we calculated was 10.265 and this gives me a true error of minus 0.75061. So that is how you are going to calculate your true errors based on simply calculating the true value or the exact value and subtracting from that the approximate value. And that's the end of this segment.