TechTorch

Location:HOME > Technology > content

Technology

Stirlings Approximation and the Comparison of n! and ( n^n )

May 31, 2025Technology3745
Stirlings Approximation and the Comparison of n! and ( n^n ) Stirlings

Stirling's Approximation and the Comparison of n! and ( n^n )

Stirling's approximation is a powerful tool in mathematics, particularly in the estimation of factorials. It provides a way to approximate the factorial of a number ( n ) as follows:

n! (sim) (sqrt{2 pi n} left(frac{n}{e}right)^n)

This approximation reveals that the factorial function grows rapidly but differs significantly from ( n^n ). To delve into this, let's first compare the factorial and the power form of ( n ).

Comparing n! and ( n^n )

Considering the Stirling's approximation for ( n! ), we have:

n! (sim sqrt{2 pi n} left(frac{n}{e}right)^n)

This indicates that ( n! ) is approximately ( left(frac{n}{e}right)^n ) multiplied by a factor that grows like ( sqrt{n} ).

To compare ( n! ) and ( n^n ), we can write:

(frac{n!}{n^n} sim frac{sqrt{2 pi n} left(frac{n}{e}right)^n}{n^n} sqrt{2 pi n} left(frac{1}{e}right)^n)

As ( n ) increases, ( left(frac{1}{e}right)^n ) tends to 0, while ( sqrt{2 pi n} ) grows much slower than ( n^n ). Therefore, we can conclude that:

(frac{n!}{n^n} to 0 quad text{as} quad n to infty)

Stirling's Approximation in Detail

Stirling's approximation is given as:

n! (sqrt{2 pi n} left(frac{n}{e}right)^n left(1 frac{1}{12n} frac{1}{288n^2} - cdots right))

Ramanujan provided a remarkable formulation of Stirling's approximation:

n! (sqrt{pi} left(frac{n}{e}right)^n left(1 frac{8n^3 2n^2 n}{30n^3} cdots right)^{1/6})

with ( 0

Understanding the Approximation

Stirling's approximation is an approximation and not an exact equality, as higher-order terms are involved. For a large odd number ( n 2m - 1 ), we can provide a simpler understanding of why ( n! ) is far less than ( n^n ) but still closer to ( frac{n^n}{e^n} ).

For example, consider the factorial of a large odd number ( n 2m - 1 ). Instead of multiplying ( 1 times 2 times 3 times ldots times n ) in that order, start at the middle and work outwards in pairs. Each pair ( (m-k)(m k) ) is less than ( m^2 ). Therefore:

(displaystyle n!

In fact, ( n! ) is not just less than ( n^n ), it is less than ( frac{n^n}{2^n} ). For an even smaller approximation, ( frac{n!}{n^n} ) approaches 1 as ( n ) grows large, meaning that ( n! ) is close to ( frac{n^n}{e^n} ).

Conclusion

In summary, Stirling's approximation provides a precise estimation of the factorial function, which is significantly smaller than ( n^n ) for large values of ( n ). This approximation confirms that ( n! ) is asymptotically much smaller than ( n^n ).