![]() |
|
|
| |
|
||||
In mathematics, the factorial of a natural number n is the product of the positive integers less than or equal to n. This is written as n! and pronounced "n factorial". The notation n! was introduced by Christian Kramp in 1808. Since the exclamation mark, "!", is sometimes pronounced "bang" or "shriek", these words are occasionally used colloquially for "factorial" in pronouncing terms like n!.
DefinitionThe factorial function is formally defined by
For example,
This definition implies in particular that
because the product of no numbers at all is 1 (see empty product for an account of that fact). Proper attention to the value of the empty product is important in this case, because
The factorial function can also be defined (for non-integer in addition to the usual integer values of z), via the gamma function:
The latter representation points at a generalization of the notion of factorial for the set of complex numbers, with the exception of negative integers. The sequence of factorials (sequence A000142 in OEIS) for n = 0, 1, 2,... starts: ApplicationsFactorials are important in combinatorics. For example, there are n! different ways of arranging n distinct objects in a sequence. (The arrangements are called permutations.) And the number of ways one can choose k objects from among a given set of n objects (the number of combinations), is given by the so-called binomial coefficient
Factorials also turn up in calculus. For example, Taylor's theorem expresses a function f(x) as a power series in x, basically because the n-th derivative of xn is n!. Factorials are also used extensively in probability theory. Factorials are often used as a simple example when teaching recursion in computer science because they satisfy the following recursive relationship (if n ≥ 1):
Calculating factorialsThe numeric value of n! can be calculated by repeated multiplication if n is not too large. That is basically what pocket calculators do. The largest factorial that most calculators can handle is 69!, because 70! > 10100. When n is large, n! can be estimated quite accurately using Stirling's approximation:
Here is a simple weak version that can be proved using secondary-school mathematics; the essential tool is mathematical induction. It is included here as an exercise:
Logarithm of the factorialMissing image Log-factorial.PNG Plot of the natural logarithm of the factorial The logarithm of the factorial can be used to calculate the number of digits in a given base the factorial of a given number will take. log n! can easily be calculated as follows:
Note that this function, if graphed, is approximately linear, for small values; but the factor <math>{\log n!} \over n<math> does grow arbitrarily large, although quite slowly. The graph of log(n!) for n between 0 and 20,000 is shown in the figure on the right. A good approximation for log n! is to take the logarithm of Stirling's approximation:
One can see from this that log(n!) is Ο(n log n). This result plays a key role in the analysis of the computational complexity of sorting algorithms. GeneralizationsThe gamma functionThe related gamma function Γ(z) is defined for all complex numbers z except for the nonpositive integers (z = 0, −1, −2, −3, ...). It is related to factorials in that it satisfies a recursive relationship similar to that of the factorial function:
Together with the definition Γ(1) = 1 this yields the equation
Because of this relationship, the gamma function is often thought of as a generalization of the factorial function to the domain of complex numbers. This is justified for the following reasons.
MultifactorialsA common related notation is to use multiple exclamation points to denote a multifactorial, the product of integers in steps of two (n!!), three (n!!!), or more. n!! denotes the double factorial of n and is defined recursively by
n!!=
\left\{
\begin{matrix}
1,\qquad\quad\ &&\mbox{if }n=0\mbox{ or }n=1;
\\
n(n-2)!!&&\mbox{if }n\ge2.\qquad\qquad
\end{matrix}
\right.
<math>
For example, 8!! = 2 · 4 · 6 · 8 = 384 and 9!! = 1 · 3 · 5 · 7 · 9 = 945. The sequence of double factorials (sequence A006882 in OEIS) for n = 0, 1, 2,... starts Some identities involving double factorials are:
One should be careful not to interpret n!! as the factorial of n!, which would be written (n!)! and is a much larger number (for n>2). The double factorial is the most commonly used variant, but one can similarly define the triple factorial (n!!!) and so on. In general, the k-th factorial, denoted by n!(k), is defined recursively as
n!^{(k)}=
\left\{
\begin{matrix}
1,\qquad\qquad\ &&\mbox{if }0\le n |
||
|
|
|
|
|
|
Copyright 2008 WordIQ.com - Privacy Policy
::
Terms of Use
:: Contact Us
:: About Us This article is licensed under the GNU Free Documentation License. It uses material from the Wikipedia article "Factorial". |