Back to the on-screen lesson ·

The Boltzmann factor and the partition function

The probability of a state in contact with a reservoir, $e^{-E/kT}/Z$, derived from the reservoir's entropy; partition functions of small systems; and the factor at work in flames, stars and the atmosphere.

Paper packet. Every task here also exists on screen, where it is checked automatically; answers written on paper are not assessed by Nydus. When you are back at a device, enter your answers there.

1. What you will learn

By the end of this lesson you will be able to derive the Boltzmann factor, find the ratio of populations of two levels including degeneracy, build a partition function and the probabilities of every state, and apply the factor to atoms, molecules and the atmosphere.

2. What you already have

You know entropy as $k\ln\Omega$, temperature as $1/T = \partial S/\partial U$, and that in an isolated system every microstate is equally probable. This lesson asks a different question: not about an isolated system, but about a small system — one atom, one molecule, one spin — sitting in contact with a large reservoir at a fixed temperature.

3. Words for this lesson

TermWhat it means
ReservoirA system so large that the energy the small system exchanges with it does not change its temperature.
Boltzmann factor$e^{-E/kT}$, the relative probability of a state of energy $E$.
Partition function$Z = \sum_s e^{-E(s)/kT}$, the sum of the Boltzmann factors of all states.
Boltzmann distribution$P(s) = e^{-E(s)/kT}/Z$.
Degeneracy$g$, the number of distinct states sharing one energy level.
Thermal energy scale$kT$, about $0.026$ eV at room temperature.
Scale height$H = kT/mg$, the height over which the atmosphere's density falls by a factor of $e$.

4. The probability of a state falls exponentially with its energy

Put a small system in contact with a reservoir at temperature $T$, the two together isolated with total energy $U_0$. When the small system is in a particular state $s$ with energy $E(s)$, the reservoir has energy $U_0 - E(s)$, and by the fundamental assumption the probability of state $s$ is proportional to the number of microstates the reservoir then has:

$$P(s) \propto \Omega_R(U_0 - E(s)) = e^{S_R(U_0 - E(s))/k}.$$

The reservoir is large, so expand its entropy to first order: $S_R(U_0 - E) \approx S_R(U_0) - E\,\partial S_R/\partial U = S_R(U_0) - E/T$. The first term is the same for every state, and

$$P(s) = \frac{e^{-E(s)/kT}}{Z}, \qquad Z = \sum_s e^{-E(s)/kT}.$$

The Boltzmann factor $e^{-E/kT}$ sets the relative probability of each state, and the partition function $Z$ makes the probabilities add to one. A state's chance depends on how its energy compares with $kT$: at $E = kT$ the factor is $0.37$, at $5kT$ it is $0.0067$, at $20kT$ it is $2 \times 10^{-9}$.

For two states the partition function cancels:

$$\frac{P(s_2)}{P(s_1)} = e^{-[E(s_2) - E(s_1)]/kT}.$$

If an energy level contains $g$ distinct states, its population carries a factor $g$: $N_2/N_1 = (g_2/g_1)e^{-\Delta E/kT}$.

Another way: picture

Picture the reservoir as a bank holding a vast sum and the small system as a customer who may withdraw any amount. The bank has more ways to arrange its money the more it keeps, and each dollar withdrawn cuts its arrangements by the same factor. So large withdrawals are exponentially rarer than small ones. Temperature sets how steep that cut is: a hot reservoir hardly notices a withdrawal, a cold one notices it a great deal.

Another way: steps

  1. List the states and their energies, with degeneracies.
  2. Compute each Boltzmann factor $e^{-E/kT}$, measuring energies from the lowest.
  3. For a ratio of two levels, use $(g_2/g_1)e^{-\Delta E/kT}$ and stop.
  4. For probabilities, add all the factors to get $Z$ and divide.
  5. Check: probabilities add to one and fall as the energy rises.

5. The method, step by step, and how to check it

  1. Choose the zero of energy. Only differences matter, since shifting every energy by the same amount multiplies every factor, and $Z$, by the same constant. Measuring from the lowest state keeps the numbers tidy.
  2. Put $E$ and $kT$ in the same unit. In electronvolts, $k = 8.617 \times 10^{-5}$ eV/K and $kT = 0.0259$ eV at $300$ K; in joules, $k = 1.381 \times 10^{-23}$ J/K.
  3. Compute $E/kT$ first, then the exponential. The exponent is the whole story: a gap of $0.05$ eV at room temperature is $1.93kT$ and gives a factor of $0.14$; the same gap at $150$ K is $3.87kT$ and gives $0.021$.
  4. Include degeneracies when a level has several states.
  5. Normalize by the partition function when probabilities rather than ratios are wanted.

Checks. The lowest state is always the most probable single state at positive temperature, though a highly degenerate level can hold more of the population. As $T \to 0$ everything falls into the lowest state; as $T \to \infty$ every state becomes equally probable. And the probabilities from $Z$ must add to one exactly.

6. Where the Boltzmann factor shows up

The same factor governs a remarkable range of phenomena.

In each case the numbers work the same way: find the energy that matters, divide by $kT$, and exponentiate.

7. The partition function is more than a normalization

It is tempting to treat $Z$ as a mere bookkeeping constant, but it encodes everything about the system's thermal behavior. The average energy is

$$\bar{E} = \frac{1}{Z}\sum_s E(s)e^{-\beta E(s)} = -\frac{\partial \ln Z}{\partial \beta}, \qquad \beta = \frac{1}{kT},$$

which the next lesson uses to derive heat capacities. The Helmholtz free energy is $F = -kT\ln Z$, from which entropy, pressure and chemical potential follow by differentiation. Computing $Z$ for a system — a sum over its quantum states — is therefore the main task of statistical mechanics, and the rest of this course is a series of partition functions: for an oscillator, a gas, a solid, and a gas of photons.

8. Why room temperature leaves most atoms unexcited

The energy scales of physics make the Boltzmann factor a sharp switch. At room temperature $kT \approx 0.026$ eV, about $1/40$ of an electronvolt. Molecular rotations have level spacings of about $0.0001$ to $0.001$ eV, far below $kT$, so they are fully active; vibrations have spacings of $0.1$ to $0.5$ eV, several times $kT$, so they are mostly frozen; electronic excitations of atoms need a few electronvolts, a hundred times $kT$, so the factor is around $e^{-100} \approx 10^{-44}$ and essentially no atom in the air is electronically excited. That hierarchy is the quantum explanation of the heat capacities met at the start of the course: equipartition applies to the modes whose quanta are small beside $kT$, and the rest sit in their ground states.

9. Temperature as the steepness of the exponential

The Boltzmann factor gives temperature a second, very concrete meaning. Plot the logarithm of a state's probability against its energy: the Boltzmann distribution makes it a straight line with slope $-1/kT$. A cold system has a steep line, so every extra unit of energy costs a large factor in probability, and nearly everything sits in the lowest states. A hot system has a shallow line, and high-energy states are only mildly disfavored.

This is how temperatures are measured where no thermometer can go. Astronomers measure the relative populations of several levels of an atom or molecule from the strengths of its spectral lines, plot the logarithm of each population, divided by its degeneracy, against the level's energy, and read the temperature from the slope. The same Boltzmann plot is used in plasma physics, in combustion research and in the interstellar clouds where stars are born. If the points do not lie on a straight line, the system is not in thermal equilibrium, and that too is information: a laser, a fluorescent tube and the gas around a young star are all examples of populations that no single temperature describes.

The straight line also explains why only the ratio $E/kT$ ever appears. Doubling every energy and doubling the temperature leaves every probability unchanged, so physics at a temperature of a few kelvin, where nuclear spins matter, looks the same on this plot as physics at thousands of kelvin, where atoms are excited, with the axes relabeled.

10. In the world: why a sodium streetlight and a salted flame glow yellow

Sprinkle table salt on a gas flame and it flashes yellow; the old low-pressure sodium streetlights of American highways glowed the same color. The light comes from sodium atoms dropping from their first excited level, $2.10$ eV up, which emits the famous yellow line at $589$ nm.

In a flame at $2500$ K, $kT = 0.215$ eV and $\Delta E/kT = 9.75$. The Boltzmann factor is $e^{-9.75} = 5.8 \times 10^{-5}$, and with three states in the excited level to one in the ground level, about $175$ atoms in a million are excited at any moment. Few as that is, each excited atom emits within about $16$ ns and is re-excited by collisions, so a pinch of salt produces a bright glow.

Flame photometers in hospital laboratories used this to measure sodium and potassium in blood. Because the excited fraction depends on temperature as $e^{-\Delta E/kT}$, a flame $100$ K hotter makes the signal about $45$ percent brighter, which is why the instruments control their flames so carefully, or compare against a reference element in the same flame.

11. In the world: the thinning air of the Rockies

The barometric formula is the Boltzmann factor applied to gravity. A nitrogen molecule at height $h$ has extra energy $mgh$, so the density falls as $e^{-h/H}$ with scale height $H = kT/mg \approx 8.2$ km at $270$ K.

In Denver, $1.6$ km up, the density is $e^{-1.6/8.2} = 0.82$ of its sea-level value; in Leadville, Colorado, at $3.1$ km, it is $0.68$; at the $4.4$ km summit of Mount Whitney, $0.58$. Each breath there carries about forty percent less oxygen, which is why climbers acclimatize and why baseballs fly about ten percent farther at Coors Field, where the thinner air exerts less drag.

The formula is approximate because the atmosphere is not at one temperature — it cools by about $6.5$ K per kilometer in the lower atmosphere — and because air is a mixture. Heavier molecules have a smaller scale height, so in a perfectly still atmosphere the heavier gases would concentrate lower down. The turbulent lower atmosphere mixes them evenly, but above about $100$ km, where mixing stops, the separation by the Boltzmann factor really does take over and the air becomes lighter with height.

12. A high-energy state is rare, not forbidden

It is common to picture thermal excitation as a threshold: below some temperature an excited state is empty, above it the state fills. The Boltzmann factor has no threshold. At every positive temperature every state has some probability, which falls smoothly and exponentially as its energy rises in units of $kT$. What looks like a threshold is just how fast the exponential changes: a factor of $e^{-40}$ is not zero, but it is $4 \times 10^{-18}$, and in a mole of atoms it still means about a million excited ones.

A second trap is to forget degeneracy. The factor $e^{-E/kT}$ is the probability of one state. A level containing many states can hold more of the population than a lower level with few states, which is how the higher rotational levels of a gas, with their growing degeneracies, end up more populated than the lowest one.

13. Two states of a molecule

  1. Two states of a molecule differ by $0.05$ eV. Find $kT$ at $300$ K.

    $kT = 8.617 \times 10^{-5} \times 300 = 0.02585\ \text{eV}$

    Room-temperature thermal energy.

  2. Find the gap in units of $kT$.

    $\dfrac{\Delta E}{kT} = \dfrac{0.05}{0.02585} = 1.934$

    The exponent that decides everything.

  3. Write the ratio of probabilities.

    $\dfrac{P_2}{P_1} = e^{-1.934}$

    The partition function cancels in a ratio.

  4. Evaluate the expression.

    $\dfrac{P_2}{P_1} \approx 0.145$

    About one molecule in seven is in the upper state for every one in the lower.

  5. Find the probability of the upper state if these are the only two.

    $P_2 = \dfrac{0.145}{1 + 0.145} \approx 0.127$

    Normalize by the partition function $Z = 1 + e^{-1.934}$.

14. A three-level system

  1. A system has states at $0$, $\epsilon$ and $2\epsilon$ with $e^{-\epsilon/kT} = 0.5$. Write the Boltzmann factors.

    $1, \quad 0.5, \quad 0.5^2 = 0.25$

    Doubling the energy squares the factor.

  2. Add them for the partition function.

    $Z = 1 + 0.5 + 0.25 = 1.75$

    The sum over all states.

  3. Find each probability.

    $P_0 = \dfrac{1}{1.75} = 0.571, \quad P_1 = \dfrac{0.5}{1.75} = 0.286, \quad P_2 = \dfrac{0.25}{1.75} = 0.143$

    Factor over the sum.

  4. Check that they add to one.

    $0.571 + 0.286 + 0.143 = 1.000$

    Normalization.

  5. Find the average energy.

    $\bar{E} = 0 \times 0.571 + \epsilon \times 0.286 + 2\epsilon \times 0.143 = 0.571\epsilon$

    Each energy weighted by its probability.

  6. Find what $kT$ is in units of $\epsilon$.

    $e^{-\epsilon/kT} = 0.5 \quad\Rightarrow\quad \dfrac{\epsilon}{kT} = \ln 2 \quad\Rightarrow\quad kT = 1.44\epsilon$

    At this temperature the system is warm enough to reach its upper states often.

15. Why the Sun's hydrogen lines are faint

  1. Hydrogen's $n = 2$ level lies $10.2$ eV above $n = 1$. Find $kT$ at the Sun's surface, $5800$ K.

    $kT = 8.617 \times 10^{-5} \times 5800 = 0.500\ \text{eV}$

    Hot by everyday standards, but small beside atomic energies.

  2. Find the gap in units of $kT$.

    $\dfrac{\Delta E}{kT} = \dfrac{10.2}{0.500} = 20.4$

    A large exponent.

  3. Evaluate the Boltzmann factor.

    $e^{-20.4} = 1.37 \times 10^{-9}$

    Each individual excited state is very rarely occupied.

  4. Count the states in each level.

    $g_1 = 2, \qquad g_2 = 8$

    The number of states in level $n$ is $2n^2$, counting spin.

  5. Multiply by the degeneracy ratio.

    $\dfrac{N_2}{N_1} = \dfrac{8}{2} \times 1.37 \times 10^{-9} = 5.5 \times 10^{-9}$

    Four times as many states to be in, each as rare as before.

  6. Say what it means for the spectrum.

    $\text{about 5 atoms in a billion in } n = 2$

    The visible Balmer absorption lines start from $n = 2$, so only this tiny fraction can produce them.

  7. Compare with a hotter star at $10\,000$ K.

    $\dfrac{N_2}{N_1} = 4e^{-10.2/0.862} = 4e^{-11.8} = 3.0 \times 10^{-5}$

    Five thousand times more: the Balmer lines are strongest in stars near $10\,000$ K, and the Boltzmann factor is why.

16. Your turn: a spin has two states $2.0 \times 10^{-4}$ eV apart. At $4.0$ K, what is the ratio of upper to lower?

  1. Find the thermal energy $kT$.

    $kT = 8.617 \times 10^{-5} \times 4.0 = 3.45 \times 10^{-4}\ \text{eV}$

    Thermal energy at liquid-helium temperature.

  2. Find the exponent.

    $\dfrac{\Delta E}{kT} = \dfrac{2.0 \times 10^{-4}}{3.45 \times 10^{-4}} = 0.580$

    The gap is comparable with $kT$.

  3. Your turn: work this step out. Its working is at the end of the packet.

    Evaluate the ratio.

17. Guided practice

At temperature $T$ the population of an excited state is $\dfrac{1}{4}$ of the ground state's. The temperature is doubled. What is the ratio now?

18. Guided practice

Complete the worked solution: a system has states of energy $0$, $\epsilon$ and $2\epsilon$, and $e^{-\epsilon/kT} = 0.2$. Find the partition function and the average energy in units of $\epsilon$.

  1. Square the factor for the top state.

    $e^{-2\epsilon/kT} = (0.2)^2 =$ q

    Twice the energy, the factor squared.

  2. Add the three factors.

    $Z = 1 + 0.2 + x^2 =$ z

    The partition function sums every state's factor.

  3. Weight each energy by its factor and add.

    $0 \times 1 + 1 \times 0.2 + 2 \times x^2 =$ e

    In units of $\epsilon$; dividing this by $Z$ gives the average energy.

19. Guided practice

A system is in contact with a reservoir at $218$ K. Match each quantity to its expression.

$e^{-E/kT}$$\sum_s e^{-E(s)/kT}$$e^{-E/kT}/Z$$e^{-\Delta E/kT}$
the Boltzmann factor of a state
the partition function
the probability of a state
the ratio of two states' probabilities

20. Practice

A system has three states with energies $0$, $\epsilon$ and $2\epsilon$. At its temperature, $e^{-\epsilon/kT} = 0.5$. Fill in each state's Boltzmann factor and probability, the probabilities to four decimal places.

Boltzmann factorprobability
energy $0$
energy $\epsilon$
energy $2\epsilon$

21. Practice

Two states of a molecule differ in energy by $0.025$ eV. At $300$ K, what is the ratio of the upper state's probability to the lower's? Use $k = 8.617 \times 10^{-5}$ eV/K.

Answer:

22. Practice

Sodium's first excited level lies $2.10$ eV above its ground state and has three times as many states. In a flame at $3000$ K, how many sodium atoms per million are in the excited level? Use $k = 8.617 \times 10^{-5}$ eV/K.

Answer:

23. Somewhere new

Treat the atmosphere as nitrogen at a uniform $270$ K, for which $kT/mg = 8.176$ km. What is the density of air at Leadville, Colorado, $3.1$ km up, as a fraction of its sea-level value?

Answer:

24. Lesson test

Lesson test: one question per skill, one attempt each, no hints. Your answers are checked when you submit.

25. Test question

A system has three states with energies $0$, $\epsilon$ and $2\epsilon$. At its temperature, $e^{-\epsilon/kT} = 0.1$. Fill in each state's Boltzmann factor and probability, the probabilities to four decimal places.

Boltzmann factorprobability
energy $0$
energy $\epsilon$
energy $2\epsilon$

26. What you can do now

You can find the probability of any state of a system at a known temperature. Explain to someone why a hot flame excites only a few sodium atoms in a million, yet still glows brightly.

Working for the steps left to you

16. Your turn: a spin has two states $2.0 \times 10^{-4}$ eV apart. At $4.0$ K, what is the ratio of upper to lower?, step 3

$e^{-0.580} \approx 0.56$

Both states well populated.