5D Library › Dream Motif Bipartite Graphs, Deterministic Oracle Decks and Subconscious Prior Activation · 中文

Chapter 8. Auditing a Card App and a Pre-Registered Trial

An audit any user can run

A hashed deck (Chapter 3) makes two kinds of misconduct detectable. The first is the redraw: letting a user, or the app on the user’s behalf, draw again until the card looks good. The second is quiet substitution by the operator. The cure for the second is a commit-reveal log: each midnight the app publishes the SHA-256 digest of that day’s secret salt; the next day it reveals the salt, and anyone can check the digest and recompute every logged reading from user, date, salt and question.

Calculation

# Chapter 8. p15: Auditing a card app. (1) Redraws: if 27 of 54 cards
# read as "positive" and a user may redraw a negative card up to r
# times, the share of positive readings is 1 - 0.5**(r + 1). (2) A
# commit-reveal log: the app publishes SHA-256 of each day's salt in
# advance; afterwards anyone can recompute every top card from user,
# date, salt and question. An operator who quietly redrew a negative
# card for 5% of 1,000 users (seed 89) is caught by recomputation.
import hashlib
import random

DECK = ["{}{:02d}".format(s, r) for s in "FWAE" for r in range(1, 14)]
DECK += ["JK1", "JK2"]
POSITIVE = set(DECK[0::2])

def top_card(user, date, salt, question):
    q = hashlib.sha256(question.encode("utf-8")).hexdigest()
    seed = hashlib.sha256("{}|{}|{}|{}".format(user, date, salt, q)
                          .encode("utf-8")).digest()
    w = int.from_bytes(hashlib.sha256(seed).digest()[:4], "big")
    limit = (2 ** 32 // 54) * 54
    k = 0
    while w >= limit:
        k += 1
        w = int.from_bytes(hashlib.sha256(seed + bytes([k])).digest()[:4],
                           "big")
    return DECK[w % 54]

if __name__ == "__main__":
    for r in range(4):
        print("   redraws allowed {}: positive share {:.3f}".format(
            r, 1 - 0.5 ** (r + 1)))
    salt = "s-2026-11-09"
    commit = hashlib.sha256(salt.encode()).hexdigest()
    print("   commitment published at midnight: {}...".format(commit[:24]))
    rng = random.Random(89)
    log, doctored = [], 0
    for u in range(1000):
        user, q = "u{:04d}".format(u), "What should I start today?"
        card = top_card(user, "2026-11-09", salt, q)
        if card not in POSITIVE and rng.random() < 0.05:
            card = rng.choice(sorted(POSITIVE))
            doctored += 1
        log.append((user, q, card))
    ok = hashlib.sha256(salt.encode()).hexdigest() == commit
    bad = sum(1 for user, q, card in log
              if top_card(user, "2026-11-09", salt, q) != card)
    print("   salt matches commitment: {}; doctored {}, caught {}".format(
        ok, doctored, bad))
    pos = sum(1 for _, _, c in log if c in POSITIVE) / 1000
    print("   positive share in the log {:.3f} (fair 0.500)".format(pos))
#    redraws allowed 0: positive share 0.500
#    redraws allowed 1: positive share 0.750
#    redraws allowed 2: positive share 0.875
#    redraws allowed 3: positive share 0.938
#    commitment published at midnight: 29e32d586fb225d412fe1adb...
#    salt matches commitment: True; doctored 25, caught 25
#    positive share in the log 0.533 (fair 0.500)

If half the cards read as “positive” and a negative card may be redrawn once, 0.750 of readings come out positive; twice, 0.875; three times, 0.938. Each redraw is invisible in a single reading and obvious in aggregate. In the simulated log of 1,000 users, an operator who replaced a negative card for 5% of them doctored 25 readings; the revealed salt matched the published commitment and recomputation caught all 25. The positive share of the log, 0.533 against a fair 0.500, would not by itself have shown the doctoring; recomputation does.

A pre-registered trial

The claims worth testing are the behavioural one of Chapter 6 and, for completeness, the claim of foreknowledge. The trial has three arms for four weeks: a daily oracle card, a daily random task number (the active control, identical except for imagery), and no aid; the outcome is work blocks started per week, from a time log.

Calculation

# Chapter 8. p16: Sample sizes for a pre-registered three-arm trial.
# Arms: a daily oracle card, a daily random task number (active
# control), no aid; 4 weeks; outcome: work blocks started per week.
# Two comparisons, so two-sided alpha 0.025 each, power 0.80, normal
# approximation n = 2 (z_a + z_b)^2 / d^2 per arm. Equivalence of card
# and number (TOST, margin d = 0.2, alpha 0.05, power 0.90). And a test
# of "the card foretells the day": hit rate 1/54 by chance against a
# claimed 1/40, one-sided alpha 0.001, power 0.90.
import math
from statistics import NormalDist

Z = NormalDist().inv_cdf

def n_two(d, alpha, power):
    return math.ceil(2 * (Z(1 - alpha / 2) + Z(power)) ** 2 / d ** 2)

if __name__ == "__main__":
    for d in (0.2, 0.3, 0.5):
        print("   effect d={:.1f}: {} people per arm".format(
            d, n_two(d, 0.025, 0.80)))
    tost = math.ceil(2 * (Z(0.95) + Z(0.95)) ** 2 / 0.2 ** 2)
    print("   card vs number equivalent within d=0.2: {} per arm".format(
        tost))
    p0, p1 = 1 / 54, 1 / 40
    za, zb = Z(1 - 0.001), Z(0.90)
    n = ((za * math.sqrt(p0 * (1 - p0)) + zb * math.sqrt(p1 * (1 - p1)))
         / (p1 - p0)) ** 2
    print("   hit rate 1/54 vs 1/40: {:,} scored draws".format(
        math.ceil(n)))
#    effect d=0.2: 476 people per arm
#    effect d=0.3: 212 people per arm
#    effect d=0.5: 77 people per arm
#    card vs number equivalent within d=0.2: 542 per arm
#    hit rate 1/54 vs 1/40: 9,054 scored draws

To detect a difference of d = 0.2 between the card and either other arm with two comparisons, 476 people per arm are needed; for d = 0.3, 212; for d = 0.5, 77. To show that the card and the plain number are equivalent within d = 0.2, 542 per arm. To test the claim that the card foretells the day, scored by a blind judge as a hit or a miss, a hit rate of 1 in 54 by chance against a claimed 1 in 40 needs 9,054 scored draws at a one-sided significance level of 0.001.

Note

A four-step check for any card or dream app. First, ask for the inputs and the algorithm, and recompute a reading yourself; a deterministic service can be checked, an opaque one cannot (p05). Second, look for redraws, including “ask again” buttons, and count them (p15). Third, keep a fit/no-fit diary for four weeks before judging accuracy (p10). Fourth, if the app helps you start work, compare it with a coin or a plain plan for two weeks each: the help is real if it survives that comparison (p11).

Hypothesis · not established

Pre-registered prediction (not yet tested): the oracle card and the random task number do not differ in blocks started per week by more than d = 0.2, and both exceed no aid. Blind judges’ hit rate for the card’s foretelling does not exceed 1 in 54. What would show it wrong: the card beats the number by more than d = 0.2, or the judged hit rate is significantly above chance.

Summary of the book

A dream dictionary is a bipartite graph whose loose readings put almost every motif next to almost every matter of life (p01), and a REM-like spreading process produces remote combinations without any message (p02). Allowing reverse fulfilment makes a dream come true by chance 0.918 of the time within a week (p03); day residue meeting a weekly routine makes seven-day residues come true 0.735 of the time (p04). A SHA-256 seed with rejection sampling and the Durstenfeld shuffle gives a fair, reproducible 54-card deck (p05), and three common slips bias it (p06). One changed character gives an unrelated reading (p07), and 455 users have an even chance of sharing a three-card spread (p08). A daily card fits at least one event on 0.395 of days by chance and is remembered as fitting 0.746 of the time (p09, p10). Whatever it does for action, a coin does as well and a plan better (p11, p12). The six dreams, Wang Fu’s method and Jung’s scarab read best as statements about the dreamer and about the number of opportunities (p13, p14).

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).