An imaginary creature that is able to open and shut a partition dividing two volumes of a gas in a container, when the two volumes are initially at the same temperature. The partition operated by the demon is only opened to allow fast molecules through. Such a process would make the volume of gas containing the fast molecules hotter than it was at the start; the volume of gas remaining would accordingly become cooler. This process would be a violation of the second law of thermodynamics and therefore cannot occur. Maxwell’s demon was invented by James Clerk Maxwell in a letter written in 1867 to show that the second law of thermodynamics has its origins in statistical mechanics, although the name was suggested by Sir William Thomson, subsequently Lord Kelvin. The problem of Maxwell’s demon was solved in the 1970s in terms of the relation between information theory and thermodynamics.