Given that
The partition function in statistical mechanics tells us the number of quantum states of a system that are thermally accessible at a given temperature
How does one interpret the statistical mechanical partition function and free energy mathematically, in terms of the sample space, analogous to the way you can interpret microstates and macrostates in terms of a probability sample space? It seems very Shannon's entropy-like. If you take the example of flipping 2 coins:
- Random experiment: Toss two coins
- Example of an Outcome: $10 = (Heads, Tails)$
- Sample space: $S = {11,10,01,00}$, $|S| = 4$
- Examples of Events: 2 Heads $= 2H = \{11\}$, $|2H| = 1$, $1H = \{10,01\}$, $|1H| = 2$, $0H = \{00\}$, $|0H| = 1$
we can translate this into the language of statistical mechanics:
- A microstate is an element of the sample space, e.g. $10$ or $01$.
- A macrostate is an event (a subset of the sample space), e.g. $1H = \{10,01\}$.
- The statistical weight (statistical probability) of a macrostate is the cardinality of the event, e.g. $|1H| = 2$.
- The equilibrium distribution is the most likely macrostate which is the macrostate with the highest statistical weight which is the event with the highest cardinality, e.g. $1H = \{10,01\}$ since $|1H| = 2$.
Finally, the Maxwell-Boltzmann distribution function $n_i$ for the coin toss is found by extremizing $$w(n) = "number \ of \ heads \ in \ n" = \tfrac{2!}{n!(2-n)!}= \tfrac{2!}{n_1!n_2!}$$ with respect to $n_i$ given the constraint equation $n_1 + n_2 = 2$, showing $n_1 = e^0 = 1$ maximizes $w$, i.e. $w(1) = |1H| = |\{10,01\}| = 2$ is the maximum. As fas as I can see, the MB distribution is a function of the total number of particles, $2$, but not the energy as there is no energy in this example.
Here we see everything interpreted mathematically, however I don't see how one does this for the partition function or for the free energy. So to ask my question:
What exactly is the partition function in this example, and what is it's meaning in general?
It sounds like it tells you how many elements are in an event for a given energy and given particle number, i.e. the cardinality of a subset of the sample space which varies as a function of the Lagrange multipliers.
What is the free energy in this example, and in general?
As a concept it seems very similar to the partition function, only it tells you how energies and particle numbers are distributed over all subsets of the sample space that we are considering, not just the most probable one, e.g. it says something about subset 0, subset 1 and subset 2. Though I'm not sure whether it works like this or whether it just relates to the most probable distribution the whole time, and says something about energies over all possible distributions (i.e. for 2, 3, 4, ... as particle numbers in the numerator of the MB distribution function given above).