# Maxwell demon with memory storage

Let's consider a classical Maxwell demon as described in wiki https://en.wikipedia.org/wiki/Maxwell%27s_demon. It spends energy for measuring velocities and coordinates of some particles and uses the obtained information to create temperature difference between two parts of the container.

Then let's suppose that the demon doesn't use the information obtained by the measurements immediately but saves it into some information storage. So if the fraction of measured particles is large enough and the dynamics of them could be described by classical mechanics and the shape of the container is well known, it is possible to use the measured information in future to predict with more that 50% probability is the heat flux through the trapdoor from one part of the container to the other in each infinitesimal interval of time positive or negative (in the case when the trapdoor is open) and so create a temperature difference between two parts of the container.

In such case there is no violation of energy conservation law because the demon spends more energy for observation and calculation, but one could say that the information is stored inside the demon's memory storage.

My questions are following:

• Is it correct to say that the amount of useful energy that the demon could release using it's memory is equivalent to Helmholtz free energy in the system?
• Is it correct to say that the energy stored in the memory storage? Or it is better to formulate it in some more accurate words?

I'm interested in this thought experiment because I'm wonder what actually information is in physics and how is it related to energy and I will appreciate if one recommend some interesting reading about this topic.

P.S. The question is a bit related to this one Maxwell's Demon Constant (Information-Energy equivalence)

• Maxwell's demon dies with the impossibility of a precise measurement for $T>0$, so you never even get to the storage part without violating, at least, the third law of thermodynamics. – CuriousOne Feb 20 '16 at 9:16
• @CuriousOne It is enough to build just probability distributions for predicting on average is the approaching to the trapdoor particle faster or slower than average (that is why I wrote only about probabilities of positive/negative heat flux in the question). So the measurements errors don't kill the demon but just make it perform worse. – Alexander Rodin Feb 20 '16 at 9:46
• If your demon has a temperature of 3K, then it can cool the entire gas to 3K, whether you store anything or not. The amount of energy that it can extract is given by Carnot's formula. It totally doesn't matter how it works. That's the beauty of thermodynamics... you don't have to worry about the details. – CuriousOne Feb 20 '16 at 9:49
• @CuriousOne Why can't it have the same temperature as the gas? – Alexander Rodin Feb 20 '16 at 10:00
• @CuriousOne I actually told you that this model doesn't require precise measurements, it is enough for the demon to have deal with probabilities. So the third law of thermodynamics doesn't need to be violated. – Alexander Rodin Feb 20 '16 at 10:25

Is it correct to say that the energy stored in the memory storage? Or it is better to formulate it in some more accurate words?

It depends on how the memory storage device works. All such devices I know do increase and decrease their energy as a part of their operation, but I do not think there is, in general, a correlation between the energy of the device and the information on the state of the gas. You can extract free energy from the gas and preserve the state of the memory device.

Let us model a memory storage device. How do we store data? Data or information is something meaningful so you always store it by arranging something in a specific way. For instance in a computer the flip-flops store data and they have to be activated in a meaningful way. In a brain(though not completely well understood) chemicals in your neuron stores the data by arranging some specific molecules in given order.

The important thing in all this is the "order". The more the data you want to store the more things you need to arrange in specific manner. This decreases the entropy of a given system. Why? Because entropy is a measure of disorder, of chaos. If a system is ordered naturally the entropy is less. Thus information is directly related to entropy.

Any information has a particular entropy associated with it. For instance if I say you that my birthday is on second half of the year, it has lot of uncertainty and thus high entropy. Now if I say my birthday is in september the information increases but the disorder or entropy decreases. Now if my mention which week it is in I am becoming more specific and decreasing the entropy.

If you've understood the relation between entropy and information let's now come to your question. When the demon stores the info he decreases the entropy of the memory device. The 2nd law of thermodynamics prevents this from doing without spending any work. So he must spend some energy doing it. That's the energy you were looking for.

• But there is something unclear about amount of the minimum amount information (in bits) that has to be stored to be able to produce a given work later. Let's suppose that there is two demons, both of them use e.g. arithmetic coding to make sure that the information is not redundant and the required amount of bits is asymptotically not larger than it's Shannon entropy. But Shannon entropy is actually defined on top of some probability distribution, that is the prior dist of each demon. If two demons have different priors, they will require different amount of storage. How to deal with it? – Alexander Rodin Feb 26 '16 at 9:12
• Although there can be many ways of storing a given data, the most efficient one will be the one that stores theoretically minimum amount of data for the given situation. All the other will be less efficient and hence will use more energy which automatically ensures our condition. – Ari Feb 26 '16 at 9:28
• You are right, but with some assumptions. In general the most efficient is to minimize a sum of amount of information in bits multiplied to $kT \ln 2$ and the energy required for converting this information to useful form. Because it is possible that in case of storing minimum amount of data the demon would spend much more energy for computations required for converting that data to useful form than the amount of the energy required for just storing the compressed fraction of the data. – Alexander Rodin Feb 26 '16 at 10:16