How big are factorials?
summary
The number of digits in a large factorial can be estimated using a simplified version of Stirling's approximation. This method relies on the properties of the Gamma function and Laplace's method for approximating integrals. By taking the base-10 logarithm of the approximation, one can quickly determine the scale of enormous numbers without a computer. This approach provides a reasonably accurate result that is sufficient for most mental calculations.
key points
- The Gamma function serves as a continuous interpolation of the factorial for all positive real numbers, allowing the use of calculus to analyze factorial growth.
- Stirling's approximation is derived by applying Laplace's method to the Gamma function's integral, resulting in a formula that relates n! to the constant e and square root of 2πn.
- Calculating the number of digits involves taking the log10 of Stirling's formula, where the dominant term n * log10(n/e) provides the bulk of the estimation.
who should read it
Math enthusiasts, students, or programmers who want to understand the theoretical basis for estimating large numbers and the relationship between factorials and integrals.
discussion warm
consensus
Commenters are fascinated by the sheer scale of factorials, specifically 52!, and share various intuitive analogies to visualize these incomprehensibly large numbers. There is a strong agreement that these mathematical concepts are effective tools for blowing people's minds and demonstrating the limits of human intuition. The discussion transitions into technical implementations of calculating large factorials and the utility of Stirling's approximation in computer science and physics.
top insight
The connection between the number of permutations of a deck of cards (52!) and the complexity of sorting algorithms is a key insight. One commenter explains that since there are n! configurations for an array of n elements, representing or differentiating each configuration requires n log n bits, which fundamentally explains why the standard runtime of a basic sorting algorithm is O(n log n).
Generated by an LLM from the article and thread. Check the sources before relying on it.