In this part we introduce the foundations of Statistical Physics. We begin with a simple but deep question: how can the behaviour of a gas, a magnet, or a liquid — each made of an astronomically large number of atoms — be understood from the microscopic rules governing each individual particle?
The central idea is that we do not need to track every atom. Instead, we use probability and statistics to extract the macroscopic behaviour that emerges when enormously many particles interact together. The key concepts developed here are the microstate, the macrostate, the fundamental postulate of equal probabilities, and the celebrated Boltzmann entropy .
From these foundations, the familiar quantities of thermodynamics — temperature, pressure, energy, and entropy — are given deep microscopic meaning for the first time. Special attention is given to the classical ideal gas as the paradigmatic application, which lets us derive the ideal gas law and the equipartition theorem from scratch.
This part aims to build physical intuition first, introducing mathematical tools only when they genuinely illuminate the physics, and preparing the reader for the study of the canonical and grand-canonical ensembles.
Introduction to Statistical Physics¶
Imagine you have a bottle of air sitting on your desk. Inside that bottle are roughly 1022 molecules — nitrogen, oxygen, a little argon — all flying around, bouncing off each other and off the walls, changing direction billions of times per second. If you tried to write down the position and velocity of every single molecule and track how each one evolves according to Newton’s laws, you would need more computer memory than exists on Earth, and more time than the age of the universe.
And yet, with just three numbers — temperature, pressure, and volume — you can describe that bottle of air with extraordinary precision. How is that possible?
The answer is statistical physics: the art of extracting exact macroscopic predictions from microscopic chaos, not despite the enormous number of particles, but because of it. When 1022 particles are involved, statistical fluctuations become negligibly small, and average behaviour becomes essentially certain. This is the deep reason thermodynamics works so well.
This chapter introduces the ideas, vocabulary, and first results of statistical physics. We will:
Understand the difference between microstates and macrostates.
State and explore the fundamental postulate of statistical mechanics.
Introduce phase space as the arena where statistical mechanics lives.
Define the Boltzmann entropy and understand what it really means.
Derive temperature, pressure, and the first law from statistics alone.
Apply everything to the classical ideal gas.
Resolve the Gibbs paradox and understand why particles must be treated as indistinguishable.
Microstates and Macrostates¶
The Gap Between Micro and Macro¶
The most fundamental distinction in statistical physics is the difference between a microstate and a macrostate.
A microstate is the complete, precise description of a system at the atomic level — the exact position and velocity of every single particle, at every instant. For a gas of particles in three dimensions, this is a list of numbers: three position coordinates and three momentum components per particle. The microstate changes billions of times per second as particles collide and move.
A macrostate is what we actually measure in the lab — quantities like temperature , pressure , volume , and total energy . A macrostate is specified by just a handful of numbers, regardless of whether the system contains 10 or 1023 particles.
A Warm-Up: Coins and Counting¶
Before diving into atoms and gases, let us build intuition with the simplest possible example: flipping coins.
Imagine you flip coins. Each coin can be Heads (H) or Tails (T). The microstate is the full outcome of every coin — something like HHTH. There are equally probable microstates in total.
Now suppose you only care about the total number of heads — this is the macrostate. There are only 5 possible macrostates: 0, 1, 2, 3, or 4 heads.
How many microstates correspond to each macrostate?
| Macrostate (# heads) | Number of microstates | Example microstates |
|---|---|---|
| 0 | 1 | TTTT |
| 1 | 4 | HTTT, THTT, TTHT, TTTH |
| 2 | 6 | HHTT, HTHT, HTTH, THHT, THTH, TTHH |
| 3 | 4 | HHHT, HHTH, HTHH, THHH |
| 4 | 1 | HHHH |
The macrostate with 2 heads is 6 times more likely than the macrostate with 0 heads, simply because it has 6 times as many corresponding microstates. If we observed the system at a random moment, we would almost certainly find it in the most probable macrostate.
Now scale this up: for coins, the number of microstates for 50 heads is roughly 1029, while 100 heads has just 1. For coins (the scale of real physics), the most probable macrostate is so overwhelmingly more likely than any other that it is, for all practical purposes, the only macrostate we ever observe. This is why thermodynamics is so precise.
The Fundamental Postulate¶
All Microstates Are Equally Likely¶
The entire edifice of statistical mechanics rests on one foundational assumption:
This might seem like a very bold claim. Why should we believe it? There are several reasons:
It is the most unbiased assumption. If we have no information that distinguishes one microstate from another, it is logically most honest to assign them equal probability. Any other choice would require us to explain why some microstates are preferred.
It is consistent with the equations of motion. Liouville’s theorem in classical mechanics — and its quantum analogue — shows that the density of phase-space trajectories is conserved as the system evolves. A uniform distribution over accessible microstates is therefore a stationary (time-independent) distribution, consistent with equilibrium.
It works. Every prediction derived from this postulate agrees with experiment to extraordinary precision. That is ultimately its strongest justification.
Why Systems Settle in the Most Probable Macrostate¶
Given the fundamental postulate, why do we always observe the most probable macrostate?
The answer is pure arithmetic. In a system of 1023 particles, the most probable macrostate has so many more corresponding microstates than any other macrostate that the probability of ever observing a different macrostate is not just small — it is essentially zero.
To put it concretely: if you released a gas into one half of a box, the probability that all molecules spontaneously return to the left half is — a number so tiny that even if you waited for a trillion times the age of the universe, it would almost certainly never happen.
This is the statistical origin of the second law of thermodynamics: systems evolve towards states of higher probability (higher entropy) and never spontaneously return to states of lower probability.
Phase Space: The Arena of Statistical Mechanics¶
What is Phase Space?¶
To count microstates for a continuous system (like a gas of real atoms), we need a mathematical arena. That arena is phase space.
For a single particle moving in three dimensions, we need 6 numbers to specify its state completely: three position coordinates and three momentum components . Together, these define a single point in a 6-dimensional space — the phase space of one particle.
For a system of particles, the phase space is -dimensional. A single point in this high-dimensional space specifies the complete microstate of the entire system — where every particle is and how fast it is moving.
The Energy Surface and the Energy Shell¶
For an isolated system with fixed total energy , all accessible microstates must satisfy:
where is the Hamiltonian (total energy function). This condition defines a surface in phase space — the energy surface — and the system’s trajectory is forever confined to it.
In practice, we always allow a tiny energy uncertainty (much smaller than ), so we work with a thin shell between energies and rather than an infinitely thin surface. The volume of this energy shell is the key quantity we need:
This volume counts (in a precise sense) how many microstates the system has access to. The larger , the more microstates are accessible, and — as we will see — the larger the entropy.
For a single particle of mass moving in one dimension with energy , the Hamiltonian is . The “energy surface” is just two points: . The energy shell has width at each point.
For a single particle in 3D, the energy surface in momentum space is a sphere of radius . The energy shell is a thin spherical shell of volume .
For particles, each contributes 3 momentum components. The energy surface in the -dimensional momentum space is a hypersphere of radius . Its “surface area” grows as — an astronomically large number for macroscopic .
Entropy: Counting Disorder¶
The Boltzmann Definition¶
We have seen that some macrostates are more probable than others simply because they correspond to more microstates. Boltzmann had the brilliant idea of capturing this in a single number. In 1877, he proposed:
where:
is the entropy of the macrostate,
is the number of microstates compatible with that macrostate (proportional to the phase-space volume ),
J/K is Boltzmann’s constant, which sets the scale.
This formula is engraved on Boltzmann’s tombstone in Vienna. It is one of the most important equations in all of physics.
Why the Logarithm?¶
The logarithm in is not arbitrary. It is chosen for a crucial physical reason: entropy must be additive.
If you have two independent systems A and B, their combined entropy should be (total entropy is the sum of parts). But the total number of microstates for two independent systems is the product: .
The logarithm converts this product into a sum:
Any other function of would fail this requirement.
Entropy in Everyday Terms¶
Let us build some intuition with a few everyday examples before turning to physics.
A tidy room has a very small number of arrangements (everything in exactly the right place). A messy room has an enormous number of arrangements (socks could be on the floor, the desk, the chair...). Entropy is higher for the messy room. The second law says the room will spontaneously become messier over time, never spontaneously tidier — exactly as anyone who has lived in student accommodation can confirm.
When you drop a spot of ink into a glass of water, it spreads out and mixes uniformly. The mixed state has vastly more microstates (each ink molecule could be anywhere in the full volume) than the unmixed state (each ink molecule confined to a small spot). The system moves from low entropy to high entropy. It never spontaneously unmixes.
When a gas expands from a small volume to a larger volume , each molecule has more positions available to it. With molecules, the number of accessible microstates increases by — an unimaginably large factor for any macroscopic gas. The entropy increase is .
A perfect crystal at absolute zero has just one accessible microstate: every atom is sitting at its precise lattice site, not vibrating. , so . This is the third law of thermodynamics: the entropy of a perfect crystal at absolute zero is zero.
Temperature: What Does It Really Mean?¶
Heat Flow Between Two Systems¶
We now ask: if two systems are placed in thermal contact and allowed to exchange energy, what determines how they share that energy at equilibrium?
Consider two systems, 1 and 2, with energies and and entropies and . Their total energy is fixed: . Energy can flow back and forth, but the total is conserved.
The combined system will settle into the most probable state, which means the state with the maximum total number of microstates, i.e., the state that maximises the total entropy .
When we work out the mathematics of this maximisation, we find that at equilibrium:
In other words, equilibrium requires that both systems have the same rate of change of entropy with energy. This common value is what we define as the inverse temperature:
The Physical Meaning of Temperature¶
This definition might look abstract, but it has a beautifully simple physical interpretation.
measures how rapidly the number of accessible microstates increases when you add a little energy to the system. Think of it as the system’s appetite for energy:
A system with a large (low ) has a strong appetite — adding energy dramatically increases the number of accessible microstates.
A system with a small (high ) has a weak appetite — it already has so many accessible microstates that adding more energy barely changes the count.
Heat flows from high to low $T because it increases the total entropy:**
When a hot system (small ) transfers energy to a cold system (large ), the cold system gains more entropy than the hot system loses. The total entropy increases. This process is spontaneous. The reverse — heat flowing from cold to hot — would decrease total entropy and never happens spontaneously.
The Zeroth Law of Thermodynamics¶
The definition of temperature as the quantity equalised at thermal equilibrium immediately implies the zeroth law of thermodynamics:
Pressure, Chemical Potential, and the First Law¶
Where Does Pressure Come From?¶
Just as temperature was defined by asking what is equalised when two systems can exchange energy, we can define pressure by asking what is equalised when two systems can exchange volume.
Imagine two chambers separated by a movable, thermally insulating piston. The total volume is fixed, but the piston can slide, exchanging volume between the two sides. The system maximises total entropy, which gives the equilibrium condition:
The common value of this derivative defines pressure through . Microscopically, pressure arises because moving the wall gives the particles more space to occupy — more accessible microstates — and the system pushes in the direction that increases its entropy.
Chemical Potential¶
Similarly, if two systems can exchange particles, the equilibrium condition involves the chemical potential , defined through:
Particles flow from regions of high chemical potential to low chemical potential, just as heat flows from high temperature to low temperature.
The First Law of Thermodynamics¶
Putting together the definitions of temperature, pressure, and chemical potential, we can write a single equation that expresses how the internal energy changes when the macroscopic state of the system changes:
This is the first law of thermodynamics — the conservation of energy — but written in a form that makes explicit the three ways energy can change:
Adding heat to the system increases its internal energy by increasing the entropy (increasing the number of accessible microstates). This is energy transferred randomly at the microscopic level.
Compressing the system (decreasing ) does work on it, increasing its energy. This is energy transferred systematically — by pushing the wall.
Adding particles changes the energy by . In many problems is fixed () and this term drops out, giving the simpler form .
The Second Law: Entropy Always Increases¶
The Statement¶
The second law of thermodynamics is one of the most profound statements in all of science:
From the statistical viewpoint, this is not mysterious at all. An isolated system evolves randomly through its accessible microstates. There are enormously many more microstates corresponding to the high-entropy macrostate than to any low-entropy macrostate. So the system almost always moves towards higher entropy — not because of any driving force, but simply because of the overwhelming weight of numbers.
The Arrow of Time¶
The second law gives time its direction. The microscopic laws of physics (Newton’s laws, quantum mechanics) are perfectly symmetric in time — if you filmed a single particle bouncing, you could not tell if the film was playing forwards or backwards. But if you filmed a gas expanding into a vacuum and played it backwards, the absurdity would be immediately obvious.
This asymmetry is entirely statistical. The expanding gas visits ever more probable macrostates. The reversed film would show a journey towards an astronomically improbable macrostate — possible in principle, but never observed in practice.
Free Expansion as an Example¶
A gas occupies the left half of a box. The right half is empty (vacuum). The partition is suddenly removed.
Before: all molecules confined to volume . Few accessible microstates.
After: all molecules free to move in volume . Each molecule has twice as many positions available. The number of accessible microstates increases by — an unimaginably enormous factor.
The entropy increase is:
For one mole of gas, this is about 5.8 J/K — a macroscopically measurable entropy increase. The gas never spontaneously contracts back to the left half.
The Classical Ideal Gas¶
Now we apply the full statistical mechanics framework to the most important example: the classical ideal gas. This is a gas of identical, non-interacting particles in a box of volume , with total energy .
“Non-interacting” means the particles do not push or pull on each other — they only feel the walls of the box. This is an excellent approximation for low-density gases at high temperature (like ordinary air at room conditions).
Counting Microstates¶
For the ideal gas, the total energy is just the sum of kinetic energies of all particles:
where is the momentum of particle and is its mass.
The constraint defines a hypersphere in the -dimensional momentum space with radius . Multiplying by the position space volume (each of the particles can be anywhere in the box), the total accessible phase-space volume is:
The volume of a hypersphere in dimensions with radius is , giving:
The Sackur-Tetrode Equation¶
Taking the logarithm and using the correct normalisation (more on the shortly), the entropy of the ideal gas works out to be:
This is the Sackur-Tetrode equation (1912), independently derived by Hugo Sackur and Otto Tetrode. It is the complete entropy of a monatomic classical ideal gas.
From this single equation, all thermodynamic properties of the ideal gas follow by differentiation.
Everything Follows from Entropy¶
Differentiating with respect to at fixed and :
Each particle contributes to the total energy — for each of its three translational degrees of freedom. This is the equipartition theorem.
Differentiating with respect to at fixed and :
This is the ideal gas law — derived entirely from counting microstates, with no empirical input!
Since , the heat capacity at constant volume is:
This means it takes J of heat to raise the temperature of each molecule by 1 K.
Using and , the speed of sound in the gas is:
For nitrogen at room temperature ( K, kg), this gives m/s — in good agreement with the measured value of 343 m/s.
The Gibbs Paradox and Indistinguishability¶
A Surprising Puzzle¶
Here is a thought experiment that reveals something deep about the nature of identical particles.
Take a box divided by a partition. On the left: molecules of gas A at temperature and pressure . On the right: molecules of gas B, also at temperature and pressure . Now remove the partition.
If A and B are different gases (say, nitrogen and oxygen), the gases mix, and the entropy increases. This is the entropy of mixing — a real, measurable effect. You can verify it by noting that you now need to do work to separate them again.
But what if A and B are the same gas — say, nitrogen on both sides? When you remove the partition, nothing observable happens. The gas on both sides was already at the same temperature, pressure, and density. The system is in equilibrium both before and after.
The entropy should not change. And yet if you naively count microstates by treating the molecules as distinguishable labelled particles (as classical mechanics suggests), you find a spurious entropy increase of — as if mixing two identical gases were somehow different from having one big container of gas. This is the Gibbs paradox, noticed by Josiah Willard Gibbs in 1875.
The Resolution: Particles Are Indistinguishable¶
The resolution is both simple and profound: identical particles are not distinguishable.
In quantum mechanics, two electrons, two nitrogen molecules, or any two identical particles are not merely similar — they are in principle completely indistinguishable. There is no experiment, even in principle, that can tell “molecule number 347” from “molecule number 8,193” if both are nitrogen molecules in the same quantum state.
This means that if you swap two identical particles, you have not created a new microstate — you have the same microstate. To correctly count microstates, we must divide by the number of ways we can permute identical particles, which is (N factorial):
With this correction, the entropy becomes:
Notice that the volume appears as (volume per particle), not . This makes the entropy extensive — proportional to when and are held fixed — and the mixing entropy for two identical gases is exactly zero.
What Happens for Different Gases?¶
When genuinely different gases mix, the entropy increase is real and is given by:
where and are the mole fractions. For equal amounts (), this gives . This entropy of mixing is the thermodynamic reason why spontaneous mixing of different gases is irreversible.
A Preview: The Three Ensembles¶
The microcanonical ensemble — the framework we have built throughout this chapter — describes a system that is completely isolated: fixed , , and . It is the most fundamental ensemble, but it is often the most difficult to work with in practice, because real experiments rarely fix the energy exactly.
Statistical mechanics has developed two other ensembles, each suited to a different experimental situation. All three give the same thermodynamic results in the limit of large .
The Three Ensembles of Statistical Mechanics
Ensemble | Fixed quantities | Fluctuating quantity | Thermodynamic potential | Best suited for |
|---|---|---|---|---|
Microcanonical | , , | (nothing) | Entropy | Isolated systems; conceptual foundations |
Canonical | , , | Energy | Free energy | Systems in contact with a heat bath; most practical calculations |
Grand Canonical | , , | Energy and particle number | Grand potential | Open systems; quantum gases; chemical reactions |
The microcanonical ensemble answers the question: given fixed energy, what are the equilibrium properties?
The canonical ensemble answers: given fixed temperature (heat bath), what are the equilibrium properties?
The grand canonical ensemble answers: given fixed temperature and chemical potential (heat and particle reservoir), what are the equilibrium properties?
Summary¶
In this chapter we have laid the foundations of statistical physics. The central ideas to take away are:
Statistical physics bridges the microscopic world of atoms and the macroscopic world of thermodynamics. It does so through probability: by counting microstates, we identify the most probable macrostate, which is overwhelmingly more probable than any other for large systems. This is why thermodynamics is so precise.
A microstate is the complete atomic-level description. A macrostate is the small set of macroscopic variables we measure.
The fundamental postulate says all accessible microstates are equally likely.
Entropy is — a measure of how many microstates correspond to a given macrostate.
Temperature is — the quantity equalised at thermal equilibrium.
Pressure is — the quantity equalised when volumes can adjust.
The first law follows directly from these definitions.
The second law is a statement of overwhelming probability, not a fundamental law of nature.
The ideal gas law and the equipartition theorem are derived entirely from counting microstates.
The Gibbs paradox is resolved by recognising that identical particles are indistinguishable, requiring the correction.
The microcanonical ensemble is conceptually fundamental but computationally awkward. In practice, we usually work with the canonical ensemble (fixed , , ), which is mathematically more tractable and directly applicable to systems in contact with a heat bath — which describes almost all real laboratory situations.