Problems

1.8. Problems#

1.1 In statistical mechanics, factorial \(n!\) of huge integer \(n\) such as the Avogadro number often appears. It is difficult to manage such a huge number even analytically. A common method to deal with such a large number is to use the Stirling’s approximation:

(1.3)#\[ \ln(n!) \approx n \ln(n) - n + \frac{1}{2} \ln(2 \pi n) \]

Then, the factorial can be approximated as

(1.4)#\[ n! \approx \sqrt{2 \pi n} \left ( \frac{n}{\text{e}} \right )^n\, . \]

To verify the accuracy of this formula, compute the ratio \(R=\displaystyle\frac{n!}{\sqrt{2 \pi n} \left ( \frac{n}{\text{e}} \right )^n}\) for \(n=10, 100\), and \(1000\). If the approximation is good, \(R\) approaches \(1\) as \(n\) increases. Verify it by computing \(R\). Note that direct calculation of \(R\) is hard but \(\ln R\) can be easily evaluated.