## You are here

HomeStirling's approximation

## Primary tabs

# Stirling’s approximation

Stirling’s formula gives an approximation for $n!$, the factorial function. It is

$n!\approx\sqrt{2n\pi}n^{n}e^{{-n}}$ |

We can derive this from the gamma function. Note that for large $x$,

$\Gamma(x)=\sqrt{2\pi}x^{{x-\frac{1}{2}}}e^{{-x+\mu(x)}}$ | (1) |

where

$\mu(x)=\sum_{{n=0}}^{\infty}\left(x+n+\frac{1}{2}\right)\ln\left(1+\frac{1}{x+% n}\right)-1=\frac{\theta}{12x}$ |

with $0<\theta<1$. Taking $x=n$ and multiplying by $n$, we have

$n!=\sqrt{2\pi}n^{{n+\frac{1}{2}}}e^{{-n+\frac{\theta}{12n}}}$ | (2) |

Taking the approximation for large $n$ gives us Stirling’s formula.

There is also a big-O notation version of Stirling’s approximation:

$n!=\left(\sqrt{2\pi n}\right)\left(\frac{n}{e}\right)^{n}\left(1+\mathcal{O}% \left(\frac{1}{n}\right)\right)$ | (3) |

We can prove this equality starting from (2). It is clear that the big-O portion of (3) must come from $e^{{\frac{\theta}{12n}}}$, so we must consider the asymptotic behavior of $e$.

First we observe that the Taylor series for $e^{x}$ is

$e^{x}=1+\frac{x}{1}+\frac{x^{2}}{2!}+\frac{x^{3}}{3!}+\cdots$ |

But in our case we have $e$ to a vanishing exponent. Note that if we vary $x$ as $\frac{1}{n}$, we have as $n\longrightarrow\infty$

$e^{x}=1+\mathcal{O}\left(\frac{1}{n}\right)$ |

Related:

MinkowskisConstant, AsymptoticBoundsForFactorial

Synonym:

Stirling's formula, Stirling's approximation formula

Type of Math Object:

Theorem

Major Section:

Reference

Groups audience:

## Mathematics Subject Classification

68Q25*no label found*30E15

*no label found*41A60

*no label found*

- Forums
- Planetary Bugs
- HS/Secondary
- University/Tertiary
- Graduate/Advanced
- Industry/Practice
- Research Topics
- LaTeX help
- Math Comptetitions
- Math History
- Math Humor
- PlanetMath Comments
- PlanetMath System Updates and News
- PlanetMath help
- PlanetMath.ORG
- Strategic Communications Development
- The Math Pub
- Testing messages (ignore)

- Other useful stuff

## Recent Activity

3:56 pm

new question: Harshad Number by pspss

Sep 14

new problem: Geometry by parag

Aug 24

new question: Scheduling Algorithm by ncovella

new question: Scheduling Algorithm by ncovella

new question: Harshad Number by pspss

Sep 14

new problem: Geometry by parag

Aug 24

new question: Scheduling Algorithm by ncovella

new question: Scheduling Algorithm by ncovella