Spin version of Maxwell's demon: Where's the energy? I have confused myself about the following variant of Maxwell's demon and I can't seem to find out where the energy went. 
Consider this: You have a chain (one dimension) of spins (up/down) with a nearest-neighbor coupling. Energy is minimized if spins are aligned. Let us say the energy difference between alignment and not-alignment is E. The zero temperature state is either all up or all down. If we heat the state up to a temperature T, some of the spins will flip with a probability given by the Bolzmann-factor, depending on the ratio T/E. So far so good. 
Now the finite temperature state has energy because the states aren't all aligned, but the distribution is thermal and it's no useful (free) energy. However, if you knew which spins are misaligned, you could selectively flip them. Let us say the system is such that you can flip them by shooting a photon with energy E at the spin. Eg, you shoot at the middle spin in a series of three. If it's up,up,up then the photon will be absorbed and you end up with up, down, up. If it's up, down, up, the photon stimulates emission and you get up, up, up plus two photons of energy E. If you have up, down, down, the photon doesn't change anything about the total energy. The same happens if you exchange all ups with downs.
Now the thing is this: If you do not know which spins you have to flip, your chances of gaining or losing energy by shooting photons at the chain are the same. You just convert one thermal state into the other. But if you knew which spins to flip, you could topple them over selectively and get energy out of the system. Essentially, you extract it from the thermal bath that did heat up the chain. That's possible (I think) because you are using information to reduce the entropy of the system.
My question is this: How do I see that the energy needed to measure the spin orientations in the chain is at least as large as the energy I can gain by flipping them selective once I have measured? It isn't clear to me why it should not be possible to measure them with some very low-energetic probe, eg measuring the local magnetic field with the Hall effect. 
 A: The energy needed to measure the spins can be essentially nought, or at least, in a thought-experimental point of view, it can be made arbitrarily small. However, if you think that the second law is salvaged by a nonzero work needed for measurement you are, even though ultimately wrong, in the most excellent company. None less than the great Leo Szilard proposed this explanation in 1929 in L Szilard, "Über die Entropieverminderung in einem thermodynamischen System bei eingriffen intelligenter Wesen (on the reduction of entropy in a thermodynamic system by the intervention of intelligent beings)",
Zeitschrift für Physik 53 (1929), pp840-856.
However, this system still complies with the second law of thermodynamics through Landauer's Principle. In this explanation, the work needed that "upholds" the second law comes not from measurement but the need to forget information. Curiously, therefore, it is the loss rather than the getting of information that costs. You need ultimate to wipe the finite memory of any machine that is continuously converting the thermalised spins to work: this machine needs to measure the spins to flip the right ones. 
But the laws of nature at the microscopic level are reversible and so the time evolution operator mapping the World's state at any time to any other (either past or present) is bijective. Nature cannot forget Her history.
Therefore, the measured spin states, even though wiped from the computer's memory, must somehow wind up encoded in the now subtly changed states of the computer's matter so that the whole system's state is still reversibly mapped by time evolution. Thus the computer becomes more and more thermalised as the conversion runs forward. Ultimately its information soaking capacity is exhausted and work must be done to expell the excess entropy so that it can keep working. What you gain from flipping spins, you lose through the need to "forget".
See my answer to the Physics SE question "How can the microstates be measured with zero energy expenditure?" as well as my answer to the question "Exorcism of Maxwell's Demon" as well as Emilio Pisanty's answer to the same question. Note well that Emilio cites an respected objector to the forgetting argument, so you would do well to read another viewpoint and think about all this for yourself, as you seem, through your question, to be well able to do. Don't worry about the mistakes in your question the commenters point out: it's still a great question and I make worse ones than those all the time.
One of the best references around on this stuff is Charles Bennett's review paper:
Charles Bennett, "The Thermodynamics of Computation: A Review", Int. J. Theo. Phys., 21, No. 12, 1982
