If a system is in contact with a heat bath at temperature , the probability that it is in the th microstate, with energy , is given by the Boltzmann distribution:
The normalisation constant is found by saying that the probability that the system is in some
microstate is one: , so
The details of the derivation are here. In outline, we consider the system and heat reservoir together as a larger, isolated system with a total energy which is fixed but which can be differently distributed between its two parts. If we specify the microstate (and energy) of , the probability of this depends of the number of microstates of the reservoir with the remaining energy. This decreases with decreasing reservoir energy in just the way given by the Boltzmann distribution.
For an ideal gas or paramagnet, where interactions between atoms can be ignored, any particle can be considered as the system and all the others form the reservoir . In that case the Boltzmann distribution holds for the state of an individual atom (hence typical first-year applications like the variation of pressure with height in the atmosphere, and the distribution of velocities of atoms in a gas).
For the spin- paramagnet in a magnetic field there only are two energy states; and . So
In the whole system of atoms, the number of up-spins on average will be
,
so we have
This is exactly consistent with the expression we found for the temperature of the isolated system with a fixed number of up-spins (and hence energy).
Note that in thermal equilibrium, the average number of particles in the higher energy state is always less than the number in the lower energy state. As the temperature tends to infinity the ratio approaches, but never exceeds, one.
References