# How is partition function related to ordinary generating function?

Ordinary generating function can be used to solve combinatorial enumeration problems.

Now if the energy levels are discrete, say $g_i$, and if one want to count how many ways one can add up $g_i$ to get an energy level $G$, the ordinary generating function can be written as $$\sum_{n_i\ge0} x^{\sum_i g_in_i}$$Where $n_i$ is the number of particles in energy level $g_i$, and the number of ways to get energy level $G$ can be read off as the coefficient of the term $x^{G}$ (This is the same as Polya's coin change problem in combinatorics).

If you collect the terms by total number of particles, and for system with only one particle, you get $Z =\sum x^{g_i}$, now you can get the number of ways n particles form a system of energy G by read off the coefficient of the $x^{G}$ term of the function $Z^n$.

And if you write $x$ as $e^{-\beta}$, $Z$ becomes partition function, is there any other relationships?

• possible duplicate physics.stackexchange.com/q/174150 – gatsu Apr 20 '15 at 21:07
• @gatsu moment generating function and exponential generating function are related but not the same – Ziqian Xie Apr 20 '15 at 21:22
• @gatsu I made a mistake by saying it was exponential generating function before, it should be ordinary generating function. – Ziqian Xie Apr 20 '15 at 22:21
• One thing I found out was that OGF and EGF are related by Laplace transform, and for an EGF $F(x)$, $\exp(F(x))$ is the set forming by elements of original combinatorial object, so taking logarithm is the inverse of this operation. So log-partition function might can be seen as generating function for single elements of system? – Ziqian Xie Apr 26 '15 at 12:32