# Math questions.

Two questions: Why does 0! == 1, and what does 0^0 evaluate to?

My background in math is through basic calc, so please be gentle.

And this isn’t a homework assignment or anything. My teacher couldn’t explain it beyond “Because we say so”. Can light be shone on these questions?

Your first question seems silly to me, so I’m going to assume I don’t understand what you’re asking and go on to the second question. 0[sup]0[/sup] is undefined, much like 0/0. The reason is that there’s no totally consistent way to define it. For instance, the limit as x goes to 0 of x[sup]0[/sup] = 1, but the limit as y goes to 0 of 0[sup]y[/sup] = 0. So if we define it as either 0 or 1, then it’s going to cause a discontinuity in one equation or the other.

Now, we could define one way or the other, and as long as we stayed consistent, everything would work out. But we haven’t. It’s easier just to leave it undefined.

Oh I understand your first question now. 0 factorial equals 1. Got it. There are many good ways to understand why this should be so. Here’s one of my favorite:

78! / 77! = 78
10! / 9! = 10
3! / 2! = 3

So… what do you think 1! / 0! should equal?

0! is defined as 1.

Or, you can try:

n! = n*(n-1)!

1! = 1*0!

1 = 0!

Should have previewed.

0! = 1 because it is convenient to define it that way, and it’s consistent with the normal definition. Additionally, that’s what you get out of the gamma function, which is the generalized version of the factorial function.

Achernar handled your second question exactly the way I would have.

Also, your use of == outside of a programming language irks me to no end. I dunno why, but it does.

That’s what threw me off at first. I parsed == and thought, ah, programming notation! Then I parsed the ! as ‘not’. Then I parsed the whole expression “0 is not equivalent to one”. Then I thought, “Well duh. What kind of stupid question is that?”

Another reason 0! = 1 is that you can define n! as the integral from 0 to infinity of e^{-x}x^n and when n = 0 that evaluates to 1. The other reasons are valid too. Notice that this formula interpolates the factorial function between integer.

As for the second question, there are a number of reasons why 0^0 = 1, which I will not go into. But the function x^x is not continuous at 0, with the result that the limit as x --> 0 of x^x does not exist. But that is not the same question.

Hari Seldon: Isn’t your integral just the gamma function referred to by ultrafilter?

Yes. Well, it is not exactly the gamma function but either gamma(n+1 or gamma(n-1) (it has been 40 years since I looked).

But mainly, I wanted to correct what I said. The function x |–> x^x is actually continuous at 0 when you let 0^0 = 1. But the two variable function (x,y) |–> x^y is not continuous at (0,0). For example, as you come in along the line y = 0, the value is 1 and along the line x = 0, the value is 0. If you come in along other curves, you can get other values. Sorry about that.

One other point, is that all these limits are actually one-sided limits taken along positive vaules of one or both variables. The reason is that if y < 0, then x^y --> infinity as x --> 0, while if x < 0, then the exponential is a many-valued (and complex-valued)function, actually infinitely many-valued function unless the exponent is rational, but there is a principal positive branch when x > 0, which is what is being talked about.

Here’s another reason 0! is 1. Factorials are used to express the formulas for binomial coefficients. These are the coefficients of the terms in the expansion of (x+y)^n. The m-th term (counting from 0) of this expansion is the binomial coefficient (m n) [the m is supposed to be written above the n but I can’t manage that here]. The formula for (m n) is n! / (m! * (n-m)!). This formula gives the right answer for m = 0 or m = n if you define 0! as 1.

Chava

I’ve never heard anyone argue that way. Care to enlighten us as to why?

I love that explanation, especially because Hari uses it to ‘prove’ something that isn’t true! Haw haw haw!

At least once a week someone asks a question like this, asking the value of something that isn’t defined. Invariably a handful of chumps jumps in to give various answers. 0^0 IS NOT DEFINED. This is because exponentiation is not a ‘total’ binary function.

As for 0! = 1, it’s just because 1 is the multiplicative identity. I guess a lot of people find it natural to think of 0! as 0, because everyone learns addition (and that x+0 = x) before they learn that x*1 = 1. Consider it this way: n! = prod(i from 1 to n)(i).

Now consider how you evaluate sum(i from 1 to 0)(i). Obviously it’s 0, the additive identity.

That’s the intuitive answer. The real answer is “by definition of !”.

I am surprised a commonly given reason for having 0!=1 hasn’t been mentioned yet:

n! is the number of ways to arrange n different items in a row. For 0 items, there is exactly one way. A lot of discrete math writers explain it that way. E.g., Graham, Knuth and Patashnik “Concrete Mathematics”. They also give, pg. 162, the explanation that 0[sup]0[/sup] must be defined to be 1 in order for the binomial theorem to work. I prefer the “multiplicative identity” explanation for both.

No matter what one defines 0[sup]0[/sup] to be, there are functions that become discontinuous as a result. If it’s one, the function 0[sup]x[/sup] becomes discontinuous at zero. If it’s zero, then x[sup]0[/sup] becomes discontinuous at zero.

However, ftg’s point about the binomial theorem convinces me that setting 0[sup]0[/sup] = 1 is the right choice. I don’t know if this is Knuth et al.'s explanation, but consider (a + 0)[sup]1[/sup] (a not equal to 0). Clearly, that’s equal to a. By the binomial theorem, (a + 0)[sup]1[/sup] = c(1,1)a[sup]1[/sup]0[sup]0[/sup] + c(1,0)a[sup]0[/sup]1[sup]0[/sup], where c(n, k) is the appropriate binomial coefficient (n!/(k!(n-k)!)). That reduces to a0[sup]0[/sup]. Since we know that that’s equal to a, we can divide both sides of the equation a0[sup]0[/sup] = a to get 0[sup]0[/sup] = 1.

I believe that’s the standard logic for setting 0^0 = 1 when it’s inconvenient for it to be undefined – here’s a paraphrase from a FAQ on the subject: Zero to Zero Power.

OK, you think that my 0^0 = 1 is totally arbitrary. Yes, it is true that 0^x is discontinuous at 0, but that does not mean it is undefined. As I said there are a number of reasons and they would be easier to state if I could remember the various codes, so bear with me. First off, and the most important to me is that when m and n are natural numbers, n^m is the number of functions from m to n. Here I take the usual definition of n as the set {0,1,…,n-1} and then 0 is the empty set. The number of functions from the empty set to the empty set is exactly 1. Second (although not unrealted) is the fact that if A and B are disjoint finite sets and if {x_a|a in A} and {x_b|b in B} are A and B indexed families and if C is the union of A and B, then the product of all the x_c, where c ranges over the union of A and B is simply the product of the x_a times the product of the x_b. When A (or B) is empty, this implies that the empty product has to be defined to be 1. 0^0 is an empty product (of no copies of 0). This, BTW, is another explanation for why 0! = 1. A similar argument implies that the empty sum is 0. Third the usual inductive definitions of addition, multiplication, and exponentiation of integers are (S(n) is the successor of n, the next integer after n; it would be n + 1 if + were already defined):

addition: m + 0 = m and m +S(n) = S(m+n)
multiplication: m0 = 0 and mS(n) = m*n + n
exponentiation: m^0 = 1 and m^{S(n)} = (m^n)*m

If 0^0 were anything other than 1, the third one would require a more complicated definition. The situation might be different if exponentiation were defined by induction on the base rather than the exponent, but such a definition would be hopelessly complicated.

So there are three reasons why this is the best definition. I could probably find more if pressed. To say that 0^0 is undefined is to say that no one has defined it. Well, I and many many other mathematicians have defined it and we defined it to be 1. You want to define it otherwise, go right ahead, but unless you can find a good reason, others will not go along. Now suppose you do find a good reason. Not impossible, maybe not even unlikely, although nothing comes to mind. Then you right a paper and you say at the outset that for the purposes of this paper, 0^0 will be understood to be defined as 7. No problem. People are forever starting papers in this way and, so long as there is some reason for doing so, there is no harm.

Someone above said that 0^0 is UNDEFINED. As those there were, somewhere, a compendiium of definitions (and undefinitions) that everyone must follow. Well, there ain’t such. Not even a list of standard notations. Maybe pi is used in one place as the ratio of the circumference to the diameter of a circle. The next place might use for a projection operator (say in some Hilbert space). In a third, it might be an element of a set called P. Maybe I will have e = mc^2 is some paper in which e, m, and c have meanings unrelated to their meanings in physics.