5D Library › Insulin-Glucagon Bistability, Visceral Lipolysis Kinetics and Linear-Programming Diet Optimization · 中文

Chapter 8. The Month, and the Gate

What the scale will actually show

A twenty-eight day plan is bought on the expectation of a number on a scale, and the number on the scale is the least informative quantity in the whole exercise. Three things move at once. Fat leaves slowly, at the rate the deficit allows. Glycogen leaves quickly, together with the water bound to it, and returns the moment carbohydrate does. And the scale itself is noisy, because gut contents and fluid shift from day to day by more than a day of fat loss amounts to. Hall and colleagues make the general case for modelling rather than extrapolating a deficit (Hall et al. 2011); p15 does the narrow version with imperfect adherence, since the trials in Chapter 3 found adherence to be the thing that actually varies (Trepanowski et al. 2017).

Calculation

# Chapter 8. p15: What twenty-eight days on the plan does to the scale,
# and why the scale is a poor witness. Three things move at once: fat,
# which the deficit removes slowly; glycogen with the water bound to it,
# which a low-carbohydrate week removes quickly and which returns the
# moment carbohydrate does; and the day-to-day noise of gut contents and
# fluid. Adherence is not perfect: the deficit achieved each day is the
# target times a draw between nought and one and a bit. Four thousand
# paths, seed 95, so the figures repeat exactly.
import random

SEED, PATHS, DAYS = 95, 4000, 28
TARGET = 500.0            # kcal a day aimed at
KCAL_PER_G = 7.7          # adipose tissue
GLY_KG = 1.60             # kg of glycogen and the water bound to it
GLY_DAYS = 6              # days over which that store is drawn down
NOISE_KG = 0.45           # day-to-day scale noise, one standard deviation
ADHERE_A, ADHERE_B = 0.55, 1.25

def one(rng):
    fat_g = 0.0
    weights = []
    for d in range(DAYS):
        adhere = rng.uniform(ADHERE_A, ADHERE_B)
        fat_g += TARGET * adhere / KCAL_PER_G
        gly = GLY_KG * min(1.0, (d + 1) / GLY_DAYS)
        weights.append(-fat_g / 1000.0 - gly + rng.gauss(0.0, NOISE_KG))
    return fat_g / 1000.0, weights

def q(v, a):
    s = sorted(v)
    return s[int(a * (len(s) - 1))]

if __name__ == "__main__":
    rng = random.Random(SEED)
    fat, scale, w1, w4, rose = [], [], [], [], 0
    for _ in range(PATHS):
        f, w = one(rng)
        fat.append(f)
        scale.append(w[-1])
        w1.append(w[6])
        w4.append(w[-1] - w[20])
        if w[-1] > w[20]:
            rose += 1
    print("   {} paths of {} days, target deficit {:.0f} kcal a day"
          .format(PATHS, DAYS, TARGET))
    print("   fat lost, kg: median {:.3f}, 10% to 90% {:.3f} to {:.3f}"
          .format(q(fat, 0.5), q(fat, 0.1), q(fat, 0.9)))
    print("   scale change at day {}, kg: median {:.3f},"
          " 10% to 90% {:.3f} to {:.3f}".format(DAYS, q(scale, 0.5),
                                                q(scale, 0.1),
                                                q(scale, 0.9)))
    print("   scale change at day 7, kg: median {:.3f}".format(q(w1, 0.5)))
    print("   of the day-7 fall, glycogen and water are {:.3f} kg"
          .format(GLY_KG))
    print("   so fat is only {:.3f} of what the scale showed in week one"
          .format((q(fat, 0.5) * 7.0 / DAYS) / -q(w1, 0.5)))
    print("   scale change over the last week, kg: median {:.3f}"
          .format(q(w4, 0.5)))
    print("   share of paths whose scale rose over the last week: {:.3f}"
          .format(rose / PATHS))
    print("   mean adherence achieved: {:.3f}"
          .format((ADHERE_A + ADHERE_B) / 2.0))
    print("   fat the plan would remove at full adherence: {:.3f} kg"
          .format(TARGET * DAYS / KCAL_PER_G / 1000.0))
    print("   median achieved as a share of that: {:.3f}"
          .format(q(fat, 0.5) / (TARGET * DAYS / KCAL_PER_G / 1000.0)))
    print("   the noise of one weighing, {:.2f} kg, is {:.2f} times the"
          .format(NOISE_KG, NOISE_KG / (q(fat, 0.5) / DAYS)))
    print("   fat a median day removes, which is why daily weighing"
          " misleads")
#    4000 paths of 28 days, target deficit 500 kcal a day
#    fat lost, kg: median 1.636, 10% to 90% 1.548 to 1.726
#    scale change at day 28, kg: median -3.233, 10% to 90% -3.802 to -2.647
#    scale change at day 7, kg: median -2.030
#    of the day-7 fall, glycogen and water are 1.600 kg
#    so fat is only 0.202 of what the scale showed in week one
#    scale change over the last week, kg: median -0.409
#    share of paths whose scale rose over the last week: 0.261
#    mean adherence achieved: 0.900
#    fat the plan would remove at full adherence: 1.818 kg
#    median achieved as a share of that: 0.900
#    the noise of one weighing, 0.45 kg, is 7.70 times the
#    fat a median day removes, which is why daily weighing misleads

Over 4000 paths of 28 days at a target deficit of 500 kcal a day, the median fat lost is 1.636 kg with a ten to ninety range of 1.548 to 1.726, against 1.818 kg at full adherence; the median achieved is 0.900 of that, which is simply the mean adherence. The median change on the scale at day 28 is a fall of 3.233 kg, with a range of 3.802 to 2.647. The gap between 1.636 and 3.233 is the water, and it is not a loss of anything the plan was aiming at.

The first week is where this matters commercially. The median scale change at day 7 is a fall of 2.030 kg, of which 1.600 kg is glycogen and its water, so only 0.202 of what the scale showed is fat. Everything the first week sells is mostly water, and it comes back.

The last week is where it matters psychologically. The median scale change over the final week is a fall of only 0.409 kg, and 0.261 of paths show the scale rising over that week even though every one of them is losing fat throughout. A single weighing carries noise of 0.45 kg, which is 7.70 times the fat a median day removes. Anyone who weighs daily and reacts to the reading is reacting to noise about seven times out of eight.

Hypothesis · not established

The author’s interpretation (not yet tested): abandonment in week four is driven by the arithmetic of the scale rather than by hunger, because that is the week in which a quarter of adherent people see the number go up. What would show it wrong: in a cohort weighed daily with intake recorded, if dropout in week four were predicted by hunger ratings and not by whether the individual’s own seven-day trend had turned positive, the arithmetic account would be wrong.

Who must not attempt this

The last computation in the book is the one that should come first in any product built on it. A plan that lowers insulin on purpose interacts with several common medicines in ways that can be dangerous, and it is contraindicated outright in several common conditions. p16 applies rounded population prevalences to a synthetic adult population and counts.

Calculation

# Chapter 8. p16: How many readers the safety gate must turn away. A
# plan that lowers insulin on purpose is dangerous for some people and
# needs a doctor's supervision for others. The prevalences below are
# rounded from published population figures for adults in a developed
# country and are applied independently, which overstates how many
# people carry exactly one flag and understates how many carry several;
# the point is the order of magnitude of the gate, not a forecast.
# Twenty thousand synthetic adults, seed 95.
import random

SEED, N = 95, 20000
STOP = (
    ("type 1 diabetes",                 0.0045),
    ("pregnant or breastfeeding",       0.0300),
    ("taking insulin",                  0.0220),
    ("taking a sulfonylurea",           0.0180),
    ("taking an SGLT2 inhibitor",       0.0260),
    ("history of an eating disorder",   0.0290),
    ("kidney function below 45",        0.0150),
    ("body mass index below 20",        0.0400),
    ("under 18 or frail and over 70",   0.0600),
)
CARE = (
    ("treated high blood pressure",     0.2600),
    ("type 2 diabetes on metformin",    0.0700),
    ("gout or raised uric acid",        0.0400),
    ("gallstones",                      0.0600),
    ("on a diuretic",                   0.0900),
    ("thyroid medication",              0.0500),
)

if __name__ == "__main__":
    rng = random.Random(SEED)
    stop_n = care_n = clear_n = 0
    stop_counts = [0] * len(STOP)
    care_counts = [0] * len(CARE)
    multi = 0
    for _ in range(N):
        s = [rng.random() < p for _, p in STOP]
        c = [rng.random() < p for _, p in CARE]
        for i, v in enumerate(s):
            stop_counts[i] += v
        for i, v in enumerate(c):
            care_counts[i] += v
        if any(s):
            stop_n += 1
            if sum(s) > 1:
                multi += 1
        elif any(c):
            care_n += 1
        else:
            clear_n += 1
    print("   {} synthetic adults".format(N))
    print("   absolute stop flags, share carrying each:")
    for (name, p), k in zip(STOP, stop_counts):
        print("   {:<34}{:.4f}   (set {:.4f})".format(name, k / N, p))
    print("   needs supervision, share carrying each:")
    for (name, p), k in zip(CARE, care_counts):
        print("   {:<34}{:.4f}   (set {:.4f})".format(name, k / N, p))
    print("   turned away outright: {:.4f}".format(stop_n / N))
    print("   of those, share with more than one stop flag: {:.4f}"
          .format(multi / stop_n))
    print("   cleared only with supervision: {:.4f}".format(care_n / N))
    print("   free to proceed unsupervised: {:.4f}".format(clear_n / N))
    print("   so the gate stops or refers {:.4f} of adults"
          .format((stop_n + care_n) / N))
    print("   a plan written for everyone is therefore written for"
          " {:.4f} of them".format(clear_n / N))
#    20000 synthetic adults
#    absolute stop flags, share carrying each:
#    type 1 diabetes                   0.0042   (set 0.0045)
#    pregnant or breastfeeding         0.0285   (set 0.0300)
#    taking insulin                    0.0217   (set 0.0220)
#    taking a sulfonylurea             0.0185   (set 0.0180)
#    taking an SGLT2 inhibitor         0.0285   (set 0.0260)
#    history of an eating disorder     0.0299   (set 0.0290)
#    kidney function below 45          0.0146   (set 0.0150)
#    body mass index below 20          0.0394   (set 0.0400)
#    under 18 or frail and over 70     0.0590   (set 0.0600)
#    needs supervision, share carrying each:
#    treated high blood pressure       0.2542   (set 0.2600)
#    type 2 diabetes on metformin      0.0688   (set 0.0700)
#    gout or raised uric acid          0.0398   (set 0.0400)
#    gallstones                        0.0649   (set 0.0600)
#    on a diuretic                     0.0926   (set 0.0900)
#    thyroid medication                0.0510   (set 0.0500)
#    turned away outright: 0.2215
#    of those, share with more than one stop flag: 0.0993
#    cleared only with supervision: 0.3603
#    free to proceed unsupervised: 0.4182
#    so the gate stops or refers 0.5818 of adults
#    a plan written for everyone is therefore written for 0.4182 of them

Across 20000 synthetic adults, 0.2215 carry at least one absolute stop flag, and of those 0.0993 carry more than one. A further 0.3603 carry something that calls for supervision rather than prohibition, which leaves 0.4182 free to proceed unsupervised. The gate therefore stops or refers 0.5818 of adults.

Note

The flags, stated plainly. The absolute stops in p16 are type 1 diabetes (0.0042 in this sample), pregnancy or breastfeeding (0.0285), insulin (0.0217), a sulfonylurea (0.0185), an SGLT2 inhibitor (0.0285), any history of an eating disorder (0.0299), kidney function below the stated threshold (0.0146), a body mass index below 20 (0.0394), and being under eighteen or frail and over seventy (0.0590). On insulin or a sulfonylurea, cutting carbohydrate without changing the dose causes hypoglycaemia. On an SGLT2 inhibitor it can cause ketoacidosis at a normal blood glucose, which is why it is missed. The supervision list, led by treated high blood pressure at 0.2542, is where Chapter 5’s potassium arithmetic becomes dangerous rather than merely expensive. None of this is a substitute for a doctor who knows the individual case.

The independence assumption in p16 is wrong in a known direction: these conditions cluster, so the share carrying exactly one flag is overstated and the share carrying several is understated. That does not help the plan. Clustering concentrates risk in fewer people without reducing how many must be turned away, and the figure that matters, 0.2215 stopped outright, is a count of people with any flag, which clustering lowers only slightly.

Summary

Over 28 days the median fat lost is 1.636 kg while the scale falls 3.233 kg, and in week one only 0.202 of the fall is fat. In the last week the median fall is 0.409 kg and 0.261 of paths show the scale rising, with single-weighing noise 7.70 times a median day’s fat loss. The safety gate stops 0.2215 of adults outright and refers a further 0.3603, leaving 0.4182 who may proceed unsupervised. The arithmetic in this book is therefore a description of a mechanism and a bound on its size, and not a plan to be followed by the person who bought the book.

References

Hall, Kevin D., Gary Sacks, Dhruva Chandramohan, et al. 2011. “Quantification of the Effect of Energy Imbalance on Bodyweight.” The Lancet 378 (9793): 826 to 837.
Trepanowski, John F., Cynthia M. Kroeger, Adrienne Barnosky, et al. 2017. “Effect of Alternate-Day Fasting on Weight Loss, Weight Maintenance, and Cardioprotection among Metabolically Healthy Obese Adults.” JAMA Internal Medicine 177 (7): 930 to 938.

Fan, Y. (2026). Insulin-Glucagon Bistability, Visceral Lipolysis Kinetics and Linear-Programming Diet Optimization: Hepatic Glycogen Depletion Times, Triglyceride-Glucose Indices and Micronutrient-Constrained Menus [胰岛素胰高血糖素双稳态、内脏脂解动力学与线性规划配餐] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090248 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).