Repulsive classical identical particles on a square lattice I am not sure whether it is some well-known named model in statistical physics. 
I could not find it in any standard text-book that I know of. 
Let there be $N$ identical classical particles occupying a square lattice of $2N$ sites with at most one particle per site. Let the alternate sites be names $A$ and $B$. Let $p$ be the fraction of particles on $A$-type sites and assume that for a fixed value of $p$, all configurations are equally likely. (mean field approximation?)  


*

*Then how does one calculate the entropy as a function of $p$? I guess there is some simplification that will happen if one works in the limit of $N$ being very large. (thermodynamic limit?)  


Let there be a repulsive interaction energy of $E_0$ whenever neighbouring $A$ and $B$ type sites are occupied. 


*

*In that case the claim seems to be that the average total energy $E(p)$ is given by $4NE_0p(1-p)$. (..I am not sure whether here any large $N$ limit has been taken..but I guess this too is some asymptotic answer..)


I would be glad if someone can help calculate/derive the above two bulleted questions. 
I would like to know if there is some general framework or class of models from which this comes. 


*

*Apparently the interesting thing about this model is that it has a second order phase transition.  How does one prove that? Or is it somehow supposed to be obvious? 

*Will some single unique value of $p$ get picked out in the high and low temperature limit? How does one determine that? 
For the last/above two of the questions one would obviously need to assume that the system is at a thermal equilibrium at a temperature $T$. Then I guess the value of $p$ gets determined by minimizing the ``free energy" $=F(p) = E(p) - TS(p)$. But to be able to do this calculation one would probably first need to find the answer to the first two questions in the large $N$/ thermodynamic limit. 
 A: Okay, I think I have some of it figured out.
For the first part of the problem, we need to know number of microstates if the $A$-density is $p$. We need to position $pN$ particles into $N$ $A$-sites and $(1-p)N$ particles into $N$ $B$-sites. Since these numbers are equal the total number of states is 
$$\#_{\rm states}(p) = {N \choose pN}^2$$
And so the entropy (with $k_B \equiv 1$) can be written as
$$S(p) = \log(\#_{\rm states}(p)) =　2 \log{N! \over (pN)! ((1-p)N)!} \sim $$
$$ \sim 2\left( N \log N - (pN)\log(pN) - ((1-p)N \log ((1-p)N)\right) = $$
$$ = 2N \left( p \log p - (1-p) \log (1-p) \right)$$
where we have used the Stirling approximation of the factorial $N! \sim \sqrt{2 \pi N} \left({N \over e} \right)^N$ and we discarded the square root since this isn't proportional to $N$ under logarithm.
The average energy is easily computed. First note that since $Np$ is the number of occupied sites the total energy will be $Np$ times site energy. Now, the site energy will be a sum of contributions from each edge and since the problem has lattice symmetry it will get multiplied by 4 (here I suppose you assume the problem is 2D) and since the neighboring site is occupied with probability $(1-p)$ we get $E = 4 E_0 Np (1-p)$.
One looks at the thermodynamic limit of macroscopic observables and looks for non-analyticies (these signify phase transition). The most standard quantity we look at is the free energy and its derivatives. As for proving phase-transition, now that is very hard problem and has been rigorously done only for few special models.
You are correct in your last paragraph, one can determine the equilibrium by minimizing the free energy. I'll leave this to you since it is a routine computation.
