Skip to main content

Registration is now open for this year's LibreFest! Join us virtually the week of July 13.

Register here
Mathematics LibreTexts

2.3: Factorials

  • Page ID
    174253
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\dsum}{\displaystyle\sum\limits} \)

    \( \newcommand{\dint}{\displaystyle\int\limits} \)

    \( \newcommand{\dlim}{\displaystyle\lim\limits} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \(\newcommand{\longvect}{\overrightarrow}\)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    Definitions and Theorems

    Definition: Factorial (Non-Recursive Definition)

    The factorial of a whole number \( n \), denoted \( n! \) and reads as "\( n \) factorial," is defined to be following piecewise function.\[ n! = \left\{ \begin{array}{ll}
    1, & \text{if } n = 0 \\
    n (n-1)(n-2)\cdots 3 \cdot 2 \cdot 1, & \text{if } n \geq 1 \\
    \end{array} \right. \nonumber \]

    For example, \( 5!=5\times 4\times 3\times 2\times 1=120\).

    The factorial operation is encountered in many areas of Mathematics, notably in Combinatorics, where its most basic use counts the possible distinct sequences - the permutations - of \(n\) distinct objects (of which there are \(n!\)). In Calculus, factorials are used in power series for the exponential function and other functions, and they also have applications in Algebra, Number Theory, Probability Theory, and Computer Science.

    Theorem: Factorial Recurrence Relation

    For \(n \geq 1\),\[ n! = n (n-1)! \nonumber \]

    For example, \( 5!=5\cdot 4!=5\cdot 24=120\).

    The factorial of \(0\) being defined as \(1\) has several motivations:

    • If we consider that \(n!\) is the product of all natural numbers less than or equal to \(n\), then \(0!\) involves the product of no numbers at all. As such, it is an empty product - a product of no factors. This, by convention, is equal to the multiplicative identity.
    • If we consider that \(n!\) is the number of permutations of \(n\) objects, then there is exactly one permutation of zero objects. Hence, from a combinatorial perspective, \(0! = 1\).
    • With \(0!=1\), the recurrence relation for the factorial remains valid at \(n=1\). Therefore, with this convention, a recursive computation of the factorial needs to have only the value for zero as a base case, simplifying the computation and avoiding the need for additional special cases.
    • Setting \(0! = 1\) allows for simplicity of formulas when it comes to power series expansions in Calculus.
    Definition: Factorial (Recursive Definition)

    The factorial of a whole number \( n \), denoted \( n! \) and reads as "\( n \) factorial," is defined by the recursive formula\[ \begin{array}{rclclcc}
    a_0 & = & 0! & = & 1 & & \\[6pt]
    a_n & = & n! & = & n \cdot a_{n- 1} & \quad & \text{for } n \geq 1 \\[6pt]
    \end{array}  \nonumber \]

    Examples

    Example \(\PageIndex{1}\): Evaluating Factorials Directly

    Evaluate each of the following.

    1. \(4!\)
    2. \(7!\)
    3. \(1!\)
    4. \(0!\)
    Solutions
    1. Write out the descending product from \(4\) down to \(1\): \[4! = 4 \cdot 3 \cdot 2 \cdot 1 = 24.\nonumber\]
    2. Write out the descending product from \(7\) down to \(1\): \[7! = 7 \cdot 6 \cdot 5 \cdot 4 \cdot 3 \cdot 2 \cdot 1 = 5040.\nonumber\]
    3. The product contains only one factor: \[1! = 1.\nonumber\]
    4. By the defining convention for the empty product: \[0! = 1.\nonumber\]
    Example \(\PageIndex{2}\): Using the Recurrence Relation

    Use the recurrence relation \(n! = n \cdot (n-1)!\) to express \(8!\) in terms of \(7!\), then evaluate.

    Solution
    Apply the recurrence relation with \(n = 8\): \[8! = 8 \cdot 7!\nonumber\] Since \(7! = 5040\) (computed in Example \(\PageIndex{1}\)): \[8! = 8 \cdot 5040 = 40320.\nonumber\] The recurrence avoids recomputing the full product from scratch whenever a nearby factorial value is already known.
    Example \(\PageIndex{3}\): Simplifying a Factorial Fraction—Adjacent Factorials

    Simplify \(\dfrac{n!}{(n-1)!}\).

    Solution
    Apply the recurrence relation to expand the numerator: \[\dfrac{n!}{(n-1)!} = \dfrac{n \cdot (n-1)!}{(n-1)!}.\nonumber\] Cancel the common factor \((n-1)!\): \[\dfrac{n \cdot (n-1)!}{(n-1)!} = n.\nonumber\] Therefore, \(\dfrac{n!}{(n-1)!} = n\) for every integer \(n \geq 1\).
    Example \(\PageIndex{4}\): Simplifying a Factorial Fraction—Two Steps Down

    Simplify \(\dfrac{n!}{(n-2)!}\).

    Solution
    Expand the numerator by applying the recurrence relation twice: \[n! = n \cdot (n-1) \cdot (n-2)!\nonumber\] Substitute into the fraction: \[\dfrac{n!}{(n-2)!} = \dfrac{n \cdot (n-1) \cdot (n-2)!}{(n-2)!}.\nonumber\] Cancel the common factor \((n-2)!\): \[\dfrac{n \cdot (n-1) \cdot (n-2)!}{(n-2)!} = n(n-1).\nonumber\] Therefore, \(\dfrac{n!}{(n-2)!} = n(n-1)\).
    Example \(\PageIndex{5}\): Simplifying a Numerical Factorial Fraction

    Simplify \(\dfrac{10!}{7!}\) without computing either factorial in full.

    Solution
    Expand only the portion of \(10!\) that does not cancel: \[\dfrac{10!}{7!} = \dfrac{10 \cdot 9 \cdot 8 \cdot 7!}{7!}.\nonumber\] Cancel the common factor \(7!\): \[\dfrac{10 \cdot 9 \cdot 8 \cdot 7!}{7!} = 10 \cdot 9 \cdot 8 = 720.\nonumber\]
    Example \(\PageIndex{6}\): Simplifying a Fraction with a Sum in the Argument

    Simplify \(\dfrac{(n+1)!}{n!}\).

    Solution
    Apply the recurrence relation to the numerator, treating \((n+1)\) as the current integer: \[(n+1)! = (n+1) \cdot n!\nonumber\] Substitute: \[\dfrac{(n+1)!}{n!} = \dfrac{(n+1) \cdot n!}{n!} = n+1.\nonumber\] Therefore, \(\dfrac{(n+1)!}{n!} = n+1\).
    Caution: Factorials Do Not Distribute

    A common error is to treat the factorial as if it distributes over addition or subtraction. It does not. In general, \[(a + b)! \neq a! + b! \qquad \text{and} \qquad (a + b)! \neq a! \cdot b!\nonumber\] For example, \((2 + 3)! = 5! = 120\), but \(2! + 3! = 2 + 6 = 8\) and \(2! \cdot 3! = 2 \cdot 6 = 12\). When simplifying factorial fractions, always expand the factorial using the recurrence relation rather than splitting the argument.


    Sources

    Several parts of this text use modifications from the following source:

    This source is released under the Creative Commons Attribution-Share-Alike License 4.0.


    This page titled 2.3: Factorials is shared under a CC BY-NC-SA license and was authored, remixed, and/or curated by Roy Simpson.