In Mathematics , (or '''Stirling's formula''') is an approximation for large Factorial s. It is named in honour of James Stirling .
The formula is written as:
::
for any sufficiently large integer ''n'', where ''ln'' is the Natural Logarithm function. (The Gamma function formulation described below is the equivalent approximation for non-integers).
More formally, Stirling's approximation is
::
:(See Limit , Square Root , π , E .)
which is often written as
::
The formula, together with precise estimates of its error, can be derived as follows. Instead of approximating ''n''!, one considers the Natural Logarithm
:
Then, we can apply Euler-Maclaurin Formula by putting f(x) = ln(''x'') to find an approximation of the value of ln(''n''!).
:
where Bk is Bernoulli Number and R is the remainder of Euler-Maclaurin formula.
We can then take limits on both sides,
:
Let the above limit be y and compound the above two formula, we get the approximation formula in its logarithmic form:
:
where O(f(n)) is Big-O Notation .
Just take the exponential on both sides, and choose any positive integer m, say 1. We get the formula with an unknown term ey.
:
The unknown term ey can be found by taking the limit on both sides as n tends to infinity and using Wallis' Product . One can estimate the value of ey is . Therefore, we get Stirling's formula:
:
The formula may also be obtained by repeated Integration By Parts .
The leading term can be found through the Method Of Steepest Descent .
More precisely,
:
with
:
Stirling's formula is in fact the first approximation to the following series (now called the ):
:
As , the error in the truncated series is asymptotically equal to the first omitted term. This is an example of an Asymptotic Expansion .
The asymptotic expansion of the logarithm is also called ''Stirling's series'':
:
In this case, it is known that the error in truncating the series is always of the same sign and at most the same magnitude as the first omitted term.
Stirling's formula may also be applied to the Gamma Function
:
defined for all complex numbers other than non-positive integers. If
then
:
Repeated integration by parts gives the asymptotic expansion
:
|
= \ln\Gamma (z) - \left( z-rac12
ight) \ln z +z - rac12\ln(2\pi).
One way to do this is by means of a convergent series of inverted
Rising Exponentials . If
, then
:
where
:
From this we obtain a version of Stirling's series
:
:::
which converges when
.
The approximation
:
or equivalently,
:
can be obtained by rearranging Stirling's extended formula and observing a coincidence between the resultant power series and the
Taylor Series expansion of the
Hyperbolic Sine function. The term in square brackets is optional and increases accuracy slightly; even without it, this approximation is good to more than 8 decimal digits for ''z'' with a real part greater than 8. Viktor Toth (2004) suggests it for computing the Gamma function with fair accuracy on calculators with limited program or register memory.
The formula was first discovered by
Abraham De Moivre in the form
:
Stirling's contribution consisted of showing that the constant
is
. The more precise versions are due to
Jacques Binet .
- Abramowitz, M. and Stegun, I., ''Handbook of Mathematical Functions'', http://www.math.hkbu.edu.hk/support/aands/toc.htm
- Paris, R. B., and Kaminsky, D., ''Asymptotics and the Mellin-Barnes Integrals'', Cambridge University Press, 2001
- Whittaker, E. T., and Watson, G. N., ''A Course in Modern Analysis'', fourth edition, Cambridge University Press, 1963. ISBN 0521588073
- Toth, V. T. ''Programmable Calculators: Calculators and the Gamma Function''. http://www.rskey.org/gamma.htm, modified 2004