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.

Ali Abbasinasab
  • 1,633
  • 12
  • 18
  • 62
    "only one way to do nothing" seems quite appropriate – Hagen von Eitzen Jul 01 '16 at 20:51
  • 1
    One order to arrange nothing in. – shai horowitz Jul 01 '16 at 20:55
  • 6
    Honestly that's my favorite way to rationalize that definition, I think it's a great way to make it feel intuitive – Triatticus Jul 01 '16 at 21:02
  • 67
    As a developer, I read that as 0 != 1, or "0 not equal to 1", and was very confused – Jojodmo Jul 02 '16 at 07:33
  • 15
    @Jojodmo I found myself in the same position, but at least it is still a valid assertion, so my OCD was not upset – Darren H Jul 02 '16 at 07:59
  • 11
    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. – Rhymoid Jul 02 '16 at 12:35
  • 10
    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$. – J. M. ain't a mathematician Jul 02 '16 at 15:02
  • 1
    @Jojodmo confused me too. The title is updated to be less ambiguous now. – David Sherret Jul 03 '16 at 15:43
  • A life of procrastination proves there are many ways to do nothing. – Asaf Karagila Jul 05 '16 at 05:17
  • In a move to abstract algebra's. Would it be a relevant question to ask this for any algebra? i.e. x!=x*(x-1)! then 0! = 1! ? The operations and question seem to have meaning, in terms of the definition of "algebra" I know. Of course in some algebra's x! would be a constant zero; I think. So I guess a question could be: what is the algebraic criterion for x! <>0 for all x? – rrogers Jul 06 '16 at 13:05

10 Answers10


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\}$.

Stefan Perko
  • 11,817
  • 2
  • 23
  • 59
  • 1
    While I accept that it is convention that there is a map $\emptyset\to \emptyset$, and from the perspective of category theory it has to exist if you want to include the empty set in the category of sets (at which point, if you are okay with there being any maps from the empty set to anything else, you might as well make it the initial object), I never felt like this was self-evident. If mathematicians had declared that there were no maps from the empty set to anything else (not even to itself), I would have been okay with that convention. – Aaron Jul 01 '16 at 22:37
  • 21
    @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. – Mario Carneiro Jul 01 '16 at 22:46
  • 8
    @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\}$. – Mario Carneiro Jul 01 '16 at 22:51
  • @Aaron : One can also remove the objects in category theory and have the identity arrows represent the objects. (See "category theory without objects" or "category theory without reference to objects".) In this setting, for the category of sets, there must be an arrow $\varnothing \rightarrow \varnothing$ if $\varnothing$ is to be represented (and it had better be; it's a set!). Of course, this arrow exists by definition ("every object has an identity morphism"), which is what I think you were saying... But why don't you like the map $\{ \}$ containing no (input, output) pairs? – Eric Towers Jul 02 '16 at 08:21
  • 1
    @MarioCarneiro I agree that it makes a lot of things work out quite nicely, and if you didn't have it, life would be bad, but defining something to make formal properties hold isn't necessarily the only way to define things. I think it is a good convention in this case, but I still think it's a convention. Just as the empty sum is zero and the empty product is one are both conventions. There is good reasoning behind them, that gives nice properties, but they are not a priori the only way to define things. – Aaron Jul 02 '16 at 08:32
  • 1
    @EricTowers It's not that I don't like the empty map, it's that it's not obvious to me that it's actually a map. I accept that we've agreed that it is, but I could easily imagine another world where we all agreed that it wasn't. – Aaron Jul 02 '16 at 08:34
  • 6
    @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. – Stefan Perko Jul 02 '16 at 08:38
  • @StefanPerko That definition gives that the empty map is a map, I've seen others where it is handled as a vacuous case. I'm just of the opinion that things which are vacuously true are suspect, and that any definition with vacuous cases is equally suspect in those cases. Saying "we take the definition which makes the theorem true" is a perfectly good justification for a definition, but is still somehow unfulfilling to me. For a similar example, 1 is neither prime nor composite, but a unit. I accept this, but am not truly happy with it. – Aaron Jul 02 '16 at 09:04
  • 3
    @Aaron: I see no real basis for that opinion: it appears to rest entirely on some sort of subjective discomfort. (And I can't think of any definition of *function* that I'd accept by which ${^\varnothing\varnothing}$ would *not* be $\{\varnothing\}$.) – Brian M. Scott Jul 02 '16 at 09:33
  • @BrianM.Scott I do not think subjective discomfort and intuition should be easily brushed aside when one asks what the correct definition/generalization of a not-yet-formalized. Going back to the original question of whether $0!=1$ because there is only one way to do nothing, that isn't as clear a statement to prove (in the absence of a definition) as, say, there are 6 ways to order 3 objects in a line. Some definitions are obviously correct, others only seem correct after you have built up theory and found patterns. To me, these ($0!=1, \emptyset^{\emptyset}=\{\emptyset\}$) are the latter. – Aaron Jul 02 '16 at 10:39
  • 4
    @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. – Brian M. Scott Jul 02 '16 at 10:50
  • 4
    @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. –  Jul 03 '16 at 10:03
  • @Hurkyl I wouldn't call it unfamiliarity. I accepted that the empty function was a function nearly two decades ago. I just think that as a pedagogical point and in the absence of additional structure/theorems/context (of which there is plenty), there isn't a clear reason that we declare empty functions to be functions. It's only obviously a function if you take a definition of function that was fully formalized after the special case was decided. If you have a rigorous definition to begin with, you are in a different position that a student figuring out what *should* be true. – Aaron Jul 03 '16 at 10:23
  • 1
    @Aaron If it were "just" a convention that the empty product is 1 then it would be possible to do useful mathematics under a different convention, with a non-unity empty product. Can you exhibit such a model? – PM 2Ring Jul 03 '16 at 12:49
  • @PM2Ring yes, that model would be the one where you don't use empty products because you find them nonsensical. There is certainly no better value than $1$ to assign to the empty product, and it allows various formulas to extend in nice ways, but it is not some obvious truth that everybody should be able to see as soon as they learn about taking the product over non-empty finite sets. A useful convention that fits into a bigger picture and has nice properties is still a convention. – Aaron Jul 03 '16 at 20:21

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$

  • 34,893
  • 7
  • 46
  • 95
  • 30
    I also like this approach because it shows that the negative integers have their factorials undefined. – John Molokach Jul 01 '16 at 21:50
  • 5
    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" ? – Michel Billaud Jul 02 '16 at 11:36
  • 1
    @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 – Stefan4024 Jul 02 '16 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. – Simply Beautiful Art Jul 02 '16 at 12:42
  • @MichelBillaud For those who don't do sets. :-) – Simply Beautiful Art Jul 02 '16 at 12:43
  • 3
    A great solution that doesn't rely on the unsatisfying "because it's defined that way. – JTP - Apologise to Monica Jul 03 '16 at 02:22
  • @Stefan4024 I find it harder to understand in that way. It's quite easy tonotice that $\prod_{1 \leq x \leq n}{x} = 1$ when the product is empty. Everybody uses this property in a number of places, for example the property that $\prod_{x \in S}{x} = (\prod_{x \in (S \cap Y)}) \cdot (\prod_{x \in S \setminus Y})$ wouldn't be true for $Y=\emptyset$ otherwise (and that rule is used even in middle school when you say that you can always add a $1 \cdot {}$ when handling things like monoids etc. – Bakuriu Jul 03 '16 at 10:21
  • @Bakuriu Personally for me I think this is an easier way to notice why $0! = 1$. After all the product of an empty set might be not so clear for younger people. Also using empty sets to show that $0!=1$ uses a convention that the product of an empty set is $1$. So I think it's better to see examples like this one in order to see why it makes sense to define $0! = 1$. – Stefan4024 Jul 03 '16 at 11:36
  • @MichelBillaud I genuinely don't know the answer, but isn't the convention that "_the product on the empty set is 1_" as much _because it makes things work_ as the convention that 0! is 1? – TripeHound Jul 04 '16 at 11:20
  • @TripeHound more generally, starting from a binary (associative-commutative) operation, the generalization to sets works much better with the convention that it returns the *neutral element* of the operation when applied to the empty set. Works with sum (0), product (1), min( $+\infty$), etc. – Michel Billaud Jul 04 '16 at 13:37
  • This is definitely how I would have executed it. $+1$ – Mr Pie Apr 28 '20 at 05:01

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).

  • 9,046
  • 5
  • 30
  • 50
  • 1
    The use of parentheses here reminds me very much of the Babylonian introduction of the zero. – Jander Jul 03 '16 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

  • 457
  • 6
  • 16

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$.

Bill Cook
  • 27,291
  • 61
  • 83

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.

  • 1,272
  • 8
  • 16

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 05 '16 at 00:57
  • 1
    @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). –  Jul 05 '16 at 01: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...$

  • 530
  • 4
  • 10

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.

  • 24,082
  • 9
  • 33
  • 83