I'm having trouble to do an infinite sum in R I want to do the infinite sum of 1/(1+n) how would I do this in R? Thank You -- View this message in context: http://r.789695.n4.nabble.com/How-to-do-an-infinite-sum-in-R-tp4649770.html Sent from the R help mailing list archive at Nabble.com.
Perhaps it would help to think before you compute. albyn On Fri, Nov 16, 2012 at 09:30:32AM -0800, Simon Bolivar wrote:> I'm having trouble to do an infinite sum in R > > I want to do the infinite sum of 1/(1+n) > > how would I do this in R? > > Thank You > > > > -- > View this message in context: http://r.789695.n4.nabble.com/How-to-do-an-infinite-sum-in-R-tp4649770.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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. >-- Albyn Jones Reed College jones at reed.edu
You would need an infinite amount of time and an infinite amount of numerical precision, all to arrive at the conclusion that the answer is infinite. Or you could take a short cut: ans <- Inf --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. Simon Bolivar <xforstuff at gmail.com> wrote:>I'm having trouble to do an infinite sum in R > >I want to do the infinite sum of 1/(1+n) > >how would I do this in R? > >Thank You > > > >-- >View this message in context: >http://r.789695.n4.nabble.com/How-to-do-an-infinite-sum-in-R-tp4649770.html >Sent from the R help mailing list archive at Nabble.com. > >______________________________________________ >R-help at 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.
On Nov 16, 2012, at 9:30 AM, Simon Bolivar wrote:> I'm having trouble to do an infinite sum in R > > I want to do the infinite sum of 1/(1+n) > > how would I do this in R?You could try submitting this job: sum(1/(1+1:(2^31-1) ) ) # 2^31-1 being the highest integer in R at the moment After I consumed all of the physical space in my 32GB memory and paged out to virtual memory (something I was not surprised about) with this action, I killed my R session. You could also see if you got better answers from a symbolic algebra program. -- David Winsemius, MD Alameda, CA, USA