What does Assurance Contracts and Pre-Sales conclude, in numbers, about “Closing the Loop: Operating a Limited Pre-Sale Page, the Calculator and a Pre-Registered Test”?

Answer: Chapter 8 gives the operating procedure for a limited pre-sale page, the distilled Threshold Chance Calculator and a pre-registered test whose whole-campaign design needs 392 pre-sales per arm. The book contains 20 runnable Python programs.

Scope of the numbers: Parameters are illustrative; all calculations are generated by the book's programs. The book is general analysis, not individualised business or legal advice.

中文版

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: 392

z for 0.9751.9600, z for 0.80 = 0.8416
visitors per arm (0.040 vs 0.046)17943
pre-sales per arm (0.45 vs 0.55)392
simulated power 0.8050, false alarms 0.0390 (2000 runs)
Show the full program
# Chapter 8. p82: sample size for the pre-registered test. Both arms
# keep the full refund; arm B adds a refund bonus. Unit 1: visitors,
# outcome = pledges (illustrative 0.040 versus 0.046). Unit 2: whole
# pre-sales, outcome = batch made (illustrative 0.45 versus 0.55).
# Two-sided alpha 0.05, power 0.80, normal approximation for two
# proportions; then a fixed-seed simulation of the campaign-level
# design checks power and the false-alarm rate at the computed size.
import math
import random


def phi(z):
    return 0.5 * (1 + math.erf(z / math.sqrt(2)))


def zq(p):
    lo, hi = -10.0, 10.0
    for _ in range(100):
        mid = (lo + hi) / 2
        if phi(mid) < p:
            lo = mid
        else:
            hi = mid
    return (lo + hi) / 2


def n_per_arm(p1, p2, alpha=0.05, power=0.80):
    za, zb = zq(1 - alpha / 2), zq(power)
    pb = (p1 + p2) / 2
    num = (za * math.sqrt(2 * pb * (1 - pb))
           + zb * math.sqrt(p1 * (1 - p1) + p2 * (1 - p2)))
    return math.ceil(num ** 2 / (p1 - p2) ** 2)


def reject(rng, n, p1, p2, za):
    x1 = len([1 for _ in range(n) if rng.random() < p1])
    x2 = len([1 for _ in range(n) if rng.random() < p2])
    pb = (x1 + x2) / (2 * n)
    se = math.sqrt(2 * pb * (1 - pb) / n)
    return se > 0 and abs(x2 / n - x1 / n) / se > za


if __name__ == "__main__":
    print("z for 0.975 = {:.4f}, z for 0.80 = {:.4f}".format(
        zq(0.975), zq(0.80)))
    nv = n_per_arm(0.040, 0.046)
    nc = n_per_arm(0.45, 0.55)
    print("visitors per arm (0.040 vs 0.046): {}".format(nv))
    print("pre-sales per arm (0.45 vs 0.55): {}".format(nc))
    rng = random.Random(20261113)
    za, sims = zq(0.975), 2000
    hit = len([1 for _ in range(sims) if reject(rng, nc, 0.45, 0.55, za)])
    null = len([1 for _ in range(sims) if reject(rng, nc, 0.50, 0.50, za)])
    print("simulated power {:.4f}, false alarms {:.4f} ({} runs)".format(
        hit / sims, null / sims, sims))

Single source and citation

Fan, Y. (2026). Assurance Contracts and Pre-Sale Group Thresholds: Refund Promises and Free-Riding Equilibria in Public Goods (Version 1.0.0), Chapter 8: Closing the Loop: Operating a Limited Pre-Sale Page, the Calculator and a Pre-Registered Test. 5D Library. DOI pending

DOI pending · monograph page goes live after publication · 5DL-B-316 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026316,
  author    = {Fan, Yafu},
  title     = {Assurance Contracts and Pre-Sale Group Thresholds: Refund Promises and Free-Riding Equilibria in Public Goods},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book