2

I've found some times, while playing with combinatorics, that Mathematica can't calculate some functions because $0^0$ is not defined as $1$.

(I know that some people think that $0^0$ should be left undefined. I'm convinced that $0^0$ should be defined as $1$ and this question doesn't intend to open a discussion of that).

My question is this:

If I redefine $0^0$ as $1$ in Mathematica like this:

Unprotect[Power]
Power[0,0]=1
Protect[Power]

could I be breaking some internal algorithms of Mathematica?

I did redefined FactorInteger[1] as {} a while ago (and that help me to simplify many function definitions) and I haven't find any issues as a result of that, but I'm afraid that messing with Power could be more delicate.

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
jjagmath
  • 411
  • 2
  • 9
  • This has come up before, here and here. Mr. Wizard's solution in the second link seems like an elegant solution. Any function you want to define, where 0^0 should be 1, define using Internel`InheritedBlock, and the change will be localized. – Jason B. Jan 20 '21 at 20:18
  • 2
    MichaelJacksonEatingPopcorn.gif – Chris K Jan 20 '21 at 20:19
  • 2
    "...could I be breaking some internal algorithms of Mathematica?" - Yes. Generally speaking, if you ever make a modification to something as basic as an arithmetic operation, anything that breaks afterwards is more than likely your fault. Why not reformulate your combinatorial formulae so that computing 0^0 is avoided? Otherwise, define a custom function like myPower = If[#2 == 0, 1, #1^#2] & and use that instead. – J. M.'s missing motivation Jan 21 '21 at 03:36

0 Answers0