What does The Thermodynamics of Desire conclude, in numbers, about “The Free-Energy Principle: A Mind That Wants Both Safety and Novelty”?
Answer: The two columns tell different stories. Surprisal falls at first and then stops falling: it approaches 0.500 nats, the entropy of the 0.8/0.2 pattern itself, and never goes below it. That remaining surprise is noise; no amount of learning can remove it. Information gain falls by a factor of ten and keeps falling towards zero. After a hundred evenings, the partner is still a little unpredictable, but no longer teaches anything.
Scope of the numbers: The book is not therapy, relationship counselling or medical advice. Marked boxes separate published evidence, runnable Python calculations, classical texts and the author's hypotheses; wherever a comparison between physics and love is an analogy, the book says so, and every hypothesis states what result would refute it.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 0.2, 0.500, 0.8
| evenings | mean surprisal | mean information gain (nats) |
|---|---|---|
| 1-10 | 0.620 | 0.0927 |
| 11-30 | 0.526 | 0.0239 |
| 31-100 | 0.509 | 0.0082 |
| floor: entropy of a 0.8/0.2 pattern = 0.500 nats |
Key formula
Show the full program
from math import lgamma, log
def digamma(x):
r = 0.0
while x < 6:
r, x = r - 1 / x, x + 1
f = 1 / (x * x)
return r + log(x) - 0.5 / x - f * (1 / 12 - f * (1 / 120 - f * (1 / 252 - f * (1 / 240 - f / 132))))
def kl_beta(a1, b1, a0, b0):
"""KL divergence of Beta(a1, b1) from Beta(a0, b0): what one evening taught us, in nats."""
lnB = lambda a, b: lgamma(a) + lgamma(b) - lgamma(a + b)
return (lnB(a0, b0) - lnB(a1, b1) + (a1 - a0) * digamma(a1)
+ (b1 - b0) * digamma(b1) + (a0 - a1 + b0 - b1) * digamma(a1 + b1))
a, b = 1.0, 1.0 # no idea yet how the partner's evenings go
evenings = [1, 1, 0, 1, 1, 1, 0, 1, 1, 1] * 10 # 100 evenings: 1 = the usual, 0 = something different
rows, s, g = [], 0.0, 0.0
for n, x in enumerate(evenings, 1):
p = a / (a + b) # predicted chance of "the usual"
s += -log(p if x == 1 else 1 - p) # surprisal of what happened
a1, b1 = (a + 1, b) if x == 1 else (a, b + 1)
g += kl_beta(a1, b1, a, b) # information gained
a, b = a1, b1
if n in (10, 30, 100):
rows.append((n, s, g))
print("evenings mean surprisal mean information gain (nats)")
prev_n, prev_s, prev_g = 0, 0.0, 0.0
for n, s, g in rows:
k = n - prev_n
print(f"{prev_n + 1:3d}-{n:<3d} {(s - prev_s) / k:14.3f} {(g - prev_g) / k:16.4f}")
prev_n, prev_s, prev_g = n, s, g
print(f"floor: entropy of a 0.8/0.2 pattern = {-(0.8 * log(0.8) + 0.2 * log(0.2)):.3f} nats")Single source and citation
Fan, Y. (2026). The Thermodynamics of Desire (Version 1.0.0), Chapter 4: The Free-Energy Principle: A Mind That Wants Both Safety and Novelty. 5D Library. https://doi.org/10.5281/zenodo.23682498
DOI: 10.5281/zenodo.23682498 · Read the monograph · 5DL-B-004 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026004,
author = {Fan, Yafu},
title = {The Thermodynamics of Desire},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
doi = {10.5281/zenodo.23682498},
url = {https://doi.org/10.5281/zenodo.23682498}
}