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, 0! is equal to 1.
Factorials can be used to find out how many possible ways there are to arrange objects.
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.
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
The factorial function grows very fast. There are ways to arrange 10 items.