Exercises — Canonical ensemble — partition function Z
Reminders we will use repeatedly (all derived in the parent note):
Level 1 — Recognition
Goal: read a system and write down without differentiating anything yet.
Exercise L1.1
A single spin sits in a magnetic field. It has exactly two microstates: "down" with energy and "up" with energy . Write and the probability of "up".
Recall Solution L1.1
What we do: sum one Boltzmann factor per microstate. There are two. Why ? Because is literally the average of the two exponentials times 2 — it is the natural shape whenever two states sit symmetrically about zero energy. Probability of "up": Sanity check: as () the term crushes the other, so — the spin freezes into its lowest energy . ✓
Exercise L1.2
A particle has three energy levels: , , (the last two are a degenerate pair — two distinct microstates that happen to have the same energy ). Write two ways: as a sum over microstates, and using degeneracy .
Recall Solution L1.2
Sum over microstates (three terms, one per microstate): Using degeneracy (the count of microstates sharing energy ): here at energy , and at energy . They agree. Degeneracy is just bookkeeping: it lets you write one term for each energy instead of one term for each microstate.
Level 2 — Application
Goal: turn into a real thermodynamic number by differentiating.
Exercise L2.1
For the spin of L1.1 (), compute and check both temperature limits.
Recall Solution L2.1
What we do: apply . Why differentiate ? Because — the derivative of is , divided by gives . So: Limits:
- (): , so ✓ (locked in the ground state ).
- (): , so ✓ (both states equally likely, average of and is zero).
See the shape of vs :

Exercise L2.2
For the two-level system with energies and (), find the heat capacity and describe its shape.
Recall Solution L2.2
From the parent, . Differentiate w.r.t. . It is cleaner to use so .
Chain rule to :
Shape (the Schottky anomaly): at both (nothing to excite) and (both states already full), with a bump in between near . A finite level gap always makes a hump, not a plateau.

Level 3 — Analysis
Goal: connect to fluctuations, free energy, and entropy — read physics off the maths.
Exercise L3.1
For the two-level system (), verify the fluctuation–dissipation relation by computing directly from .
Recall Solution L3.1
Direct variance. With , , : since . Compare with . From L2.2, . Then: (multiply top and bottom by ). They match. ✓ Energy fluctuations are heat capacity in disguise: a system that soaks up heat easily is one whose energy jitters a lot.
Exercise L3.2
For the classical 1D harmonic oscillator, . Find , , and from , and confirm .
Recall Solution L3.2
Free energy: Entropy . Write with : Energy from : The log terms cancel, leaving ✓ — matching the equipartition result (2 quadratic degrees of freedom ).
Level 4 — Synthesis
Goal: combine factorization, indistinguishability, and differentiation to build a full result.
Exercise L4.1
distinguishable independent spins, each as in L1.1 (). Write , then for the whole system, and its low- behaviour.
Recall Solution L4.1
Factorization. Independent subsystems ⇒ total energy is a sum ⇒ Boltzmann factor of a sum is a product ⇒ the sum over all configurations factorizes: Total energy — note , so: Exactly copies of the single-spin answer, as it must be — independent parts add. Low-: , , (all spins in the ground state). ✓
Exercise L4.2
indistinguishable classical ideal-gas atoms in a box of volume , single-particle partition function where is the thermal wavelength. Using and Stirling's approximation , derive the pressure and show it gives the ideal gas law.
Recall Solution L4.2
Why ? Swapping two identical atoms is not a new microstate; the plain product overcounts by . Dividing fixes it and (as the parent notes) resolves the Gibbs paradox. Free energy: . Pressure . Only the piece of depends on (recall and has no ): The ideal gas law drops straight out. The never touched , so it does not change — but it is essential for a correct, extensive entropy.
Level 5 — Mastery
Goal: build a new result end-to-end and interpret a limit no worked example showed you.
Exercise L5.1
A quantum harmonic oscillator has energy levels for (infinitely many, evenly spaced by ). (a) Sum the geometric series to get . (b) Find . (c) Show it reduces to the classical at high and to the zero-point energy at .
Recall Solution L5.1
(a) Sum . Pull out the constant offset: Why a geometric series? Each term is a fixed ratio times the previous — that is exactly what a geometric series is, and whenever (true here since ). So: (the second form uses ). (b) Energy. . Since : (c) Limits:
- (): , so — the zero-point energy, a purely quantum floor that the classical oscillator (Example 2) never had. ✓
- (): use for small , so , giving — the classical equipartition result. ✓
The full curve interpolates smoothly between these two, freezing out below :

Exercise L5.2
For that quantum oscillator, evaluate numerically (in units of ) at , and separately confirm the number of thermally accessible states is not what literally equals (steel-manning the "" myth).
Recall Solution L5.2
Number: at , So : above the zero-point , since some higher levels are populated, but well below the classical ... wait — here , and the quantum answer exceeds it: the zero-point energy pushes the quantum oscillator above the naive classical value at this cold temperature. That gap is the quantum correction. The myth: here , which is less than 1 — yet the system is not "in fewer than one state". is a weighted sum of Boltzmann factors, not a probability; with the offset baked in, its numerical value can even dip below 1. Probabilities are , each safely in .
Recall ladder
Which ensemble fixes and lets fluctuate?
Formula for average energy from ?
How do energy fluctuations relate to heat capacity?
Why divide by for a classical gas?
What is in terms of ?
Zero-point energy of a quantum oscillator at ?
Related: Boltzmann distribution · Microcanonical ensemble · Grand canonical ensemble — grand partition function · Heat capacity and fluctuations · Helmholtz free energy F · Equipartition theorem.