Find the Perfect Value of n for Calculating e Accurately - Proven Method

  • Thread starter Thread starter Projector
  • Start date Start date
Projector
Messages
2
Reaction score
0
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.
 
Mathematics news on Phys.org
Have you tried any values of n?
 
Looks like a straightforward calculation problem to me!
 
lol, look up e on wikipedia and you'll know why we're giggling over here
 
Trick question? 9 significant digits or 9 digits after the decimal point?
 
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, 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 (10<sup>16</sup> or so), (1+1/n)-1=0 using off-the-shelf double-precision numbers!<br /> <br /> 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.<br /> <br /> Since I have a &quot;<a href="https://www.physicsforums.com/showthread.php?t=206096&quot;" class="link link--internal">https://www.physicsforums.com/showthread.php?t=206096&quot;</a>&quot;, 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:
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 homework 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.
 
Psst, the 9th digit is...8! :smile:

Two point 7, two times Ibsen, 459045.
 
Ibsen, or Verne, or Schubert... (google for the win).
 
Back
Top