Thermodynamics was written by people trying to sell better steam engines, and it ended up being the part of physics least likely ever to be overturned. Four statements: that temperature exists at all, that energy is never created or destroyed, that it always spreads out, and that you can never quite finish cooling something down. Everything below is computed live from those four — the engine's ceiling, the direction heat flows, and the exact odds against a room's air deciding to pile up in one corner.
The first three laws were already numbered when someone noticed they all quietly assumed something unproven: that "the same temperature" is a real relationship, and that it is transitive. If A is in equilibrium with the thermometer and B is in equilibrium with the same thermometer, then A and B are in equilibrium with each other — which is the only reason a thermometer tells you anything about anything except itself. Set two blocks to the same temperature below and connect them: the heat flow is exactly zero, and that is what temperature means. Set them differently and watch. The three blocks have different heat capacities, so they do not meet in the middle — they meet at the energy-weighted average, which the panel computes independently and compares.
The first law is bookkeeping with no exceptions: whatever internal energy a gas gains, it gained by having heat put in or by having work done on it. Push the piston in without letting heat escape and the gas gets hotter even though you added no heat — that is a bicycle pump warming up, and it is the whole of the first law in one gesture. The four processes below take the same gas to the same final volume by different routes; the shaded area under each path is the work, integrated numerically from the curve rather than looked up, and the last tile reports how far ΔU − (Q − W) is from zero.
You cannot turn heat entirely into work. Not because engineers are not clever enough — because doing so would decrease the entropy of the universe, and nothing does that. The best any engine can manage between a hot and a cold reservoir is η = 1 − Tc/Th, and the reason is visible in the T–S diagram on the right: the heat you pay for is the whole column under the hot leg, the work you get is only the rectangle between the two temperatures. The strip below Tc is not recoverable by any means. Drag the two sliders at the top of the page — notice the ceiling rises far faster by making the hot side hotter than by making the cold side colder, which is why power stations chase turbine-inlet temperature and not colder rivers.
| heat engine | Th | Tc | Carnot ceiling | actually achieves | share of the ceiling |
|---|
The Carnot column is computed from the two temperatures beside it, not typed in. Note the petrol engine: it runs hotter than a power station and has the highest ceiling in the table, yet delivers the smallest share of it, because it also has to idle, throttle, accelerate and throw its exhaust away hot.
Nothing stops the air in a room from crowding into one half. No law is violated; no particle would have to do anything unusual. It is simply that of the 2N ways N molecules can be arranged left-or-right, exactly 2 have them all on one side, so the odds are 21−N. With six particles the box below manages it about twice a minute. With ten, about once every five minutes. With twenty you would be waiting days, and with the 1022 molecules in a real room the wait is a number that has to be written as a power of a power. Entropy's arrow is not a push — it is the overwhelming numerical superiority of messy arrangements over tidy ones.
Two separate engines are running here, and they do not quite agree — which is the interesting part. The box is a real collision simulation: equal hard discs, elastic bounces, kinetic energy conserved to one part in 1014. Its left-right count is correlated from frame to frame, because a particle that was on the left a millisecond ago probably still is, and its long-run occupancy comes out a few percent below the ideal law — over six simulated hours at N = 8 it spends 6.92 × 10−3 of its time all on one side against an exact 7.81 × 10−3. That gap is not an error. It is excluded volume: discs take up room, and crowding eight of them into half a box costs something that eight points would not pay. So the clean statistics come from the second engine — a seeded mulberry32 stream drawing independent fair coins by the hundred thousand every frame, with no size and no memory. The orange points fall off the yellow line only where the sampler runs out of trials, never before.
Each stage of cooling can only remove a fraction of the heat that is left, so it takes an infinite number of stages — or infinite work — to arrive at exactly 0 K. That is the third law, and it has a sharp practical edge: the work needed to pump one joule out of something at Tc is (Th/Tc − 1) joules, which does not rise gently as you go down, it diverges. Getting a joule out of liquid helium at 4.2 K costs 70 joules. Out of something at a nanokelvin, 300 billion. Drag the marker down the ladder and watch the price.
The numbers are checks, not settings. The Carnot efficiency drawn from the T–S rectangle is computed by integrating ∮P dV around a four-leg cycle for a monatomic ideal gas, and at Th = 811 K, Tc = 311 K it returns 0.616522811 against the closed form 1 − Tc/Th = 0.616522811 — agreement to thirteen digits, with the reversibility condition Qh/Th − Qc/Tc landing within 10−14 J/K of zero. Adiabatic compression is likewise checked both ways: halving the volume of a monatomic gas gives a pressure ratio of 3.17480, and 25/3 is 3.17480. The rarity sampler reproduces 21−N to within Poisson noise at every N it can reach — at N = 18, 231 hits against 228.9 expected, a fifth of a standard deviation. The mixing panel was swept over 122,850 unequal temperature pairs and the entropy change came out positive every single time, the smallest being 2.9 × 10−3 J/K.
The randomness matters more than it looks. Every random number here comes from mulberry32, seeded, because a hand-rolled linear congruential generator — the kind that looks fine in a scatter plot — has a lowest bit that repeats its predecessor 99.14% of the time. A particle box driven by one of those would show a beautifully wrong distribution and no warning.
What it simplifies is worth knowing. The gas is ideal: no molecular volume, no attraction, no vibration or rotation soaking up energy, so γ is fixed at 5/3 and real air (γ ≈ 1.4) would behave differently. Every cycle drawn here is reversible and therefore infinitely slow — a real engine running at a useful speed loses more, which is why the maximum-power efficiency 1 − √(Tc/Th) is often a better guide to a real plant than the Carnot number beside it. The reservoirs are infinite and stay at fixed temperature. The particle box has no gravity, no walls that absorb energy, and only 32 particles at most, so it shows you fluctuations that a real cubic metre of air would never let you see — and because its particles are discs with real area rather than points, its occupancy statistics sit a measurable few percent under 21−N, by 11% at N = 8 and by 33% by N = 12. The sampler beside it, which is where the quoted probabilities come from, has no such excluded volume. And the third-law ladder prices cooling with an ideal reversible fridge; every real dilution refrigerator does far worse, which is the point — the divergence is a floor, and reality sits above it.