please confirm my understanding

Discussion in 'Recreational Math' started by John Smith, Sep 29, 2003.

  1. John Smith

    John Smith Guest

    Can someone confirm my understanding of a function converging to a
    finite value?

    In this case, the function is Euler's zeta function:

    zeta(x) = (1/1^x) + (1/2^x) + (1/3^x) + ...

    1. For any value of x > 1, the series yields a finite value.

    2. The greater the number of terms, the closer the sum
    to this finite value.

    3. Since it is possible to add an infinite number of terms, the
    theoretical finite value can never be reached.

    Am I mistaken on any or all of these points? Is this manner of
    approaching a particular value but never reaching it called asymptotic?
     
    John Smith, Sep 29, 2003
    #1
    1. Advertisements

  2. John Smith

    Bob Pease Guest


    Pretty close!

    But the term "Never" is discouraging.
    I prefer " as close as you like."

    Bob Pease
     
    Bob Pease, Sep 29, 2003
    #2
    1. Advertisements

  3. John Smith

    Nat Silver Guest

    I suppose you mean "impossible."
    Anyway, the sum has been reached already.
    There is no addition taking place. The addition is
    finished. We can approximate the value of the series,
    if it converges, by adding finitely many terms. And
    there are techniques which allow us to obtain the
    the exact sum of the series. For example, we know
    that your zeta(2) = (pi)^2/6 - 1.
     
    Nat Silver, Sep 30, 2003
    #3
  4. John Smith

    bystander Guest

    Yes, I suppose I do mean impossible. :)

    When I calculate ((pi)^2/6) - 1 with a calculator I get .6449. When I
    calculate the zeta function for 2 with a computer program with 30,000
    terms I get 1.6449. Why the discrepancy? Is my program broken?

    /* implement zeta(2) = (1/1^2) + (1/2^2) + (1/3^2) + ...
    with 30,000 terms
    */
    #include <stdio.h>
    #include <stdlib.h>
    #include <math.h>

    int main(int argc, char * argv[])
    {

    if(argc != 3)
    {
    fprintf(stderr, "\nusage: zeta <x> <terms>\n");
    exit(EXIT_FAILURE);
    }
    double x = strtod(argv[1], NULL);
    double terms = strtod(argv[2], NULL);
    double zeta = 0;
    int idx, denominator = 1;

    for(idx = 1; idx <= terms; ++idx)
    {
    zeta += 1 / pow(denominator, x);
    ++d;
    }

    printf("\nzeta(%f) == %f\n", x, zeta);
    return 0;
    }
     
    bystander, Sep 30, 2003
    #4
  5. John Smith

    John Smith Guest

    Yes, I suppose I do mean impossible. :)

    When I calculate ((pi^2)/6) - 1 with a calculator I get .6449. When I
    calculate the function with 30,000 terms with a computer program I get
    1.6449. Why is 1 subtracted ? Is my program broken?

    /* implement zeta(2) = (1/1^x) + (1/2^x) + (1/3^x) + ...
    with 30,000 terms
    */
    #include <stdio.h>
    #include <stdlib.h>
    #include <math.h>

    int main(int argc, char * argv[])
    {

    if(argc != 3)
    {
    fprintf(stderr, "\nusage: zeta <x> <terms>\n");
    exit(EXIT_FAILURE);
    }
    double x = strtod(argv[1], NULL);
    double terms = strtod(argv[2], NULL);
    double zeta = 0;
    int idx, denominator = 1;

    for(idx = 1; idx <= terms; ++idx)
    {
    zeta += 1 / pow(denominator, x);
    ++d;
    }

    printf("\nzeta(%f) == %f\n", x, zeta);
    return 0;
    }
     
    John Smith, Sep 30, 2003
    #5
  6. John Smith

    John Smith Guest

    Yes, I suppose I do mean impossible. :)

    When I calculate ((pi^2)/6) - 1 with a calculator I get .6449. When I
    calculate the function with 30,000 terms with a computer program I get
    1.6449. Why is 1 subtracted? Is my program broken?

    /* implement zeta(2) = (1/1^2) + (1/2^2) + (1/3^2) + ...
    with 30,000 terms
    */
    #include <stdio.h>
    #include <stdlib.h>
    #include <math.h>

    int main(int argc, char * argv[])
    {

    if(argc != 3)
    {
    fprintf(stderr, "\nusage: zeta <x> <terms>\n");
    exit(EXIT_FAILURE);
    }
    double x = strtod(argv[1], NULL); /* x = 2 */
    double terms = strtod(argv[2], NULL); /* terms = 30000 */
    double zeta = 0;
    int idx, denominator = 1;

    for(idx = 1; idx <= terms; ++idx)
    {
    zeta += 1 / pow(denominator, x);
    ++denominator;
    }

    printf("\nzeta(%f) == %f\n", x, zeta);
    return 0;
    }
     
    John Smith, Sep 30, 2003
    #6
  7. John Smith

    Proginoskes Guest

    Round-off error.
    -- Christopher Heckman
     
    Proginoskes, Sep 30, 2003
    #7
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.