subscribe

The more he talks about trust, the faster I count my silvers - George Soros

Taylor series revisited (Using stochastic article 17 of n)

November 27th, 2009

(Read from the beginning) OR
(If you have not read article "16 of n" already then please consider reading it before continuing here

 

So it has been quite some time since I updated this blog. I was too distracted with a lot of stuff, work at office, my new dot com site (still working on it) and family vacation among other thing.

In addition to this I have also been struggling with ITO’s lemma. I have been trying to understand at least ‘something’ about it for a long time now and I have not yet managed to unlock the secret L

Anyway, it does appear that I need to revisit the concept of Taylor Series. There are a lot of blogs for Taylor Series including my own and all they talk about is e^x. The problem is it is hard to make anything out of this concept, this is just confusing L

Taylor series is

f(x) = f(a) + \frac{f'(a)}{1!}(x-a) + \frac{f'' (a)}{2!}(x-a)^2 + \frac{f''' (a)}{3!}(x-a)^3  +. . . .

The problem is that I did not have a clue how to use this series to find solution to a practical problem, I mean any problem at all!

So I decided to dig deeper and after pulling my hair for one week, I have slowly started to understand what this series is all about.  So here are my preliminary findings J

Let us say we need to find square-root of a number say 4.10 using taylor series . The first step is to find the deriviatives

f(a) = x^{1/2}

f'(a) = \frac{1}{2 x^{1/2}}

f''(a) = \frac{-1}{4 x^1 x^{1/2}}

f'''(a) = \frac{1.5}{4 x^2 x^{1/2}}

Now there is a reason why I am writing down x^2x^{1/2} instead of x^{2.5} It just makes the calculation much easier. At least for me who is not trained to grasp the meaning of numbers such as x^{2.5} :) 

And finally f^{(4)}(a) = \frac{-3.75}{4 x^3 x^{1/2}}

Now we need to plug in a number in the above equation. Since we need to calculate square root of 4.10, let us plug in 4 and calculate the values. Why four? Because it is a nice little round number and we know the square root of four :)

 

 

 

 

 

 

 

 

 

 

 f(a) = 2

f'(a) = \frac{1}{4}

f''(a) = \frac{1}{32}

f'''(a) = \frac{1.5}{128}

f^{(4)}(a) = \frac{3.75}{512}

Next step is to rewrite the Taylor series plugging in our values to come up with an equation of square root of 4.

f(x) = 2 + \frac{\frac{1}{4}}{1!}(x-a) + \frac{\frac{1}{32}}{2!}(x-a)^2 + \frac{\frac{1.5}{128}}{3!}(x-a)^3  + \frac{\frac{3.75}{512}}{4!}(x-a)^4

i.e

f(x) = 2 + \frac{1}{4}(x-a) + \frac{1}{64}(x-a)^2 + \frac{1.5}{768}(x-a)^3  + \frac{3.75}{12288}(x-a)^4

 

 

Now we are ready to find square-root of 4.10 with the above equation. Just substitute x with 4.10 and a with 4

f(4.10) = 2 + \frac{1}{4}(4.10-4) + \frac{1}{64}(4.10-4)^2 + \frac{1.5}{768}(4.10-4)^3  + \frac{3.75}{12288}(4.10-4)^4

Which gives us a value of 2.024846. Hurray!!! If you calculate the square-root of 4.10 on your calculator then you can confirm that Taylor Series did calculate the square-root correctly.

Now let us calculate square-root of various numbers using the above series

Number              Taylor Series square root          Square root as per calculator

   4.5                                  2.121319                                       2.12132

   5.0                                  2.236023                                       2.236068

   6.0                                  2.448242                                       2.44949

 10.0                                  2.963867                                       3.162278

So as you can see our series giving us in-correct results as we move away from four. What is happening? I have drawn both the values in the graph. The line in red is actual square-roots and line in blue is the square roots calculautd with the help of taylor function at value of 4.

 

As you can see the blue line (which is our Taylor Series) is moving away and away from the actual values. So what does this tell us?

(What we have done above is we have expanded Taylor series for square-root of a number at a point which is four in our case). To convert any function to a Taylor Series we need to expand the series at a point and as long we are near that point we will get accurate results. 

It should be obvious by now that is important to find a point where f(x) can easily be calculated. In our case to find out square-root of 4.10, all we had to do was to calcuate square root of 4 (which we hopefully already know).

So does this mean that Taylor series is completely hopeless when it comes to complex functions? Because after all we need to calculate f(x) for one point.

Not really! We had a problem with square-root since this is a singular series i.e. it is not defined for negative numbers. So this was an odd example that I picked up. But what about functions where f(a) can be calculated at point 0 which will make the series really easy to solve? Or what about a function that exactly matches taylor series at all points? Here again we can expand the series at point 0 and get a simplified polynomial (Taylor series is a polynomial). Let us look at a few such series next.

I will be away for most of December, visiting H'bad in India for a week and then off for rest of the December on vacation. So if I do not get a chance to write another blog in next month then Happy new Year! Hopefully todays stock market action was just a small pull-back (which may run for 3-4 days) rather than a crash    

(Continue reading: article 18 of n)
  • Share/Bookmark

Leave a Reply

Name and Email Address are required fields. Your email will not be published or shared with third parties.

IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)

What is 14 + 12 ?
Please leave these two fields as-is: