1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Sum of alternating series using four-digit chopping arithmetic

  1. Feb 9, 2013 #1
    1. The problem statement, all variables and given/known data
    Let [itex]a_{n}[/itex] be an alternating series whose terms are decreasing in magnitude. How to compute the sum as precisely as possible using four-digit chopping arithmetic? In particular, apply the method to compute [itex]\sum\limits_{n = 0}^\infty {\frac{{{{( - 1)}^n}}}{{(2n)!}}}[/itex] and specify how the term [itex]\frac{{{{( - 1)}^n}}}{{(2n)!}}[/itex] is obtained.


    Here is an excerpt from my textbook regarding the definition of finite digit chopping arithmetic:

    2. Relevant equations



    3. The attempt at a solution
    I was told that calculating by nesting is more precise than calculating term by term, but how to calculate the sum of a series going to infinity? Any hint given is much appreciated, thanks!
     
    Last edited: Feb 9, 2013
  2. jcsd
  3. Feb 9, 2013 #2

    haruspex

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    I suggest working backwards from some value of n, and considering each term as a fraction of the one to the left.
    E.g. for the target series, one term is -1/2n times the one to the left. So you could start with the max n that gives a nonzero value in four decimal digits. Then add 1, to represent the term to the left, then multiply by -1/(2n-2) to get it relative to the next term to the left, and so on. I.e the sum is
    1 +(-1/2)(1+(-1/4)(1+(-1/6)(1+....
     
    Last edited: Feb 9, 2013
  4. Feb 9, 2013 #3
    Oh, that solved the infinity problem, but how do we come up with such n? I was given a function to simulate the 4-digit chopping arithmetic in MATLAB:
    As for the sum, should it be:
    [itex] - \frac{1}{2}\left( {1 - \frac{1}{{12}}\left( {1 - \frac{1}{{30}}\left( {1 - \frac{1}{{56}}\left( {1 - ...} \right)} \right)} \right)} \right)[/itex]?

    Thanks!
     
  5. Feb 9, 2013 #4
    If possible for a given series, I would suggest calculating the the series in pairs, positive and negative, so that you don't lose precision in the subtraction.

    This method is possible and somewhat useful for this particular series but the terms decrease too fast to show this to its best advantage.
     
  6. Feb 9, 2013 #5
    Thanks but I don't think that method gives a better accuracy than nested polynomials. For example, to calculate [itex]y = a + bx + c{x^2} + d{x^3}[/itex], one has to do 6 multiplications and 3 additions (assuming that the powers of x are calculated separately), while nesting it to [itex]y = a + x(b + x(c + dx))[/itex] requires only 3 multiplications and 3 additions. Less computations mean less roundoff errors and thus increasing the accuracy.
     
  7. Feb 10, 2013 #6

    haruspex

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    What's the ratio between consecutive terms? That will tell what to put in the nesting. You want to start with the largest n for which the ratio doesn't truncate to zero in four digits.
     
  8. Feb 10, 2013 #7
    Ah thanks, I've figure it out already. n is 86 and the sum is 0.5403. Actually the sum is approximated by Maclaurin's series to be cos(1). :)
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Sum of alternating series using four-digit chopping arithmetic
  1. Arithmetic series sum (Replies: 1)

Loading...