Basis Lab

Answers · The mathematics underneath

Why is 0! equal to 1?

In shortZero factorial is one because there is exactly one way to arrange nothing: the empty arrangement, with nothing left to place.

Zero factorial is one. There is exactly one way to arrange no items: leave the shelf empty, with every item already placed because there are none. That empty arrangement is a completed arrangement, not the absence of an arrangement.

5!=5×4×3×2×1=120,4!=4×3×2×1=245! = 5\times4\times3\times2\times1 = 120,\qquad 4! = 4\times3\times2\times1 = 24

The factorials run downward by division. From 5!=1205!=120, 4!=120/5=244!=120/5=24; from 4!=244!=24, 3!=24/4=63!=24/4=6; from 3!=63!=6, 2!=6/3=22!=6/3=2; from 2!=22!=2, 1!=2/2=11!=2/2=1. The same relation at n=1n=1 is 1!=1×0!1!=1\times0!, so 1=1×0!1=1\times0!, and therefore 0!=10!=1.

n!=n (n−1)!for n≥1,1!=1×0!  ⇒  1=0!n! = n\,(n-1)! \quad\text{for } n\ge1,\qquad 1! = 1\times0! \;\Rightarrow\; 1=0!

The empty arrangement

The natural guess is that an empty arrangement should count as zero, or as nothing at all. That confuses an arrangement with an item. An arrangement is a way of finishing the job. With no items there is no choice to make and nothing left over, so the job is already finished in exactly one way: do nothing. Calling that zero would say there is no way to have finished arranging nothing, which is false. The empty shelf is a result, not a missing result.

The shelf example makes the distinction concrete. With one book there is one shelf: the book in the only position. Remove the book. The shelf does not disappear; there is still one possible state of the shelf, the empty one. Counting arrangements is counting states, and an empty state is a state. Equivalently, an arrangement assigns each item to a distinct position. For zero items there are no items and no positions to fill, and there is exactly one assignment, the empty assignment. You do not get zero assignments; you get the one assignment that maps nothing to nothing.

The product with no factors

A factorial is also a product: n!=1×2×⋯×nn! = 1\times2\times\cdots\times n. When n=0n=0 the product has no factors. The empty product is 11 because 11 is the identity for multiplication: multiplying by 11 leaves a product unchanged, so starting with 11 and multiplying by nothing leaves 11. This is the same fact as the empty arrangement, written in the language of products. It is not a convention bolted on to make formulas tidy. It is what the multiplication rule gives when the pile starts empty and there is one way for it to stay empty.

Set 0!=00!=0 and the recurrence gives 1!=1×0!=01!=1\times0!=0. But 1!1! is the number of orders of one item, and that number is one: the item alone. Continuing, 2!=2×0=02!=2\times0=0, 3!=3×0=03!=3\times0=0, and every higher factorial collapses to zero. The counting formulas at the edges fail too. The number of ways to choose none from five is one, and the formula gives the same value only when 0!=10!=1. With 0!=00!=0 that expression divides by zero. The value 0!=10!=1 is what keeps the same rule working at the boundary.

(50)=5!0! 5!=1201×120=1\binom{5}{0}=\frac{5!}{0!\,5!}=\frac{120}{1\times120}=1

Where it stops

This is a count for whole numbers of items, zero included. Negative integers do not describe a pile that can be arranged, so ordinary factorial is not defined there; the gamma function extends the formula but is not counting arrangements. If some items are indistinguishable, the count is divided by the arrangements of the identical items, but at zero items there is nothing to divide and the empty arrangement remains one. The value is not saying there is one item. It is saying there is one arrangement of zero items.

Read upward, the recurrence starts at the empty case: 0!=10!=1, then 1!=1×1=11!=1\times1=1, 2!=2×1=22!=2\times1=2, 3!=3×2=63!=3\times2=6, 4!=4×6=244!=4\times6=24, 5!=5×24=1205!=5\times24=120. The chain has to begin somewhere. The empty arrangement is the only start that makes the first step correct. If you begin at 0!=00!=0, the first step gives 1!=01!=0, and no later step can repair it because multiplying zero by anything remains zero.

Zero factorial is not a statement that there is one item. It is a statement about the number of arrangements of an empty collection. The collection has size zero; the count of its arrangements has size one. Those are different numbers, and there is no contradiction in them being different. A set with no elements has one subset, namely itself; similarly it has one ordering, namely the empty ordering. That does not make zero into one; it makes the count of orderings of nothing equal to one.

Worth keeping

  • An empty arrangement is one completed arrangement, not zero arrangements.
  • Once one factorial is one, the downward recurrence forces zero factorial to be one.
  • The empty product is one because one is the identity for multiplication.

Where this goes next

This question is one step of Counting Without Listing, a course that works through its subject from the beginning. The page that teaches this part of it is Putting Things in Order, and it reads the whole way through whether or not you have an account.

What an account changes is the practice: problems standing under every idea, marked with a reason rather than a tick, in a copy of the course that is yours.

Read that pageThe whole course

Other questions people ask about this

  1. How come lining up only some of the things still involves factorials?Because you multiply only the choices for the places you fill, so a partial line-up is a factorial with the unused tail divided out.
  2. Why do I divide by k! when the order doesn't matter?You divide by the number of ways to order the chosen items, because the ordered count listed every chosen group that many times.
  3. How does having more items than slots guarantee that two of them share a slot?If you put more items into fewer slots, at least one slot must hold two, because if every slot held at most one you could not fit them all.
  4. Why do I have to subtract the overlap when I add two groups together?Because anything in both groups gets counted twice, so you take one copy back out to leave it counted once.
  5. What is the difference between variance and standard deviation?They measure the same spread: variance is the average squared distance from the mean, standard deviation is its square root, so you report the standard deviation and calculate with the variance.
  6. How do you make a vague claim precise enough to tell whether it's true?Fix what is being talked about, what is asserted, which cases are covered and the cut-off, then name an observation that would prove it false.

Read alongside