# HP Forums

Full Version: 0^0 = 1?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
I recently found that the wp34s reports 0^0 to be 1. Incidentally, the complex version of this operation works as expected, throwing a Domain Error or, if flag D is set, returning NaN + j*NaN.

Regards.
The question pops up every so often, and has been answered each and every time.

The exact answer is 'NaN', but it is convenient (and in this case, very much so) to have it defined as 1. That is one of the reasons why the 49/50 return '?' for 0^0 yet 1. for 0.^0.

What is 0^0

Cheers, Werner
Why would you say the exact answer is NaN? The article you link to mentions the usual argument for 0^0 being undefined, namely, that 0^x has a discontinuity at x=0, but then it makes the case that 0^0=1 makes more sense, because it avoids the discontinuity in x^0 at x=0, without introducing any inconsistencies elsewhere.

Given that, setting 0^0=NaN but 0.^0.=1. doesn't seem to make sense.
(04-21-2017 01:54 PM)Thomas Okken Wrote: [ -> ]Given that, setting 0^0=NaN but 0.^0.=1. doesn't seem to make sense.

lim x->0 f(x)^g(x) = 1, if f(x), g(x) are real functions perhaps? 0. is real.
Thomas,
0^0 is undefined, exactly like SIN(x)/x is undefined at x=0.
So, for exact arguments (decimal integers), that is what the 49/50 return: '?'.
In the case of computations with reals, it is convenient to have it return 1. because that's what the limit is for x approaching 0 (for SIN(x)/x, and for a large class of functions f(x) and g(x) for f(x)^g(x) ). Limits are not values, however.
In the case of the 48/50, an extra argument to return 1. for 0.^0. was compatibility with the 48, that also returned 1. (But lacked the exact decimal integer type).

Cheers, Werner
I've just read some pages concerning this matter. The strongest (to me) argument in favour of the 0^0 = 1 convention are such relying on the definition of the +, · and ^ operations upon operations over sets (number of elements in the union of 2 disjoint sets => +, number of pairs you can pick from two sets => ·, number of functions from 1 set to the other => ^). The binomial theorem does also have a weight.

But these arguments hold valid for integers (in fact they are "integer" arguments). Even the repeated-multiplication argument holds for integers. Why then throw an error (ala wp34s) or report ? (ala 49/50) for 0^0 in integer mode?

Also, accepting that the limit argument suggests 0^0 = 1 for reals, why not also for complex numbers?

Regards.

note: I've found this link https://www.quora.com/What-is-0-0-the-ze...-of-zero-1 interesting
(04-22-2017 08:00 AM)Werner Wrote: [ -> ]Limits are not values

Sure they are. Saying sin(x)/x is undefined at x=0 is just as arbitrary as saying x/x is undefined at x=0. Cancelling zeroes is not kosher in general, but cancelling identical variables is fine, even if they may be zero. It's algebra, not arithmetic.

0^0 is an empty product, and empty products are 1. Why make an unnecessary exception for 0?
(04-22-2017 01:02 AM)Egan Ford Wrote: [ -> ]
(04-21-2017 01:54 PM)Thomas Okken Wrote: [ -> ]Given that, setting 0^0=NaN but 0.^0.=1. doesn't seem to make sense.

lim x->0 f(x)^g(x) = 1, if f(x), g(x) are real functions perhaps? 0. is real.

There are some real functions f(x) and g(x) where lim x->0 f(x)^g(x) does not equal 1. I remember coming up with some back in my college days when "0^0" was being debated by students (almost a quarter century ago). Initially, I sided with the students that 0^0=1 (the HP 48SX being supporting evidence). However, by the next class I thought of some formulas that supported the professor's correct statement that 0^0 is of Indeterminate Form.

https://en.wikipedia.org/wiki/Indeterminate_form
Happy to throw in my 2 cents:

To assign 0^0 a meaningful value, that value should be the unique "limit" (in some sense) of x^y as x and y go to zero independently. Otherwise the choice of "meaningful" value becomes rather arbitrary. In general (x and y real or complex) such a limit does not exist so NaN seems an appropriate result.

But of course you can chose to restrict the domains of x and y depending on your context. For example you can restrict y to be an integer, in which case it seems to make sense to take the "limit" for y by only considering values of the form x^0, where x goes to zero. In this case 1 can be justified as "the" result even in the complex (for x) case. This is of course also consistent with the "empty product" argument, which also implies that y should be an integer.

But even if you would only allow arbitrary positive (or zero) values for x and y then a unique limit does not exist and therefore it does not seem to make sense to assign a meaningful value. To see this, simply take an arbitrary number a, with 0 < a < 1, and take x = a^N and y = 1/N, so that x^y = a. By letting N go to infinity x and y will both go to zero with x^y = a as the limiting value along this x-y path.

Of course you could undermine the argument above by only allowing certain x-y paths (e.g. rays of the form ax = by) but you would again need a very specific context to justify that limitation.
I'm sure you can observe all sorts of interesting behaviors in lim (x->0) f(x)^g(x), but that's not helping with the question that started this thread; that's just changing the subject.

Regarding this new requirement that in order for a limit to be defined, it must be defined from all directions: that's called "moving the goalposts." :-) In order for a limit to be defined, it must be unique, but being defined from all directions is not necessary.

Consider: lim (x->0) 1/x is undefined, because the limit from above is +Inf, while the limit from below is -Inf. Not equal, therefore undefined.

Now consider lim (x->0) log(x). From above, -Inf; from below, undefined. Would you say that lim (x->0) log(x) is not -Inf?
No actually, I am not moving goalposts: I am applying the standard mathematical definition of a limit for a function of two variables. And rather than "being defined from all directions" not being necessary, this definition is even stronger than that (based on the usual epsilon-delta or topological criteria).
Limits for functions of a single (real) variable are deceptive because there is only "from above" and "from below". In 2 and more dimensions "all directions" do need to be taken into account to get a decent definition of "limit".

With regards to you log(x) example, that only reinforces my statement that the (topology and) domain choice for the variables (arguments) matters. If you only define log(x) for x>0, and you extend the real numbers with +Inf and -Inf, then you are right. If you don't extend the real numbers then there is no limit ("out of range" if you like). But if you extend the definition of log(x) to x<0 then there is no limit either. Where you say "undefined" (for x<0), I could say "out of range" because you failed to extend the real numbers to the complex numbers.

You could also extend the real numbers with (unsigned) Inf only and then 1/x would also have a limit. This may seem silly for real numbers but it is in fact standard practice for complex numbers and 1/0 is in fact treated as equal to Inf in the extended complex plane, i.e. on the Riemann sphere.

But the case for 0^0 is much simpler because you can stick to positive numbers to see why it should not be defined; unless you limit yourself to integer exponents.
I just realise that I may have caused some confusion with the words 'the unique "limit" (in some sense)' in my original post. This wasn't to imply that I was going to consider alternative definitions of what it means to be a "limit", but rather to cover the case of dealing with integer values only for y (the only case for which setting 0^0 to 1 seems justified).

When y only takes on integer values then the idea of taking a limit where y is going to 0 may seem strange, but "in some sense" (the discrete topology on the integers) taking this limit follows the standard mathematical definition and is consistent with other "limits". It basically amounts to setting y to 0 and taking the usual limit for x only (i.e. it becomes 1-dimensional again).
Well, yes, y^x is a bivariate function, so you can come at (0, 0) from more than just two directions. If we parameterize the direction as an angle φ from the positive x axis, we get

y^x = (r sin(φ))^(r cos(φ))

and the value we're looking for is the limit of that as r goes to zero.
For all φ ∈ (0, π), so positive y, this limit is 1; for all φ ∈ (π, 2π), so negative y, this limit is also 1, albeit with a side trip through the complex plane.

This leaves only the cases φ = 0 and φ = π, i.e. y = 0 with x > 0 and x < 0, respectively. Lim (x->0) 0^x is undefined if you come at it from below, because of division by 0. From above it's tricky, because while 0^x = 0 for all x > 0, suggesting simply continuing this line yielding 0^0 = 0, its behavior at x = 0 is rather special:

0^x = e^(x * log(0)) = e^(x * -Inf)

because x * -Inf = -Inf for all x > 0, and undefined when x = 0. The usual tricks for resolving limits by dropping higher-order terms or cancelling factors don't work here because that infinity really is a hard infinity, not a factor that goes to inifinity as we approach the limit.

So, lim (r->0) (r sin(φ))^(r cos(φ)) = 1 for φ ∈ (0, π) ∪ (π, 2π) and undefined for φ = 0 and φ = π.

Make of that what you will. :-)
There's a brief and interesting discussion of this topic on this page of the "Ask a Mathematician" website, which walks through the difficulties of the analysis but concludes:

Quote:...But if this is the case, then how can mathematicians claim that 0^0=1? Well, merely because it is useful to do so. Some very important formulas become less elegant to write down if we instead use 0^0=0 or if we say that 0^0 is undefined. For example...
(04-23-2017 02:58 PM)Thomas Okken Wrote: [ -> ]So, lim (r->0) (r sin(φ))^(r cos(φ)) = 1 for φ ∈ (0, π) ∪ (π, 2π) and undefined for φ = 0 and φ = π.

Make of that what you will. :-)

Ahhh... I promised myself not to get involved in this one, but since nobody mentioned this... here it goes:

There's one missing piece of the puzzle here.
when 0 < r cos(φ) < 1, you could express that number r cos(φ) as a fraction: m/n (I know, not always but bear with me).

Now a^(m/n) has infinite solutions spinning all around the complex plane. When r->0 this fraction will have a huge denominator 'n', which means a huge number of different solutions very closely spaced. So when the limit goes to zero, turns out the solution is not (real) 1, but the entire (complex) unit circle, with infinite solutions of magnitude 1 in all directions.
So we know the magnitude is 1, but the argument in the complex plane is undefined, so for newRPL I chose 0^0=1 in real mode, and NaN in complex mode.

Does it make sense?
(04-23-2017 07:33 PM)Claudio L. Wrote: [ -> ]Does it make sense?

I understand what you're saying, but I disagree with what you're doing. By your logic, you could argue that even sqrt(4) should be NaN, because +2 and -2 are equally valid solutions to x^2=4, and so there is no unique solution.

That's not what y^x should be doing. It should calculate e^(x log(y)), and that *is* a proper mathematical function, having no more than one value at each point. I'd say if you want a root extractor that returns all the n roots of x^n=y, that should be a separate function.
(04-23-2017 07:45 PM)Thomas Okken Wrote: [ -> ]...calculate e^(x log(y)), and that *is* a proper mathematical function, having no more than one value at each point.

In the complex plane, ln(z) is a multivalued function, that's the whole point.

https://en.wikipedia.org/wiki/Complex_logarithm

If you look only into the real set, it's hard to see why 0^0 wouldn't be 1. In the complex plane is clear that there are infinite solutions.
I'm not arguing one definition is incorrect or not, just showing a way to "help" visualize why you might define 0^0 = undefined, which hadn't been mentioned before in the thread.
(04-24-2017 12:40 AM)Claudio L. Wrote: [ -> ]In the complex plane, ln(z) is a multivalued function, that's the whole point.

OK, but in computation, it is conventional to pick the principal branch. This is analogous to picking only +2 for sqrt(4); in order to make the function usable computationally, it must be one-valued (in other words, it must be a function), and those are the standard ways of doing that.
Even when restricted to real numbers, 0^0 is undefined in general. This is why 0^0 is considered an indeterminate form like 0/0 or 1^inf.

When real functions f(x) and g(x) are restricted to just be the functions that are analytic at x=0, then 0^0 is 1.

For examples of 0^0 != 1 because f(x) and/or g(x) are not analytic at 0 are:
• lim (x->0) of (e^(-1/x)) ^ x = 1/e. In fact, this function equals the constant 1/e for all real x
• lim (x->0+) of x ^ ( ln(2)/ln(x) ) = 2. In fact, this function equals the constant 2 for all real positive x (though you also need to use limits for x=1 because it creates another indeterminate form of 1^inf).
• lim (x->0+) of x ^ ( ln(7)/ln(x) ) = 7. Same as above, different constant.
Note: the last two examples can be modified from lim (x->0+) to the broader lim (x->0) [i.e. the limit is the same from "above" as "below"] by changing the formula to abs(x) ^ ( ln(C)/ln(abs(x)) ).

So why do so many engineers, scientists, and a small number mathematicians like to say 0^0 = 1? Simply because in their respective areas they usually work with only analytic functions. Thus, they don't need to deal with the hassle of that 0^0 is actually undefined in the general case.
(04-24-2017 03:45 AM)Chris Dreher Wrote: [ -> ]So why do so many engineers, scientists, and a small number mathematicians like to say 0^0 = 1? Simply because in their respective areas they usually work with only analytic functions. Thus, they don't need to deal with the hassle of that 0^0 is actually undefined in the general case.

No, it's because they don't change the subject by introducing transformations that cause you to end up looking at a completely different problem.

Consider lim (x->0) x/x. I don't think it's controversial to say that that is 1. Now take lim (x->0) f(x)/g(x), where f(x) and g(x) are nice, well-behaved functions, both zero at x=0, both with a nonzero derivative at x=0, continuously differentiable, etc. etc. etc.

Suddenly you can make that limit come out to whatever you want. Does this lead to some deep insight? No, because you're no longer looking at the same problem.
Pages: 1 2 3
Reference URL's
• HP Forums: https://www.hpmuseum.org/forum/index.php
• :