MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

undocumented assumption in limit

  • To: mathgroup at smc.vnet.net
  • Subject: [mg35863] undocumented assumption in limit
  • From: Andrzej Kozlowski <andrzej at platon.c.u-tokyo.ac.jp>
  • Date: Sun, 4 Aug 2002 06:00:19 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

There is an undocumented assumption in limit, which has already been 
discussed in this list , which is that

Limit[Sin[z]/z, z -> Infinity]

is actually

Limit[Sin[z]/z, z -> Infinity,Direction->-1]

If you do not know that you might find the following surprising (at 
least I did):


Limit[Tan[x], x -> Pi/2]

-Infinity

This assumption is in fact controllable with the Direction function. As 
for (2), of course you are right, Limit does in a way "know" quite a lot 
of things. But the point is that there is no systematic way of 
incorporating the sort of assumptions the user might enter into a Limit 
computation. In other words, if you enter just the assumptions that 
Limit needs for your case they might be used, but slightly different 
ones, may not. In fact, I do not deny that you can introduce a simple 
assumptions mechanism, what I doubt is that it can do much more than you 
can already do by means of various substitutions of the kind you used in 
this problem. Your point (3) actually is a good illustration of the kind 
of thing that is likely to go wrong in a primitive assumption mechanism, 
by which I mean one that is based on trying to match some known patterns 
rather than using a general algorithm. The problem with syntactic 
pattern matching is that semantically (i.e. mathematically) equivalent 
expressions will usually not match the same pattern, and it is normally 
not possible to write out all possible patterns that amount to the same 
mathematical condition. The conditions a=1+Re[b] and a=Re[b] contain 
exactly the same "mathematical" information about a, but they are 
different as patterns. Different outputs in these cases seem to indicate 
that no general algorithm but only some kind of pattern matching is 
being used. So I think this example rather supports my position. Point 
(4) is simply a  bug, which was pointed out by Jack Goldberg recently on 
this list. I certainly  am not saying Limit is perfect, in fact I think 
its has very limited use. In my opinion it is only useful for dealing 
with singular cases where you need to consider Direction. In all other 
situations it is much better to use Series. I also doubt that adding an 
assumptions mechanism to Limit would make much difference. Fixing all 
the remaining bugs would do more.

Andrzej Kozlowski



On Saturday, August 3, 2002, at 10:54  AM, DrBob wrote:

> Andrzej makes sense in a way, but I have a few problems:
>
> (1) Since Limit[Sin[z]/z, z -> Infinity] evaluates to zero, Limit is
> obviously making an assumption about z, and hence it's capable of making
> assumptions.  In this case, it's making an assumption we have no control
> of, which can't be ideal.  Also note this assumption isn't DOCUMENTED.
>
> (2) If a = Exp@Re@b;Limit[Sin[a z]/(a z), z -> Infinity] evaluates to
> zero, Limit apparently "knows" that Exp@Re@b is >0 or, at least,
> non-zero and real, and it uses that information in computing the limit,
> does it not?  How does it do that, if assumptions can't be handled in
> the inner workings?
>
> (3) a=1+Re@b;Limit[Sin[a z]/(a z),z->Infinity] evaluates to zero, but a
> = Re@b;Limit[Sin[a z]/(a z), z -> Infinity] is NOT evaluated.  In both
> cases, a==0 for b on a vertical line in the complex plane, but Limit
> ignores that problem in case and not the other.
>
> (4) ClearAll[a, F];Limit[F[z, a], z -> 0] evaluates to F[0,y] but
> ClearAll[a, F];F[z_, a_] := Sin[a z]/(a z);Limit[F[z, a], z -> Infinity]
> is unevaluated.  In the first case, Limit has made an unwarranted
> assumption about F.
>
> In short, Limit can and does make assumptions; we simply can't control
> them.
>
> If Andrzej's point is that algebraic software still can't do all the
> work for us, that's obviously true.  If he's saying Limit is doing all
> it can reasonably be expected to do, I don't think so.  (Witness these
> anomalies in Limit's behavior.)
>
> Bobby
>
> -----Original Message-----
> From: Andrzej Kozlowski [mailto:andrzej at platon.c.u-tokyo.ac.jp]
To: mathgroup at smc.vnet.net
> Sent: Friday, August 02, 2002 5:31 PM
> Cc: 'Dana DeLouis'; mathgroup at smc.vnet.net; j_m_1967 at hotmail.com
> Subject: [mg35863] Re: [mg35818] Re: Limit[Sin[a*x]/(a*x), x -> Infinity]
>
> It is true that Mathematica could "automatically" replace parameters
> which are positive by E^Re[a] or E^Abs[a], and make a few more
> replacements of this kind (though it is not necessarily clear which one
> would be the most helpful one in a given situation) but that would do no
>
> more than you can do by making such substitutions by hand. It would thus
>
> be only of cosmetic use (it may save you a typing a few characters,
> although even then I am not sure that Assumptions-> ...{a>0}  is that
> much improvement on /.a->E^(Re[b])) but they would not help you to solve
>
> a single problem you can't do now.  A serious assumptions mechanism
> would be able to take an assumption and derive from it the consequences
> significant for the convergence of a limit, in other words make
> deductions and size estimations the way one does when working with
> serious limit problems (e.g. using bounds on the coefficients in the
> Taylor series ).   Compare the assumptions mechanism in Integrate and in
>
> Simplify. The first works largely like what you are suggesting, in other
>
> words you have to know what assumptions are relevant (no deduction),
> they must be just in the right form, and may be ignored even if they are
>
> relevant. The other let's you enter the actual conditions and let's
> Mathematica itself make the necessary deductions.
>
> Also the original post said:
>
>> I don't want to write specific assumptions for each term in Limit
>> since I have many different variables and forms of a.
>
> The only wat to do this is to temporarily re-define Limit for the
> particular problem at hand.
>
> Andrzej Kozlowski
>
>
> On Saturday, August 3, 2002, at 05:06  AM, DrBob wrote:
>
>> There's nothing to prevent Limit from converting the condition a>=0
> into
>> the change of variables a=Exp@Re@b and computing the limit (no matter
>> what limit function or asymptote we're looking at), if Limit were made
>> "assumption-aware".  That's only one example, but I think most
>> conditions we'd be interested in can be handled similarly.
>>
>> Bobby
>>
>> -----Original Message-----
>> From: Andrzej Kozlowski [mailto:andrzej at platon.c.u-tokyo.ac.jp]
To: mathgroup at smc.vnet.net
>> Sent: Friday, August 02, 2002 8:30 AM
>> Cc: mathgroup at smc.vnet.net; drbob at bigfoot.com; j_m_1967 at hotmail.com
>> Subject: [mg35863] Re: [mg35818] Re: Limit[Sin[a*x]/(a*x), x -> Infinity]
>>
>>
>> On Friday, August 2, 2002, at 03:42  PM, Dana DeLouis wrote:
>>
>>>
>>> Hello.  I do not have an answer, as I am new also.
>>> In Mathematica 4.2, Help says in part "...Limit therefore makes no
>>> explicit assumptions about symbolic functions." Same for the Package
>>> "NLimit."  Therefore, I think we're out of luck here.
>>
>> You can't make assumptions in Limit. There are not enough general
>> methods for such a mechanism to be really useful.
>>
>>> As an newbe observation, the only option for Limit (For Mathematica
> 4.
>> 2)
>>> is "Direction."  However, if you type ??Limit, there is another
> Option
>>> listed that appears not to be documented. That option is "Analytic."
>> I
>>> thought maybe this would solve this type of problem, but it does not.
>> I
>>> do not know for sure what this option does.  Anyone else??
>>
>> This is meant for the situations when you use a custom defined
> function.
>>
>> For example:
>>
>> In[21]:=
>> Limit[f[Sin[x]/x], x -> 0]
>>
>> Out[21]=
>> Limit[f[Sin[x]/x], x -> 0]
>>
>> but
>>
>> In[22]:=
>> Limit[f[Sin[x]/x], x -> 0, Analytic -> True]
>>
>> Out[22]=
>> f[1]
>>
>>
>>
>>>
>>> Information["Limit", LongForm -> True]
>>> "Limit[expr, x->x0] finds the limiting value of \
>>> expr when x approaches x0...
>>>
>>> Attributes[Limit] = {Listable, Protected}
>>>
>>> Options[Limit] = {Analytic -> False, Direction -> Automatic}
>>>
>>> As a possible workaround, would substituting many values for "a"
> work?
>>> Here is what I am thinking...
>>>
>>> v = Table[Random[Real, {0, 2*Pi}], {100}];
>>>
>>> Union[(Limit[Sin[#1*x]/(#1*x), x -> Infinity] & ) /@ v]
>>>
>>> I get all zero's like you predicted for many values of a.
>>> {0}
>>>
>>> If you try "Integers", then I get an "Indeterminate" because the
> limit
>>> does not like "a" being 0.
>>>
>>> v = Table[Random[Integer, {-4, 4}], {10}];
>>>
>>> Union[(Limit[Sin[#1*x]/(#1*x), x -> Infinity] & ) /@ v]
>>>
>>>
>>> {0, Indeterminate}
>>
>>
>>
>> Actually the problem is that the function Sin[z]/z is singular at
>> Infinity. Thus:
>>
>> In[26]:=
>> Limit[Sin[z]/z, z -> Infinity, Direction -> -1]
>>
>> Out[26]=
>> 0
>>
>> In[27]:=
>> Limit[Sin[z]/z, z -> Infinity, Direction -> -I]
>>
>> Out[27]=
>> Infinity
>>
>> In other words the limit depends on the direction. So when you
> consider
>>
>> Limit[Sin[a z]/(a z), z -> Infinity]
>>
>> it is not clear in which direction the limit is being taken. This
>> depends on whether a is real or not (as Bobby Treat already pointed
> this
>>
>> out in his message),and of course there is the special case a==0.
>>
>> Since Limit does nto allow assumptions to be entered if you know that
>> you will be dealing with such cases frequently one approach is to
>> redefine limit:
>>
>> Unprotect[Limit];
>>
>> In[28]:=
>> Limit[Sin[a_*x_]/(a_*x_), x_ -> Infinity] /;
>>      Im[a] == 0 && a != 0 = 0;
>> Limit[Sin[a_*x_]/(a_*x_), x_ -> Infinity] /;
>>      Re[a] == 0 && a != 0 = Infinity;
>>
>> In[30]:=
>> Protect[Limit];
>>
>>
>> Now you need to enter assumptions about a's or b's, e.g.:
>>
>> In[31]:=
>> a/:Im[a]=0;
>>
>> In[32]:=
>> a/:(aâ? 0)=True;
>>
>> this says a is a non-zero real. Limit will now return the expected
>> answer:
>>
>> In[33]:=
>> Limit[Sin[a*x]/(a*x), x -> Infinity]
>>
>> Out[33]=
>> 0
>>
>> similarly for the case when b is non zero and imaginary we will get:
>>
>> In[34]:=
>> b /: Re[b] = 0;
>>
>> In[35]:=
>> b /: b != 0 = True;
>>
>>
>> In[36]:=
>> Limit[Sin[b*x]/(b*x), x -> Infinity]
>>
>> Out[12]=
>> Infinity
>>
>> If you are sure you are going to onl be dealing with non-zero real
>> numbers you can redefine Limit to return always 0 in such cases, which
>> may make it simpler to deal with a large number of them in one go.
>>
>
>>
>>
>>>
>>> --
>>> Dana
>>> Windows XP  & Mathematica 4.1
>>> = = = = = = = = = = = = = = = = =
>>>
>>> "JM" <j_m_1967 at hotmail.com> wrote in message
>>> news:<aiat23$5b0$1 at smc.vnet.net>...
>>>> Sorry for 'refreshing' this message but does anyone know if I can
>>>> define the assumption below.
>>>>
>>>> I don't want to write specific assumptions for each term in Limit
>>>> since I have many different variables and forms of a. Is it possible
>>>> to generalise the assumption?
>>>>
>>>> it would really help me (and I really don't want to have to buy any
>>>> additional maths software).
>>>>
>>>>
>>>> timreh719 at yahoo.com.tw (bryan) wrote in message
>>>> news:<ahdf97$i36$1 at smc.vnet.net>...
>>>>> Hi All :
>>>>>    I am also interesting in the solution of how to make an
> asumption
>>>
>>>>> in Mathematica. I can't find any method in Mathematica. If anybody
>>>>> has the approch to do this , please send it to my e-mail too ,
> Thank
>>>
>>>>> you all ..
>>>>>
>>>>> j_m_1967 at hotmail.com (JM) wrote in message
>>>>> news:<ah8otr$aut$1 at smc.vnet.net>...
>>>>>> I know that this should be 0 but why can't I get mathematica to
>>>>>> think likewise.
>>>>>>
>>>>>>
>>>>>> In[4]:= Limit[Sin[a*x]/(a*x),x->Infinity]
>>>>>>
>>>>>>               Sin[a x]
>>>>>> Out[4]= Limit[--------, x -> Infinity]
>>>>>>                 a x
>>>>>>
>>>>>> Is the problem a? How can I specify the properties of or
>>>>>> assumptions that may be made about a?
>>>>
>>>
>>>
>>>
>>
>>
>>
>
>
>
>
Andrzej Kozlowski
Toyama International University
JAPAN
http://platon.c.u-tokyo.ac.jp/andrzej/



  • Prev by Date: RE: RE: RE: RE: Installing package "SpreadOption`"
  • Next by Date: Re: Recursive Function
  • Previous by thread: RE: Notebook question
  • Next by thread: Using % in ; separated commands