MathorynMathematical Formula Database

Combinatorics

Factorial

The factorial of a non-negative integer is the product of all positive integers up to it. It counts the number of ways to arrange nn distinct objects in a row.

n!=n⋅(n−1)⋯2⋅1,0!=1n!=n\cdot(n-1)\cdots2\cdot1,\qquad 0!=1
LaTeXn!=n\cdot(n-1)\cdots2\cdot1,\qquad 0!=1

Variables

nn
non-negative integer

Example

Compute 5!5!.

  1. 5⋅4⋅3⋅2⋅15\cdot4\cdot3\cdot2\cdot1.

Answer: 120120.

Related formulas