[Edu-sig] Update from Urner [why 0**0 == 1?]

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Thu, 25 Jul 2002 10:41:40 -0700 (PDT)


> Question:  why do both J and Python define 0**0 (or 0^0 in J) to be 1,
> when mathematicians (and Wolfram's Mathematica) call this undefined?

Concrete Mathematics actually covers a reason for defining 0**0 as 1 in
the chapter on binomial coefficients --- I think it's somewhere in Chapter
5.


Although the functions 0**x and x**0 have different limiting values as x
approaches zero, we should define 0**0 == 1 so that the binomial theorem:

    (x+y)**r = sum_k (n choose r)  (x**r) (y **(n-r))

works for all r >= 0, even if x == -y.  If you have The Art of Computer
Programming Volume 1 handy, see section 1.2.6 on the explanation of the
binomial theorem, and you'll see it.


Hope this helps!