Chapter 6 provides a formal derivation of the various ensembles, microcanonical (NVE), canonical (NVT), Gibbs (NpT), and the grand-canonical (μVT). For each ensemble, the partition function, free energy, and statistical averages of other thermodynamic properties are derived. The relationships between these ensembles are discussed, emphasizing that averages calculated by them are the same, while the fluctuations are different, as those shown for the energy fluctuation in the NVT, NPT and the μVT ensembles. The ability to obtain the same average by different ensembles (which adds to the versatility of statistical mechanics discussed in Chapter 5) is demonstrated by treating a specific problem in several ensembles.