Skip to content

Factorial

Factorial counts orderings of distinct objects. Understand why 0! is one and why five candidates give 120 full orders, 20 ordered pairs or 10 two-name sets.

The factorial of a positive integer nn, written n!n! and read “nn factorial”, is the product of the integers from 11 through nn:
n!=1×2×⋯×n,0!=1.n!=1\times2\times\cdots\times n, \qquad 0!=1.
Its basic counting interpretation is the number of ways to put all nn distinct objects in order, using each exactly once. Such an ordering is a permutation. The elementary definition uses nonnegative integers: a negative number or a fractional number of objects is outside this counting problem.

Five candidates, 120 review orders

Suppose a quant researcher has five distinct candidate asset labels, A through E, and wants to examine each once. There are five choices for the first position, four remaining choices for the second, then three, two and one. Multiplying gives

5!=5×4×3×2×1=120.5!=5\times4\times3\times2\times1=120.

A–B–C–D–E and B–A–C–D–E are different review orders. No assumption about independent random selections is needed: this is a count of possible sequences. Converting those counts into probabilities would require a probability model; all orders need not be equally likely.

Five candidate labels give 5, 4, 3, 2 and 1 choices for successive slots, yielding 120 complete orders. AB and BA are two orders of one set; 20 ordered pairs give 10 unordered pairs.
Five candidate labels give 5, 4, 3, 2 and 1 choices for successive slots, yielding 120 complete orders. AB and BA are two orders of one set; 20 ordered pairs give 10 unordered pairs.
Illustrative candidate labels, used without repetition. The lower panel removes duplicate orders when only the selected names matter.
The count describes review sequences. It does not give the number of possible weighted portfolios: reordering a list leaves holdings unchanged when each weight stays attached to its asset. Allowing continuously varying weights introduces a different, generally infinite, set of allocations.

Why zero factorial equals one

With no objects, there is exactly one possible sequence: the empty sequence. There are no choices to make, but there is still one completed arrangement. Thus 0!=10!=1, rather than zero.

This also makes the recurrence

n!=n(n−1)!,n≥1,n!=n(n-1)!,\qquad n\ge1,
work at its boundary: 1!=1×0!=11!=1\times0!=1. In product notation, 0!0! is an empty product, whose value is the multiplicative identity, one. It is not a product containing a factor of zero.

Ordering two names is different from selecting two

If the researcher fills only the first two positions, there are 5×4=205\times4=20 ordered pairs. Equivalently,

5!(5−2)!=20.\frac{5!}{(5-2)!}=20.

If only the two selected names matter, AB and BA describe the same selection. Every pair has 2!=22!=2 orders, so divide by two:

(52)=5!2! 3!=10.\binom{5}{2}=\frac{5!}{2!\,3!}=10.
This is a binomial coefficient: it counts two-name sets, before any weights are assigned. The distinction to settle first is what makes two outcomes different. Full ordering, partial ordering and unordered selection answer different questions. If labels can repeat, or objects are indistinguishable, the unrestricted n!n! count also needs adjustment.
For a broader treatment, Counting and Combinatorics develops the multiplication principle, partial permutations and combinations (public preview; full lesson requires membership).

Sources

Last updated
  • counting
  • combinatorics
  • permutations
← Back to the glossaryBack to top ↑