# factorial

A recursive operation on natural numbers denoted by \(n!\) and defined as follows:

\[\begin{eqnarray*} 0! & = & 1 \\ & & \\ n! & = & n(n-1)! \end{eqnarray*}\]

Thus 1! is given by 1×0!, which is 1, 2! is given by 2×1!, which is 2, and 3! is 3×2!, or 6. In general for any natural number \(n\), we have

\[n! = n \cdot (n-1) \cdot (n-2) \cdot \cdots \cdot 3 \cdot 2 \cdot 1 \]

In other words, \(n!\) is the product of all the natural numbers up to and including \(n\).

This operation is used frequently in statistics and probability, and is central to many combinatorial operations, like combinations and permutations.