Nepedia
Back to Discover
Advanced Reader
🔢

Stirling's approximation

math Maturity 11-13 Next article →

In mathematics, Stirling's approximation is a powerful tool used to estimate factorials. A factorial is the product of all positive integers up to a specific number. As these numbers increase, factorials grow at an incredibly rapid rate.

Mplwp factorial gamma stirling
Mplwp factorial gamma stirling

Because these values become so massive, calculating them exactly can be difficult. Stirling's formula provides an asymptotic approximation, meaning the estimate becomes increasingly accurate as the input value grows. It is an essential method for handling the scale of large-number mathematics.

To understand how this works, mathematicians often look at the natural logarithm of the factorial. This is useful because the logarithm of a product is the sum of the logarithms. By converting the product into a sum, one can approximate that sum using an integral. This process essentially calculates the area under a curve to estimate the total value.

Mplwp factorial gamma stirling
Mplwp factorial gamma stirling

To refine this estimate, the Euler–Maclaurin formula is applied. This formula helps account for the error between the sum and the integral by using Bernoulli numbers. This step-by-step refinement allows for a much more precise result.

There are several ways to derive or express this approximation. One common method involves using Laplace's method, which is a way to approximate integrals of certain functions. Another approach uses the Central Limit Theorem and the Poisson distribution. In this version, the Poisson distribution is shown to converge toward a normal distribution. By evaluating the density function at the mean, mathematicians can derive the same logarithmic form. These different paths all lead to the same fundamental understanding of how factorials behave.

The history of this formula involves several important mathematical figures. Abraham de Moivre first discovered a related result in 1721. His version provided an approximate rational-number expression for the natural logarithm of a specific constant. However, it was not as precise as the version we use today. In 1730, James Stirling made a major contribution in his work, Methodus Differentialis. He published this in London and proved the exact value of the constant.

Stirling error vs number of terms
Stirling error vs number of terms

This work transformed the initial discovery into a precise mathematical tool.

Stirling's approximation is highly significant in the field of computer science. It is frequently used to find the worst-case lower bound for comparison sorting. This helps researchers understand the minimum number of steps required to sort a list of data. In these applications, it is often convenient to use the binary logarithm. The formula is also used to estimate the gamma function. The gamma function is a mathematical concept that extends the idea of factorials to complex numbers. This allows the approximation to be used in much broader mathematical contexts.

One fascinating aspect of the formula is the Stirling series, which provides higher-order corrections. This series allows for even greater accuracy by adding more terms.

Stirling series relative error
Stirling series relative error

However, this is an asymptotic expansion rather than a convergent series. This means that for any specific number, adding too many terms will eventually make the accuracy worse. The error in a truncated series is typically at most the same magnitude as the first omitted term. This creates a delicate balance for mathematicians trying to achieve perfect precision.

Modern technology has also found ways to adapt these ideas for practical use. For example, Robert H. Windschitl suggested an approximation in 2002 for calculators. This version helps devices with limited memory compute the gamma function accurately. In 2007, Gergő Nemes proposed a version that is even simpler but equally precise. The famous mathematician Srinivasa Ramanujan also included related ideas in his lost notebook. These modern developments ensure that Stirling's ideas remain useful in our digital age.

600 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (3)
File:Mplwp factorial gamma stirling.svg
Mplwp factorial gamma stirling.svg
File:Stirling series relative error.svg
Stirling series relative error.svg
File:Stirling error vs number of terms.svg
Stirling error vs number of terms.svg
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.