The Entropy of a Markov Chain
Understanding the Entropy of a Markov Chain
Written by CasualPhysicsEnjoyer
In 1865, Clausius introduced a fundamental physical quantity known as entropy. By analyzing physical processes as a series of interconnected engines, he demonstrated a core law of nature: in any irreversible process, entropy always climbs.
The Nature of Entropy
Depending on the type of process, entropy behaves differently:
| Process Type | Entropy Change () | Example |
|---|---|---|
| Reversible | Carnot's ideal engine | |
| Irreversible | Most natural processes |
It is important to note that entropy cannot decrease spontaneously unless the system is isolated unless external energy is applied to the system. While you cannot measure entropy directly with a ruler or a thermometer, it remains an indispensable concept because we can derive measurable quantities from it.
"Life as entropy."
I have previously touched upon this notion, which was heavily influenced by Schrödinger (1944) and his introduction of negentropy. The premise is that living organisms maintain their internal order by consuming energy from their environment, thereby reducing their own local disorder.
However, the precise mechanics of this are often elusive. To gain clarity, I believe in using toy models—mathematically consistent simulations that allow us to observe how entropy evolves over time.
From Thermodynamics to Markov Chains
One particularly useful model is Dyson's toy model of a cell. In this framework, a cell is represented as a Markov chain that eventually settles into one of three equilibrium states, with "life" and "death" being two of the primary outcomes.
If we want to apply the "life as entropy" philosophy here, we need a definition of entropy that fits a Markov chain. This is tricky because Clausius defined entropy based on heat and temperature:
How do we bridge the gap between thermal energy and a probabilistic state machine?
The Boltzmann Perspective
The answer lies in the work of Ludwig Boltzmann, who linked entropy to the number of possible microstates compatible with a macrostate.
Imagine observing a system's macro-variables (e.g., pressure, volume, temperature). There are countless internal configurations (microstates) that could produce those same macro-readings.
- Low Entropy: A gas at absolute zero. Particles are fixed and motionless; there are very few ways to arrange them to achieve this state.
- High Entropy: A hot gas. There are vast numbers of position and velocity combinations that result in the same temperature.
Boltzmann formalized this with his famous equation:
Where is the Boltzmann constant. While the formula is elegant, the proof—which involves taking limits of particles with finite velocities—is complex and continues to be a subject of mathematical rigor.
A Concrete Example: Electron Spin
To see this in action, let's calculate the entropy of a tiny system consisting of 5 electrons. Each electron can be either spin up () or spin down ().
In magnetic models, energy is determined by the alignment of spins:
Goal: Find the entropy for a macrostate where .
- Step 1: Determine the number of spins. Given and , we solve to find and .
- Step 2: Calculate the number of microstates (). We use the binomial coefficient to find how many ways 3 up-spins can be arranged in 5 slots:
import math
W = math.comb(5, 3)
# Result: 10
- Step 3: Compute Entropy. Using Boltzmann's formula: Alternatively, in bits: .
By repeating this for different energy levels, we can plot entropy as a function of energy.
Applying this to Dyson's Model
Now we can transition back to the Markov chain. In Dyson's model, we have sites, each capable of being in one of three states:
- Empty
- Active
- Inactive
By applying the logic of counting microstates to these sites, we can determine the entropy of the system as it converges toward equilibrium.
Visual References
