21.1: Factorials
In counting, factorials come up a lot.
notation for the computation formula
\begin{equation*} n (n - 1) (n - 2) \dotsm 2 \cdot 1 \text{,} \end{equation*}
for natural number \(n\)
\begin{align*} 3! & = 3 \cdot 2 \cdot 1 = 6, & 7! = 7 \cdot 6 \cdot 5 \cdot 4 \cdot 3 \cdot 2 \cdot 1 = 5,040. \end{align*}
A factorial contains every smaller factorial as a factor. For example,
\begin{equation*} \dfrac{7!}{3!} = \dfrac{ 7 \cdot 6 \cdot 5 \cdot 4 \cdot \cancel{(3!)} }{ \cancel{3!} } = 7 \cdot 6 \cdot 5 \cdot 4 = 840\text{.} \end{equation*}
To avoid division by zero in certain formulas, define \(0! = 1\text{.}\) This choice is also made to be consistent with the methods for counting permutations we will explore in this chapter.