In a canonical ensemble, the probability of occupying specific microstates is influenced by energy, leading to unequal probabilities for different microstates within the system. This contrasts with the total system plus environment, where all microstates are equally probable. The canonical ensemble is motivated by placing the system in a larger heat bath, allowing energy exchange, which results in a calculation of microstates for both the system and the heat bath. The entropy of the total system can be expressed in terms of the heat bath and the subsystem, with the approximation that most energy resides in the heat bath. Ultimately, the probability of the subsystem having a specific energy is related to the number of states in the composite system, demonstrating the dependence on temperature and energy.