# Math questions.

**URL:** <https://boards.straightdope.com/t/math-questions/140873>\
**Category:** Factual Questions\
**Created:** [December 6, 2002, 5:32am UTC](https://boards.straightdope.com/t/math-questions/140873 "2002-12-06T05:32:04Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![robertliguori](https://avatars.discourse-cdn.com/v4/letter/r/46a35a/32.png) [@robertliguori](https://boards.straightdope.com/u/robertliguori)\
**Post date:** [December 6, 2002, 5:32am UTC](https://boards.straightdope.com/t/math-questions/140873/1 "2002-12-06T05:32:04Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Achernar](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Achernar](https://boards.straightdope.com/u/Achernar)\
**Post date:** [December 6, 2002, 5:39am UTC](https://boards.straightdope.com/t/math-questions/140873/2 "2002-12-06T05:39:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Achernar](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Achernar](https://boards.straightdope.com/u/Achernar)\
**Post date:** [December 6, 2002, 5:41am UTC](https://boards.straightdope.com/t/math-questions/140873/3 "2002-12-06T05:41:32Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Desmostylus](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@Desmostylus](https://boards.straightdope.com/u/Desmostylus)\
**Post date:** [December 6, 2002, 5:46am UTC](https://boards.straightdope.com/t/math-questions/140873/4 "2002-12-06T05:46:02Z")

</div>

0! is defined as 1.

Or, you can try:

n! = n\*(n-1)!

1! = 1\*0!

1 = 0!

---

<div class="post-metadata">

**Author:** ![Desmostylus](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@Desmostylus](https://boards.straightdope.com/u/Desmostylus)\
**Post date:** [December 6, 2002, 5:47am UTC](https://boards.straightdope.com/t/math-questions/140873/5 "2002-12-06T05:47:19Z")

</div>

Should have previewed.

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [December 6, 2002, 6:17am UTC](https://boards.straightdope.com/t/math-questions/140873/6 "2002-12-06T06:17:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Achernar](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Achernar](https://boards.straightdope.com/u/Achernar)\
**Post date:** [December 6, 2002, 6:24am UTC](https://boards.straightdope.com/t/math-questions/140873/7 "2002-12-06T06:24:38Z")

</div>

> [@](#):
>
> \*Originally posted by ultrafilter \*  
> 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?” 🙂

---

<div class="post-metadata">

**Author:** ![Hari\_Seldon](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/hari_seldon/32/5173_2.png) [@Hari\_Seldon](https://boards.straightdope.com/u/Hari_Seldon)\
**Post date:** [December 6, 2002, 12:30pm UTC](https://boards.straightdope.com/t/math-questions/140873/8 "2002-12-06T12:30:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Desmostylus](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@Desmostylus](https://boards.straightdope.com/u/Desmostylus)\
**Post date:** [December 6, 2002, 12:48pm UTC](https://boards.straightdope.com/t/math-questions/140873/9 "2002-12-06T12:48:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Hari\_Seldon](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/hari_seldon/32/5173_2.png) [@Hari\_Seldon](https://boards.straightdope.com/u/Hari_Seldon)\
**Post date:** [December 6, 2002, 2:14pm UTC](https://boards.straightdope.com/t/math-questions/140873/10 "2002-12-06T14:14:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Chava](https://avatars.discourse-cdn.com/v4/letter/c/f07891/32.png) [@Chava](https://boards.straightdope.com/u/Chava)\
**Post date:** [December 6, 2002, 3:32pm UTC](https://boards.straightdope.com/t/math-questions/140873/11 "2002-12-06T15:32:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [December 6, 2002, 3:35pm UTC](https://boards.straightdope.com/t/math-questions/140873/12 "2002-12-06T15:35:15Z")

</div>

> [@](#):
>
> \*Originally posted by Hari Seldon \*  
> **As for the second question, there are a number of reasons why 0^0 = 1, which I will not go into.**

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

---

<div class="post-metadata">

**Author:** ![KarmaComa](https://avatars.discourse-cdn.com/v4/letter/k/e36b37/32.png) [@KarmaComa](https://boards.straightdope.com/u/KarmaComa)\
**Post date:** [December 6, 2002, 5:19pm UTC](https://boards.straightdope.com/t/math-questions/140873/13 "2002-12-06T17:19:05Z")

</div>

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 !”.

---

<div class="post-metadata">

**Author:** ![ftg](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ftg/32/2801_2.png) [@ftg](https://boards.straightdope.com/u/ftg)\
**Post date:** [December 6, 2002, 6:18pm UTC](https://boards.straightdope.com/t/math-questions/140873/14 "2002-12-06T18:18:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [December 6, 2002, 6:49pm UTC](https://boards.straightdope.com/t/math-questions/140873/15 "2002-12-06T18:49:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Mighty\_Maximino](https://avatars.discourse-cdn.com/v4/letter/m/e95f7d/32.png) [@Mighty\_Maximino](https://boards.straightdope.com/u/Mighty_Maximino)\
**Post date:** [December 6, 2002, 7:10pm UTC](https://boards.straightdope.com/t/math-questions/140873/16 "2002-12-06T19:10:53Z")

</div>

> [@](#):
>
> \*Originally posted by ultrafilter \*  
> **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.**

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](http://mathforum.org/dr.math/faq/faq.0.to.0.power.html).

---

<div class="post-metadata">

**Author:** ![Hari\_Seldon](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/hari_seldon/32/5173_2.png) [@Hari\_Seldon](https://boards.straightdope.com/u/Hari_Seldon)\
**Post date:** [December 6, 2002, 9:39pm UTC](https://boards.straightdope.com/t/math-questions/140873/17 "2002-12-06T21:39:57Z")

</div>

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: m_0 = 0 and m_S(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.
