What does The Sandbox, Determinism and Active Inference conclude, in numbers, about “Structured Sandboxes and the Reshaping of Priors”?
Answer: With inverse temperatures from 2 to 10 the better option is found within 100 trials almost every time; at 20 only 36 % of the time, at 40 only 1 %. The last column is a reminder of the other side: the learner with the lowest inverse temperature finds the better option fastest but explores too much, keeps trying options it knows are worse, and earns less on average than a learner with a moderate inverse temperature. In this model the best is not unlimited exploration but thorough exploration in a low-stakes phase, followed by exploitation once good estimates are in hand. That is exactly the sequence a good sandbox can offer: "hot" in the sandbox, "cooler" back in life.
Scope of the numbers: Marked boxes separate published evidence, runnable Python calculations (15 programs, all checked), classical sources and the author's hypotheses. This book is not psychotherapy or diagnosis; its account of old priors driving repeated setbacks is a hypothesis and a cross-disciplinary analogy and never implies that victims are responsible for what happened to them.
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: 10, 100, 20, 36, 40
| inverse temperature | discovered within 100 trials | median trials to discovery | mean payoff per trial | |||
| 2 | | 100% | | 13 | | 0.56 |
| 5 | | 100% | | 15 | | 0.66 |
| 10 | | 98% | | 26 | | 0.68 |
| 20 | | 36% | | 56 | | 0.55 |
| 40 | | 1% | | 74 | | 0.50 |
Show the full program
# Threat, inverse temperature and the discovery of a better option (a simplified model).
# Four options. The learner starts with a pessimistic prior: the familiar option is worth 0.5,
# new ones 0.2. In truth option 3 pays 0.8 on average. Choice is softmax with inverse temperature
# beta; the model's assumption is that perceived threat raises beta (more exploitation).
import math, random
TRUE = [0.5, 0.3, 0.4, 0.8]
def run(beta, trials=100, alpha=0.2, seed=0):
rng = random.Random(seed)
q = [0.5, 0.2, 0.2, 0.2]
found = None
total = 0.0
for t in range(trials):
z = [math.exp(beta * v) for v in q]
u, acc, a = rng.random() * sum(z), 0.0, 0
for i, zi in enumerate(z):
acc += zi
if u <= acc:
a = i; break
r = TRUE[a] + rng.gauss(0, 0.2)
q[a] += alpha * (r - q[a])
total += TRUE[a]
if found is None and q[3] > max(q[:3]):
found = t + 1
return found, total / trials
print("inverse temperature | discovered within 100 trials | median trials to discovery | mean payoff per trial")
for beta in (2, 5, 10, 20, 40):
out = [run(beta, seed=s) for s in range(500)]
res = [o[0] for o in out]
pay = sum(o[1] for o in out) / len(out)
hits = sorted(r for r in res if r is not None)
med = hits[len(hits) // 2] if hits else None
print(f"{beta:19d} | {len(hits) / len(res):28.0%} | {med if med else '-':>26} | {pay:21.2f}")Single source and citation
Fan, Y. (2026). The Sandbox, Determinism and Active Inference (Version 1.0.0), Chapter 5: Structured Sandboxes and the Reshaping of Priors. 5D Library. https://doi.org/10.5281/zenodo.23738794
DOI: 10.5281/zenodo.23738794 · Read the monograph · 5DL-B-015 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026015,
author = {Fan, Yafu},
title = {The Sandbox, Determinism and Active Inference},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
doi = {10.5281/zenodo.23738794},
url = {https://doi.org/10.5281/zenodo.23738794}
}Other chapter answers in this book
- Chapter 1 · The Bayesian Brain and the Self-Fulfilling Prophecy
- Chapter 2 · Two Routes: Change the Mind, or Change the World
- Chapter 3 · Markov Blankets and the Boundary of the Individual
- Chapter 4 · Escaping the Local Optimum: Exploration and Exploitation
- Chapter 6 · Determinism, Chaos and Agency
- Chapter 8 · Practice and a Pre-Registered Trial