Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Question regarding e

  1. Dec 27, 2007 #1
    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. jcsd
  3. Dec 27, 2007 #2

    D H

    Staff: Mentor

    Have you tried any values of n?
  4. Dec 27, 2007 #3


    User Avatar
    Staff Emeritus
    Science Advisor

    Looks like a straightforward calculation problem to me!
  5. Dec 27, 2007 #4
    lol, look up e on wikipedia and you'll know why we're giggling over here
  6. Dec 28, 2007 #5


    User Avatar
    Homework Helper

    Trick question? 9 significant digits or 9 digits after the decimal point?
  7. Dec 28, 2007 #6

    D H

    Staff: Mentor

    It is a trick question in a sense. Just throwing numbers at a typical computer implementation of [itex](1+1/n)^n[/itex] 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 [itex](1+1/n)^n[/itex] (I did just this with Excel, perl, and C on a Mac and on a Linux box.) The error shrinks as [itex]n[/itex] increases up until [itex]n=10^7[/itex] or so. At this point the error stops shrinking. The problem is that the computer performs the calculation [itex](1+1/n)^n[/itex] as [itex]\exp(n*\log(1+1/n))[/tex]. For large n, [itex]log(1+1/n)\approx(1+1/n)-1[/itex], and this will err from [itex]1/n[/itex] using off-the-shelf double-precision numbers. For sufficiently large n (1016 or so), [itex](1+1/n)-1=0[/itex] 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 [itex](1+1/n)^n-e[/itex] 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 "certain type of brain that's easily disabled", I of course had to double-check this limit using an extended precision math package. Ta-da, it works as predicted.
  8. Dec 30, 2007 #7


    User Avatar
    Science Advisor
    Homework Helper
    2015 Award

    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.
  9. Dec 30, 2007 #8


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    Dearly Missed

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

    Two point 7, two times Ibsen, 459045.
  10. Dec 30, 2007 #9
    Ibsen, or Verne, or Schubert... (google for the win).
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?

Similar Discussions: Question regarding e