The calculation of factorials $n!$ can be quite difficult when $n$ is large. James Stirling (1692 - 1770) developed a formula which helps to approximate the factorial. The approximation is quite good - for $n=10$ the formula generates a value differing from the correct one only by $1$%, for $n=100,$ the error is even $0.1$%.

# Theorem: Approximation of Factorials Using the Stirling Formula

The factorial $n!$ can be asymptotically approximated by the following formula: $$n!\sim\sqrt{2\pi n}\left(\frac ne\right)^n,$$ where $e$ is the Euler's constant $e\approx 2.71828\ldots$ and $\pi$ is the number pi $\pi\approx 3.141592653\ldots.$

The approximation error is given by the inequation $$\sqrt{2\pi n}\left(\frac ne\right)^n < n! < \sqrt{2\pi n}\left(\frac ne\right)^n\exp\left(\frac{1}{12(n-1)}\right).$$

Proofs: 1

Thank you to the contributors under CC BY-SA 4.0!

Github:

### References

#### Bibliography

1. Forster Otto: "Analysis 1, Differential- und Integralrechnung einer Veränderlichen", Vieweg Studium, 1983