In physics, the **second law of thermodynamics** is a statement about the quality and direction of energy flow, and it is closely related to the concept of entropy. It establishes the fact that certain transfers of energy, such as electrical heating of a liquid, can only proceed in one direction. Electricity can heat a cool liquid, but a heated liquid, by itself, cannot create electricity. In the first case, the energy is of high quality but in the second case it is of low quality.

The Kelvin-Planck statement of the second law of thermodynamics says, "It is impossible for any device that operates on a cycle to receive heat from a single reservoir and produce a net amount of work." One of the consequences of this is that no heat engine can have an efficiency of 100%. That includes idealized heat engines with no friction and no other dissipative effects.

The second law of thermodynamics is important to engineers because it provides a way to determine the quality, as well as the amount of degradation of energy during a process. It is also used to determine the theoretical upper limits for the performance of many commonly used engineering systems like refrigerators and internal combustion engines. Any device that violates the second law of thermodynamics is called a perpetual motion machine of the second kind. One example of this would be a device that can do work such as pumping water, simply by taking energy from the air.

The second law can be stated in terms of entropy as follows: the entropy of an isolated system increases in time.

Boltzmann has first addressed this question. He has given explanation by means of Statistical mechanics, first for diluted gases in his H-theorem. He does not derive the second law of thermodynamics from mechanics alone, but also from the probability arguments. His idea is to use the coarse graining, grouping of microstates into macrostates, and then to make a statement about what is most probable to happen for a macrostate - for some microstates the entropy will decrease, but this happens with low probability.

The Ergodic hypothesis was important for Boltzmann approach. It says that, over long periods of time, the time spent in some region of the phase space of microstates with the same energy is proportional to the volume of this region, i.e. that all accessible microstates are equally probable over long period of time. Equivalently, it says that time average and average over the statistical ensemble are the same.

In Quantum mechanics, the ergodicity approach can also be used. However, there is alternative explanation, which involves Quantum collapse - it is a straightforward result that quantum measurement increases entropy of the ensamble. Thus, second law of thermodynamics is intimately related to quantum measurement theory and quantum collapse - and none of them is completely understood.

- Xin Yong Fu and Zi Tao Fu, "
*Realization of Maxwell's Hypothesis : An Experiment Against the Second Law of Thermodynamics*". Shanghai Jiao Tong University, Shanghai, P.R. China (arXiv.org)