2

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

phntm
  • 199
  • 6
  • 4
    Look up Stirling's formula.https://en.wikipedia.org/wiki/Stirling%27s_approximation – Ethan Bolker Sep 07 '22 at 13:34
  • 1
    https://en.wikipedia.org/wiki/Stirling%27s_approximation – jcneek Sep 07 '22 at 13:34
  • 1
    See also: What is the purpose of stirling's approximation to a factorial. It should be emphasized, it is an approximation and so $x!$ and $\sqrt{(2\pi x)}(x/e)^x$ (you left the root and an $x$ out in your quote of [1]) are not identically equal. The one is clearly an integer when $x$ is, but it would be shocking if the other is, involving pi, e, and $\sqrt{2}$ like that... (I don't know that it can be proven yet though that it never is... such things are notoriously hard) – JMoravitz Sep 07 '22 at 14:11
  • thanks so much!! At first I thought there could be a typo in the journal article but as noted below Boltzmann approximates $ln(x!)$ by $xln(x) − x + 1/2 ln(2π)$ rather than $(x + 1/2)ln(x) − x + 1/2 ln(2π)$ which accounts for the discrepancy. – phntm Sep 08 '22 at 10:02

1 Answers1

1

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$.

CiaPan
  • 13,049
Dan
  • 14,978
  • 1
    Thanks so much!! This solved the mystery. It turns out that Boltzmann's isn't using Stirling's approximation exactly. "Boltzmann approximates $ln(x!)$ by $x ln(x) − x + 1/2 ln(2π)$ rather than $(x + 1/2) ln(x) − x + 1/2 ln(2π)$ as is now usual. For x >> 30 the relative difference is small." See. Id. Footnote 7. Hence the missing $x^(1/2)$. – phntm Sep 08 '22 at 09:49