# Probability in canonical ensemble - relation to temperature

I've got a conceptual question about the canonical ensemble. In the derivation of the probability distribution (see e.g. Kardar, Statistical physics of particles, p. 110ff) it is stated that a small system S is maintained at a constant temperature T through contact with a large reservoir R.
Now, in general, temperature is defined statistically as $\left. \frac{1}{T}=\frac{\partial S}{\partial E}\right|_{V,N}$ if we assume that $S=S(E,V,N)$. So, in general, $T=T(E,V,N)$. This follows from maximizing the total number of microstates of a system at energy $E_{tot}$ that is a combination of two subsystems which can exchange energy (see e.g. Kardar, p. 100). This maximisation is achieved when $T_1=T_2$ for the two subsystems and leads to a solution, say $E^0_1$ and $E^0_2$ for the energies contained in the two subsystems when $T_1=T_2$.
As I understand it, this does however not mean that the subsystems will always have those energies at temperature T. It just means that the subsystems are most likely to be found with energies $E^0_1$ and $E^0_2$ at temperature T since with these energy values the number of microstates of the combined system is maximised.
Now to the canonical ensemble: In this case, as my understanding goes, the two subsystems are small system S and reservoir R, $E_1$ can be taken as the energy of the small system S and $E_2$ as the energy of the reservoir R. Is it correct to say, then that the canonical probability distribution for the energies of system S: $p(E_i)=\frac{\sum_{\mu(E_i)} e^{-\beta E_i}}{Z} = \frac{g(E_i) e^{-\beta E_i}}{Z}$ can be regarded as a measure of how likely the energy of the system S is to deviate from the most likely value $E^0_S$ it "should have" given its temperature? (In the above equation, $g(E_i)$ is just the number of microstates with energy $E_i$). In particular, would the most likely energy obtained via $\left. \frac{\partial p}{\partial E_i}\right |_T$ coincide with $E^0_S$?

From Reif's derivation of the canonical ensemble, the idea in describing the smaller system S is to use the fact that the total system including both S and R is isolated and in thermal equilibrium. That is, the total energy, using the notation you have written, would be $E_T=E_1+E_2$ and it must be constant. Then we use the assumption that, for this total system, all microstates which satisfy this condition will be equally likely.
Writing down the probability $p_S(E_i)$ for the system S then is the equivalent of writing $p_R(E_T-E_i)$ for the reservoir since the reservoir must have this energy. In other words, one way to think about the distribution is that it describes the ways in which the two systems' energies could add to $E_T$, and subsequently it will describe the most likely way that the two systems will do this.