Skip to content
Tutorials Center
My learning

Topics

Lesson 1 of 39 ยท Getting Started

What Is Statistical Mechanics?

Meet statistical mechanics: how the random motion of enormous numbers of atoms produces steady temperature, pressure and entropy, with a runnable simulation.

A glass of water holds roughly 10^25 molecules. Each one jiggles, collides and changes direction billions of times per second. Yet the glass has a single temperature, a single pressure and a calm surface. How do such steady, simple numbers come out of so much chaos?

Statistical mechanics is the branch of physics that answers this question. It starts from the laws that govern individual particles (classical or quantum) and uses probability to predict the behavior of the whole system. Thermodynamics, which you may have met already, tells you how heat, work and entropy relate. Statistical mechanics explains why those relations hold and lets you calculate quantities like heat capacities from a microscopic model.

This course is at university level. We will be rigorous, but every idea comes with intuition and a short simulation you can run and change.

Two levels of description

Physicists describe a gas at two levels.

  • The microscopic level lists everything about every particle: positions and momenta (classical) or the quantum state of the whole system. This description is called a microstate.
  • The macroscopic level lists only a few measurable numbers: energy U, volume V, particle number N, temperature T, pressure P. This is a macrostate.

Enormously many microstates share the same macrostate. Statistical mechanics is the bridge between the two levels.

flowchart LR
  A["Microstate<br/>positions and momenta of all particles"] -->|"averaging with probabilities"| B["Macrostate<br/>U, V, N, T, P"]
  B -->|"how many microstates?"| C["Entropy S"]

The bridge: probabilities turn microscopic detail into a few macroscopic numbers.

Why probability works: large numbers

You cannot follow 10^25 particles one by one, and you would not want to. Luckily, you do not need to. When you add up an enormous number of random contributions, the total becomes extremely predictable.

Here is the simplest example. Put N gas molecules in a box with an imaginary dividing line in the middle. Each molecule is equally likely to be on the left or the right. The number on the left fluctuates, but the fraction on the left becomes extremely close to 1/2 as N grows. The typical deviation of the fraction from 1/2 is 1/(2โˆšN).

Python Fraction of molecules on the left side

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

For N = 10 the fraction swings wildly. For a million it is pinned near 0.5 to three decimal places. For 10^23 molecules the fluctuations are about 10^-12 of the total, so small that no instrument could see them. This is why thermodynamics looks exact even though its foundation is random.

A first count of microstates

If each of N molecules can be on the left or the right, the number of microstates of this crude model is 2^N. This grows astonishingly fast, so we usually work with logarithms.

Python How many microstates is that?

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

For one mole of molecules (N_A = 6.02214076 ร— 10^23) the count is 10 raised to a number with 23 digits. Numbers this big make logarithms the natural tool, and that is exactly why entropy, which you will meet in chapter 2, is defined with a logarithm.

The central idea: the most probable macrostate wins

Not all macrostates are equally likely, because they contain different numbers of microstates. In the box example, "exactly half on each side" contains far more microstates than "all on the left" (which has exactly one). If every microstate is equally likely, you will almost always find the system in a macrostate that contains an overwhelming number of microstates.

That single observation explains a lot:

  1. Gas spreads to fill its container: the spread-out macrostates have vastly more microstates.
  2. Heat flows from hot to cold: the final shared-energy macrostates have more microstates.
  3. Entropy increases: entropy is (up to a constant) the logarithm of the number of microstates.

Statistical mechanics does not claim that gas cannot gather in one half of a box. It says that such an event is so improbable for large N that you will never see it in the lifetime of the universe.

The plan of this course

  1. Getting started: probability, counting and the constants you will use.
  2. Entropy: microstates, macrostates and the Boltzmann formula S = k ln ฮฉ.
  3. Ensembles: isolated systems (microcanonical) and systems in contact with a heat bath (canonical).
  4. Partition functions: one master quantity, Z, from which every thermodynamic property follows.

Later chapters (written separately) cover ideal gases, quantum statistics, the Ising model and Monte Carlo simulation. Next, we review the probability you need: Probability for Physicists.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is a microstate?

    A microstate specifies everything at the particle level (for example all positions and momenta, or the full quantum state). A macrostate only gives quantities such as U, V and N.
  2. 2. N molecules are each equally likely to be in the left or right half of a box. How does the typical deviation of the left fraction from 1/2 change as N grows?

    The standard deviation of the fraction is 1/(2 sqrt(N)), so fluctuations shrink as the system gets larger.
  3. 3. Why does a gas spread to fill its container?

    Nothing forbids the gas being in a corner; it is just vastly less probable because that macrostate has far fewer microstates.
  4. 4. Why are logarithms of microstate counts convenient?

    Counts like 2^(10^23) are enormous. Taking the logarithm gives manageable numbers and makes the entropy of independent systems additive.

Summary

  • Statistical mechanics derives the thermodynamics of large systems from the microscopic laws plus probability.
  • A microstate is a full microscopic description; a macrostate is a short list of measurable quantities.
  • With N huge, relative fluctuations are of order 1/โˆšN, so averages are effectively exact.
  • The macrostate you observe is the one with overwhelmingly the most microstates.
  • Counts are huge, so we work with logarithms.

Next: Probability for Physicists