What does Evolutionary Games and Reciprocity conclude, in numbers, about “Practice and a Pre-Registered Trial”?

Answer: With an SD of community means of 0.15 (slightly more conservative than the illustrative model above), a smallest difference of interest of 0.10 (control 0.40, arm A 0.50), two-sided \(\alpha = 0.05\) and 90 % power, 48 analysable communities are needed per arm (normal approximation; a t-distribution correction adds about one); allowing for about 10 % of communities being incomplete because someone drops out, 54 communities are recruited per arm, that is 648 people per arm and 1,296 in all. With an SD of 0.18, 69 communities per arm would be needed; with a smallest difference of interest of 0.08, 74. All these parameters are assumptions and should be checked against pilot data before the trial begins.

Scope of the numbers: The book discusses mathematical models of evolutionary games; it is not moral instruction and not business advice. Marked boxes separate published evidence, runnable Python calculations (15 programs, all checked), classical sources and the author's hypotheses.

中文版

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.05, 0.08, 0.10, 0.15, 0.18, 0.40

communities per arm (alpha 0.05 two-sided, 90 % power)
   SD of community means   delta 0.08   delta 0.10   delta 0.12
           0.12               48          31          22
           0.15               74          48          33
           0.18              107          69          48
model: SD of community means 0.138; SD of individual rates 0.291; ICC 0.15
   design effect if analysed per person: 1 + (m - 1) ICC = 2.70
chosen: SD 0.15, delta 0.10 (control 0.40 -> 0.50): 48 communities per arm analysable;
   allowing 10 % incomplete communities, recruit 54 per arm =
   648 people per arm, 1296 in all
true effect 0.10: some benefit shown 0.905; 'at least 0.10' shown 0.027
true effect 0.15: some benefit shown 1.000; 'at least 0.10' shown 0.383
true effect 0.20: some benefit shown 1.000; 'at least 0.10' shown 0.902
Show the full program
# Sample size for the Chapter 8 cluster-randomised trial. Unit of randomisation: an
# online COMMUNITY of 12 people who play 30 rounds of a public goods game in re-matched
# groups of 3. Primary outcome, one number per community: the share of "contribute"
# decisions in rounds 21-30. The analysis is at community level, so the sample size
# needs the SD of community means (sigma_g), which depends on the intra-cluster
# correlation (ICC) of individual rates. All parameter values are assumptions, to be
# checked against pilot data.
# Arm A labels: one fixed rule, simple standing with strict justification (see p15).
import math, random
from statistics import NormalDist, mean, pstdev
rng = random.Random(14)
z = NormalDist().inv_cdf
ALPHA, POWER, M = 0.05, 0.90, 12

def n_per_arm(sd, delta):
    return math.ceil(2 * (z(1 - ALPHA / 2) + z(POWER)) ** 2 * sd ** 2 / delta ** 2)

print("communities per arm (alpha 0.05 two-sided, 90 % power)")
print("   SD of community means   delta 0.08   delta 0.10   delta 0.12")
for sd in (0.12, 0.15, 0.18):
    print(f"           {sd:.2f}              " + "         ".join(
        f"{n_per_arm(sd, d):3d}" for d in (0.08, 0.10, 0.12)))

# A generative model for individuals: person j in community g contributes in each of the
# 10 scored rounds with probability p = base + u_g + e_j (clipped to 0..1), where
# u_g ~ N(0, 0.13^2) is shared by the community and e_j ~ N(0, 0.25^2) is personal.
def community(base, tau=0.13, s_e=0.25):
    u = rng.gauss(0, tau); rates = []
    for _ in range(M):
        p = min(1.0, max(0.0, base + u + rng.gauss(0, s_e)))
        rates.append(sum(rng.random() < p for _ in range(10)) / 10)
    return rates
cs = [community(0.40) for _ in range(3000)]
means = [mean(c) for c in cs]
sd_g = pstdev(means)
within = mean(pstdev(c) ** 2 * M / (M - 1) for c in cs)
icc = (sd_g ** 2 - within / M) / (sd_g ** 2 - within / M + within)
print(f"model: SD of community means {sd_g:.3f}; SD of individual rates"
      f" {math.sqrt(within + sd_g ** 2 - within / M):.3f}; ICC {icc:.2f}")
print(f"   design effect if analysed per person: 1 + (m - 1) ICC ="
      f" {1 + (M - 1) * icc:.2f}")

SD, DELTA = 0.15, 0.10
n = n_per_arm(SD, DELTA); rec = math.ceil(n / 0.9)
print(f"chosen: SD 0.15, delta 0.10 (control 0.40 -> 0.50): {n} communities per arm"
      f" analysable;")
print(f"   allowing 10 % incomplete communities, recruit {rec} per arm =\n  "
      f" {rec * M} people per arm, {2 * rec * M} in all")

# What the decision rule (p15) will say if the true effect equals the smallest effect of
# interest (0.10): 95 % CI of the difference from a two-sample t-type interval.
def trial(true_delta, n):
    a = [rng.gauss(0.40, SD) for _ in range(n)]; b = [rng.gauss(0.40 + true_delta, SD)
                                                       for _ in range(n)]
    d = mean(b) - mean(a)
    se = math.sqrt((pstdev(a) ** 2 + pstdev(b) ** 2) * n / (n - 1) / n)
    return d - 1.96 * se, d + 1.96 * se
for td in (0.10, 0.15, 0.20):
    res = [trial(td, n) for _ in range(4000)]
    benefit = sum(lo > 0 for lo, hi in res) / 4000
    strong = sum(lo >= 0.10 for lo, hi in res) / 4000
    print(f"true effect {td:.2f}: some benefit shown {benefit:.3f};"
          f" 'at least 0.10' shown {strong:.3f}")

Single source and citation

Fan, Y. (2026). Evolutionary Game Theory, Direct and Indirect Reciprocity and the Emergence of Cooperation (Version 1.0.0), Chapter 8: Practice and a Pre-Registered Trial. 5D Library. https://doi.org/10.5281/zenodo.23788551

DOI: 10.5281/zenodo.23788551 · Read the monograph · 5DL-B-035 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026035,
  author    = {Fan, Yafu},
  title     = {Evolutionary Game Theory, Direct and Indirect Reciprocity and the Emergence of Cooperation},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  doi       = {10.5281/zenodo.23788551},
  url       = {https://doi.org/10.5281/zenodo.23788551}
}

Other chapter answers in this book