# Is $0! = 1$ because there is only one way to do nothing?

The proof for $0!=1$ was already asked at here. My question, yet, is a bit apart from the original question. I'm asking whether actually $0!=1$ is true because there is only one way to do nothing or just because of the way it's defined.

• "only one way to do nothing" seems quite appropriate Jul 1, 2016 at 20:51
• As a developer, I read that as 0 != 1, or "0 not equal to 1", and was very confused Jul 2, 2016 at 7:33
• @Jojodmo I found myself in the same position, but at least it is still a valid assertion, so my OCD was not upset Jul 2, 2016 at 7:59
• If you'd define factorial n = product [1 .. n] in Haskell, then factorial 0 == product [1 .. 0] == product [] == 1. In this view, the value of $0!$ is $1$ because that's the identity element of the monoid formed by the natural numbers under multiplication. Jul 2, 2016 at 12:35
• A more general statement is that an empty product is said to be equal to $1$, in the same way that an empty sum is equal to $0$. Jul 2, 2016 at 15:02

Yes, precisely there is a unique function $\emptyset \to \emptyset$ (with empty graph), which happens to be a bijection ($\operatorname{id}_\emptyset$). Note, that $n!$ is the number of bijections $\{1,\dots, n\}\to \{1,\dots,n\}$.

• @Aaron This is not a convention - it's the only reasonable interpretation. In category theory, the empty set is the initial object, meaning that there is exactly one map $\emptyset\to A$ for any $A$; adding an exception for $A=\emptyset$ would break this. A function can have its domain split, producing two restricted functions - this leads to the equation $A^{B+C}=A^BA^C$ for the size of function spaces. If $\emptyset$ is an identity for cardinal addition, it follows that $A^\emptyset=1$. We split the original function into $f$ restricted to $B$ and $C=\emptyset$, and both restrictions exist. Jul 1, 2016 at 22:46
• @Aaron The main argument I can see for $\emptyset^\emptyset=\emptyset$ is as a continuation of $\emptyset^A=\emptyset$, which is valid for $A\ne\emptyset$. If $f:A\to \emptyset$ means $\forall x\in A,f(x)\in\emptyset$, though, it makes sense that the proof by contradiction that $f$ does not exist breaks down when $A=\emptyset$, because there are no witnesses anymore. Thus functions can't simply map to universal statements (unless you also want to deny vacuous truth). There are just too many things that rely on $\emptyset^\emptyset=\{\emptyset\}$. Jul 1, 2016 at 22:51
• @Aaron Mmh, if you want to have something more concrete: When I first learned about functions there where explained to me as triple $f = (A,G,B)$ with $G \subseteq A \times B$, such that for all $a\in A$ there exists a unique $b\in B$ with $(a,b)\in G$. Under this interpretation $(\emptyset, \emptyset, \emptyset)$ is a function. - That things work out nicely is reason enough for me to make definitions a certain way. Nobody has dropped "the" bombshell yet: without initial object $\mathsf{Set}$ fails to be an elementary topos. Same goes of course for the categories of presheaves on a category. Jul 2, 2016 at 8:38
• @Aaron: I said nothing about the original question above $0!$. I'm talking only about your objection to the empty function. And the fact that ${^\varnothing\varnothing}=\{\varnothing\}$ requires no special definition: it's an immediate consequence of the general definition of function, which I consider obviously correct. Jul 2, 2016 at 10:50
• @Aaron: I fully believe the discomfort here is less about clarity and more about unfamiliarity -- there is a strong general tendency to treat trivial and degenerate cases as special cases even when they're not, so you are uncomfortable when not doing so.
– user14972
Jul 3, 2016 at 10:03

For positive numbers the factorial function $n!$ is defined as the product of all positive integers less or equal to $n$. To define $0!$ we need to "extend" the definition. Another way to define it is to notice that:

$$(n-1)! = \frac{n!}{n}$$

Pluging $n=1$ we get: $0! = \frac{1!}{1} = 1$

• I also like this approach because it shows that the negative integers have their factorials undefined. Jul 1, 2016 at 21:50
• For 0, the set of integers between 1 and n is empty, and the product on the empty set is 1 (just like the sum is 0). Do we really need an "extension" ? Jul 2, 2016 at 11:36
• @MichelBillaud You're right, that's why I used the parenthesis. But somebody might have a problem with noticing that the product of empty set is $1$. The recursive formula working backwards is easier to understand Jul 2, 2016 at 12:00
• I like this approach because assuming the factorial is monotone continuous over the region $1\le x<\infty$, it is possible to sketch the gamma function. Jul 2, 2016 at 12:42
• A great solution that doesn't rely on the unsatisfying "because it's defined that way. Jul 3, 2016 at 2:22

I'm going to go a bit against the grain and say that this isn't a very great way of thinking about this. Having a combinatorial intuition for functions that have combinatorial definitions is great, but that intuition often just doesn't work for vacuous cases where you plug in 0 for one of the values, because getting the right answer really requires thinking carefully about the formal definition with sets.

Say you have three numbers, 1, 2, 3, and you look at all the different ways you can write them down

1, 2, 3

1, 3, 2

2, 1, 3

2, 3, 1

3, 1, 2

3, 2, 1

Now if you count those, you see six lines. In general, if you do this for $$n$$ numbers, you will see $$n!$$ lines. But what about 0 numbers? Here's all the ways you can write 0 numbers:

Seems weird. I don't know about you, but I see 0 lines. But based on what everyone is saying, there should be one line there. What's going on? Is there really one way to count nothing?

The problem is that, for this intuitive definition to work right, there has to be one "empty" line. There aren't empty lines in the other cases, though, just when you have 0 numbers. Confused? Let's look at this just a little differently. Let's do the same thing again, but this time, when we write the numbers, let's write parentheses around them:

(1, 2, 3)

(1, 3, 2)

(2, 1, 3)

(2, 3, 1)

(3, 1, 2)

(3, 2, 1)

Now instead of counting lines, we count the number of parenthesized items of numbers. These are called $$n$$-tuples, or just tuples. $$n!$$ is the number of $$n$$-tuples, the number of tuples of length $$n$$. Formally, it is the size of the set of all $$n$$-tuples.

Now, let's do 0. How many tuples of length 0 are there? Here's one:

()

Based on our definition of a tuple (parenthesized ordered list of numbers), that counts. It should be pretty obvious that that is the only one. So 0! is 1.

At the end of the day, you have to define functions like $$n!$$ in a set theoretic way. Then the values of corner cases like $$0!$$ fall out of those definitions, typically by something called vacuous truth ("vacuous" is a word I used above, not by accident).

• The use of parentheses here reminds me very much of the Babylonian introduction of the zero. Jul 3, 2016 at 17:47

Yes. 0! = 1 because it is defined that way. One of the reasons it is defined that way is because it makes sense in the context of combinatorics given that there is only one empty object or permutation up to isomorphism.

So both are correct - it varies on one's definition of the factorial function. When defined in reference to a combinatorial quantity it would be possible to prove 0! = 1. When defined recursively it is usually taken as definitional.

"Everybody knows that if you add up no numbers, you get zero. Not everybody knows that if you multiply no numbers, you get $1$, but I know that." - Tom Goodwillie, 2 Dec 2008

From a combinatorial perspective, $0!=1$ because the only map between the empty set and itself is the empty map. However, I prefer the algebraic motivation.

An empty product of a repeated operation should yield the operation's identity. This means empty product (under multiplication) should yield $1$ and an empty sum should yield $0$.

Consider two disjoint finite (index) sets: $A$ and $B$. Then adding up everything over $A$ and $B$ should be the same as adding up everything over $A$, then over $B$ and then adding those two results. Symbolically: $$\sum_{n \in A \cup B} f_n = \sum_{n \in A} f_n + \sum_{n \in B} f_n$$

What if $B=\emptyset$? Then this says: $$\sum_{n \in A} f_n = \sum_{n \in A \cup \emptyset} f_n = \sum_{n \in A} f_n + \sum_{n \in \emptyset} f_n$$ Therefore, $\sum_{n \in \emptyset} f_n$ needs to be $0$.

The exact same line of reasoning yields this about empty products (we just use multiplicative instead of additive notation). Again, consider two disjoint finite (index) sets: $A$ and $B$. Then multiplying everything over $A$ and $B$ should be the same as multiplying everything over $A$, then over $B$ and then multiplying those two results. Symbolically: $$\prod_{n \in A \cup B} f_n = \left(\prod_{n \in A} f_n \right) \left(\prod_{n \in B} f_n\right)$$

Letting $B=\emptyset$, we get... $$\prod_{n \in A } f_n = \prod_{n \in A \cup \emptyset} f_n = \left(\prod_{n \in A} f_n \right) \left(\prod_{n \in \emptyset} f_n\right)$$ Therefore, $\prod_{n \in \emptyset} f_n=1$.

Finally, define $n! = \prod_{k=1}^n k = \prod_{k \in \{1,\dots,n\}} k$. When $n=0$, this is the empty product, so it needs to be $1$.

That's right. One way I feel is a good way to argue this is to look at two collections in conjunction with each other, say Box A and Box B. There are $n$ objects in Box A, and $m$ objects in Box B, and let's suppose we want to find all possible ways of arranging the items in Box A, and then in Box B, separately . Of course,

$$N = n!m!$$

Now suppose there are no objects in Box B. We still have $n!$ ways of arranging the remaining objects in Box A, so $0! = 1$. One way to do nothing extra.

Yes to both alternatives.

That there is only one way to do nothing is a strong motivation to ensure that the factorial is defined in such a way that you have $0! = 1$.

However, every question of "why is this true" in mathematics ultimately boils down to "it's a consequence of how things are defined". (presuming, of course, that we know the fact with full rigor)

• I take it that you are not a Platonist!
– thb
Jul 5, 2016 at 0:57
• @thb: I would stand by my comment even in a world of platonic ideals! The ideal is the motivation for the mathematical constructions, not the constructions themselves. It's the map vs. territory issue -- a mark appears on the map for no deeper reason than because that's how the map was drawn. The terrain is simply a motivation for drawing the map in a particular way (or for consulting the map).
– user14972
Jul 5, 2016 at 1:07

From the combinatoral beginning it is like that by definition, but later developed branches of maths shows $Γ(n + 1) = n! \ \ n = 0, 1, 2...$

There is 1 way to select to do the same thing out of a set of activites (of which one could be "nothing") over and over $n$ times in a row if that is what you mean by "doing nothing". You could also consider this combination:

$$\left(\begin{array}{c}n\\0\end{array}\right) = \frac{n!}{n!\cdot 0!} = 1 \text{ iff } 0! = 1$$

One combination to pick 0 out of many activities.

However, except for the very most basic of tasks several things are usually necessary to do to get any one task done. Sometimes also order matters.

Say I want to make dinner. I will need to buy the food, prepare the food, boil it or fry it or put it in the oven. Just doing a few of the combinations of activities won't accomplish the task. I will need to achieve a true value of some chain of a series of ANDs and/or possibly ORs for activities to fulfil my criteria for having made dinner.