Re: Bug in Limit ?
- To: mathgroup at smc.vnet.net
- Subject: [mg26011] Re: [mg25951] Bug in Limit ?
- From: bernd at bio.vu.nl (Bernd Brandt)
- Date: Thu, 16 Nov 2000 03:43:00 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hi Bob, In Mathematica 3.0 and 4.0 I also found a bug in Calculus Limit. I i have included examples. The bug was reported to Wolfram, their comment was that it is an Add-On package, and Add-On packages may contain bugs.... When approximate numbers are used for parameters with Calculus'Limit' results are incorrect! Bugs is still present in Mathematica 4.0, but ... it is still an Add-On package :-( Examples are from Fred Simons. Regards, Bernd An obvious example with exponential functions In[1]:= << Calculus`Limit` In[2]:= Limit[Exp[-a t] (-S + Exp[a t] S), t -> Infinity] Out[2]= S How does Mathematica know the Limit is S. It assumes a>0 !! [N.B. the kernel's Limit does not assume this and returns the expression] In[9]:= a = 1; S = 2.5; Limit[Exp[-a t] (-S + Exp[a t] S), t -> Infinity] Out[10]= 0 !!! Zero !???? In[11]:= a = 1; S = 5/2; Limit[Exp[-a t] (-S + Exp[a t] S), t -> Infinity] Out[12]= \!\(5\/2\) In[13]:= Limit[ Exp[ 0.t], t -> \[Infinity]] Out[13]= 1 Why "1" 0. is not exactly zero, the limit could be 0, 1, or infinity Notice the difference between the Limits below. In the first case the answer is "1" in the second is should also be "1" then! In[14]:= Limit[ 20 Exp[ 0.t], t -> \[Infinity]] Out[14]= 1 In[15]:= Limit[ b Exp[ 0.t], t -> \[Infinity]] Out[15]= b BobHanlon at aol.com wrote: In a message dated 11/14/00 4:27:00 AM, mtpagesj at lg.ehu.es writes: >This looks like a bug in the package Calculus`Limit` > >In[1]:= $Version >Out[1]= "4.0 for Power Macintosh (July 20, 1999)" > >In[2]:= << Calculus`Limit` > >In[3]:= Limit[(2^(n + 1) + 3^(n + 1))/(2^n + 3^n), n -> Infinity] >Out[3]= 9 > >The calcultion was done in a G4. The same result was obtained in version >3 >under windows. > It is definitely wrong. It does much better if you simplify the expression before taking the limit. Needs["Calculus`Limit`"]; Limit[(2^(n + 1) + 3^(n + 1))/(2^n + 3^n), n -> Infinity] 9 (2^(n + 1) + 3^(n + 1))/(2^n + 3^n) // FullSimplify 3 - 1/(1 + (3/2)^n) Limit[%, n -> Infinity] 3 Plot[(2^(n + 1) + 3^(n + 1))/(2^n + 3^n), {n, 0, 20}]; Bob Hanlon