5D Library › 塔罗超几何抽样、雷诺曼网格拓扑与卡巴拉生命树图论 · English

第三章 雷诺曼大桌阵的网格组合学

三十六张牌与两种大桌阵

雷诺曼牌有 36 张,编号与图案沿袭约 1799 年纽伦堡出版的纸牌游戏《希望游戏》(Das Spiel der Hoffnung)(Hechtel 1799)。「大桌阵」把 36 张牌全部摊开:一种是 4 行 9 列(9×49 \times 4),另一种是 4 行 8 列再在下方中间加 4 张(8×4+48 \times 4 + 4)。解读者先找到指示牌(例如 28 号男士或 29 号女士),再看其他关键牌与它的相对位置:是否相邻、相距多远、是否在同一行或同一列、是否隔着「马步」、是否处于镜像位置。

洗匀的大桌阵是 S36S_{36} 中的一个均匀随机排列,所以任何两张指定的牌落在一对均匀随机的不同格子上。9×49 \times 4 网格有 36 个格子,有序格子对共 1260 个;下面的所有概率都是对这 1260 对的精确计数。

推导

# Chapter 3. p06: Distances in the 9 x 4 Grand Tableau.
# 36 cards in a random order fill 4 rows of 9. Two named cards (say the
# significator 28 and a key card) then occupy a uniformly random pair of
# distinct cells. We list the exact laws of their Manhattan distance and
# of the relations readers use: touching (8 directions, a king's move),
# same row, same column, a knight's move, and mirroring (reflection in
# the middle column, the middle line, or both).
from fractions import Fraction
from itertools import permutations

R, C = 4, 9
CELLS = [(r, c) for r in range(R) for c in range(C)]

def relations(a, b):
    dr, dc = abs(a[0] - b[0]), abs(a[1] - b[1])
    return {
        "touching": max(dr, dc) == 1,
        "same row": dr == 0,
        "same column": dc == 0,
        "knight": {dr, dc} == {1, 2},
        "mirror": b in ((a[0], C - 1 - a[1]), (R - 1 - a[0], a[1]),
                        (R - 1 - a[0], C - 1 - a[1])) and b != a,
    }

if __name__ == "__main__":
    pairs = list(permutations(CELLS, 2))
    tot = len(pairs)
    print("   ordered pairs of distinct cells: {}".format(tot))
    law = {}
    for a, b in pairs:
        d = abs(a[0] - b[0]) + abs(a[1] - b[1])
        law[d] = law.get(d, 0) + 1
    print("   Manhattan distance law:")
    for d in sorted(law):
        print("     d = {:2d}  {:3d}/{}  {:.4f}".format(
            d, law[d], tot, law[d] / tot))
    mean = Fraction(sum(d * n for d, n in law.items()), tot)
    print("   E[d] = {} = {:.4f}".format(mean, float(mean)))
    for key in ("touching", "same row", "same column", "knight", "mirror"):
        n = sum(relations(a, b)[key] for a, b in pairs)
        print("   P({:11s}) = {:4d}/{} = {:.4f}".format(key, n, tot, n / tot))
    nb = {}
    for a in CELLS:
        k = sum(relations(a, b)["touching"] for b in CELLS if b != a)
        nb[k] = nb.get(k, 0) + 1
    print("   neighbours of a cell (cells with that many): {}".format(
        dict(sorted(nb.items()))))
#    ordered pairs of distinct cells: 1260
#    Manhattan distance law:
#      d =  1  118/1260  0.0937
#      d =  2  188/1260  0.1492
#      d =  3  214/1260  0.1698
#      d =  4  200/1260  0.1587
#      d =  5  168/1260  0.1333
#      d =  6  136/1260  0.1079
#      d =  7  104/1260  0.0825
#      d =  8   72/1260  0.0571
#      d =  9   40/1260  0.0317
#      d = 10   16/1260  0.0127
#      d = 11    4/1260  0.0032
#    E[d] = 13/3 = 4.3333
#    P(touching   ) =  214/1260 = 0.1698
#    P(same row   ) =  288/1260 = 0.2286
#    P(same column) =  108/1260 = 0.0857
#    P(knight     ) =  148/1260 = 0.1175
#    P(mirror     ) =  100/1260 = 0.0794
#    neighbours of a cell (cells with that many): {3: 4, 5: 18, 8: 14}

距离与邻接的基率

两张指定的牌之间曼哈顿距离的期望恰为 13/3;最常见的距离是 3(0.1698),距离为 1 的概率是 0.0937。八方向相邻(国际象棋中「王」的一步)的概率为 0.1698,大约六分之一。同一行的概率 0.2286 远高于同一列的 0.0857,因为一行有 9 格而一列只有 4 格。马步关系的概率为 0.1175,镜像关系(关于中列、中行或两者的反射)的概率为 0.0794。

把这几种关系放在一起,任意一张关键牌与指示牌之间「有某种值得一提的空间关系」几乎是必然的:相邻、同行、同列、马步与镜像各自的基率已经在一成到两成之间,而读者通常同时考察好几张关键牌。

9 \times 4 大桌阵中两张指定牌之间曼哈顿距离的精确分布(p06)。

邻接关系的基率还取决于指示牌落在哪里:四个角上的格子只有 3 个邻居,边上的 18 个格子有 5 个,内部的 14 个格子有 8 个。

另一种布局与「本宫」

推导

# Chapter 3. p07: The 8 x 4 + 4 layout, and cards in their own house.
# Layout B: four rows of 8, plus a row of 4 under the middle columns
# (columns 2-5). Position k (1..36, read row by row) is "house k" and
# carries the meaning of card k. A card in its own house is a fixed point
# of the random permutation; their number has an exact law (derangements)
# close to Poisson(1). We also count how many cards touch the
# significator, averaged over where it lands.
from fractions import Fraction
from itertools import permutations
from math import comb, exp, factorial

def layout_a():
    return [(r, c) for r in range(4) for c in range(9)]

def layout_b():
    return [(r, c) for r in range(4) for c in range(8)] + \
           [(4, c) for c in range(2, 6)]

def touching(a, b):
    return max(abs(a[0] - b[0]), abs(a[1] - b[1])) == 1

def derange(n):
    d = [1, 0]                      # D(n) = (n - 1)(D(n-1) + D(n-2))
    for m in range(2, n + 1):
        d.append((m - 1) * (d[-1] + d[-2]))
    return d[n]

def summary(name, cells):
    pairs = list(permutations(cells, 2))
    t = sum(touching(a, b) for a, b in pairs)
    d = sum(abs(a[0] - b[0]) + abs(a[1] - b[1]) for a, b in pairs)
    print("   {}: P(touching) = {:.4f}, E[Manhattan] = {:.4f}".format(
        name, t / len(pairs), d / len(pairs)))
    print("              mean neighbours per cell {:.3f}".format(
        t / len(cells)))

if __name__ == "__main__":
    summary("9 x 4    ", layout_a())
    summary("8 x 4 + 4", layout_b())
    n = 36
    print("\n   own-house cards among 36 (exact vs Poisson(1)):")
    for k in range(6):
        p = Fraction(comb(n, k) * derange(n - k), factorial(n))
        print("     k = {}  {:.5f}  {:.5f}".format(
            k, float(p), exp(-1) / factorial(k)))
    p0 = Fraction(derange(n), factorial(n))
    print("   P(at least one card in its own house) = {:.5f}".format(
        1 - float(p0)))
    print("   P(significator 28 in house 28) = 1/36 = {:.5f}".format(1 / 36))
#    9 x 4    : P(touching) = 0.1698, E[Manhattan] = 4.3333
#               mean neighbours per cell 5.944
#    8 x 4 + 4: P(touching) = 0.1730, E[Manhattan] = 4.1048
#               mean neighbours per cell 6.056
#
#    own-house cards among 36 (exact vs Poisson(1)):
#      k = 0  0.36788  0.36788
#      k = 1  0.36788  0.36788
#      k = 2  0.18394  0.18394
#      k = 3  0.06131  0.06131
#      k = 4  0.01533  0.01533
#      k = 5  0.00307  0.00307
#    P(at least one card in its own house) = 0.63212
#    P(significator 28 in house 28) = 1/36 = 0.02778

8×4+48 \times 4 + 4 布局把最后 4 张放在中间四列之下,平均每格的邻居数由 5.944 增加到 6.056,相邻概率由 0.1698 升到 0.1730,平均曼哈顿距离由 4.3333 降到 4.1048。两种布局的差别很小,但它说明「相邻」的基率不是一个常数,而是布局的函数。

大桌阵的另一条读法是「宫位」:第 kk 个位置是第 kk 号牌的宫。牌落在自己的宫,就是随机排列的一个不动点。不动点个数的精确分布由错排数给出,与均值为 1 的泊松分布在小数点后五位都一致:恰好没有、恰好一张的概率都是 0.36788,至少有一张牌落在本宫的概率为 0.63212。指定的一张牌(例如 28 号)落在本宫的概率只有 1/36,即 0.02778,但「总有一张牌落在本宫」的概率接近三分之二。

注

指定事件与「某个」事件。 「这张牌落在本宫」的基率是 0.02778,「有牌落在本宫」的基率是 0.63212。事后挑出发生了的那一个,再按指定事件的基率去评价它,是把基率放大了二十多倍。第五章把这一点推广到整个牌阵。

小结

大桌阵是网格上的均匀随机排列。两张指定的牌相邻的概率约为六分之一,同行约为两成,马步约为一成,平均曼哈顿距离为 13/3;这些基率随布局与指示牌的位置变化。至少一张牌落在本宫的概率为 0.63212。

参考文献

Hechtel, Johann Kaspar. 1799. Das Spiel Der Hoffnung. Card game of 36 illustrated cards, published by G. P. J. Bieling, Nuremberg.

Fan, Y. (2026). Tarot Hypergeometric Sampling, Lenormand Grid Topology and Kabbalistic Tree Graphs: Reversal Binomial Mixtures, Grand-Tableau Manhattan Distances and Twenty-Two-Edge Spectral Centrality [塔罗超几何抽样、雷诺曼网格拓扑与卡巴拉生命树图论] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090191 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).