What does Dream Motifs, Hashed Decks and Coincidence Rates conclude, in numbers, about “A Deterministic 54-Card Deck: SHA-256 and the Fisher-Yates Shuffle”?
Answer: Chapter 3 builds a 54-card deck from SHA-256 and the Fisher-Yates shuffle; its 148,824 three-card spreads pass a chi-square test over 54,000 users, and three common slips are shown.
Scope of the numbers: It does not claim that dreams or cards foretell anything; the motif graph, event rates, memory rates and behavioural parameters are illustrative or synthetic; all data are generated by its programs; the book is not medical or psychological advice. In Chapter 6 an illustrative model shows that a card helps with action paralysis (the chance of starting work rises from 0.584 to 0.740) exactly as much as a coin, and less than an if-then plan.
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: 148824, 54, 54000
| seed 6b33b8f955f4aaf1... spread: F13 W02 E08 | |
| same inputs again give the same spread: True | |
| ordered three-card spreads | 54 x 53 x 52 = 148,824 |
| 54,000 users, expected count per card 1,000 | |
| top card : chi-square 66.8 on 53 df, p | 0.096, counts 907-1083 |
| position of JK1: chi-square 57.5 on 53 df, p | 0.312, counts 924-1083 |
Show the full program
# Chapter 3. p05: A deterministic 54-card oracle shuffle from SHA-256.
# Deck: four suits F, W, A, E of 13 ranks, plus two jokers JK1, JK2.
# Seed = SHA-256(user | date | SHA-256(question)); a counter-mode stream
# SHA-256(seed || i) gives 32-bit words; an index below n is drawn by
# rejection (words at or above the largest multiple of n are discarded),
# and the deck is shuffled by Fisher-Yates (Durstenfeld). The top three
# cards are the past / present / way-out spread. Uniformity is checked
# over 54,000 user IDs with a chi-square test (Wilson-Hilferty p-value).
import hashlib
import math
DECK = ["{}{:02d}".format(s, r) for s in "FWAE" for r in range(1, 14)]
DECK += ["JK1", "JK2"]
def seed_of(user, date, question):
q = hashlib.sha256(question.encode("utf-8")).hexdigest()
return hashlib.sha256("{}|{}|{}".format(user, date, q)
.encode("utf-8")).digest()
class Stream:
def __init__(self, seed):
self.seed, self.i, self.buf = seed, 0, b""
def word(self):
if not self.buf:
self.buf = hashlib.sha256(
self.seed + self.i.to_bytes(4, "big")).digest()
self.i += 1
w, self.buf = int.from_bytes(self.buf[:4], "big"), self.buf[4:]
return w
def below(self, n):
limit = (2 ** 32 // n) * n
while True:
w = self.word()
if w < limit:
return w % n
def shuffle(seed):
deck, st = list(DECK), Stream(seed)
for i in range(len(deck) - 1, 0, -1):
j = st.below(i + 1)
deck[i], deck[j] = deck[j], deck[i]
return deck
def p_chi2(x, df):
z = ((x / df) ** (1 / 3) - (1 - 2 / (9 * df))) / math.sqrt(2 / (9 * df))
return 0.5 * math.erfc(z / math.sqrt(2))
if __name__ == "__main__":
s = seed_of("u001", "2026-11-09", "Should I launch the course now?")
d = shuffle(s)
print(" seed {}... spread: {}".format(s.hex()[:16], " ".join(d[:3])))
print(" same inputs again give the same spread: {}".format(
shuffle(seed_of("u001", "2026-11-09",
"Should I launch the course now?"))[:3] == d[:3]))
print(" ordered three-card spreads: 54 x 53 x 52 = {:,}".format(
54 * 53 * 52))
n = 54000
top = dict.fromkeys(DECK, 0)
jpos = [0] * 54
for u in range(n):
d = shuffle(seed_of("u{:05d}".format(u), "2026-11-09",
"Should I launch the course now?"))
top[d[0]] += 1
jpos[d.index("JK1")] += 1
e = n / 54
print(" {:,} users, expected count per card {:,.0f}".format(n, e))
for name, obs in (("top card", list(top.values())),
("position of JK1", jpos)):
x = sum((o - e) ** 2 / e for o in obs)
print(" {:15s}: chi-square {:.1f} on 53 df, p = {:.3f}, "
"counts {}-{}".format(name, x, p_chi2(x, 53), min(obs),
max(obs)))Single source and citation
Fan, Y. (2026). Dream Motif Bipartite Graphs, Deterministic Oracle Decks and Subconscious Prior Activation (Version 1.0.0), Chapter 3: A Deterministic 54-Card Deck: SHA-256 and the Fisher-Yates Shuffle. 5D Library. https://doi.org/10.5281/zenodo.24090233
DOI: 10.5281/zenodo.24090233 · Read the monograph · 5DL-B-089 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026089,
author = {Fan, Yafu},
title = {Dream Motif Bipartite Graphs, Deterministic Oracle Decks and Subconscious Prior Activation},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
doi = {10.5281/zenodo.24090233},
url = {https://doi.org/10.5281/zenodo.24090233}
}Other chapter answers in this book
- Chapter 1 · Dream Motifs as a Bipartite Graph, and Spreading Activation in REM Sleep
- Chapter 2 · Reverse Dreams, Direct Dreams and Day Residue
- Chapter 4 · Avalanche, Collisions and How Unique a Reading Is
- Chapter 5 · Littlewood's Law and Selective Memory
- Chapter 6 · The Card as an Action Anchor
- Chapter 7 · The Six Dreams of the Rites of Zhou, Wang Fu's Ten Kinds of Dream, the Dunhuang Dream Book and Jung's Synchronicity
- Chapter 8 · Auditing a Card App and a Pre-Registered Trial