# How can $0!=1$ if the definition of factorial is $n!=n\times (n-1)!$ [duplicate]

Its a pretty basic question.

If the definition of factorial is $n!= n\times(n-1)!$, then how can $0!=1$ since if we feed $0$ into the equation we get $0!=0\times (-1)!$?

This comes after a Numberphile video where they explained that you can write $4!=\frac{5!}5$ then you can say that $0!=\frac{1!}1$ which equals $1$.

They also say that there is one way to arrange nothing but I would say there are $0$ ways to arrange nothing since there is nothing to arrange.

• If answers given to that question do not suffice, see the "linked" questions there.
– user147263
Mar 26, 2015 at 2:44
• There is not generally taken to be a $(-1)!$ - that is, the factorial only applies to non-negative integers. So we can't really use the definition there - we have to work backwards from $1!=1$, as the video you saw probably did. Mar 26, 2015 at 2:45
• Well if we follow the definition shouldn't -1! be equal to a sort of negative infinity since it keeps on going forever. The point is i've always been taught that n!=nx(n-1)! is the definition for factorial but 0!=1 does to fit that definition. Or was my teacher wrong and that is not the definition? Mar 26, 2015 at 2:53

A nice definition of $n!$ is the number of bijections from $\{1,2,\dots,n\}$ to itself. Thus $0!$ is the number of bijections from the empty set to itself. There is one such map, which can be thought of as an empty product of sorts.

• Wow, this is my first time seeing this view. This is fantastic, thanks! Mar 26, 2015 at 3:24
• No problem, glad it helped! Mar 28, 2015 at 1:58

As to why there is one way to arrange zero objects, I once read a very nice explanation: To count the number of ways to arrange something, you take a picture of every possible layout of the items, and then you count the number of distinct pictures. For zero items, there is going to be no items in the arrangements, but you will still have one single picture of nothing, representing a single arrangement.

• Nicely addresses soundness, rather than analytical convenience. Mar 26, 2015 at 3:51

$$0! = \prod_{j \in \varnothing} j = e^{\sum_{j \in \varnothing}\log j} = e^0 = 1$$

Note: I sympathize with your question because this used to bother me as well. It seemed absurd that some authors of textbooks could get by with letting $0!=1$ because it was "convenient to define it to be so" (can't remember exactly which book that came out of). First note that the title of your question does not make a great deal of sense in the context of definitions because $0!$ is actually defined to be equal to $1$. Here are two common definitions for the factorial: $$n!=\prod_{k=1}^n k$$ and $$n!= \begin{cases} 1 & \text{if n=0},\\ (n-1)!\cdot n & \text{if n>0}. \end{cases}$$ Thus, you truly cannot prove that $0!=1$. It doesn't make any sense. However, there may be some intuition to be had via combinatorics.

Some intuition via combinatorics: You may have seen the notation $\binom{n}{r}=\frac{n!}{r!(n-r)!}$ at some point. When $r\leq n$, the notation $\binom{n}{r}$ represents the number of ways to select $r$ objects out of $n$ objects regardless of their ordering. Now, suppose $r=n$. What does this mean? It means you are selecting all objects at one time, and the number of ways you can do this is $$\require{cancel} \binom{n}{r} = \frac{n!}{n!(n-n)!} = \frac{\cancel{n!}}{\cancel{n!}\cdot 0!} = \frac{1}{0!} = 1.$$ Hence, $0!=1$.

This is not a proof--just some possible intuition.

• I think your answer is the best, at least it brings some comfort. But like you said it sounds like some dude in the past just decided that 0! should equal 1 to make some maths fit nice but if thats the case then one could also say, and I know this sounds stupid, that 4=3 to make some other maths fit nice. Mar 26, 2015 at 3:10
• @SimonMoore You may be misunderstanding my answer then. That is not how it works. The point here is that you're quibbling about a recursive definition. What definition could you ever get $4=3$ from? Mar 26, 2015 at 3:13
• I'm not saying that 4=3, I know it doesent, i'm just saying that I can't find any proof that 0!=1 and the definition seems to be invented. Like I said before 1 way to arrange nothing doesen't seem to make much sence. Mar 26, 2015 at 3:30
• @SimonMoore You are right that it was invented. Just like the definition of many other things :) At least it seems like you have a better intuitive understanding of why it's true now. Mar 26, 2015 at 3:41
• @SimonMoore, I disagree with crash. The theorem $0!=1$ wasn't invented, it was discovered. The correct definition of $n!$ is as follows: it is the number of bijections between any two $n$ element sets. Since there is precisely one bijection between any two $0$-element sets, hence $0!=1$. This is essentially what bburGsamohT is getting at. Mar 28, 2015 at 11:18

The equation $n! = n \cdot (n-1)!$ only holds for $n \geq 1$, so you're not allowed to plug in $n=0$ like you did in the question.

Try plugging in $n=1$ instead. We get:

$$1! = 1 \cdot 0!$$

Hence

$$1! = 0!$$

So if you agree that $1!$ equals $1$, then:

$$1 = 0!$$

We simply define 0! to be 1. Also, this definition plays nice with the Gamma function.

• I don't know why you were downvoted, you are entirely correct. The factorial function is defined as $0!=1$ and $n!=n(n-1)!$.
– user223391
Mar 26, 2015 at 2:52
• @avid19 Hurt my feelings, is what it did. ;)
– Jon
Mar 26, 2015 at 2:55
• Stranger's opinions of my posts online have always been very important to me. My feelings would be hurt too. :)
– user223391
Mar 26, 2015 at 3:07
• I downvoted, for the following reasons: a) everything that we define is just by definition, so to emphasize that $0!$ is defined to be $1$ is pretty much meaningless b) your answer makes it sound like $0!=1$ is an arbitrary convention modulo agreeing with the gamma function, which it certainly is not, and c) bringing the gamma function in here is obviously the wrong thing to be doing. Go back and reread the OP's question. He/she is clearly struggling with basic logic. That's okay - we all had this problem at one point - but bringing the Gamma function into the mix isn't helping the OP. Mar 26, 2015 at 3:19

If we feed $0$ into the equation we get $0!=0\times(-1)!$

And? What seems to be the problem? $(-1)!~$ is $~\pm\infty,~$ or, to put it more rigorously, it is

undefined. More to the point, $~\displaystyle\lim_{x\to0}x\cdot(x-1)!~=~\lim_{x\to0}x\cdot\Gamma(x)~=~1$.

Because we first get to 0 by 1! = 1*0!, and this gives 0! = 1.

When we try to get to -1!, we get 0! = 0*(-1)! which, naively, says that $(-1)! = \infty$.

This actually means that (-n)! is not defined for integer n < 0.

Look at the gamma function to see how factorial is defined for non-integer values. Also look at the reflection formula.