How to Use
Enter n:
- Input: Positive integer
- Output: Stirling approximation
- Extra: Error and ln(n!)
Accuracy
- n=1: ~8.3% error
- n=10: ~0.83% error
- n=100: ~0.083% error
- n=1000: ~0.0083% error
Why Approximate?
For large n, n! overflows computers. Stirling gives a usable formula. ln(n!) avoids overflow entirely. Used in entropy formulas, statistical mechanics, and information theory.
Step-by-Step Instructions
- 1Enter n.
- 2View Stirling approximation.
- 3Compare with exact value.
- 4Check relative error.
- 5See ln(n!) for large n.