Maxwell's demon is the name given to a thought experiment designed to question the possibility of violating the second law of thermodynamics. It was formulated and named after the Scottish physicist James Clerk Maxwell in 1867.
The centre of the thought experiment involves a box of gas molecules, evenly distributed and with an equilibrium distribution of energy: referred to as the Boltzmann distribution. In this case some molecules will have high energy, others will have lower energy - on the molecular level this is how quickly the particles move about, and manifests itself in the macroscopic world as heat. Maxwell hypothesized that if you separated this box with a barrier and had a demon stand at a gate between the two sections, it could selectively open the gate to allow the higher energy (faster moving) particles into one room. It could also bar the way for the slower moving particles, allowing them to only travel in the opposite direction. The energy consumed by the demon while doing this can be minuscule, as it is merely opening a doorway, rather than actively transporting molecules from one side to the other. If left running like this, the system would create a temperature differential between the two compartments that could be used to perform work - and would reverse the entropy of the system. As the thought experiment asks that the demon does not expend energy to open the gate (or consumes only a minute amount) to create this differential, the system would create a perpetual motion machine.
This would violate the laws of thermodynamics as perpetual motion is impossible - you cannot get more energy out than you put in. Yet the demon of the thought experiment, given the ability to look at a molecule and open a gate, would consume far less energy than the entire system generated. This apparently simple way to get around the fixed laws of thermodynamics puzzled James Clerk Maxwell and many other scientists of the era. How to prove that Maxwell's demon could not work (leaving the laws of thermodynamics intact) had to wait some time.
It is known from looking at conventional perpetual motion engines that it's not possible to get more energy out than you put in. With Maxwell's demon, the action of watching the molecules in order to identify their kinetic energy, and the action of opening and closing the gate require energy. While the energy barrier to opening the gate could, in principle, be reduced to negligible quantities, the part about processing information to identify the appropriate "hot" and "cold" molecules always consumes energy. To do this, without resorting to magic, at the very least the molecules would have to come into physical contact with a detector, or interact with photons to sense their properties remotely, and this would consume energy. Information processing by the demon, then, is a process that necessarily consumes energy and equals any work that could be derived from a heat gradient produced by the demon. This led to the introduction of information into the world of thermodynamics, and how order, energy and information were related very closely.
The concept of information being related to energy and entropy is a key part of the physics underlying computer processes. RAM chips that store information are, in fact, ever so slightly heavier than RAM chips without information because of the relationship between energy and information, and the relationship between mass and energy (E=mc2). Particularly, information and entropy are very closely related concepts: lots of information is a low entropy state, less information is a high entropy state. So storing information, organising the bits on a computer chip into a less random pattern, requires energy to be pumped into a system to reverse the natural entropy experienced and organise the degrees of freedom available.
It would also involve working with demons, which are notoriously unreliable.[citation NOT needed]