The factorial of a whole number , written as or , is found by multiplying by all the whole numbers less than it. For example, the factorial of 4 is 24, because . Hence one can write . For some technical reasons, is equal to .

Factorials can be used to find out how many possible ways there are to arrange objects.

Factorial

For example, if there are 3 letters (A, B, and C), they can be arranged as ABC, ACB, BAC, BCA, CAB, and CBA. That is be 6 choices because A can be put in 3 different places, B has 2 choices left after A is placed, and C has only one choice left after A and B are placed. In other words, choices.

Factorial

The factorial function is a good example of recursion (doing things over and over), as can be written as , which can be written as and finally as . Because of this, can also be defined as , with

Factorial

The factorial function grows very fast. There are ways to arrange 10 items.

Applications

The earliest uses of the factorial function involve counting permutations: there are different ways of arranging distinct objects into a sequence. Factorials appear more broadly in many formulas in combinatorics, to account for different orderings of objects. For instance the binomial coefficients count the combinations (subsets of from a set with and can be computed from factorials using the formula

Related sequences and functions

Several other integer sequences are similar to or related to the factorials:

Alternating factorial

The alternating factorial is the absolute value of the alternating sum of the first factorials, These have mainly been studied in connection with their primality; only finitely many of them can be prime, but a complete list of primes of this form is not known.

Notes

Factorials are not defined for negative numbers. However, the related gamma function () is defined over the real and complex numbers (except for negative integers).

Related pages

Exclamation mark

Permutation

References

Other websites

Calculation of Factorial (0≤N≤40000)

Recursion

Mathematics

Combinatorics

Integer sequences