Loading Scale Physics...
Updated Nov 2026
11 min read

Statistical Mechanics

Patterns from Randomness

A Handful of Numbers

A glass of water holds about 8 x 10²⁴ molecules. Each one is moving, turning and bumping into its neighbors, and it changes speed and direction trillions of times a second. No computer could follow them all, and nothing would be learned from the list if one could. Yet a thermometer dipped in the glass reads 20°C and stays there. A few numbers, such as temperature, pressure and volume, describe the whole glass, and describe it precisely.

None of those numbers belongs to any one molecule. A single molecule has a speed, but no temperature; it strikes a wall, but has no pressure. They belong only to crowds. Statistical mechanics explains how laws this sharp come out of motion too tangled for anyone to follow. It does not follow the molecules. It counts what they could be doing, and finds that one kind of outcome is so much more common than all the others that it is the only one anyone ever sees.

A magnified speck in water among tightly packed water molecules, with the jagged path it has been knocked along
Uneven taps from unseen molecules push a speck about

The Wobble Shrinks

Toss a coin a hundred times and you get about fifty heads, give or take five: a wobble of a tenth. Toss it a million times and the give or take grows to about five hundred, but that is now a thousandth of the half million. The wobble grows only as the square root of the number of tosses, so its share shrinks as the number grows.

Molecules striking a wall are tosses of the same kind. Each strike is a small tap at a random moment, and in air a patch of wall the size of a fingernail takes a few times 10²³ of them every second. Over a second, the wobble in their sum is a couple of parts in a trillion, far too small for a pressure gauge to show. A smaller patch takes fewer taps, and feels a larger wobble.

One gas: the smaller the lid, the bigger its wobble

On something small enough, the wobble can be seen. A speck of dust in water jiggles without end, knocked about by taps that do not quite balance. Its wandering grows like the coin’s wobble: in four times as long, it gets only about twice as far from where it began.

Physicists held a glass bead a few thousandths of a millimeter across in a beam of laser light, in air, and tracked it fast enough to catch its speed before the air’s countless tiny kicks could add up to change it. Its speeds were spread out just as a gas molecule’s are. On average, its energy of motion matched an air molecule’s energy of flight. The bead moved as one more molecule of the air, only hundreds of billions of times heavier.

Counting the Ways

Set a hot block of metal against a cold one, and heat flows from hot to cold until both are equally warm. It never flows the other way. Yet nothing in a single collision prefers a direction. Film two atoms colliding, run the film backward, and you see another collision that is just as possible.

The direction comes from counting. The energy of a solid is held by its atoms as jiggling, in small units, and neighbors pass units to each other at random. Take two blocks of a hundred atoms each, sharing a hundred units. There are more than 10²¹ times as many ways to split the units evenly between the blocks as to keep them all in one. Each hop is as likely to go one way as the other, yet the energy spreads, because the spread-out arrangements outnumber the rest beyond any contest. At any moment, the chance of finding nine tenths of it back in the block it started in is less than one in a trillion.

Random hops spread the energy: even shares have most ways

Entropy is this count, or more exactly the number of digits in it: how many ways the atoms can be arranged while the whole looks the same from outside. Heat flows from hot to cold, a gas fills its room and ink spreads through water because each goes toward the outcome with more ways. A real block holds some 10²⁴ atoms, and for it the odds against going back have more digits than anyone could write in a lifetime.

Because this is a matter of odds, it should fail now and then in something small, and it does. Physicists dragged a bead through water with laser tweezers. Over a tenth of a second, the water’s jiggling quite often pushed the bead ahead of the light that pulled it, so that heat from the water did work, the reverse of the usual flow. Over two seconds, that was never seen. How often it happened over each stretch of time matched what counting predicts. The rule that heat flows from hot to cold is not obeyed by each collision. It is the odds, and for anything large enough to see, the odds are a certainty.

Counting has one gap. It finds the likely future, but run backward it says the same about the past: by counting alone, a half-melted ice cube was more melted a minute ago, not less. What breaks the tie is that universe began in a very unlikely state: hot and almost perfectly smooth, which is rare wherever gravity is at work, since gravity favors clumps. Ever since, matter has been clumping into stars, and stars have been pouring their light into the cold of space. Why it began that way is not settled; several explanations have been proposed, and none is confirmed.

What Temperature Measures

The everyday answer is that temperature measures how hard things jiggle. In a gas, each way a molecule can fly or tumble takes, on average, the same share of energy, and temperature sets the size of that share. The two atoms of a nitrogen or oxygen molecule can also vibrate against each other, but at room temperature that takes almost nothing: the quantum steps of their vibration are too large for the jiggling to pay. At room temperature, the shares for flying send the molecules of air along at about 470 meters per second on average.

Counting gives a deeper answer, one that also covers things that do not jiggle. Give a body one more unit of energy, and the number of ways its atoms can be arranged grows. In a cold body that one unit multiplies the number of ways many times over; in a hot one, by much less. Temperature is the measure of this, turned around: the more each unit multiplies the ways, the colder the body. Two bodies in contact trade energy until a unit passed across multiplies the ways on one side by just as much as it divides them on the other, and then their temperatures are equal. Heat leaves a hot body because a unit that leaves cuts its ways by a small factor, and multiplies the cold body’s by a large one.

This answer allows something the jiggling picture cannot. In some systems the energy has a ceiling: the tiny magnets of atoms in a magnetic field can point along it or against it, and nothing more. Once more than half point against it, adding energy leaves fewer ways, not more. Such a system has a negative temperature, and it is hotter than anything at a positive one: put it in contact with any such thing, and energy flows out of it. Physicists have made negative temperatures with the magnets of atoms, and with atoms moving through a lattice of laser light.

The Price of Energy

Counting also says how energy is shared out at a given temperature. An arrangement that takes more energy from its surroundings is rarer, and each equal step of extra energy makes it rarer by the same factor. The colder the surroundings, the steeper that price. This one rule, the Boltzmann factor, runs through all of statistical mechanics.

Air shows it on a grand scale. Each step up costs a molecule energy against gravity, so each step up holds fewer of them: the air’s pressure halves every 5.5 kilometers or so, and on the summit of Everest it is about a third of what it is at sea level. In a thin gas whose molecules never collide, each one climbs only as high as its own speed allows, and the air thins in exactly the same way. The few that are fast are the few that fly high.

Few molecules are fast, so few climb high

Speed has its price too, so at one temperature the molecules of a gas do not share one speed. Any one exact motion, a given speed in a given direction, is rarer the faster it is. But a high speed can be had in more ways than a low one, as a big ball has more surface than a small one. Together the two give a spread: few move very slowly, most move near a typical speed, and a very few move several times faster. Warm the gas, and the whole spread shifts to higher speeds and grows wider. The shape of this spread is called the Maxwell-Boltzmann distribution.

The fast few do much of the world’s work. A puddle dries far below boiling, because a few molecules at its surface move fast enough to break free, and unless the air is already full of vapor, fewer come back. Each one that leaves takes more than its share of energy with it, and the water left behind cools. That is how sweat cools skin. Chemical reactions need collisions hard enough to break bonds, and the number of molecules that fast grows steeply as the temperature rises, so many reactions run about twice as fast for every ten degrees. In the Sun’s core, the protons that fuse come from the fast end of the spread, with a few times the typical energy, helped by tunneling.

Add up these weights over every arrangement a system can take, and you get one quantity, called the partition function. From it follow the system’s energy, its pressure, how much heat it takes to warm it, and where it changes phase. Much of the work of statistical mechanics is finding that sum, or a good estimate of it.

Why Averages Work

All of this assumes that a system, left alone, ends up looking like a typical one of its arrangements. It never visits them all: for a glass of water that would take unimaginably longer than the age of universe. It only has to mix its energy well enough to lose track of where it started. Usually it does. Collisions shuffle energy so well that air settles into its spread of speeds within about a billionth of a second.

Some things never get there. A liquid cooled quickly into glass is caught in one jumble of molecules, and at room temperature would take far longer than the age of universe to find the crystal it could settle into. Its arrangement is set by its history, not by counting.

Cold atoms show both sides plainly. Physicists held atoms in thousands of thin tubes of laser light, so that each could move only along a line, and set them swinging back and forth. Equal atoms on a line that push on each other only at contact can do nothing in a collision but swap their speeds, even when three meet at once, as between the balls of a Newton’s cradle. After thousands of collisions the atoms in each tube still held, between them, the same set of speeds they started with, and the usual spread of speeds did not form.

A glass vacuum cell between two copper coils on an optics table, two wide red laser beams crossing inside it and making a fine stack of thin tubes of light, each holding tiny glowing clouds of atoms
Clouds in tubes of light swap speeds but do not settle

In another experiment, six atoms in a row were started in one exact state and cut off from everything else. Within moments, any two or three of them looked, as closely as could be measured, as if they had been warmed in a bath, while the six together kept their exact state. The rest of the row served as the bath. Even a crowd of six can settle the way counting says, once its members are entangled, their states tied together.

When Waves Overlap

Everything so far treats molecules as tiny balls. Each really travels as a wave, and the slower it moves, the wider its wave. In air at room temperature, a molecule’s wave is about a two-hundredth of the distance to its neighbors, so the waves never meet and the picture of balls holds. Cool a gas far enough, or pack it tightly enough, and the waves overlap. Identical particles can never truly be told apart, but while their waves stay apart that makes no difference. Once the waves overlap, it does, and the counting changes.

In our three-dimensional world, particles come in two kinds. Fermions, such as electrons, never share a state; bosons, such as atoms of helium-4, crowd into one. In a cold, dense crowd this difference rules everything. Bosons pile into the lowest state, and become a superfluid or a single giant wave. Fermions fill the states one at a time from the bottom up, so the topmost carry high energies even at absolute zero, and the crowd pushes back when squeezed, however cold it is.

Cooled alike, bosons crowd in and fermions stay spread out

Physicists cooled two kinds of lithium atoms together in one trap, one kind bosons and the other fermions. As they cooled, the cloud of bosons kept shrinking, while the cloud of fermions stopped shrinking and stayed larger, held open by nothing but the rule against sharing.

Electrons in a metal are a crowd of this kind all the time. They are light and packed close: if they moved only with the warmth of the room, each electron’s wave would span about twenty of the gaps between them. They would need over 100,000 degrees to act like tiny balls, and copper boils at 2,562°C. So the electrons in every wire fill their states from the bottom, and only those near the top can take up energy as the metal warms, which is why they add so little to the heat it takes to warm a metal. The same rule against sharing holds up white dwarf stars against their own gravity.

Why the World Is Predictable

The everyday world is predictable not because its molecules are orderly, but because there are so many of them that their random motions average out. Where the crowd is small, the wobble returns. The molecular machines in a living cell, some ten millionths of a millimeter across, are kicked by the water around them with forces as large as their own. They work with that jiggling rather than against it: each burns a fuel molecule to let the kicks carry it forward and to block the kicks that would carry it back.

Every law of heat that has a direction, from why ice melts to why an engine needs a cold side, is a statement about odds of this kind. Energy being kept is not: that holds in every single collision. For anything large, the odds are so lopsided that they act as certainty.

Some of what you read here you already know