       Re: L'Hopital's rule contradiction --- what am I messing up?

• To: mathgroup at smc.vnet.net
• Subject: [mg8335] Re: [mg8215] L'Hopital's rule contradiction --- what am I messing up?
• From: seanross at worldnet.att.net
• Date: Sun, 24 Aug 1997 13:24:51 -0400
• Sender: owner-wri-mathgroup at wolfram.com

```Tom Chwastyk wrote:
>
> Yesterday I was writing something dealing with the entropy of a probability
> distribution s(p)=sum_i p_i log p_i. I wondered if I had to exclude p_i=0
> from the sum, so I looked at
>
> limit_(p->0) p log p = 0 (-infinity) .
>
> This is an indeterminate form, so I tried applying L'Hopital's rule
> (limit of an indeterminate form two-factor product is the limit of the
> product of the derivatives of the factors) and got
>
> .... = limit_(p->0) (1) (1/p) = infinity .
>
> This seemed odd (I didn't see the exclusion all over the literature), so I
> asked Mathematica for Limit[p Log[p], p->0] and got back 0. I am confident
> that 0 is correct. For one thing, I looked at plots of p and log p; p seems
> to go to 0 faster than log p goes to -infinity. Second, I found the MMa
> book even includes (with evident pride) the example Limit[x Log[x],x->0]
> giving 0 'even though there's not a power series for Log[x] about 0'.
> Third, I looked at q=log p, p=e^q with the equivalent
>
> limit_(q->-infinity) e^q q = 0 (-infinity);
>
> this is indeterminate again, but now L'Hopital gives
>
> .... = limit(q->-infinity) (e^q) (1) = (0) (1) = 0.
>
> Question: what am I messing up or overlooking in the first version?
>
>
> Tom
> --
> Tom Chwastyk ["Fosdick". Polish: CH='H, W=F (here),
> A=AH, Y=I. Soften strict 'HFAH-stik.... :-) ]
> Naval Research Laboratory Code 6383
> Wash. DC 20375-5343    (202) 767 2567

I think you are mis-applying L'Hopitals rule.  It states that if the
limit of x/y is indeterminate, then x'/y' has the same limit.  Your
first case was p Log p and you apply LH to get 1 * 1/p.  Instead you
needed to write either Log p /(1/p) in which case both numerator and
denominator are infinity or p/(1/Log p) in which case they are zero.
Apply LH to the correct numerator and denominator and I bet you will get
a better answer.  The second example you give is a case of cancelling
errors.

```

• Prev by Date: Re: Abs derivative (continued) (was Re: ? ? ? ! ?)
• Next by Date: Turning Off FractionBox[ ] Globally?
• Previous by thread: L'Hopital's rule contradiction --- what am I messing up?
• Next by thread: Re: L'Hopital's rule contradiction --- what am I messing up?