# How does $S = k\ln W$ relate to the statement that heat does not flow from cold to hot objects?

There're several ways the Second Law of Thermodynamics can be stated. I'm thinking of these two:

Entropy never decreases spontaneously.

and

Heat does not spontaneously flow from cold to hot objects.

From the first statement, we know that the entropy of the object is given by $$S = k \ln W$$, where $$W$$ is the number of microstates. How is this equivalent to the second statement that heat does not spontaneously flow from cold to hot objects? The second statement doesn't seem like it is related to microstates at all.

I tried drawing two systems, one which has five accessible quantum energy levels (corresponding to higher temperature) and one with only two levels. The first system then has five different microstates and the second has only two. If heat were to flow from cold to hot objects, then the second object would have only one energy level while the first one has six. Total entropy is now $$k \ln 6 + k \ln 1 < k \ln 5 + k \ln 2$$, i.e. entropy has decreased, which makes the entire approach sounds like nonsense.

• The connection is provided by Boltzmann's $H$ Theorem, which shows that the statistical definition of entropy is (under generic conditions) always nondecreasing.
– Buzz
Oct 14, 2020 at 1:49
• I think a complete answer to your question might just be a statistical mechanics course. But note that your example doesn't work, because temperature depends on the state, not just on the system. You have to specify occupation numbers for your energy levels to talk about a temperature. Oct 14, 2020 at 3:05
• The Boltzmann equation is for microcanonical (closed) system, while entropy non-decreasing is for canonical-like ensembles (small portion of large closed system). You have to abridge those two to answer the question. No need for QM here, as you even not using it's distinctive properties, in compare to classical mechanics. Oct 14, 2020 at 6:23

A qualitative answer to your question is that a system at higher temperature has higher W, all else being equal. So if you take a certain quantity of heat $$Q$$ out of a system at high temperature $$T_h$$, without doing anything else, the change in entropy is $$-\frac{Q}{T_h} = k \frac{\Delta W_h}{W_h}$$ (where $$\Delta W_h < 0$$), and if you put that same heat into a system at low temperature $$T_l$$, its change in entropy is $$+\frac{Q}{T_l}= k \frac{\Delta W_l}{W_l}$$ ($$\Delta W_l > 0$$). If you add these, the net change of entropy of the system is proportional to $$\Delta W_h W_l + \Delta W_l W_h$$. Because the $$W$$'s are enormously large and for small increments of heat the $$\Delta W$$'s are much smaller, this is positive if $$W_h > W_l$$, which it is.