When can you substitute $w!$ for $\sqrt{2\pi}(w/e)^w$?

81 Views Asked by At

Hi in one of Boltzmann's discussions on thermal equilibrium he performs a minimization which relies on the assumption that $$x! = \sqrt{2\pi}(x/e)^x$$ or as he states it " here $x!$ and $\sqrt{2\pi}(x/e)^x$ have the same value." $[1]$

I'm just wondering when does this hold true?

Here $x$ is the number of molecules with a given kinetic energy so I am assuming this is limited to the case for very large $x$? However I'm having difficulty verifying this by calculations as it doesn't seem to hold for $x < 100$ and adding orders of magnitude becomes hard to calculate as the computer returns Inf values as opposed to actual numeric values.

It seems to be a known mathematical fact though as Boltzmann goes on to note "So for problems involving $w!$, use of a well known approximation (See Schlömilch's Comp. S. 438) amounts to substitution of $\sqrt{2\pi}(w/e)^w$ for $w!$." $[2]$

So I'm assuming this has to do with Schlömilch's series but I'm not sure exactly how it works? any insights would be much appreciated, thanks!

$[1]$ See p.1980 Entropy, 2015, 17, “On the Relationship between the Second Fundamental Theorem of the Mechanical Theory of Heat and Probability Calculations Regarding the Conditions for Thermal Equilibrium”

$[2]$ Id. p.1981

1

There are 1 best solutions below

1
On BEST ANSWER

It's called Stirling's approximation, and it's not being stated correctly. The actual formula is:

$$x! \approx \sqrt{2\pi x} \left(\frac{x}{e}\right)^x$$

The error is less than $1\%$ for $x \ge 9$, and less than 0.1% for $x \ge 84$.

and adding orders of magnitude becomes hard to calculate as the computer returns Inf values as opposed to actual numeric values.

This can be worked around by using logarithms.

$$\ln(x!) = \sum_{k=1}^{n} \ln(k)$$

$$\ln\left(\sqrt{2\pi x} \left(\frac{x}{e}\right)^x\right) = \left(x + \frac{1}{2}\right)\ln x - x + \frac{1}{2}\ln(2\pi)$$

Note that the latter is asymptotically equivalent to $\int \ln x ~dx = x\ln x - x + C$.