  A pedagogical approach for deriving the statistical mechanical partition
function, in a manner that emphasizes the key role of entropy in connecting the
microscopic states to thermodynamics, is introduced. The connections between
the combinatoric formula $S= k \ln W$ applied to the Gibbs construction, the
Gibbs entropy, $S = -k \sum\limits_i p_i \ln p_i$, and the microcanonical
entropy expression $S= k \ln \Omega$ are clarified. The condition for
microcanonical equilibrium, and the associated role of the entropy in the
thermodynamic potential is shown to arise naturally from the postulate of equal
{\itshape a priori} states. The derivation of the canonical partition function
follows simply by invoking the Gibbs ensemble construction at constant
temperature and using the first and second law of thermodynamics (\emph{via}
the fundamental equation $dE = TdS - PdV + \mu dN$) that incorporate the
conditions of conservation of energy and composition without the needs for
explicit constraints; other ensemble follow easily. The central role of the
entropy in establishing equilibrium for a given ensemble emerges naturally from
the current approach. Connections to generalized ensemble theory also arise and
are presented in this context.
