5D Library › 梦境意象二分图、确定性哈希牌卡与潜意识先验激活 · English

第二章 反梦、直梦与日间残留

两种解读规则,一个基率

传统梦书允许一个梦以两种方式应验:直接应验(梦见钱就得钱),或反过来应验(梦见死亡主长寿)。汉代王符的「十梦」里,「直」与「反」都在其中(见第七章)。在每种规则下,一个梦凭偶然「应验」的频率有多高?设一个简单的世界:每天有一件值得一提的事发生的概率是 0.30,好坏各半,与梦无关。

推导

# Chapter 2. p03: Direct dreams, reverse dreams and the base rate of a
# "dream that came true". A dream is read as good or bad news. Each day a
# notable event happens with probability 0.30, good or bad with equal
# chance, independently of the dream. The interpreter may (a) accept only
# the direct reading, or (b) also the reverse reading ("dreaming of death
# means long life"), and may look for the matching event within k days.
# Also: the expected number of striking matches among a million users.
import math

P_EVENT = 0.30

def p_fulfilled(k, reverse):
    per_day = P_EVENT if reverse else P_EVENT / 2
    return 1 - (1 - per_day) ** k

def p_signal(k, reverse, hit=0.9):
    # a genuine signal is fulfilled with probability `hit` on its own; the
    # same chance events that fulfil any dream can fulfil it too, so the two
    # routes combine independently: 1 - (1 - hit) * (1 - per_day) ** k
    per_day = P_EVENT if reverse else P_EVENT / 2
    return 1 - (1 - hit) * (1 - per_day) ** k

def bits(p_true_if_signal, p_true_if_not):
    # information (bits) a "fulfilled" verdict carries about whether the
    # dream was a real signal, prior 0.5, via mutual information
    p1, p0 = p_true_if_signal, p_true_if_not
    m = (p1 + p0) / 2
    h = lambda q: 0.0 if q in (0.0, 1.0) else \
        -q * math.log2(q) - (1 - q) * math.log2(1 - q)
    return h(m) - (h(p1) + h(p0)) / 2

if __name__ == "__main__":
    print("   window   direct only   direct or reverse")
    for k in (1, 3, 7, 30):
        print("   {:3d} d    {:9.3f}      {:9.3f}".format(
            k, p_fulfilled(k, False), p_fulfilled(k, True)))
    # a genuine signal fulfils itself with probability 0.9, and chance
    # events can fulfil it as well (independent composition, see p_signal)
    print("   bits a verdict carries (prior 0.5, signal fulfils 0.9):")
    print("     1-day direct: {:.3f}; 30-day direct or reverse: {:.6f}"
          .format(bits(p_signal(1, False), p_fulfilled(1, False)),
                  bits(p_signal(30, True), p_fulfilled(30, True))))
    users, p_strike = 1000000, 1e-4
    night = users * p_strike
    print("   1,000,000 users, chance match 1 in 10,000 per night:")
    print("     {:,.0f} striking stories a night, {:,.0f} a year".format(
        night, night * 365))
    print("     P(at least one tonight) = {:.6f}".format(
        1 - (1 - p_strike) ** users))
#    window   direct only   direct or reverse
#      1 d        0.150          0.300
#      3 d        0.386          0.657
#      7 d        0.679          0.918
#     30 d        0.992          1.000
#    bits a verdict carries (prior 0.5, signal fulfils 0.9):
#      1-day direct: 0.482; 30-day direct or reverse: 0.000007
#    1,000,000 users, chance match 1 in 10,000 per night:
#      100 striking stories a night, 36,500 a year
#      P(at least one tonight) = 1.000000

只接受直接应验、只看一天之内,梦应验的概率是 0.150;一周之内 0.679;一个月之内 0.992。若反向应验也算,每天的应验机会加倍:一天之内 0.300,一周之内 0.918,一个月之内 1.000。一个无论发生什么都成立的判定,不携带任何信息:设真有讯号的梦凭自身以 0.9 的概率应验,同时也可能被同样的偶然事件应验,两条途径相互独立,合起来的应验概率是 1 – (1 – 0.9)(1 – 每日偶然概率)^k;那么一天之内的直接判定关于「这个梦是不是讯号」携带 0.482 比特信息,而三十天内「直或反」的判定只携带 0.000007 比特:真讯号与纯偶然几乎都必然「应验」,判定再也分不开两者。规模也很重要 (Diaconis and Mosteller 1989):在 1,000,000 名用户中,每晚 10,000 分之一的偶然吻合,每晚产生 100 个惊人故事,一年 36,500 个,而今晚至少发生一个的概率是 1.000000。

日间残留、梦滞后与每周作息

梦确实取材于清醒生活。日记研究发现,前一两天的事件更常被编入梦中(日间残留效应),大约五到七天后还有第二个高峰(梦滞后效应)(Nielsen et al. 2004)。再加上每周重复的作息,一个无害的机制就会制造出「预知」:取自七天前的意象,恰好与明天落在同一个星期几,而作息正好在那天重复。

推导

# Chapter 2. p04: Day residue, the dream-lag effect and weekly routines.
# 12 kinds of daily event; each kind has 1 to 3 routine weekdays when it
# happens with probability 0.80 (otherwise 0.03). Each night 3 dream
# motifs are drawn: with probability 0.40 a random kind, otherwise an
# event of a past day chosen by lag weights 1:0.30 2:0.20 3:0.08 4:0.06
# 5:0.12 6:0.14 7:0.10 (higher at 1-2 and 5-7 days, the pattern reported
# for day residue and dream lag). A motif "comes true" if its kind
# happens the next day. 3,000 weeks, seed 89.
import random

LAGS = (0.30, 0.20, 0.08, 0.06, 0.12, 0.14, 0.10)
K = 12

def world(rng, routine=True):
    days = [set(rng.sample(range(7), rng.choice((1, 2, 3))))
            for _ in range(K)]
    if routine:
        return [[0.80 if d in days[k] else 0.03 for d in range(7)]
                for k in range(K)]
    mean = [sum(0.80 if d in days[k] else 0.03 for d in range(7)) / 7
            for k in range(K)]
    return [[mean[k]] * 7 for k in range(K)]

def run(routine, weeks=3000, seed=89):
    rng = random.Random(seed)
    p = world(rng, routine)
    T = 7 * weeks
    ev = [[k for k in range(K) if rng.random() < p[k][t % 7]]
          for t in range(T)]
    hits = {lag: [0, 0] for lag in range(8)}
    for t in range(7, T - 1):
        for _ in range(3):
            if rng.random() < 0.40:
                lag, kind = 0, rng.randrange(K)
            else:
                lag = rng.choices(range(1, 8), LAGS)[0]
                day = ev[t - lag + 1]
                kind = rng.choice(day) if day else rng.randrange(K)
            hits[lag][0] += kind in ev[t + 1]
            hits[lag][1] += 1
    return hits

def rate(h, keys):
    return sum(h[k][0] for k in keys) / sum(h[k][1] for k in keys)

if __name__ == "__main__":
    for routine in (True, False):
        h = run(routine)
        print("   weekly routine: {}".format("yes" if routine else "no"))
        print("     next-day hit rate: random motif {:.3f}, residue {:.3f}"
              .format(rate(h, [0]), rate(h, range(1, 8))))
        print("     by lag: 1-2 days {:.3f}, 3-6 days {:.3f}, 7 days {:.3f}"
              .format(rate(h, [1, 2]), rate(h, [3, 4, 5, 6]),
                      rate(h, [7])))
        res = sum(h[k][0] for k in range(1, 8))
        print("     share of residue hits from lag 7: {:.3f} (of residue"
              " motifs {:.3f})".format(h[7][0] / res, h[7][1] / sum(
                  h[k][1] for k in range(1, 8))))
#    weekly routine: yes
#      next-day hit rate: random motif 0.241, residue 0.245
#      by lag: 1-2 days 0.179, 3-6 days 0.206, 7 days 0.735
#      share of residue hits from lag 7: 0.301 (of residue motifs 0.100)
#    weekly routine: no
#      next-day hit rate: random motif 0.236, residue 0.272
#      by lag: 1-2 days 0.274, 3-6 days 0.270, 7 days 0.274
#      share of residue hits from lag 7: 0.102 (of residue motifs 0.102)

在有每周作息的世界里,随机意象第二天应验的比例是 0.241,残留意象是 0.245,平均几乎相同。但按滞后天数分开看就不一样了:前一两天的残留只有 0.179 应验(作息很少连续两天重复),三到六天前的残留 0.206,恰好七天前的残留 0.735。七天前的残留只占全部残留意象的 0.100,却占应验的残留意象的 0.301。没有每周作息时,按滞后天数的差别消失(0.274、0.270、0.274);残留意象仍比随机意象略容易应验(0.272 对 0.236),只因为常见的事件既容易被记住,也容易重复发生。

注

滞后数字的含义。 p04 中的滞后权重只是仿照日记研究报告的形状(一到两天与五到七天各有一个高峰),并未用任何数据拟合。结论不依赖于具体数值:只要梦取材于过去、生活又按周期重复,就总有一些梦会因此「应验」。

假说 · 尚未验证

作者的诠释(尚未验证): 在解梦应用的用户报告为「应验」的梦中,所对应的事件在同一个星期几重复发生的比例,至少是全部事件中每周重复事件比例的两倍。什么会证明它错: 在把梦与带日期的事件配对的日记研究中,「应验」的梦与每周重复事件的关联并不比其他梦更强。

小结

同时接受直接应验与反向应验的解读规则,一周之内凭偶然就有 0.918 的应验率,且不携带任何信息。真实存在的日间残留与梦滞后效应,遇上每周作息,会让七天前的残留有 0.735 的应验率;只要生活有重复,惊人的吻合就是意料之中的。

参考文献

Diaconis, Persi, and Frederick Mosteller. 1989. “Methods for Studying Coincidences.” Journal of the American Statistical Association 84 (408): 853 to 861.
Nielsen, Tore A., Don Kuiken, Geneviève Alain, Philippe Stenstrom, and Russell A. Powell. 2004. “Immediate and Delayed Incorporations of Events into Dreams: Further Replication and Implications for Dream Function.” Journal of Sleep Research 13 (4): 327 to 336.

Fan, Y. (2026). Dream Motif Bipartite Graphs, Deterministic Oracle Decks and Subconscious Prior Activation: REM Semantic Spreading, SHA-256 Fisher-Yates Permutations and Retroactive Coincidence Rates [梦境意象二分图、确定性哈希牌卡与潜意识先验激活] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090233 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).