# Partition Function for Two Level System

I have a system with $N_s$ sites and $N$ particles, such that $N_s >> N >> 1$. If a site has no particle, then there is zero energy associated with that site. The $N$ particles occupy the $N_s$ sites and can be in energies $E_1$ or $E_0$, where $E_1 > E_0$. We also know $m$ particles have energy $E_1$ and $N-m$ have particles $E_0$.

I'm trying to come up with the partition function for this system.

I found the total energy so far to be $E = m E_1 + (N-m)E_0$. I know the partition function is $Z = \sum_{\mu_s} e^{-\beta E(\mu_s)}$, where $\mu_s$ sums over all the possible microstates.

I'm trying to use the formula:

$$(1 + x)^n = \sum_{k=0}^n {n \choose k} x^k$$

Can someone show me how this is done?

I've also figured out there are $\frac{N!}{m! (N-m)!}$ ways of getting $m$, $E_1$ states and $N-m$, $E_0$ states and $\frac{N_s!}{N! (N_s-N)!}$ ways of arranging the $N$ particles in the $N_s$ sites.

Following the advice of the nephente, this is what I get so far:

$$Z = \sum_{\mu_s}{e^{-\beta E_s}} = {N_s \choose N} \sum_{m = 0}^N {N\choose m} (e^{-\beta m E_1} + e^{-\beta (N - m) E_0}) = {N_s \choose N} (e^{-\beta m E_1} + e^{-\beta (N - m) E_0})^N$$

I thought there would be a sum of two exponentials because the particle could have energy $E_1$ or $E_0$. Are you saying we should just have:

$$Z = \sum_{\mu_s}{e^{-\beta E_s}} = {N_s \choose N} \sum_{m = 0}^N {N\choose m} e^{-\beta m E_1} = {N_s \choose N} (1 + e^{-\beta m E_1})^N$$

What about the energy $E_0$? I'm having a hard time understanding which one is right and I'm a little confused why the sum over $m$ is necesary. I thought $m$ was fixed.

Here, I am thinking of ${N_s \choose N}$ as the degeneracy for each microstate due to arranging the $N$ particles in $N_s$ sites.

Edit 2:

nephente, are you saying then that this is the correct partition function?

$$Z = \sum_{\mu_s}{e^{-\beta E_s}} = {N_s \choose N} \sum_{m = 0}^N {N\choose m} e^{-\beta N E_0} e^{-\beta m (E_1-E_0)} = {N_s \choose N} e^{-\beta N E_0} (1 + e^{-\beta m (E_1-E_0)})^N$$

$$Z = {N_s \choose N} (e^{-\beta E_0} + e^{\beta (m-1)E_0}e^{-\beta m E_1})^N$$

Also, would you mind explaining why we need to sum on $m$ some more?

• LaTeX tip: \gg and \ll give $\gg$ and $\ll$ respectively. – Emilio Pisanty Nov 11 '13 at 15:16

The number of particles with energy $E_1$ is $0\leq m \leq N$. There are $N_S\choose N$ possible ways to arrange $N$ particles on $N_S$ sites. There are $N \choose m$ ways to chose $m$ out of $N$ particles to occupy the upper level $E_1$. The other $N-m$ automatically have to occupy the low-energy state $E_0$, so there are no further combinatorics involed.
This should be enough for you to write down the partition function explicitly. (Hint: there's a sum over $m$) If you still can't make progress, I will post a more detailed answer, but I encourage you to try it for yourself first.
Edit As you stated correctly in your orginal question, the energy of a microstate with $m$ particles occupying energy $E_1$ is $$E=mE_1 + (N-m)E_0 = m(E_1-E_0)+NE_0 \equiv m\Delta E+NE_0$$ The Boltzmann-factor of such a microstate is then $$e^{-\beta E} = e^{-\beta\left(m(E_1-E_0)+NE_0\right)}$$ You might notice, that only one term in the exponent contains $m\,$! The other is a constant.
Edit 2 If i'm not gravely mistaken, your second update looks correct! Now, why the sum over $m$? According to the priciples of statistical mechanics, the canonical partition function is obtained by summing over all possible configurations, weighting with the Boltzmann factor for the corresponding energy. You could also think of it as summing over all energies and weighting with an additional factor to take the degeneracy of the energy-states into account. $$Z = \sum_{\mu_s}e^{-\beta E_s} = \sum_E g_E e^{-\beta E}$$ The coefficient $g_E$ is also called the density of states (DoS) for exactly the reason that it tells you how many microstates correspond to the energy $E$.
In your problem the energy is labeled by $m$, since this is the only variable it depends on. Thus $\sum_E \rightarrow \sum_m$ and the binomials count the degeneracy or more fancy the DoS. /Edit 2