Stirling's Approximation

In class we began to investigate the use of Stirling' s approximation to calculate probabilities of microstates in systems of very large numbers of particles. This short classnote will examine the validity of this approximation. Let' s start with the more precise form of the approximation, needed when we find factorials of large (merely large) numbers. The short program below will show the accuracy of Stirling' s approximation by computing the ratio between the value of N! computed using the approximation to the exact value of N!. We find : In[9]:= We see that this form of Stirling' s approximation is accurate to within 1 % for N as small as 10, and becomes more accurate as N increases. For very large values of N, we can compute the log of N! via : ln N! = N ln N-N The program below shows the accuracy of this version of Stirling's approximation for various values of N: