One of the more esoteric notions in STATISTICAL MECHANICS is the concept of an ensemble. This has nothing to do with music; it goes back to the original meaning of the French word ensemble, which is a collection or gathering of things - much more general and abstract than the small band of musicians we tend to visualize. Anyway, the Statistical Mechanical `` ENSEMBLE'' is a collection of all the possible fully specified states of some system.
Of course, there are different kinds of ENSEMBLES depending upon what global constraints are in effect. For instance, the set of all possible states of an isolated system consisting of a fixed number N of ``particles''15.10 with a well defined total energy U is called a MICROCANONICAL ENSEMBLE. This is what we have been discussing so far.
The set of all possible states of a system consisting of a fixed number N of particles but in ``thermal contact'' with a much, much larger system (called a ``heat reservoir'') so that the energy U of can flow in or out of at random is called a CANONICAL ENSEMBLE.
And the set of all possible states of a system in contact with a reservoir with which it can exchange both energy (U) and particles (N) is called a GRAND CANONICAL ENSEMBLE.
If the utility of these concepts is less than obvious to you, join the club. I won't need to use them to derive the good stuff below, but now you will be able to scoff at pedants that pretend you can't understand ``Stat Mech'' unless you know what the various types of Ensembles are.