What does Habit Curves and the 21-Day Myth conclude, in numbers, about “A Cue-Based Automaticity Index: Cue Entropy, Time of Day and a Repetition Clock”?

Answer: A habit is a bond between context and response, and the more stable the context, the faster the bond forms. This chapter defined a cue-based automaticity index from the Shannon entropy of preceding events and time slots: it is 1.000 with a single cue and falls to 0.145 when cues are random, which under the illustrative conversion stretches T95 from 59.0 to 121.2 days. In empirical work, the gap between morning and evening performance was 105.95 days against 154.01. Switching the axis from days to repetitions, an act done 6 times a day reaches its plateau in 11 days and one done twice a week takes 184. For operators, the lowest-cost way to speed things up is not more polished content but helping each member pick one fixed preceding event on the first day, and scheduling the cycle in repetitions rather than calendar days. The next chapter turns to measurement itself: how small a change a scale can see, and why the average curve misleads.

Scope of the numbers: Its population parameters, forgetting rates and cue indices are illustrative; all calculations are generated by its programs; it is not medical or psychological advice, nor personalised business advice. Marked boxes separate published evidence, runnable Python calculations (19 programs), 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.145, 1.000, 121.2, 59.0, 95

logcuesCAIT95 (days)
one anchor, one slot11.00059.0
one anchor, 2 slots20.82066.1
2 anchors alternating20.79267.4
weekday vs weekend50.75969.0
no fixed anchor190.145121.2
Fournier ratio of T95, evening / morning: 1.454
CAI that would match it if morning = 1: 0.480
flag (CAI < 0.50): 1 log; strong (CAI >= 0.75): 4 logs
Show the full program
# Chapter 5. p51: A cue-based automaticity index (CAI) from a 28-day log.
# Each day records the anchor that preceded the behaviour (an event such
# as "after coffee") and a time slot. CAI = 1 - H / H_max, where H is the
# Shannon entropy (bits) of the observed (anchor, slot) pairs and H_max =
# log2(28) is the entropy of 28 all-different days. The author's
# illustrative link to the rate: c = c_top * (0.4 + 0.6 * CAI), with c_top
# set so that CAI = 1 gives T95 = 59 days (the drinking median of Lally
# et al. 2010). Fournier et al. (2017): morning 105.95 vs evening 154.01
# days; we ask what CAI gap the link would need to produce that ratio.
# Grouping thresholds 0.5 and 0.75 are the author's, for convenience.
import math
import random
from collections import Counter

DAYS = 28
H_MAX = math.log2(DAYS)
LN20B = math.log(20 * 30 / 35)
C_TOP = LN20B / 59.0


def cai(log):
    n = len(log)
    cnt = Counter(log)
    h = -math.fsum(v / n * math.log2(v / n) for v in sorted(cnt.values()))
    return 1.0 - h / H_MAX, len(cnt)


def t95(index):
    return LN20B / (C_TOP * (0.4 + 0.6 * index))


rng = random.Random(20261112)
anchors = ["coffee", "commute", "lunch", "shower", "dinner", "bed"]
slots = ["06", "08", "12", "18", "21", "23"]
logs = [
    ("one anchor, one slot", [("coffee", "08")] * DAYS),
    ("one anchor, 2 slots", [("coffee", "08" if d % 7 < 5 else "10")
                             for d in range(DAYS)]),
    ("2 anchors alternating", [("coffee", "08") if d % 2 else
                               ("dinner", "18") for d in range(DAYS)]),
    ("weekday vs weekend", [("commute", "08") if d % 7 < 5 else
                            (anchors[d % 6], slots[d % 6])
                            for d in range(DAYS)]),
    ("no fixed anchor", [(rng.choice(anchors), rng.choice(slots))
                         for _ in range(DAYS)]),
]
print("  log                     cues   CAI     T95 (days)")
for name, log in logs:
    v, m = cai(log)
    print("  %-22s %5d   %5.3f   %10.1f" % (name, m, v, t95(v)))
ratio = 154.01 / 105.95
print("")
print("Fournier ratio of T95, evening / morning: %.3f" % ratio)
# solve 0.4 + 0.6 * hi = ratio * (0.4 + 0.6 * lo) with hi = 1
lo = ((0.4 + 0.6) / ratio - 0.4) / 0.6
print("CAI that would match it if morning = 1: %.3f" % lo)
LOW, HIGH = 0.5, 0.75
flagged = [n for n, log in logs if cai(log)[0] < LOW]
strong = [n for n, log in logs if cai(log)[0] >= HIGH]
print("flag (CAI < %.2f): %d log; strong (CAI >= %.2f): %d logs"
      % (LOW, len(flagged), HIGH, len(strong)))

Single source and citation

Fan, Y. (2026). Asymptotic Habit-Formation Curves, Debunking the 21-Day Myth and a Cue-Based Automaticity Index (Version 1.0.0), Chapter 5: A Cue-Based Automaticity Index: Cue Entropy, Time of Day and a Repetition Clock. 5D Library. DOI pending

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

BibTeX
@book{fan2026197,
  author    = {Fan, Yafu},
  title     = {Asymptotic Habit-Formation Curves, Debunking the 21-Day Myth and a Cue-Based Automaticity Index},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book