# Statistical Mechanics, partition function for mixing

1. Mar 8, 2016

### jin94

Hi! The following image is taken from my note in Stat Mech. Please excuse my ugly handwriting...

I copied this from my professor's note on a whiteboard, and I'm not so sure if it is correct. The equations for Z1 (partition function before mixing) and Z2 (partition function after mixing) seems to imply that Z1 is much larger than Z2 (since N!/(NA! *NB!) is a large number). However, the Z=exp(-bF) then implies that the Helmlholtz free energy before mixing is lower that after mixing, indicating that mixing is not spontaneous. This is against what I have learned so far, since mixing increases entropy and, therefore, spontaneous. Could you please clarify this for me? I have been struggling with this all day long ... thank you so much! If it is hard to read, please let me know.

This is from my note in stat mech.

2. Mar 9, 2016

### TeethWhitener

It's been years since I've done this stuff, so I might be off-base with this, but it looks to me like the problem is that you don't treat volume consistently. So you have (correctly) $N_A+N_B=N$, but you also need $V_A+V_B=V$, because otherwise, you've got box $N_A$ with volume $V$ and box $N_B$ with volume $V$ and you're trying to cram them both into box $N$ with the same volume $V$, so you're increasing the pressure in the final box (therefore it's not spontaneous--you have to do work on the system). Reworking it with $V_A+V_B=V$ gives you
$$\frac{Z_1}{Z_2} = \frac{V_A^{N_A} V_B^{N_B}}{V^N} \frac{N!}{N_A!N_B!}$$
This is kind of a gross expression that I don't want to think very hard about first thing in the morning, but if you just examine a simple case where $V_A=V_B$, then you get
$$\frac{Z_1}{Z_2} = \frac{N!}{2^N N_A!N_B!}$$
which is less than 1. To see this, notice that
$$\frac{N!}{N_A!N_B!} = \binom{N}{N_A}$$
is a binomial coefficient and recall the relation:
$$\sum_{k=0}^n \binom{n}{k} = 2^n$$
Again, I don't know if this is right, but the volume thing jumped out at me.