Hi r-users, How do we evaluate the summation of (1/m!) from 0 to infinity (for example). Any help is very much appreciated. Thank you.
Well, sum of 1/m! is e--does that answer your question? Generally, I guess you have to decide how much error you're comfortable with; then using an error approximation formula, you can back out the M at which you can stop the sum. Then you can write a for loop that ends at M. Hope that helps. On Wed, Mar 25, 2009 at 8:43 PM, Roslina Zakaria <zroslina@yahoo.com> wrote:> > Hi r-users, > > How do we evaluate the summation of (1/m!) from 0 to infinity (for > example). > > Any help is very much appreciated. > > Thank you. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
Dear Roslina, For $m \rightarrow \infty$ that sum is exp(1)-1:> options(digits=20) > exp(1)-1[1] 1.718281828459045> m<-20 > sum(1/factorial(1:20))[1] 1.718281828459045 HTH, Jorge On Wed, Mar 25, 2009 at 8:43 PM, Roslina Zakaria <zroslina@yahoo.com> wrote:> > Hi r-users, > > How do we evaluate the summation of (1/m!) from 0 to infinity (for > example). > > Any help is very much appreciated. > > Thank you. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]