Factorials
In mathematics, the factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n:
The value of 0! is 1, according to the convention for an empty product. The factorial operation is encountered in many areas of mathematics, notably in combinatorics, algebra, and mathematical analysis. Its most basic use counts the possible distinct sequences – the permutations – of n distinct objects: there are n!.
The factorial function can also be extended to non-integer arguments while retaining its most important properties by defining x! = Γ(x + 1), where Γ is the gamma function; this is undefined when x is a negative integer.
Contents
Notation
Factorial of n is denoted by n! or n. The notation n! was introduced by the French mathematician Christian Kramp in 1808.
Definition
The factorial function is defined by the product
This leads to the recurrence relation
Factorial of zero
The factorial of 0 is 1, or in symbols, 0! = 1.
There are several motivations for this definition:
- For n = 0, the definition of n! as a product involves the product of no numbers at all, and so is an example of the broader convention that the product of no factors is equal to the multiplicative identity.
- There is exactly one permutation of zero objects (with nothing to permute, the only rearrangement is to do nothing).
- It makes many identities in combinatorics valid for all applicable sizes. The number of ways to choose 0 elements from the empty set is given by the binomial coefficient: More generally, the number of ways to choose all n elements among a set of n is:
- It allows for the compact expression of many formulae, such as the exponential function, as a power series:
- It extends the recurrence relation to 0.
- It matches the gamma function .
Applications
Although the factorial function has its roots in combinatorics, formulas involving factorials occur in many areas of mathematics.
- There are n! different ways of arranging n distinct objects into a sequence, the permutations of those objects.
- Often factorials appear in the denominator of a formula to account for the fact that ordering is to be ignored. A classical example is counting k-combinations (subsets of k elements) from a set with n elements. One can obtain such a combination by choosing a k-permutation: successively selecting and removing one element of the set, k times, for a total of possibilities. This, however, produces the k-combinations in a particular order that one wishes to ignore; since each k-combination is obtained in k! different ways, the correct number of k-combinations isThis number is known as the binomial coefficient, because it is also the coefficient of xk in (1 + x)n. The term is often called a falling factorial (pronounced "n to the falling k").
- Factorials occur in algebra for various reasons, such as via the already mentioned coefficients of the binomial formula, or through averaging over permutations for symmetrization of certain operations.
- Factorials also turn up in calculus; for example, they occur in the denominators of the terms of Taylor's formula, where they are used as compensation terms due to the nth derivative of xn being equivalent to n!.
- Factorials are also used extensively in probability theory and number theory.
- Factorials can be useful to facilitate expression manipulation. For instance the number of k-permutations of n can be written as while this is inefficient as a means to compute that number, it may serve to prove a symmetry property of binomial coefficients:
- The factorial function can be shown, using the power rule, to be where Dn xn is Euler's notation for the nth derivative of xn.
Rate of growth and approximations for large n
As n grows, the factorial n! increases faster than all polynomials and exponential functions (but slower than and double exponential functions) in n.
Most approximations for n! are based on approximating its natural logarithm
The graph of the function f(n) = ln n! is shown in the figure on the right. It looks approximately linear for all reasonable values of n, but this intuition is false. We get one of the simplest approximations for ln n! by bounding the sum with an integral from above and below as follows:
Hence ln n! ∼ n ln n. This result plays a key role in the analysis of the computational complexity of sorting algorithms. From the bounds on ln n! deduced above we get that
It is sometimes practical to use weaker but simpler estimates. Using the above formula it is easily shown that for all n we have ()n < n!}}, and for all n ≥ 6 we have {{math|n! < ()n.
For large n we get a better estimate for the number n! using Stirling's approximation:
This in fact comes from an asymptotic series for the logarithm, and n factorial lies between this and the next approximation:
Another approximation for ln n! is given by Srinivasa Ramanujan (Ramanujan 1988)
Both this and Stirling's approximation give a relative error on the order of , but Ramanujan's is about four times more accurate. However, if we use two correction terms in a Stirling-type approximation, as with Ramanujan's approximation, the relative error will be of order :
Licensing
Content obtained and/or adapted from:
- Factorial, Wikipedia under a CC BY-SA license