请输入您要查询的百科知识:

 

词条 Stirling's approximation
释义

  1. Derivation

  2. An alternative derivation

  3. Speed of convergence and error estimates

  4. Stirling's formula for the gamma function

  5. Error bounds

  6. A convergent version of Stirling's formula

  7. Versions suitable for calculators

  8. History

  9. See also

  10. Notes

  11. References

  12. External links

In mathematics, Stirling's approximation (or Stirling's formula) is an approximation for factorials. It is a good approximation, leading to accurate results even for small values of {{mvar|n}}. It is named after James Stirling, though it was first stated by Abraham de Moivre.[1][2][3]

The version of the formula typically used in applications is

(in big O notation, as ), or, by changing the base of the logarithm (for instance in the worst-case lower bound for comparison sorting),

Specifying the constant in the {{math|O(ln n)}} error term gives {{math|{{sfrac|1|2}}ln(2πn)}}, yielding the more precise formula:

where the sign ~ means that the two quantities are asymptotic: their ratio tends to 1 as {{mvar|n}} tends to infinity.

One may also give simple bounds valid for all positive integers {{mvar|n}}, rather than only for large {{mvar|n}}:

for . These follow from the more precise error bounds discussed below.

Derivation

Roughly speaking, the simplest version of Stirling's formula can be quickly obtained by approximating the sum:

with an integral:

The full formula, together with precise estimates of its error, can be derived as follows. Instead of approximating {{math|n!}}, one considers its natural logarithm as this is a slowly varying function:

The right-hand side of this equation minus

is the approximation by the trapezoid rule of the integral

and the error in this approximation is given by the Euler–Maclaurin formula:

where {{mvar|Bk}} is a Bernoulli number and {{math|Rm,n}} is the remainder term in the Euler–Maclaurin formula. Take limits to find that

Denote this limit as {{mvar|y}}. Because the remainder {{math|Rm,n}} in the Euler–Maclaurin formula satisfies

where we use big-O notation, combining the equations above yields the approximation formula in its logarithmic form:

Taking the exponential of both sides, and choosing any positive integer {{mvar|m}}, we get a formula involving an unknown quantity {{mvar|ey}}. For {{math|m {{=}} 1}}, the formula is

The quantity {{mvar|ey}} can be found by taking the limit on both sides as {{mvar|n}} tends to infinity and using Wallis' product, which shows that {{math|ey {{=}} {{sqrt|2π}}}}. Therefore, we get Stirling's formula:

An alternative derivation

An alternative formula for {{math|n!}} using the gamma function is

(as can be seen by repeated integration by parts). Rewriting and changing variables {{math|x {{=}} ny}} one gets

Applying Laplace's method we have:

which recovers Stirling's formula,

In fact further corrections can also be obtained using Laplace's method. For example, computing two-order expansion using Laplace's method yields

and gives Stirling's formula to two orders,

A complex-analysis version of this method[4] is to consider as a Taylor coefficient of the exponential function , computed by Cauchy's integral formula as:

This line integral can then be approximated using the saddle point method with an appropriate choice of countour radius . The dominant portion of the integral near the saddle point is then approximated by a real integral and Laplace's method, while the remaining portion of the integral can be bounded above to give an error term.

Speed of convergence and error estimates

Stirling's formula is in fact the first approximation to the following series (now called the Stirling series[5]):

An explicit formula for the coefficients in this series was given by G. Nemes.[6]{{efn|Further terms are listed in the On-Line Encyclopedia of Integer Sequences as {{OEIS link|A001163}} and {{OEIS link|A001164}}.}} The first graph in this section shows the relative error vs. {{mvar|n}}, for 1 through all 5 terms listed above.

As {{math|n → ∞}}, the error in the truncated series is asymptotically equal to the first omitted term. This is an example of an asymptotic expansion. It is not a convergent series; for any particular value of {{mvar|n}} there are only so many terms of the series that improve accuracy, after which point accuracy actually gets worse. This is shown in the next graph, which shows the relative error versus the number of terms in the series, for larger numbers of terms. More precisely, let {{math|S(n, t)}} be the Stirling series to {{mvar|t}} terms evaluated at {{mvar|n}}. The graphs show

which, when small, is essentially the relative error.

Writing Stirling's series in the form

it is known that the error in truncating the series is always of the opposite sign and at most the same magnitude as the first omitted term.

More precise bounds, due to Robbins,[7] valid for all positive integers {{mvar|n}} are

Stirling's formula for the gamma function

For all positive integers,

where {{math|Γ}} denotes the gamma function.

However, the gamma function, unlike the factorial, is more broadly defined for all complex numbers other than non-positive integers; nevertheless, Stirling's formula may still be applied. If {{math|Re(z) > 0}} then

Repeated integration by parts gives

where {{mvar|Bn}} is the {{mvar|n}}th Bernoulli number (note that the limit of the sum as is not convergent, so this formula is just an asymptotic expansion). The formula is valid for {{mvar|z}} large enough in absolute value when {{math|{{abs|arg(z)}} < π − ε}}, where {{mvar|ε}} is positive, with an error term of {{math|O(z−2N+ 1)}}. The corresponding approximation may now be written:

A further application of this asymptotic expansion is for complex argument {{mvar|z}} with constant {{math|Re(z)}}. See for example the Stirling formula applied in {{math|Im(z) {{=}} t}} of the Riemann-Siegel theta function on the straight line {{math|{{sfrac|1|4}} + it}}.

Error bounds

For any positive integer {{mvar|N}}, we introduce the following notation:

and

Then [8][9]

For further information and other error bounds, see the cited papers.

A convergent version of Stirling's formula

Thomas Bayes showed, in a letter to John Canton published by the Royal Society in 1763, that Stirling's formula did not give a convergent series.[10] Obtaining a convergent version of Stirling's formula entails evaluating Raabe's formula:

One way to do this is by means of a convergent series of inverted rising exponentials. If

then

where

where {{math|s(nk)}} denotes the Stirling numbers of the first kind. From this we obtain a version of Stirling's series

which converges when {{math|Re(x) > 0}}.

Versions suitable for calculators

The approximation

and its equivalent form

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. This approximation is good to more than 8 decimal digits for {{mvar|z}} with a real part greater than 8. Robert H. Windschitl suggested it in 2002 for computing the gamma function with fair accuracy on calculators with limited program or register memory.[11]

Gergő Nemes proposed in 2007 an approximation which gives the same number of exact digits as the Windschitl approximation but is much simpler:[12]

or equivalently,

An alternative approximation for the Gamma function stated by Srinivasa Ramanujan (Ramanujan 1988{{clarify|This is obviously supposed to be a citation but its target is not clear|date=May 2018}}) is

for {{math|x ≥ 0}}. The equivalent approximation for {{math|ln n!}} has an asymptotic error of {{math|{{sfrac|1|1400n3}}}} and is given by

The approximation may be made precise by giving paired upper and lower bounds; one such inequality is

[13][14][15][16]

History

The formula was first discovered by Abraham de Moivre[2] in the form

De Moivre gave an approximate rational-number expression for the natural logarithm of the constant. Stirling's contribution consisted of showing that the constant is precisely .[3]

See also

  • Factorial
  • Gamma function
  • Lanczos approximation
  • Spouge's approximation

Notes

{{notelist}}

References

1. ^{{citation | last = Dutka | first = Jacques | year = 1991 | title = The early history of the factorial function | journal = Archive for History of Exact Sciences | volume = 43 | issue = 3 | pages = 225–249 | doi = 10.1007/BF00389433}}
2. ^{{citation |doi=10.1214/ss/1177013818 |doi-access=free |last=Le Cam |first=L. |title=The central limit theorem around 1935 |journal=Statistical Science |volume=1 |issue=1 |pages=78–96 [p. 81] |year=1986 |mr=833276 |quote=The result, obtained using a formula originally proved by de Moivre but now called Stirling's formula, occurs in his `Doctrine of Chances' of 1733. }}.{{Unreliable source?|date=May 2009}}
3. ^{{citation |last=Pearson |first=Karl |year=1924 |title=Historical note on the origin of the normal curve of errors |journal=Biometrika |volume=16 |issue=3/4 |pages=402–404 [p. 403] |quote=I consider that the fact that Stirling showed that De Moivre's arithmetical constant was {{sqrt|2{{pi}}}} does not entitle him to claim the theorem, [...] |doi=10.2307/2331714|jstor=2331714 }}
4. ^Phillipe Flajolet and Robert Sedgewick, Analytic Combinatorics, p. 555
5. ^{{cite web|url=https://dlmf.nist.gov/5.11.i|title=NIST Digital Library of Mathematical Functions|authors= F. W. J. Olver, A. B. Olde Daalhuis, D. W. Lozier, B. I. Schneider, R. F. Boisvert, C. W. Clark, B. R. Miller, and B. V. Saunders, eds.}}
6. ^{{Citation|last=Nemes|first=Gergő|year=2010|title=On the Coefficients of the Asymptotic Expansion of n!|journal=Journal of Integer Sequences|volume=13|issue=6|pages=5 pp|issn=|doi=|postscript=}}
7. ^{{Citation|last=Robbins|first=Herbert|year=1955|title=A Remark on Stirling's Formula|journal=The American Mathematical Monthly|volume=62|issue=1|pages=26–29 pp|issn=|doi=10.2307/2308012|postscript=|jstor=2308012}}
8. ^F. W. Schäfke, A. Sattler, Restgliedabschätzungen für die Stirlingsche Reihe, Note. Mat. 10 (1990), 453–470.
9. ^G. Nemes, Error bounds and exponential improvements for the asymptotic expansions of the gamma function and its reciprocal, Proc. Roy. Soc. Edinburgh Sect. A 145 (2015), 571–596.
10. ^{{cite web |url=http://www.york.ac.uk/depts/maths/histstat/letter.pdf |title=Archived copy |accessdate=2012-03-01 |deadurl=no |archiveurl=https://web.archive.org/web/20120128050439/http://www.york.ac.uk/depts/maths/histstat/letter.pdf |archivedate=2012-01-28 |df= }}
11. ^Toth, V. T. Programmable Calculators: Calculators and the Gamma Function (2006) {{webarchive|url=https://web.archive.org/web/20051231063913/http://www.rskey.org/gamma.htm |date=2005-12-31 }}
12. ^{{Citation|last=Nemes|first=Gergő|year=2010|title=New asymptotic expansion for the Gamma function|journal=Archiv der Mathematik|volume=95|issue=2|pages=161–169|issn=0003-889X|doi=10.1007/s00013-010-0146-9|postscript=.}}
13. ^{{Citation|last=Karatsuba|first=Ekatherina|year=2001|title=On the asymptotic representation of the Euler gamma function by Ramanujan|journal=Journal of Computational and Applied Mathematics|volume=135|issue=2|pages=225–240|doi=10.1016/S0377-0427(00)00586-0}}
14. ^{{Citation|last=Mortici|first=Cristinel|year=2011|title=Ramanujan's estimate for the gamma function via monotonicity arguments|journal=Ramanujan J.|volume=25|pages=149–154}}
15. ^{{Citation|last=Mortici|first=Cristinel|year=2011|title=Improved asymptotic formulas for the gamma function|journal=Comput. Math. Appl.|volume=61|pages=3364–3369}}
16. ^{{Citation|last=Mortici|first=Cristinel|year=2011|title=On Ramanujan's large argument formula for the gamma function|journal=Ramanujan J.|volume=26|pages=185–192}}
  • {{citation |last=Olver |first=F. W. J. |last2= Olde Daalhuis |first2=A. B. |last3=Lozier |first3=D. W. |last4=Schneider |first4=B. I. |last5=Boisvert |first5=R. F. |last6=Clark |first6=C. W. |last7=Miller |first7=B. R. |last8=Saunders |first8=B. V. |lastauthoramp=yes |title=NIST Digital Library of Mathematical Functions |version=Release 1.0.13 of 2016-09-16 |url=http://dlmf.nist.gov/5.11}}
  • {{citation |last=Abramowitz |first=M. |last2=Stegun |first2=I. |lastauthoramp=yes |title=Handbook of Mathematical Functions |year=2002 |url=http://www.math.hkbu.edu.hk/support/aands/toc.htm }}
  • {{citation

| last = Nemes
| first = G.
| title = New asymptotic expansion for the Gamma function
| journal = Archiv der Mathematik
| volume = 95
| year = 2010
| issue = 2
| pages = 161–169
| doi = 10.1007/s00013-010-0146-9}}
  • {{citation |last=Paris |first=R. B. |last2=Kaminski |first2=D. |lastauthoramp=yes |chapter= |title=Asymptotics and the Mellin–Barnes Integrals |year=2001 |publisher=Cambridge University Press |location=New York |isbn=978-0-521-79001-7 }}
  • {{citation |last=Whittaker |first=E. T. |last2=Watson |first2=G. N. |lastauthoramp=yes |title=A Course in Modern Analysis |year=1996 |edition=4th |publisher=Cambridge University Press |location=New York |isbn=978-0-521-58807-2 }}
  • Dan Romik, Stirling’s Approximation for n!: The Ultimate Short Proof?, The American Mathematical Monthly, Vol. 107, No. 6 (Jun. – Jul., 2000), 556–557.
  • Y.-C. Li, A Note on an Identity of The Gamma Function and Stirling’s Formula, Real Analysis Exchang, Vol. 32(1), 2006/2007, pp. 267–272.

External links

{{commonscat}}
  • {{springer|title=Stirling formula|id=p/s087830}}
  • Peter Luschny, Approximation formulas for the factorial function n!
  • {{MathWorld | urlname=StirlingsApproximation | title=Stirling's Approximation}}
  • {{PlanetMath | urlname=StirlingsApproximation | title=Stirling's approximation}}

5 : Approximations|Asymptotic analysis|Analytic number theory|Gamma and related functions|Theorems in analysis

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/9/21 13:42:18