Having provided a satisfactory molecular interpretation of the First Law of Thermodynamics, kinetic theorists soon turned their attention to the Second. As formulated by Clausius, the Second Law of Thermodynamics implied that useful mechanical work cannot be obtained from heat except when heat flows from a high temperature to a low temperature in the special way described by Sadi Carnot; that heat spontaneously flows from hot to cold but not the reverse; and that a mysterious quantity called "entropy" tends to increase to a maximum. For the universe as a whole this state of maximum entropy was called by Clausius the "Heat Death": all energy is uniformly diffused throughout space at a low temperature, so that no mechanical work can be done and life cannot exist.
Along with puzzling about the meaning of entropy, some physicists also wondered about the implications of the statistical approach in kinetic theory. It is often stated that this approach was used only as a matter of convenience in dealing with large numbers of particles whose precise positions and velocities at any instant are unknown, or, even if known, could not be used in practice to calculate the gross behavior of the gas. It appears that, up until the time of Maxwell, 19th-century physicists always assumed that a gas is really a deterministic mechanical system. Thus if the superintelligence imagined by the French astronomer P. S. de Laplace (1749-1827) were supplied with complete information about all the individual atoms at one time he could compute their positions and motions at any other time as well as the macroscopic properties of the gas. This situation is to be sharply distinguished, according to the usual accounts of the history of modern physics, from the postulate of atomic randomness or indeterminism which was adopted only in the 1920s in connection with the development of quantum mechanics. Thus, part of the "scientific revolution" that occurred in the early 20th century is supposed to have been a discontinuous change from classical determinism to quantum indeterminism. But, as we will see, discussions about irreversibility in connection with the kinetic theory of gases led to doubts about determinism several decades before Heisenberg's Principle was announced.
Late in 1867, the same year Clausius forecast the Heat Death of the Universe, the P. G. Tait wrote to his old friend J. C. Maxwell asking for help in explaining thermodynamics in a textbook he was preparing. Maxwell responded by imagining a tiny gatekeeper who could produce violations of the Second Law. Maxwell's "Demon," as he came to be known, is stationed at a frictionless sliding door between two chambers, one containing a hot gas, the other a cold one. According to Maxwell's distribution law, the molecules of the hot gas will have higher speeds on the average than those in the cold gas (assuming each has the same chemical constitution), but a few molecules in the hot gas will move more slowly than the average for the cold gas, while a few in the cold aas will travel faster than the average for the hot gas. The Demon identifies these exceptional molecules as they approach the door and lets them pass through to the other side, while blocking all others. In this way he gradually increases the average speed of molecules in the hot gas and decreases that in the cold, thereby in effect causing heat to flow from cold to hot.
In addition to reversing the irreversible, Maxwell's Demon offered a new model for the fundamental irreversible process: he translated heat flow into molecular mixing. The ordinary phenomenon, heat passing from a hot body to a cold one, was now seen to be equivalent (though not always identical) to the transition from a partly ordered state (most fast molecules in one place, most slow molecules in another place) to a less ordered state. The concept of molecular order and disorder was henceforth to be associated with heat flow and entropy, though Maxwell himself didn't make the connection explicit.
Maxwell's conclusion was that the validity of the Second Law is not absolute but depends on the nonexistence of a Demon who can sort out molecules; hence it is a statistical law appropriate only to macroscopic phenomena.
To call the Second Law a "statistical law" does not of course imply logically that it is based on random events -- to the contrary. If Maxwell's Demon could not predict the future behavior of the molecules from the observations he makes as they approach the door, he could not do his job effectively. And in some of the later discussions it appeared that a relaxation of strict molecular determinism would make complete irreversibility more rather than less likely. (This was indeed the effect of the Burbury-Boltzmann "molecular disorder" hypothesis mentioned below.) Nevertheless at a more superficial level of discourse the characterization "statistical" conveyed the impression that an element of randomness or disorder is somehow involved.
Boltzmann then provided a quantitative version of Maxwell's argument with the help of his transport equation for the non-equilibrium velocity distribution function. He showed that collisions alwavs push f(v,x,t) toward the equilibrium Maxwell distribution. In particular, the integral of f(v,x,t) log f(v,x,t) over v and x always decreases with time unless f is the Maxwell distribution, in which case H maintains a fixed minimum value. This statement is now known as Boltzmann's H-theorem.
For a gas in thermal equilibrium, Boltzmann's H is proportional to minus the entropy as defined by Clausius in 1865. While the entropy in thermodynamics is defined only for equilibrium states, Boltzmann suggested that his H-function could be considered a generalized entropy having a value for any state. Then the H-theorem is equivalent to the statement that the entropy always increases or remains constant, which is one version of the second law of thermodynamics. The justification for Maxwell's distribution law is then based on the assertion of a general tendency for systems to pass irreversibly toward thermal equilibrium.
Boltzmann's Viennese colleague Josef Loschmidt pointed out in 1876 that according to Newton's laws one should be able to return to any initial state by merely reversing the molecular velocities. There seems to be a fundamental contradiction between the reversibility of Newton's laws and the irreversibility we see in nature. This contradiction became known as the "Reversibility Paradox"; it had already been discussed two years earlier by William Thomson, in a paper that attracted little notice.
Boltzmann replied by proposing that entropy is really a measure of the probability of a state, defined macroscopically. While each microscopic state (specified by giving all molecular positions and velocities) can be assumed to have equal probability, macroscopic states corresponding to "thermal equilibrium" are really collections of large numbers of microscopic states and thus have high probability, whereas macroscopic states that deviate siqnificantly from equilibrium consist of only a few microscopic states and have very low probability. In a typical irreversible process the system passes from a nonequilibrium state (for example high temperature in one place, low in another) to an equilibrium state (uniform temperature); that is, from less probable (lower entropy) to more probable (higher entropy). To reverse this process it is not sufficient to start with an equilibrium state and reverse the velocities, for that will almost certainly lead only to another equilibrium state; one must pick one of the handful of very special microscopic states (out of the immense number corresponding to macroscopic equilibrium) which has evolved from a nonequilibrium state, and reverse its velocities. Thus it is possible that entropy may decrease, but extremely improbable.
The distinction between macro- and microstates is crucial in Boltzmann's theory. Like Maxwell's Demon, an observer who could deal directly with microstates would not perceive irreversibility as an invariable property of natural phenomena. It is only when we decide to group together certain microstates and call them, collectively, "disordered" or "equilibrium" macrostates, that we can talk about going from "less probable" to "more probable" states.