Mathematics in Python are not correct

Arnaud Delobelle arnodel at googlemail.com
Mon May 12 12:53:27 EDT 2008


Lou Pecora <pecora at anvil.nrl.navy.mil> writes:

> In article <mailman.962.1210572565.12834.python-list at python.org>,
>  "Terry Reedy" <tjreedy at udel.edu> wrote:
>
>> "Mark Dickinson" <dickinsm at gmail.com> wrote in message 
>> news:6b64d8f4-3f61-4295-9298-4633214d1e94 at m73g2000hsh.googlegroups.com...
>> On May 11, 9:36 pm, "Terry Reedy" <tjre... at udel.edu> wrote:
>> |> Do you have in mind any situations in which it is advantageous to have 
>> 0**0
>> |> undefined?
>> 
>> | (Playing devil's advocate here.) If you regard x**y as exp(y*log(x))
>> 
>> Which, of course, I was not, but for the sake of discussion....
>> 
>> | then it's not at all clear that 0.**0. should be considered well-defined.
>> 
>> Then it seems equally dubious that 0.**y, y>0, should be well-defined.
>> It seems to me that lim as x goes to 0. exp(y*log(x)) is equally well 
>> defined whether y is 0 or not, even though there is a discontinuity in the 
>> limit.
>
> Huh?  That "discontinuity" is the problem.  Actually, the problem is 
> that the function f(x,y)=x**y=exp(y*ln(x)) will be double valued at x=0 
> and y=0.  

Actually f(x, y) can take any positive value, depending on how x and y
tend to 0.  Say for example

    x = exp(-k/y), k being a positive constant.

Then as y -> 0+, so does x and y*ln(x) = y * (-k/y) = -k

Therefore f(x, y) = exp(-k) and as y -> 0,

    x -> 0

    f(x, y) -> exp(-k)


> It's value will depend on the direction in which the limit
> approaches (x,y)=(0,0).  You cannot have a function that has two
> values at one domain point without adding branch cuts (see complex
> functions like ln(z), z is complex).  

This is unrelated, z -> ln(z) is a holomorphic function, locally
defined everywhere but at 0, therefore it can be defined on any simply
connected subset of the complex numbers not containing 0.

OTOH, f(x,y) as you defined it above is a real analytic function.
AFAIK, it doesn't have the above property.

-- 
Arnaud



More information about the Python-list mailing list