Re: Calculating e


[Prev][Next][Index][Thread]

Re: Calculating e



Thomas J. Hruska writes:

> Okay.  If you want to calculate e exactly, here is how to do it:
>
>  e^x = (x^0/0!)+(x^1/1!)+(x^2/2!)+(x^3/3!)+(x^4/4!)+(x^5/5!)...
>
> Maybe that wasn't what you were going after but it is how the calculator
> should work e as (not using the (1+1/1000000000)^1000000000 method which
> only comes close to e^1).

Who's to say how a calculator _should_ work?  :-)}

The above infinite series is well known, partly because of the nice pattern
it displays and partly because because it is _useful_.  If you want to
calculate a power of e using pencil and paper (or if you want to figure out a
rough approximation for, say, e^0.2 _mentally_), then this is the way to go.

But if you just want to calculate digits in the decimal expansion of e, then
there are _many_ formulas and processes that can be followed.  Back in the
seventeenth and eighteenth centuries, when the ideas of infinite processes
were just beginning to be explored, lots of interesting infinite sum and
product formulas were developed.  Euler alone came up with hundreds of
interesting expressions for pi, e and other important universal constants.
In the present century Ramanujan continued this tradition.  Formulas involving
infinitely nested radicals, too.

All of these can be programmed into a good calculator such as the TI-83 or
TI-86.  The idea of reaching e as a limit of expressions such as (1 + 1/n)^n
by letting n get larger and larger (say by a factor of 10, as the person
originally posting a question here did) is a very interesting one, showing
why, in a sense, e is called the "natural" base.  And thinking about why you
get the number you do when you try to find the limit of, say, (1 + 2/n)^n
is educational, also.

Of course you are never going to be able to calculate e _exactly_, any more
than you can calculate pi exactly (I believe that some 51 billion digits of
pi are currently known, but that is just a start...).  Using the floating-point
arithmetic routines built into the calculator, and representing your results
as scalars, will only take you so far.  After about twelve or thirteen digits
you start to run into round-off error.  That's the way the calculator is built.

If you want more places, what you need to do is represent the result as a
_list_. In the simplest case, each element of the list is a single digit.  You
can achieve greater economy by _packing_ digits, say allowing each element of
the list to be an integer up to 9999999999 and working base 10^10.  You then
need to work up your own arithmetic processes (subroutines).  Adding and
subtracting such lists is straightforward, as is multiplying by small integers,
but you need to "fix up" the result after each operation, performing borrows
and carries.

It's also not tough to write a routine to _divide_ such a list by a small
integer. Where it does get tough is multiplying such lists together, or
dividing a list by a list.  And powers are pretty much out of the question.
This is why the simple infinite series given by Hruska would be the formula of
choice if you were going to tackle calculating, say, 500 digits of e with a
TI-83.

Some years ago I posted on this list a set of routines for the TI-82 to
calculate large numbers of digits of pi, based on these ideas and the famous
Machin formula.  It wouldn't be hard to modify these routines to evaluate other
infinite series as well (and you could probably cut some corners with the added
powers of the TI-83 and TI-86).  I'd be happy to email copies of the
documentation to anyone interested in pursuing this idea.

RWW Taylor
National Technical Institute for the Deaf
Rochester Institute of Technology
Rochester NY 14623

>>>> The plural of mongoose begins with p. <<<<