What does The Sandbox, Determinism and Active Inference conclude, in numbers, about “Practice and a Pre-Registered Trial”?
Answer: For a smallest worthwhile effect of 0.4 standard deviations, a baseline–outcome correlation of 0.5 and 90 % power, each arm needs 100 people; with a design effect of 1.22 for groups of 12 and an intraclass correlation of 0.02, each arm needs 122 completers, and allowing 15 % loss, 144 recruits, that is 12 groups per arm. The baseline–outcome correlation and the intraclass correlation are assumptions that will be checked in a 24-person pilot; if the baseline–outcome correlation is below 0.4, the sample size will be recalculated before the main trial starts.
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: 0.02, 0.4, 0.5, 1.22, 100, 12
| standardised effect 0.3 | 132 per arm for 80 % power, 177 for 90 % (baseline-outcome correlation 0.5) |
| standardised effect 0.4 | 75 per arm for 80 % power, 100 for 90 % (baseline-outcome correlation 0.5) |
| standardised effect 0.5 | 49 per arm for 80 % power, 65 for 90 % (baseline-outcome correlation 0.5) |
| if the correlation is only 0.3, effect 0.4 needs 121 per arm for 90 % | |
| design effect for groups of 12, ICC 0.02 | 1.22 -> 122 completers per arm (power without clustering would be 95%); recruit 144 per arm allowing 15 % loss |
Show the full program
# Sample size for a two-arm parallel trial. Primary outcome: the directed-exploration parameter
# (information bonus) fitted to the Horizon task (Wilson et al. 2014), one week after the course,
# analysed by ANCOVA adjusting for the baseline value. Effect expressed in baseline SD units.
import math
from statistics import NormalDist
N = NormalDist()
def n_per_arm(d, r=0.5, alpha=0.05, power=0.90):
"""Normal approximation; ANCOVA on a baseline correlated r with the outcome shrinks the
variance by (1 - r^2)."""
za, zb = N.inv_cdf(1 - alpha / 2), N.inv_cdf(power)
return math.ceil(2 * (za + zb) ** 2 * (1 - r ** 2) / d ** 2) + 1
def power(n, d, r=0.5, alpha=0.05):
za = N.inv_cdf(1 - alpha / 2)
return N.cdf(d / math.sqrt(2 * (1 - r ** 2) / n) - za)
for d in (0.3, 0.4, 0.5):
print(f"standardised effect {d}: {n_per_arm(d, power=0.80)} per arm for 80 % power, {n_per_arm(d)} for 90 %"
f" (baseline-outcome correlation 0.5)")
print(f"if the correlation is only 0.3, effect 0.4 needs {n_per_arm(0.4, r=0.3)} per arm for 90 %")
# Both courses are taught in groups of 12, so outcomes within a group are correlated (ICC assumed 0.02).
de = 1 + (12 - 1) * 0.02
n = math.ceil(n_per_arm(0.4) * de)
print(f"design effect for groups of 12, ICC 0.02: {de:.2f} -> {n} completers per arm "
f"(power without clustering would be {power(n, 0.4):.0%}); recruit {math.ceil(n / 0.85)} per arm allowing 15 % loss")Single source and citation
Fan, Y. (2026). The Sandbox, Determinism and Active Inference (Version 1.0.0), Chapter 8: Practice and a Pre-Registered Trial. 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 5 · Structured Sandboxes and the Reshaping of Priors
- Chapter 6 · Determinism, Chaos and Agency