Skip to main content
TirageAuSort.io
Mathematics

Factorial

Also called : n!

Product of all the integers from 1 up to a number n, written n!; it counts the number of ways to order n elements.

The factorial of a whole number n, written n!, is the product of all the consecutive integers going from 1 up to n. It is an operation that turns a single number into an often very large result, because each additional factor multiplies everything that comes before it.

The most telling intuition is that of counting orders. When you arrange n objects in a row, there are n possibilities for the first place, then n minus one for the second since one object is already set down, then n minus two for the next, and so on. By multiplying these decreasing choices, you obtain exactly the factorial. It therefore answers the question: in how many ways can you order n distinct elements?

The calculation is done in words very simply: you multiply 1 by 2, then by 3, and so on up to n. Thus 4! equals 1 times 2 times 3 times 4, that is 24. Likewise, 5! equals 120 and 3! equals 6. By convention, it is also stated that 0! equals 1, because there is a single way to order nothing, namely the empty arrangement. This convention is not a whim: it makes the counting formulas consistent.

The factorial is the basic ingredient behind the other counting notions. The number of permutations of a set is directly a factorial. Arrangements and combinations, for their part, are expressed as ratios involving several factorials, the idea being to remove or keep the order information depending on the case. The distinction lies in what you divide by: for a combination, you divide in particular by the factorial of the chosen elements in order to forget their order.

On a random draw site, the factorial hides behind every shuffle. Shuffling a list of names before a draw, determining a running order, or shuffling a deck of cards amounts to choosing one arrangement from a number of possibilities equal to a factorial. Shuffling 5 cards already offers 120 distinct orders, which illustrates why a simple shuffle is enough to make a result unpredictable.

Example

The number of possible orders for shuffling 5 cards is 5! = 120.

Related terms