Counting microstates
Flip 4 coins and record the exact sequence — HHTH, THTT, whatever comes up — and you've specified a microstate: the complete, coin-by-coin description of the system. But most of the time you don't care about the exact sequence; you care about a coarser summary, like 'how many heads.' That coarser description is a macrostate, and a single macrostate can be compatible with many different microstates. With 4 coins, the macrostate '2 heads' is compatible with 6 different sequences (HHTT, HTHT, HTTH, THHT, THTH, TTHH), while the macrostate '4 heads' is compatible with exactly 1 sequence (HHHH). If every microstate is equally likely — a foundational assumption sometimes called the equal a priori probability postulate — then the macrostate with more microstates is proportionally more likely to be the one you observe. Flip 4 coins and '2 heads' is six times more probable than 'all heads,' simply because six times as many exact sequences produce it.
Scale the same idea up to something physical: 100 gas particles free to wander between two connected boxes, left and right. A microstate specifies which particular particles sit in which box; a macrostate specifies only the count — say, '50 in the left box, 50 in the right.' There is exactly one microstate corresponding to 'all 100 particles in the left box' (every particle has to be on that specific side), but there are roughly 10²⁹ microstates corresponding to '50 in each box' — the number of ways to choose which 50 of the 100 particles land on the left. If the particles are constantly jostling and re-randomizing which box they occupy, the system spends its time overwhelmingly in whichever macrostate has the most microstates — not because anything is actively pushing it there, but because that macrostate is what 'almost every microstate' looks like. This is the real content of thermal equilibrium: it isn't a special state a system settles into by some active leveling process, it's simply the macrostate so enormously more numerous than any other that the system is essentially guaranteed to be found there.
Ludwig Boltzmann gave this counting argument a name and a number. Define W (from the German Wahrscheinlichkeit, 'probability') as the number of microstates compatible with a given macrostate — the multiplicity described above: W = 1 for 'all heads' or 'all particles in the left box,' W ≈ 10²⁹ for '50 particles in each box.' Boltzmann's entropy, S, is defined not as W itself but as k_B times its natural logarithm, EQ 1.1 below. The logarithm matters for a very practical reason: multiplicities from independent subsystems multiply (double the gas and you roughly square the number of arrangements), while you want an extensive quantity — one where doubling the gas doubles the entropy. Taking a log converts that multiplication into addition, so entropy adds the way energy, volume, and particle number do. The constant k_B ≈ 1.381×10⁻²³ J/K simply fixes the units and connects this purely combinatorial quantity to the thermodynamic entropy already in use before Boltzmann — the connection the next lesson makes explicit. Boltzmann was so certain of this result's importance that he asked for it carved on his tombstone in Vienna; it's there today, S = k ln W, above his grave in the Zentralfriedhof.
Resist the common shorthand that entropy 'is disorder' — it's a useful mental image sometimes, but it's imprecise and occasionally flatly wrong (some highly 'ordered-looking' configurations, like a fully mixed alloy, have higher entropy than 'disordered-looking' unmixed ones). What entropy actually is, is a count — specifically, the logarithm of a count — of how many microscopic ways a given macroscopic description can be realized. A macrostate has high entropy not because it 'looks messy' but because an enormous number of distinct microscopic arrangements all produce that same macroscopic description, and a macrostate has low entropy when very few microscopic arrangements do. That reframing is what makes the rest of statistical mechanics tractable: instead of tracking 10²³ individual trajectories, you count arrangements and let overwhelming numbers do the physics.
1,000 coins are shaken in a box. Why do you never see all heads, even though that outcome is exactly as probable as any single specific mixed sequence?