Boltzmann distribution with interaction between particles?

First of all, I would like to apologize in advance if I make stupid mistakes. I am a mathematician and I am trying to apply the Boltzmann distribution to places where I am not sure if it is applicable (albeit I have no choice).

The situation is: I have a system which consists in a discrete line of $M$ positions in which $N$ elements are distributed with a separation of at least $D$ positions between them. The state of each element should be its position in the line. Finally, (here's the fun part) each position in the line has an associated potential (so putting an element in the position $i$ means spending $\epsilon_{i}$ units of Energy). The usual approach to this problem as far as I have seen is just assigning $p_{i} = e^{-\epsilon_{i}/kT}$, where $p_{i}$ is the probability that there is an element in the position $i$.

I don't understand this approach and I am trying to derive that new one, but I am stuck when trying to force the particles to be separated. Any insight or reference would be very much appreciated.

Edit: If it is needed, we can also say that the particles might have a velocity (i.e. they can oscillate), but they should not be able to pass through each other.

-

Sure, it's no problem to do this. The thing that has to change is that $i$ should index over all possible configurations of the $N$ elements, and the energy in the Boltzmann distribution has to be the total energy of the system.
So if $M=10$, $N=3$ and $D=2$ then, for example, $$p([1,0,0,1,0,0,1,0,0,0]) = \frac{1}{Z}e^{-\frac{\epsilon_1 + \epsilon_4 + \epsilon_7}{kT}},$$ but $$p([1,0,1,0,0,0,1,0,0,0]) = 0$$ because it's not allowed by the constraint.
To calculate the normalising factor (or "partition function") $Z$, you have to sum over all allowed configurations of the system. It isn't immediately obvious (to me) how to do that analytically in this case, but you're the mathematician so I'm sure you can find an elegant way.
Incidentally, you should be able to see that if there are no interactions between the $M$ positions then this reduces to the formula you originally quoted.
I'm glad to help. Yes, no interactions means that the probability of each of the $M$ slots being occupied is independent of whether any of the other slots are occupied. That means no restriction on the distances $D$ or on the total number of particles $N$. – Nathaniel Sep 26 '13 at 0:42