5D Library › 诊学一体转化漏斗、掌握度门控课程与持牌人网络经济学 · English

第二章 先修图与遗忘曲线:课程的骨架

十二个科目,谁先谁后

一门覆盖多种术数的课程首先要回答排序问题:八字要先懂历法与干支,奇门要先懂八字与六爻的卦象,风水(以九宫飞星一类方法为例)又用到奇门的九宫。把「a 必须在 b 之前学完」写成一条有向边,课程就是一张有向无环图(DAG)。图的拓扑排序给出合法的学习顺序 (Kahn 1962);而合法顺序一共有多少种,是图论中「线性扩张计数」的问题,一般情形下计算困难 (Brightwell and Winkler 1991),但 12 个科目可以用子集动态规划精确算出。

注

先修关系是本书设定的示意参数,不是任何传统的规定。 各科学时同样是示意值。程序中科目以拼音或英文缩写表示,对照见序言。

推导

# Chapter 2. [p03] A 12-subject prerequisite graph: order, path, count.
# Subjects (hours of study): lifa calendar (12), numer numerology (6),
# astro western astrology (14), bazi four pillars (30), liuyao six lines
# (18), ziwei purple star (28), chenggu bone weight (4), meihua plum
# blossom (10), qimen (32), fengshui (24), xingming naming (10), uranian
# (16). An edge a -> b means a must be passed before b starts.
# Computed: a topological order (Kahn, alphabetical tie-break), the
# longest (critical) path in hours, the depth layers, and the exact
# number of admissible study orders (linear extensions) by a DP over
# the 2^12 subsets of passed subjects.

HOURS = {"lifa": 12, "numer": 6, "astro": 14, "bazi": 30, "liuyao": 18,
         "ziwei": 28, "chenggu": 4, "meihua": 10, "qimen": 32,
         "fengshui": 24, "xingming": 10, "uranian": 16}
EDGES = [("lifa", "bazi"), ("lifa", "ziwei"), ("lifa", "liuyao"),
         ("lifa", "chenggu"), ("liuyao", "meihua"), ("bazi", "qimen"),
         ("liuyao", "qimen"), ("qimen", "fengshui"), ("bazi", "ziwei"),
         ("numer", "xingming"), ("bazi", "xingming"), ("astro", "uranian")]

def topo(names, edges):
    indeg = {n: 0 for n in names}
    for a, b in edges:
        indeg[b] += 1
    ready = sorted(n for n in names if indeg[n] == 0)
    order = []
    while ready:
        n = ready.pop(0)
        order.append(n)
        for a, b in edges:
            if a == n:
                indeg[b] -= 1
                if indeg[b] == 0:
                    ready.append(b)
                    ready.sort()
    return order

if __name__ == "__main__":
    names = sorted(HOURS)
    order = topo(names, EDGES)
    print("   order: " + " ".join(order[:6]))
    print("          " + " ".join(order[6:]))
    finish, prev, depth = {}, {}, {}
    for n in order:
        pre = [a for a, b in EDGES if b == n]
        best = max(pre, key=lambda a: finish[a]) if pre else None
        finish[n] = HOURS[n] + (finish[best] if best else 0)
        prev[n] = best
        depth[n] = 1 + max((depth[a] for a in pre), default=0)
    end = max(finish, key=finish.get)
    path, n = [], end
    while n:
        path.append(n)
        n = prev[n]
    print("   critical path ({} h): {}".format(
        finish[end], " -> ".join(reversed(path))))
    print("   total hours: {}".format(sum(HOURS.values())))
    for d in range(1, max(depth.values()) + 1):
        print("   layer {}: {}".format(
            d, " ".join(n for n in order if depth[n] == d)))
    idx = {n: i for i, n in enumerate(names)}
    need = [0] * len(names)
    for a, b in EDGES:
        need[idx[b]] |= 1 << idx[a]
    ways = [0] * (1 << len(names))
    ways[0] = 1
    for m in range(1 << len(names)):
        if ways[m]:
            for i in range(len(names)):
                if not m >> i & 1 and need[i] & m == need[i]:
                    ways[m | 1 << i] += ways[m]
    full = ways[-1]
    print("   admissible study orders: {:,d} of 12! = {:,d}".format(
        full, 479001600))
    print("   share of all orders    : {:.4f}".format(full / 479001600))
    print("\nReading: 12 edges remove all but a small share of the")
    print("orders, yet many admissible paths remain; the gate fixes")
    print("which subject may come next, not a single syllabus.")
#    order: astro lifa bazi chenggu liuyao meihua
#           numer qimen fengshui uranian xingming ziwei
#    critical path (98 h): lifa -> bazi -> qimen -> fengshui
#    total hours: 204
#    layer 1: astro lifa numer
#    layer 2: bazi chenggu liuyao uranian
#    layer 3: meihua qimen xingming ziwei
#    layer 4: fengshui
#    admissible study orders: 543,510 of 12! = 479,001,600
#    share of all orders    : 0.0011
#
# Reading: 12 edges remove all but a small share of the
# orders, yet many admissible paths remain; the gate fixes
# which subject may come next, not a single syllabus.
12 个科目的先修图。粗线为关键路径。

12 个科目共 204 学时,分为四层。关键路径是 lifa → bazi → qimen → fengshui,共 98 学时:即使一位学员可以同时学几门,他也至少要学完这 98 小时才能考风水。12 条先修边把 12! = 479,001,600 种排列砍到 543,510 种,只剩 0.0011。但五十多万种合法顺序仍然意味着:掌握度门控规定的是「下一门可以学什么」,而不是一条唯一的教学大纲。课程可以为不同学员给出不同的路径。

学完会忘:两种遗忘曲线

Ebbinghaus 最早用无意义音节测量遗忘 (Ebbinghaus 1885)。此后关于遗忘曲线的形式一直有争论:Wixted 与 Ebbesen 认为幂函数比指数函数更好地拟合遗忘 (Wixted and Ebbesen 1991);Anderson 与 Tweney 则指出,把许多各自按指数遗忘的人的曲线平均起来,会得到看似幂律的曲线 (Anderson and Tweney 1997)。间隔复习的效果有大量实验支持 (Cepeda et al. 2006)。

程序把两种曲线都校准为「经过 SS 天后回忆率为 0.9」,其中 SS 是记忆的稳定度:指数形式 R(t)=0.9t/SR(t) = 0.9^{t/S},幂律形式 R(t)=1/(1+t/(9S))R(t) = 1/(1 + t/(9S))。当回忆率降到目标 0.80 时安排一次复习,成功的复习使 SS 乘以 2.5。

推导

# Chapter 2. [p04] Exponential versus power-law forgetting; spacing.
# Both curves are calibrated so that recall is 0.9 after S days, where
# S is the memory's stability:
#     exponential  R(t) = 0.9 ** (t / S)
#     power law    R(t) = 1 / (1 + t / (9 S))
# A review is scheduled when R falls to the target 0.80; a successful
# review multiplies S by 2.5. Starting from S = 1 day, the program counts
# the reviews needed to keep recall >= 0.80 for 90 days and the recall
# on day 90 with no review at all. It then averages exponential curves
# over learners whose S is lognormal (median 1, log-sd 1.2): a crowd of
# exponential forgetters looks like a power law.
import math
import random

TARGET, GROW, HORIZON = 0.80, 2.5, 90

def r_exp(t, s):
    return 0.9 ** (t / s)

def r_pow(t, s):
    return 1 / (1 + t / (9 * s))

def gap(model, s):
    if model == "exp":
        return s * math.log(TARGET) / math.log(0.9)
    return 9 * s * (1 / TARGET - 1)

def schedule(model):
    t, s, days = 0.0, 1.0, []
    while True:
        t += gap(model, s)
        if t >= HORIZON:
            return days
        days.append(t)
        s *= GROW

if __name__ == "__main__":
    for model, f in (("exp", r_exp), ("pow", r_pow)):
        days = schedule(model)
        print("   {}: no review, recall on day 90 = {:.5f}".format(
            model, f(HORIZON, 1.0)))
        print("        reviews needed: {}  on days {}".format(
            len(days), " ".join("{:.1f}".format(d) for d in days)))
    rng = random.Random(74004)
    ss = [math.exp(rng.gauss(0, 1.2)) for _ in range(20000)]
    print("   crowd of exponential forgetters (lognormal S):")
    print("        day   crowd   pow(S=1)  exp(S=1)")
    for t in (1, 3, 10, 30, 90):
        crowd = sum(r_exp(t, s) for s in ss) / len(ss)
        print("        {:3d} {:7.3f} {:9.3f} {:9.5f}".format(
            t, crowd, r_pow(t, 1), r_exp(t, 1)))
    print("\nReading: four expanding reviews hold recall at the")
    print("target for 90 days under either law. Without review, the")
    print("two laws part company by orders of magnitude; and a crowd")
    print("of exponential learners already shows a power-law tail, so")
    print("a population curve cannot decide the individual law.")
#    exp: no review, recall on day 90 = 0.00008
#         reviews needed: 4  on days 2.1 7.4 20.6 53.7
#    pow: no review, recall on day 90 = 0.09091
#         reviews needed: 4  on days 2.2 7.9 21.9 57.1
#    crowd of exponential forgetters (lognormal S):
#         day   crowd   pow(S=1)  exp(S=1)
#           1   0.839     0.900   0.90000
#           3   0.655     0.750   0.72900
#          10   0.378     0.474   0.34868
#          30   0.157     0.231   0.04239
#          90   0.041     0.091   0.00008
#
# Reading: four expanding reviews hold recall at the
# target for 90 days under either law. Without review, the
# two laws part company by orders of magnitude; and a crowd
# of exponential learners already shows a power-law tail, so
# a population curve cannot decide the individual law.
指数遗忘、幂律遗忘与「指数遗忘者人群的平均」。横轴为对称对数刻度。

两种遗忘律下,四次逐渐拉长间隔的复习都足以让回忆率在 90 天内不低于 0.80:指数律在第 2.1、7.4、20.6、53.7 天,幂律在第 2.2、7.9、21.9、57.1 天,两者的安排几乎相同。不复习时两者却相差几个数量级:第 90 天,指数律的回忆率是 0.00008,幂律是 0.09091。第三部分是 Anderson 与 Tweney 的论点:一群各自按指数遗忘、稳定度不同的人,平均曲线在第 90 天仍有 0.041,远高于单个指数遗忘者,看起来像幂律。

这对课程设计有两点含义。其一,复习计划对遗忘律的形式并不敏感,可以放心按「降到目标就复习」排程。其二,用全体学员的平均曲线不能判断个人的遗忘律,也就不能用平均曲线来为个人定复习间隔;应当按每位学员自己的作答记录估计稳定度。

假说 · 尚未验证

作者的诠释(尚未验证): 术数课程中最容易遗忘的是查表类知识(如纳甲、星曜落宫),按个人稳定度安排的间隔复习能让学员在 90 天后仍保持 0.80 以上的回忆率。什么会证明这一判断错:若在预注册实验中,按个人稳定度排程的学员与按固定间隔复习的学员,在第 90 天的迁移测验成绩没有差别,那么个人化排程不值得它的复杂度。

小结

12 个科目的先修图有 98 学时的关键路径和 543,510 种合法学习顺序;门控限定的是下一步,不是唯一路径。两种遗忘律给出几乎相同的复习计划,但在不复习时相差几个数量级;人群平均曲线无法区分它们。

参考文献

Anderson, Richard B., and Ryan D. Tweney. 1997. “Artifactual Power Curves in Forgetting.” Memory & Cognition 25 (5): 724–30.
Brightwell, Graham, and Peter Winkler. 1991. “Counting Linear Extensions.” Order 8 (3): 225–42.
Cepeda, Nicholas J., Harold Pashler, Edward Vul, John T. Wixted, and Doug Rohrer. 2006. “Distributed Practice in Verbal Recall Tasks: A Review and Quantitative Synthesis.” Psychological Bulletin 132 (3): 354–80.
Ebbinghaus, Hermann. 1885. Über Das Gedächtnis: Untersuchungen Zur Experimentellen Psychologie. Duncker & Humblot.
Kahn, A. B. 1962. “Topological Sorting of Large Networks.” Communications of the ACM 5 (11): 558–62.
Wixted, John T., and Ebbe B. Ebbesen. 1991. “On the Form of Forgetting.” Psychological Science 2 (6): 409–15.

Fan, Y. (2026). Diagnostic-to-Pedagogy Conversion Funnels, Mastery-Gated Curriculum Architecture and Certification Network Economics: Self-Cannibalization Bounds, Spaced-Retrieval Curves and Two-Sided Practitioner Licensing [诊学一体转化漏斗、掌握度门控课程与持牌人网络经济学] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090197 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).