Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Stirling's approximation
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Derivation == Roughly speaking, the simplest version of Stirling's formula can be quickly obtained by approximating the sum <math display=block>\ln(n!) = \sum_{j=1}^n \ln j</math> with an [[integral]]: <math display=block>\sum_{j=1}^n \ln j \approx \int_1^n \ln x \,{\rm d}x = n\ln n - n + 1.</math> The full formula, together with precise estimates of its error, can be derived as follows. Instead of approximating <math>n!</math>, one considers its [[natural logarithm]], as this is a [[slowly varying function]]: <math display=block>\ln(n!) = \ln 1 + \ln 2 + \cdots + \ln n.</math> The right-hand side of this equation minus <math display=block>\tfrac{1}{2}(\ln 1 + \ln n) = \tfrac{1}{2}\ln n</math> is the approximation by the [[trapezoid rule]] of the integral <math display=block>\ln(n!) - \tfrac{1}{2}\ln n \approx \int_1^n \ln x\,{\rm d}x = n \ln n - n + 1,</math> and the error in this approximation is given by the [[Euler–Maclaurin formula]]: <math display=block>\begin{align} \ln(n!) - \tfrac{1}{2}\ln n & = \tfrac{1}{2}\ln 1 + \ln 2 + \ln 3 + \cdots + \ln(n-1) + \tfrac{1}{2}\ln n\\ & = n \ln n - n + 1 + \sum_{k=2}^{m} \frac{(-1)^k B_k}{k(k-1)} \left( \frac{1}{n^{k-1}} - 1 \right) + R_{m,n}, \end{align}</math> where <math>B_k</math> is a [[Bernoulli number]], and {{math|''R''<sub>''m'',''n''</sub>}} is the remainder term in the Euler–Maclaurin formula. Take limits to find that <math display=block>\lim_{n \to \infty} \left( \ln(n!) - n \ln n + n - \tfrac{1}{2}\ln n \right) = 1 - \sum_{k=2}^{m} \frac{(-1)^k B_k}{k(k-1)} + \lim_{n \to \infty} R_{m,n}.</math> Denote this limit as <math>y</math>. Because the remainder {{math|''R''<sub>''m'',''n''</sub>}} in the Euler–Maclaurin formula satisfies <math display=block>R_{m,n} = \lim_{n \to \infty} R_{m,n} + O \left( \frac{1}{n^m} \right),</math> where [[big-O notation]] is used, combining the equations above yields the approximation formula in its logarithmic form: <math display=block>\ln(n!) = n \ln \left( \frac{n}{e} \right) + \tfrac{1}{2}\ln n + y + \sum_{k=2}^{m} \frac{(-1)^k B_k}{k(k-1)n^{k-1}} + O \left( \frac{1}{n^m} \right).</math> Taking the exponential of both sides and choosing any positive integer <math>m</math>, one obtains a formula involving an unknown quantity <math>e^y</math>. For {{math|''m'' {{=}} 1}}, the formula is <math display=block>n! = e^y \sqrt{n} \left( \frac{n}{e} \right)^n \left( 1 + O \left( \frac{1}{n} \right) \right).</math> The quantity <math>e^y</math> can be found by taking the limit on both sides as <math>n</math> tends to infinity and using [[Wallis product|Wallis' product]], which shows that <math>e^y=\sqrt{2\pi}</math>. Therefore, one obtains Stirling's formula: <math display=block>n! = \sqrt{2 \pi n} \left( \frac{n}{e} \right)^n \left( 1 + O \left( \frac{1}{n} \right) \right).</math>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Stirling's approximation
(section)
Add topic