Statistical and Thermal Physics: Fundamentals and Applications

I m on the verge of a major breakthrough, but I m also at the point where physics ends and chemistry begins, so I ll have to drop the whole thing.
From a cartoon by Sidney Harris.
Gibbs (was) the only physicist who really understood statistical thermodynamics.
Niels Bohr
So far, we have only considered systems in which the number of particles is fixed, while energy can be exchanged with the outside world. Now we extend our analysis to the case where matter as well as energy can be exchanged. Just as a diathermal (thermally conducting) barrier allows energy to pass through in the form of heat, we can conceive of a barrier that is also permeable to matter, allowing particles to pass through. A diathermal barrier allows thermal equilibrium to be established when there is (on average) no net transfer of energy; similarly, when there is no net transfer of particles through a permeable barrier, diffusive equilibrium is established. It is not possible to have flow of particles without a flow of energy, so that a permeable barrier is also diathermal, and we assume that when there is diffusive equilibrium, there is also thermal equilibrium.
Consider two systems ? a and ? b, of fixed volume, immersed in a heat bath ? 0 at temperature T. They contain N a and N b particles respectively, and have energies U a and U b.