Please read wrinkly's excellent writeup in this node first.

Surely Mr. Feynman wasn't joking with his example for a perpetual motion machine. Of course the Nobel Prize winner never had any hopes that this hypothetical device would actually work: it was merely an exercise for his students to spot the flaws. However, the underlying thermodynamics and physics to this problem are subtle.

The First law of thermodynamics: conservation of energy by itself does not exclude the possibility a perpetual motion machine. The system under consideration must be a closed system (no energy exchange with the environment) or the net energy flux must equal zero (influx = outflux). Note that this would be true for ideal systems, as well as real systems.

However, the situation is different for the Second law of thermodynamics, which states that during an adiabatic process entropy cannot decrease. An alternative formulation of the law is that it is impossible to convert the heat of a system into work without the occurrence of other simultaneous changes in the system or its environment. As a result, the second law of thermodynamics is inherently for real systems, because it makes a prediction of the entropy of the system. Real systems strive towards a situation where the availability of energy is minimized (a greater disorder.)

As a result, we must consider the Feynman perpetual motion machine --- like any other perpetuum mobile--- as a real system. If we neglect the second law of thermodynamics it is not difficult to design a perpetual motion machine: an object spinning in zero gravity and a perfect vacuum would spin indefinitely. However, a perfect vacuum cannot be created. In fact, the second law of thermodynamics predicts that a perfect vacuum does not exist. It is easy to become trapped in a circular logic: theory disproves the possibility of making a perpetual motion machine, whereas the hypothetical machine disproves the theory.

In the Feynman machine, a shaft is propelled by transfer of kinetic energy (i.e. thermal energy) of gas molecules to turbine blades that are attached to the shaft. The hypothesized principle of operation is based on kinetic molecular theory, or the random motion of gas molecules inside the chamber. The concept is analogous to Brownian motion, except that this device is supposed to "channel" random motion into a specific direction by means of a ratchet and a gear with teeth.

Kinetic molecular theory certainly does not forbid anisotropy of pressure inside the system: the pressure that is exerted on the system is simply caused by the collisions of randomly moving gas molecules. There is a very small statistical probability that one side of the turbine blades at one point in time receives more collisions, or more energetic collisions than the other side. However, the kinetic energy per gas molecule is limited (on the order of 10- 18  J per molecule at room temperature), and the number of collisions per second is large (on the order of 1020 molecules cm2 s-1). These two factors make the occurrence of spontaneous directed thermal motion highly unlikely (look around: every day objects don't randomly move by themselves).

However, the statistical improbability described above does not fully explain why the Feynman machine would never work. For this, one needs to look at the other components of the system: the shaft and ratchet. Because the principle of the Feynman machine is based on molecular motion, one cannot neglect this phenomenon in other parts of the system.

The shaft and ratchet are in thermal equilibrium with the rest of the system. As a result, these atoms of these parts also have a certain kinetic energy, although their motion is restricted by their physical state (i.e. a solid). Instead of freely moving molecules, the shaft and ratchet consist of atoms that exhibit thermal vibration. As a result, the ratchet and teeth of the gear are not in perfect contact with each other. Visualize this as beating a drum with grains of sand on it. Of course these thermal vibrations are on a very small, molecular scale, and in reality the gear and ratchet are always in contact due to surface roughness.

The ratchet can only have very small downforce and friction on the gear, otherwise the required torque on the shaft would be too high to move the ratchet over a notch. As explained above, the low kinetic energy of the gas is limiting the theoretical torque that can be generated. Because of the required small downforce of the ratchet, thermal vibration of the ratchet and gear cannot be neglected. This thermal vibration will reduce the effectiveness of the ratchet: the ratchet no longer grips on the sawteeth of the gear.

Thus, the thermal vibration of the ratchet/teeth cannot be neglected. Increase the downforce of the ratchet and the shaft won't turn. Decrease the downforce, and the shaft will be able to rotate freely in both directions.