Re: Re: indeterminate expression
- To: mathgroup at smc.vnet.net
- Subject: [mg37647] Re: [mg37606] Re: indeterminate expression
- From: Andrzej Kozlowski <andrzej at platon.c.u-tokyo.ac.jp>
- Date: Thu, 7 Nov 2002 06:42:21 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
I think it may not be such a good idea for a programming language to always return 1 for 0^0. There are cases when 1 is the natural interpretation (as in the original posting) but there are also cases when this sort of thing is the result of something going wrong somewhere in one's input. If the answer is always 1 then NumericQ[0^0] will be True and in general it will be hard to catch this sort of error (when it is an error). So it may be better to keep things as they are and resort instead to the folowing simple idea: Define the function myPower: myPower[0,0]=1; Now perform your computation inside Block as follows: Block[{Power=myPower},expr]/.myPower->Power where expr is your expression involving 0^0 . I think this is preferable to simply re-defining Power, although of course it is easy enough to do that. Andrzej Kozlowski Yokohama, Japan http://www.mimuw.edu.pl/~akoz/ http://platon.c.u-tokyo.ac.jp/andrzej/ On Wednesday, November 6, 2002, at 08:54 PM, David W. Cantrell wrote: > "MH" <petronius at myrealbox.com> wrote: >> Hi, as part of a long combinatoric code, I need to calculate lots of >> p^n >> values. The problem arises when p=n=0. Such an expression is >> indeterminate obviously, > > I agree with that statement _only_ because this newsgroup concerns > Mathematica, in which 0^0 is indeed called Indeterminate. However, many > mathematicians (including myself) take 0^0 to be 1. See, for example, > the > article "What is 0^0?" at > <http://db.uwaterloo.ca/~alopez-o/math-faq/node40.html>. > Furthermore, some other computer algebra systems (in this newsgroup, > I'm > not supposed to name them, if I understand correctly) consider 0^0 to > be 1. > > Note that of course the _limit form_ 0^0 is indeterminate. No question > about that. But we are not concerned with a limit form here; rather, we > are concerned with just the arithmetic expression 0^0. > >> but since it is part of a probability >> calculation, the probability that something with 0 probability >> occuring 0 >> times is 1. Is there a rule that I can specify that would allow me to >> replace this indeterminate express with the answer that I want? > > As to this good question of yours, I'll defer to those more experienced > with Mathematica. I'll be interested in their answers. > > Ultimately however, I would like to see 0^0 = 1 by default in > Mathematica. > > David Cantrell > > -- > -------------------- http://NewsReader.Com/ -------------------- > Usenet Newsgroup Service > > >