What does The Shrinking Marshmallow Effect conclude, in numbers, about “Closing the Loop: the Toll-Booth Scenario Capsule, the Family Promise Ledger and Pre-Registration”?

Answer: Chapter 8 offers a toll-booth scenario capsule, a family promise ledger (telling a home that keeps nine promises in ten from one that keeps six needs at least 14 records) and a pre-registered testing plan. Marked boxes separate published evidence, the author's hypotheses, classical sources and runnable Python calculations (18 programs).

Scope of the numbers: Its parameters are illustrative; all calculations are generated by its programs; the book is not a psychological assessment or medical or parenting advice, and its suggestions for shops and communities are non-personalised business advice. Marked boxes separate published evidence, the author's hypotheses, classical sources and runnable Python calculations (18 programs).

中文版

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

homekept brokenmean90% intervalP>.5T* min
home A1820.864[0.729, 0.960]1.00015.0
home B750.571[0.355, 0.776]0.7099.8
home C360.364[0.150, 0.607]0.1725.2
cost per minute c = 0.05; prior Beta(1, 1)
Show the full program
# Chapter 8. p82: the family promise ledger, worked on three homes
# 模型:家庭承诺记录卡的核心算式。兑现率 k 的先验 Beta(1,1),记下兑现
# K 次、落空 B 次后后验为 Beta(1+K, 1+B);用正则化不完全贝塔函数
# (连分式)求 P(k > 0.5) 与 90% 等尾区间。把后验均值作为第三章的 q,
# 在每分钟代价 c = 0.05(示意)下求孩子的最优放弃时间 T*(p32 同式)。
# 三个示范家庭的记录数为虚构示意。
import math

M1, M2, CAP = 5.0, 60.0, 15.0


def betacf(a, b, x):
    qab, qap, qam = a + b, a + 1.0, a - 1.0
    c, d = 1.0, 1.0 - qab * x / qap
    d = 1.0 / (d if abs(d) > 1e-300 else 1e-300)
    h = d
    for m in range(1, 300):
        m2 = 2 * m
        for aa in (m * (b - m) * x / ((qam + m2) * (a + m2)),
                   -(a + m) * (qab + m) * x / ((a + m2) * (qap + m2))):
            d = 1.0 + aa * d
            d = 1.0 / (d if abs(d) > 1e-300 else 1e-300)
            c = 1.0 + aa / (c if abs(c) > 1e-300 else 1e-300)
            h *= d * c
        if abs(d * c - 1.0) < 1e-14:
            break
    return h


def betainc(a, b, x):
    if x <= 0.0:
        return 0.0
    if x >= 1.0:
        return 1.0
    lb = (math.lgamma(a + b) - math.lgamma(a) - math.lgamma(b)
          + a * math.log(x) + b * math.log(1 - x))
    if x < (a + 1) / (a + b + 2):
        return math.exp(lb) * betacf(a, b, x) / a
    return 1.0 - math.exp(lb) * betacf(b, a, 1 - x) / b


def beta_q(a, b, p):
    lo, hi = 0.0, 1.0
    for _ in range(80):
        mid = (lo + hi) / 2
        if betainc(a, b, mid) < p:
            lo = mid
        else:
            hi = mid
    return (lo + hi) / 2


def hazard(t, q):
    u = q * math.exp(-t / M1)
    v = (1 - q) * math.exp(-t / M2)
    return (u / M1 + v / M2) / (u + v)


def t_star(q, c):
    if hazard(0.0, q) <= c:
        return 0.0
    if hazard(CAP, q) >= c:
        return CAP
    lo, hi = 0.0, CAP
    for _ in range(60):
        mid = (lo + hi) / 2
        if hazard(mid, q) > c:
            lo = mid
        else:
            hi = mid
    return (lo + hi) / 2


def main():
    homes = [("home A", 18, 2), ("home B", 7, 5), ("home C", 3, 6)]
    print("home    kept broken  mean   90% interval    P>.5   T* min")
    for name, k, b in homes:
        a1, b1 = 1.0 + k, 1.0 + b
        m = a1 / (a1 + b1)
        lo, hi = beta_q(a1, b1, 0.05), beta_q(a1, b1, 0.95)
        p = 1.0 - betainc(a1, b1, 0.5)
        print("{:<8}{:>4}{:>7}  {:.3f}  [{:.3f}, {:.3f}]  {:.3f}  {:>6.1f}"
              .format(name, k, b, m, lo, hi, p, t_star(m, 0.05)))
    print("cost per minute c = 0.05; prior Beta(1, 1)")


if __name__ == "__main__":
    main()

Single source and citation

Fan, Y. (2026). The Shrinking Marshmallow Effect, Family-Resource Confounding and the Limits of Child Self-Control Interventions (Version 1.0.0), Chapter 8: Closing the Loop: the Toll-Booth Scenario Capsule, the Family Promise Ledger and Pre-Registration. 5D Library. DOI pending

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

BibTeX
@book{fan2026203,
  author    = {Fan, Yafu},
  title     = {The Shrinking Marshmallow Effect, Family-Resource Confounding and the Limits of Child Self-Control Interventions},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book