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

1. ### John SmithGuest

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

2. ### Bob PeaseGuest

Pretty close!

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

Bob Pease

Bob Pease, Sep 29, 2003

3. ### Nat SilverGuest

I suppose you mean "impossible."
Anyway, the sum has been reached already.
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
4. ### bystanderGuest

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
5. ### John SmithGuest

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
6. ### John SmithGuest

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
7. ### ProginoskesGuest

Round-off error.
-- Christopher Heckman

Proginoskes, Sep 30, 2003