Re: indeterminate expression
- To: mathgroup at smc.vnet.net
- Subject: [mg37596] Re: indeterminate expression
- From: Tom Burton <tburton at brahea.com>
- Date: Wed, 6 Nov 2002 06:53:17 -0500 (EST)
- References: <aq874p$e6e$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
On 11/5/02 2:39 AM, in article aq874p$e6e$1 at smc.vnet.net, "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, 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? I could go back and > change every instance where this pops up with a function or take the limit, > but I wanted to check if there was a more efficient method. The rule is easy, r = HoldPattern[0^0] -> 1 once you know about HoldPattern. Preventing premature evaluation may be more difficult. Example: expr = Hold[2^1+3^4+0^0+1^3] ReleaseHold[expr /. r] Tom Burton