# Question regarding e

1. Dec 27, 2007

### Projector

Question regarding "e"

I've been stumped by this question for a while now:

Find a value of n for which (1+ 1/n)^n gives the value of "e" correct to 9 decimal places.

2. Dec 27, 2007

### D H

Staff Emeritus
Have you tried any values of n?

3. Dec 27, 2007

### HallsofIvy

Staff Emeritus
Looks like a straightforward calculation problem to me!

4. Dec 27, 2007

### ice109

lol, look up e on wikipedia and you'll know why we're giggling over here

5. Dec 28, 2007

### rcgldr

Trick question? 9 significant digits or 9 digits after the decimal point?

6. Dec 28, 2007

### D H

Staff Emeritus
It is a trick question in a sense. Just throwing numbers at a typical computer implementation of $(1+1/n)^n$ won't work. The problem lies in how computers represent real numbers.

Suppose one uses a program like Excel or writes a simple program to calculate $(1+1/n)^n$ (I did just this with Excel, perl, and C on a Mac and on a Linux box.) The error shrinks as $n$ increases up until $n=10^7$ or so. At this point the error stops shrinking. The problem is that the computer performs the calculation $(1+1/n)^n$ as $\exp(n*\log(1+1/n))[/tex]. For large n, [itex]log(1+1/n)\approx(1+1/n)-1$, and this will err from $1/n$ using off-the-shelf double-precision numbers. For sufficiently large n (1016 or so), $(1+1/n)-1=0$ using off-the-shelf double-precision numbers!

A brute-force way to overcome this problem is to program using an extended precision package. An even better way to overcome the problem is to approach it analytically. A simple error analysis of $(1+1/n)^n-e$ yields a value of n above which the error will be smaller than 1e-9. I am not revealing this value in the chance that this thread is asking us to solve a homework problem.

Since I have a ""https://www.physicsforums.com/showthread.php?t=206096" [Broken]", I of course had to double-check this limit using an extended precision math package. Ta-da, it works as predicted.

Last edited by a moderator: Apr 23, 2017 at 9:47 AM
7. Dec 30, 2007

### mathwonk

i had a homework assignment in 1960 to use the taylor series to calculate e to 9 digits, and found it too tedious.

In 2006 I felt professionally embarrassed after telling the story to my calc class so sat down and did it by hand, using a small \$10 calculator for some arithmetic. (It took about 14 terms, but your sequence will have a different error term from the taylor series, so i doubt if i am giving away the answer.)

My former calc prof was still working in texas so i sent him the hw with an apology for being over 40 years late. he kindly wrote back his appreciation. maybe you too will eventually get credit for this one.

8. Dec 30, 2007

### arildno

Psst, the 9th digit is...8!

Two point 7, two times Ibsen, 459045.

9. Dec 30, 2007

### dodo

Ibsen, or Verne, or Schubert... (google for the win).