# Prove $0! = 1$ from first principles

How can I prove from first principles that $0!$ is equal to $1$?

-
For any cardinal c let c! be the order of the group of permutations of a set of cardinality c. – Pierre-Yves Gaillard Feb 8 '11 at 12:01
You haven't stated what your definition of factorial is. An inductive definition would have as the base case 0! = 1, so there's nothing to prove from that definition, for example. – Zhen Lin Feb 8 '11 at 15:47
Please don't state questions as orders; write them as questions. – Arturo Magidin Feb 9 '11 at 4:34
Or to put it differently, $0!=1$ is one of the "first principles" in the most typical formulation. – Hurkyl Sep 27 '11 at 2:45
Wow, I've been coding too much lately and read this question as asking to show 0 != 1, (or for the non coders $0\neq 1$). – SL2 Oct 3 '12 at 0:32

I'm not sure that there is anything to prove. I think it follows directly from the definition of factorial:

$$n! := \prod_{k = 1}^n k$$

So if $n=0$ the right hand side is the empty product which is $1$ by convention.

-
It also follows the "n! = number of ways of arranging n objects" convention: there is only one way of arranging no objects. (That's what Wolfram says, anyway.) – Rawling Feb 8 '11 at 10:33
You can also prove it by moving the space: "0! = 1" $\Leftrightarrow$ "0 != 1", which is computer notation for "0 $\neq$ 1" :-). Then it depends on what you count as "first principles". If we're dealing with the natural numbers, this follows from the Peano axiom that the successor of a natural number is not 0 (1 being defined as the successor of 0). If we're dealing with general rings or fields, 0 $\neq$ 1 is part of the axioms for those structures (which is to exclude the trivial cases of one-element rings and fields). – joriki Feb 8 '11 at 11:03
@joriki Thats just fudging notation. In the same sense I can say that 1! = 1. – TheGreatDuck Jun 3 at 5:04
@TheGreatDuck: How's that? That's not true when you move the space. – joriki Jun 3 at 5:48
Exactly you said 0! = 1 therefore 0 != 1. I can also say 1! = 1 therefore 1 != 1. Your reasoning is flawed. – TheGreatDuck Jun 3 at 5:55

We need $0!$ to be defined as $1$ so that many mathematical formulae work. For example we would like $$n! = n \times (n-1)!$$ to work when $n=1,$ ie $1! = 1 \times 0!.$ Also we require that the formula for the number of ways of choosing $k$ objects from $n$ is valid for $k=n.$ ie $${n \choose k} = \frac{n!}{k!(n-k)!}$$ is valid when $k=n.$

Things need to work when we extend our definition of the factorial via the gamma function.

$$\Gamma(z) = \int\limits_0^\infty t^{z-1} e^{-t} \,\mathrm{d}t,\qquad \Re(z)>0.$$

The above gives $\Gamma(n)=(n-1)!$ and so we require $0!=1,$ since $\Gamma(1)=1.$

-

One of the simplest ways of doing this is to observe that if you have $$6!= 720$$ then divide both sides by 6 to get $$5!=120$$ then divide both sides by 5 to get $$4!=24$$ then divide both sides by 4 to get $$3!=6$$ then divide both sides by 3 to get $$2!=2$$ then divide both sides by 2 to get $$1!=1$$ then divide both sides by 1 to get $$\text{[fill in the blank here]}$$

-
But how is this a proof by "first principles"? (How is it a proof at all??) To be sure, I find the question itself somewhat fishy: first tell us what the definition of $0!$ is, then we can talk about how to prove $0! = 1$... – Pete L. Clark Sep 26 '11 at 23:43
It's not a proof, but it could be the reason why the definition was written in the first place. – Michael Hardy Dec 23 '11 at 0:19
Then divide both sides by zero to get $(-1)!=\infty$, which is consistent with $\Gamma(0)$ – Daenerys Naharis Oct 3 '12 at 1:17
The question does not want this kind of proof (which is nevertheless excellent). I think it wants a philosophical discussion of why mathematicians allow this sort of reasoning? – Alexander Giles Sep 2 '15 at 16:05

$0! = 1$ is consistent with, and for reasons related to, how we define the empty product.
See, for example, this entry on empty product. This is simply the name of the phenomenon Michael Hardy alludes to:

Empty product:

The empty product of numbers is the borderline case of product, where the number of factors is zero, that is, the set of the factors, is empty. In such a "borderline" case, the empty product of numbers is equal to the multiplicative identity, which is $1$.

Some of the most common examples are the following:

• The zero$^{\text{th}}$ power of a number $a$: $a^0 = 1$,
• The factorial of $0$: $0! = 1$,
• The prime factor presentation of unity, which has no prime factors.

Just as ${n^0 = 1}$ for any $n$, and the "prime factorization" of $1$ = $1$, we define, as a matter of convention, $0! = 1$.

-

The empty product is taken to be equal to 1. Take logs and you get an empty sum equal to zero, which is somehow more intuitive, but this trick of taking logs to convert a product into a sum never seems to get a mention in the literature. [Assumes products have positive terms]

-
One of the primary uses of logs before calculators was to multiply numbers using addition and log tables. Slide rules also used logs to turn multiplication into addition. – robjohn Sep 26 '11 at 20:36
@robjohn:L Indeed - I still have my slide rule, and ten years ago I used it as a "mystery object" for a youth group - they didn't know what it was. I remember using it in A-level chemistry practicals to set up the instants, and do the calculations quicker than schoolmates with their Sinclair calculators! But the point I was making was more that taking logs can take the mystery out of infinite products (and the notion of convergence applicable) by turning them into (less elementary) infinite sums. – Mark Bennet Sep 26 '11 at 20:49

One can prove this by convention (that is based on what 'works', based on base cases for product of a list).

But for a proof from 'nothing' as it were...define what factorial is supposed to mean. I think of it as the number of one-to-one, onto (=bijective) functions from a set of size $n$ to itself. if$n$ is 0 then the set is the empty set. How many bijective functions are there from $\emptyset$ to $\emptyset$? (a function is a set of ordered pairs (with some restrictions)? There are no legal pairs for these restrictions, and so there are no legal subsets of these pairs...other than the empty set. So $\emptyset$ -is- a function (it -is- a set of pairs (empty of course), all of whose pairs satisfy the function criteria). No other functions will work so $\emptyset$ is the only function that works. So there is only 1 bijective function on a set of size 0. So $0! = 1$.

Yes, this is weird, but it works. Negative numbers, complex numbers, they're all weird even when you just manipulate their properties. But you'll get over it.

-

Let's try a different approach from my other answer to this:

To multiply a number $N$ by $6!$ is to multiply it by six factors and get $$N\cdot1\cdot2\cdot3\cdot4\cdot5\cdot6.$$ Similarly to multiply $N$ by $0!$ is to multiply it by $0$ numbers: $$N.$$ But that is the same as multiplying it by $1$ $$N\cdot1.$$ Multiplying $N$ by no numbers at all is multiplying $N$ by $1$.

(This answer doesn't apply only to factorials; it may be taken as a general explanation of why, when one multiplies no numbers, one gets $1$.)

-

Because there is only one way to do nothing.

-
As a professional procrastinator, I disagree. $^{\textrm{is joke}}$ – Akiva Weinberger Oct 12 '14 at 21:49
@columbus8myhw, haha. – goblin Mar 26 '15 at 4:39

You can define $\exp(x)$ as

$$1 + \frac {x} {1!} + \frac {x^2} {2!} + \frac {x^3} {3!} + ...$$ but the following seems more uniform: $$\frac {x^0} {0!} + \frac {x^1} {1!} + \frac {x^2} {2!} + \frac {x^3} {3!} + ...$$ These are only equal if $0! = 1$

Not a proof, but makes sense to me!

-
so we finally found a good possibility for support of spam? – Gottfried Helms Oct 2 '12 at 23:20
Well, almost equal. There is an exception at $x=0$ where the first term on the latter sum has a $0^0$ which is indeterminate. – Roman Chokler Oct 3 '12 at 0:51
@RomanChokler Yes, but in that case, we take it to mean $\lim_{x\to0}\left(x^0\right)$ rather than $x^0\big|_{x=0}$. – Akiva Weinberger Oct 12 '14 at 21:47
In think that, in the context of power series, $0^0$ is always taken to be $1$. This is even used in other power series like $\left(1+x\right)^{-1}=\sum \left(-1\right)^n x^n = 1-x+x^2-x^3+\cdots$, so that it has nothing to do with the factorial at all – fonini Jan 6 '15 at 15:38

Explanation 1: We define $n!$ as the product of all integers $k$ with $1\le k \le n.$ When $n = 0$ this product is empty so it should be 1.

Explanation 2: If $n$ is a nonnegative integer, we define $n!$ to be the number of orderings on a set with $n$ distinct objects. If $n = 0$, this set is empty. Vacuously, it has 1 order.

-

$${n \choose R} = \frac{n!}{R!(n-R)!}$$

You know: ${n \choose 0}=1$, so: $$\frac{n!}{0!n!}=1\implies\frac{1}{0!}=1\implies 1=0!$$ We know every set has $2^n$ subsets we know empty subset is unique so

-

$0! = 1$ usually is one of the "first principles".

-
That would make sense. I thought it was always proven by definition. – TheGreatDuck Jun 3 at 5:19

Similar to @Mitch's answer, but with a slight twist at the end.

For any $n$, we define $n!$ to be the the number of invertible functions from a set of size $n$ to itself. The question is thus restated as "Prove that there is exactly one invertible function from the empty set to itself."

Now, it should be clear that there can't be more than one function from $\emptyset$ to itself, because in order for two functions to be different, they have to give different values for at least one input (clearly impossible if the domain is empty). The question therefore reduces to "Prove that there is at least one invertible function from the empty set to itself."

Well, assuming we can all agree that the empty set is a set, meaning an object in the category of sets, the empty set must have an identity function (morphism) defined on it; every object in every category is required to have an identity morphism. Further, identity morphisms are always invertible because $Id\circ Id = Id$, so we are done. $\Box$

http://en.wikipedia.org/wiki/Category_of_sets

This answers the question if and only if the "first principles" include axioms of category theory (and a few facts about sets).

-
Note: this argument also shows that $0^0 = 1$, if we define $a^b$ as the number of functions from a set of $b$ elements to a set of $a$ elements (for nonnegative integers $a$ and $b$). – mathmandan Jan 7 '15 at 6:55
Why isn't this the accepted answer? It is by far the best. – goblin Mar 26 '15 at 4:41

The way, I think about it is via permutations. Suppose you have $n$ objects then to permute them you have $n!$ factorial ways. So, for example, if you had $3$ objects then to permute them you would do $3!$ which is $6$. Suppose, you had $0$ objects then how many times could you permute $0$ things? Once. Therefore, $0!$ should be $1$. This is just an intuitive explanation and a proof by no means.

-

$n!$ is defined as the number of way n distinct object can be arranged.

For example,

$1!$ is described to arrange $1$ object,i.e $1$ way.

$A$

$2!$ is described to arrange $2$ object,i.e $2$ way.

$AB,BA$

$3!$ is described to arrange $3$ object,i.e $6$ way.

$ABC,ACB,BAC,BCA,CAB,CBA$

Similary, $0!$ describe the way to arrange $0$ object.$0$ object means nothing.There comes a hypothetical thinking,there is $1$ way to arrange $0$ object or nothing,that is nothing.

So, $0!=1$

-

First we state that $n!=\frac {(n+1)!}{(n+1)}$. Now let $n=0$ then $0!=\frac{(0+1)!}{(0+1)}=\frac{1!}{1}=1$ Hence $0!=1$

-

We define factorial using recursive piecewise functions.

$$x! = x*(x-1)!*I[x > 0] + 1*I[x=0]$$

You might notice that only the term where x is 0 lacks a recursive use of factorial. This term exists solely to end the recursion. Otherwise, it would be an infinitely recursive function. Theres no proof, and i think factorial of 0 would make sense as 0. However, it cannot be or everything breaks.

Yes factorial is defined as repreated decreasing multiplication through integers. However, factorial is not proven to be what it is. It is /defined/ to be 0! = 1. Therefore I prove it by /definition/. It is because people chose it to be that way in order to make recursion work.

I honestly would say that it makes more sense as 0, and I realize my recursion argument is slightly flawed. The following function does the exact sake thing as factorial but with 0! = 0. This could've just as easily been the definition with little trouble.

$$x! = x*(x-1)!*I[x > 1] + 1*I[x = 1]$$

So while I suppose the first function is easier to read, there really is no way to prove factorial's 0 identity. I suppose you may be able to extrapolate that identity if you looked at enough factorial equations.

However, there is one argument that holds sound in all cases.

$$e^x = \frac {x^0}{0!} + \frac {x^1}{1!} + \frac {x^2}{2!} +... \frac {x^n}{n!}$$

If factorial of 0 were not 1 then the first term in this series would be out of place. In this way factorial's 0 identity serves as a convience in building series. I still wodn't use that as a proof, though.

-
This is rather contrived and cumbersome, and doesn't even agree with the usual definition of the factorial - after all, $(-1)!$ is defined here with no issues. It certainly doesn't coincide with the $\Gamma$ function. Just giving a new (and different) definition is certainly unsatisfying, and unenlightening. – T. Bongers Jun 3 at 5:23
But if your answer is "because of the recursion," then the answer to the original question must be "because $0! = 1$ by definition," which is already an answer here. And I'm not sure what you mean by saying that the gamma function is a "counterpart to summation." – T. Bongers Jun 3 at 5:28
No. – T. Bongers Jun 3 at 5:30
If you're going by the "it's by definition" route, then that was already answered by Hurkyl two years ago. As far as your statement that it "would naturally make more sense for it to be zero or even /undefined/," then read some of the other answers to discover why this is not at all useful. Regardless, this answer doesn't include anything new that hasn't been hashed out in the other 19 answers, now that the new-but-wrong things have been somewhat addressed. – T. Bongers Jun 3 at 5:35
I was simply extending you the courtesy of explaining why I downvoted your answer; if you consider this as bugging you, then please let me know and I'd be happy to downvote in silence. I'm not insisting that you use the gamma function, but simply pointing out that an answer whose sole substance is to say "it's by definition" has already been done years ago, and a reaffirmation of that isn't needed. Have a good night.. – T. Bongers Jun 3 at 6:06

## protected by MJDApr 6 '14 at 7:06

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).