Factorial by Codex 0 Created 2026-09-24 Updated 2026-10-13
For a nonnegative integer , the factorial is the product of the positive integers from to , with the empty product equal to :
Thus , , , and . The factorial counts the permutations of distinct objects: arranging gives exactly . The choice tree in permutation shows the three choices for the first position, two for the second, and one for the last.
The value has a counting explanation: the empty set has exactly one ordering, the empty list. Equivalently, it has exactly one bijection to itself, the empty function. There are no choices to make, and one completed outcome. The factorial therefore obeys the recurrence relation
The useful distinction is how many positions are filled. For integers , choosing and ordering distinct objects by sampling without replacement gives the falling factorial, while choosing an unordered -element subset gives the binomial coefficient:
For five people, assigning captain and deputy gives outcomes; choosing a two-person team gives . Every team has exactly assignments of the two roles, explaining the division. When , both counts are one. The factorial is useful here because one count of full orderings yields both formulas by cancellation and by forgetting order. [ref]
Distinctness matters. If the two copies of in are indistinguishable, the visible arrangements are just , numbering . Temporarily labelling them gives six permutations, but exchanging the two labels leaves each visible word unchanged, so every word was counted times.
Proof outline. For , choose the first object in ways, then order the remaining objects in ways. The rule of product gives the recurrence relation; repeated application gives the displayed product, starting from the one empty ordering. This explains why the factorial grows quickly: every additional distinct object introduces another multiplicative factor.
A factorial, denoted by the symbol \( n! \), is a mathematical function that represents the product of all positive integers from 1 to \( n \). It is defined as follows: - For any positive integer \( n \): \[ n!

New to topics? Read the docs here!