Entropy and Microstates
Count the ways particles can arrange themselves, and see why a gas spreads out and never packs itself back into a corner
This concept builds on Combinatorics — The Art of Counting Possibilities, Logarithms — Exponentiation in Reverse. Consider exploring them first for the best experience.
Four Particles, Two Halves
Start with 'Particles' at 4 and the wall in. Every particle is either on the left or on the right, so a full description lists the side of each one: the 'Microstate' readout, such as L L L L. Each particle has 2 choices, so 4 particles have 2 × 2 × 2 × 2 = 16 possible microstates. Right now only one of them, all on the left, is allowed.
Macrostates Hide Many Microstates
You usually cannot track every particle; you only see how many are on the left. That count is the macrostate. Look at the bar chart: all 4 on the left happens in just 1 way, but 2 on each side happens in 6 different ways, because any 2 of the 4 numbered particles can be the ones on the left. The counts 1, 4, 6, 4, 1 add up to 16.
Remove the Wall
Press 'Remove wall' and watch. The particles wander across the centre line and the green bar jumps between counts. Nothing pushes them to the right; each one simply moves at random. Yet the gas spends most of its time near half and half, because those macrostates have the most microstates. The yellow dots record the share of time spent at each count, and they settle onto the bar heights.
Entropy Is a Count, Written as a Logarithm
Boltzmann defined entropy as S = k ln W, where W is the number of microstates for the macrostate and k is Boltzmann's constant. All on the left has W = 1, so S = 0. Read the 'Entropy S = k ln W' card as the gas spreads: it climbs toward its peak at half and half. The logarithm makes entropy add up when you combine two separate boxes.
Worked Example: Ten Particles
Set 'Particles' to 10. There are 2¹⁰ = 1,024 microstates in total. All 10 on the left is just 1 of them, a chance of 1 in 1,024, about 0.1%. Five on each side can happen in 252 ways, so S = k ln 252 ≈ 5.53 k. Press 'All to left', then 'Remove wall', and watch the gas almost never return to the 1-way state.
More Particles, Sharper Peak
Slide 'Particles' up to 50 and press 'Remove wall'. Now half and half has about 1.26 × 10¹⁴ microstates, while all on the left still has only 1. The bars crowd into a narrow peak and the gas hugs the middle. A real room holds around 10²⁷ molecules, so the chance of the air packing into one half is too small to ever happen.
Why the Second Law Points One Way
Press 'Put wall back' while the gas is spread out: it stays spread out. Nothing forbids every particle from drifting back to the left; it is just overwhelmingly unlikely, because there are vastly more spread-out arrangements. That is the Second Law of Thermodynamics in counting form: an isolated system drifts toward the macrostate with the most microstates, so its entropy does not go down.
How It Works — Step by Step
-
1
Four Particles, Two Halves
Start with 'Particles' at 4 and the wall in. Every particle is either on the left or on the right, so a full description lists the side of each one: the 'Microstate' readout, such as L L L L. Each particle has 2 choices, so 4 particles have 2 × 2 × 2 × 2 = 16 possible microstates. Right now only one of them, all on the left, is allowed.
-
2
Macrostates Hide Many Microstates
You usually cannot track every particle; you only see how many are on the left. That count is the macrostate. Look at the bar chart: all 4 on the left happens in just 1 way, but 2 on each side happens in 6 different ways, because any 2 of the 4 numbered particles can be the ones on the left. The counts 1, 4, 6, 4, 1 add up to 16.
-
3
Remove the Wall
Press 'Remove wall' and watch. The particles wander across the centre line and the green bar jumps between counts. Nothing pushes them to the right; each one simply moves at random. Yet the gas spends most of its time near half and half, because those macrostates have the most microstates. The yellow dots record the share of time spent at each count, and they settle onto the bar heights.
-
4
Entropy Is a Count, Written as a Logarithm
Boltzmann defined entropy as S = k ln W, where W is the number of microstates for the macrostate and k is Boltzmann's constant. All on the left has W = 1, so S = 0. Read the 'Entropy S = k ln W' card as the gas spreads: it climbs toward its peak at half and half. The logarithm makes entropy add up when you combine two separate boxes.
-
5
Worked Example: Ten Particles
Set 'Particles' to 10. There are 2¹⁰ = 1,024 microstates in total. All 10 on the left is just 1 of them, a chance of 1 in 1,024, about 0.1%. Five on each side can happen in 252 ways, so S = k ln 252 ≈ 5.53 k. Press 'All to left', then 'Remove wall', and watch the gas almost never return to the 1-way state.
-
6
More Particles, Sharper Peak
Slide 'Particles' up to 50 and press 'Remove wall'. Now half and half has about 1.26 × 10¹⁴ microstates, while all on the left still has only 1. The bars crowd into a narrow peak and the gas hugs the middle. A real room holds around 10²⁷ molecules, so the chance of the air packing into one half is too small to ever happen.
-
7
Why the Second Law Points One Way
Press 'Put wall back' while the gas is spread out: it stays spread out. Nothing forbids every particle from drifting back to the left; it is just overwhelmingly unlikely, because there are vastly more spread-out arrangements. That is the Second Law of Thermodynamics in counting form: an isolated system drifts toward the macrostate with the most microstates, so its entropy does not go down.
Key Takeaways
Microstate Versus Macrostate
A microstate says exactly where every particle is; a macrostate only gives an overall measurement, such as how many particles are on the left. One macrostate usually covers many microstates.
Entropy Counts Arrangements
Boltzmann entropy is S = k ln W, with W the number of microstates that match the macrostate. A single arrangement means zero entropy.
Spreading Out Is Just Likely
Particles moving at random spend their time in proportion to the number of microstates, so the most numerous macrostate, half and half, wins.
Big Numbers Make It a Law
With 10 particles all on one side happens 1 time in 1,024; with the vast numbers in a real gas it effectively never happens, so entropy of an isolated system does not decrease.
Connected Concepts
Thermodynamics
The Second Law says entropy of an isolated system does not fall; here you can see that it is a statement about counting.
Binomial Distribution
The bar chart is a binomial distribution: each particle is a fair coin flip between left and right.
Pascal's Triangle
The microstate counts for 4 particles, 1 4 6 4 1, are a row of Pascal's triangle.
Information Entropy
Shannon entropy uses the same logarithm of a count of possibilities, measured in bits instead of units of k.
Diffusion
A drop of ink spreading through water is this same spreading, with trillions of particles instead of fifty.
Heat Engines & the Carnot Cycle
Entropy bookkeeping is what sets the Carnot limit on how much heat any engine can turn into work.
Law of Large Numbers
With more particles the share on each side sticks ever closer to one half.