5D Library › Tarot Hypergeometric Sampling, Lenormand Grid Topology and Kabbalistic Tree Graphs · 中文

Chapter 1. Hypergeometric Sampling of Seventy-Eight Cards

The structure of a deck

The modern tarot deck has 78 cards: 22 major arcana (numbered 0 to 21) and the minor arcana in four suits of 14, the ace to ten and four courts, page, knight, queen and king (Dummett 1980). In the programs the suits are written W (wands), C (cups), S (swords) and P (pentacles).

A spread deals nn cards in turn from the top of a shuffled deck. Dealt cards are not put back, so “drawing a major” is not a run of independent coins: every major already dealt makes the next one a little less likely. Let KK be the number of majors in the spread. It follows the hypergeometric law

P(K=k)=(22k)(56n−k)(78n).P(K = k) = \frac{\binom{22}{k}\binom{56}{n-k}}{\binom{78}{n}}.

The binomial law with p=22/78p = 22/78 is the with-replacement approximation. The two have the same mean, and their variances differ by the finite-population factor (78−n)/77(78-n)/77.

Calculation

# Chapter 1. p01: Majors in a spread - hypergeometric, not binomial.
# A tarot deck has 78 cards: 22 major arcana and 56 minor arcana in four
# suits of 14 (ace to ten, page, knight, queen, king). A spread deals n
# cards without replacement, so the number of majors K follows the
# hypergeometric law P(K = k) = C(22, k) C(56, n - k) / C(78, n).
# The binomial law with p = 22/78 is the with-replacement approximation.
from fractions import Fraction
from math import comb, factorial

N, MAJ = 78, 22

def hyper(n, k):
    return Fraction(comb(MAJ, k) * comb(N - MAJ, n - k), comb(N, n))

def binom(n, k):
    p = Fraction(MAJ, N)
    return comb(n, k) * p ** k * (1 - p) ** (n - k)

if __name__ == "__main__":
    print("   ordered upright/reversed 3-card spreads: {:,}".format(
        78 * 77 * 76 * 2 ** 3))
    print("   ordered upright/reversed 10-card spreads: {:,}".format(
        factorial(78) // factorial(68) * 2 ** 10))
    for n in (3, 10):
        mean = Fraction(n * MAJ, N)
        var = mean * Fraction(N - MAJ, N) * Fraction(N - n, N - 1)
        print("\n   n = {}: E[K] = {:.4f}, Var[K] = {:.4f} (binomial {:.4f})"
              .format(n, float(mean), float(var),
                      float(mean * Fraction(N - MAJ, N))))
        print("     k   hypergeometric   binomial")
        for k in range(0, min(n, 7) + 1):
            print("    {:2d}   {:14.5f}   {:8.5f}".format(
                k, float(hyper(n, k)), float(binom(n, k))))
        tail = sum(hyper(n, k) for k in range(n // 2, n + 1))
        print("     P(K >= {}) = {:.5f}".format(n // 2, float(tail)))
    no_major = hyper(10, 0)
    print("\n   10 cards with no major at all: {:.5f}".format(
        float(no_major)))
    print("   10 cards with 3 or more majors: {:.5f}".format(
        float(sum(hyper(10, k) for k in range(3, 11)))))
#    ordered upright/reversed 3-card spreads: 3,651,648
#    ordered upright/reversed 10-card spreads: 4,675,765,217,094,107,136,000
#
#    n = 3: E[K] = 0.8462, Var[K] = 0.5917 (binomial 0.6075)
#      k   hypergeometric   binomial
#      0          0.36437    0.37007
#      1          0.44534    0.43615
#      2          0.17004    0.17134
#      3          0.02024    0.02244
#      P(K >= 1) = 0.63563
#
#    n = 10: E[K] = 2.8205, Var[K] = 1.7883 (binomial 2.0250)
#      k   hypergeometric   binomial
#      0          0.02830    0.03639
#      1          0.13246    0.14294
#      2          0.26077    0.25271
#      3          0.28383    0.26474
#      4          0.18875    0.18201
#      5          0.07994    0.08580
#      6          0.02178    0.02809
#      7          0.00376    0.00631
#      P(K >= 5) = 0.10589
#
#    10 cards with no major at all: 0.02830
#    10 cards with 3 or more majors: 0.57847

A three-card spread with reversals has 3,651,648 ordered outcomes; a ten-card Celtic Cross has 4,675,765,217,094,107,136,000. The probability that three cards contain at least one major is 0.63563: most three-card spreads contain a major. In ten cards the expected number of majors is 2.8205 and the variance 1.7883, more than a tenth below the binomial 2.0250; the tails are therefore thinner than the binomial’s: five or more majors occur with probability 0.10589, and the binomial approximation gives too high a value at both k=6k = 6 and k=7k = 7. Three or more majors occur with probability 0.57847, no major at all with probability 0.02830.

Number of majors in a Celtic Cross: hypergeometric (without replacement) against the binomial approximation (p01).

Note

The threshold for “many majors” should be set by the hypergeometric law. If “an unusually large number of majors” means a count reached by at most 5% of random spreads, the threshold for ten cards is six: five or more still occur a tenth of the time.

The Celtic Cross as a five-colour urn

The ten cards of a Celtic Cross can be seen as ten balls drawn without replacement from an urn of five colours: 22 majors and four suits of 14. The joint law is multivariate hypergeometric; there are only 1001 count vectors summing to ten, so every probability can be summed exactly rather than simulated.

Calculation

# Chapter 1. p02: The Celtic Cross as a five-colour urn.
# Ten cards without replacement from five categories: 22 majors and four
# suits of 14 (wands W, cups C, swords S, pentacles P). The joint law is
# multivariate hypergeometric; we enumerate every count vector exactly.
# Courts: 16 cards (4 per suit). Rank pairs: two minors of the same rank
# (14 ranks x 4 suits); majors have no rank partner.
from fractions import Fraction
from itertools import product
from math import comb

TOT = comb(78, 10)

def suit_law():
    law = {}
    for a, b, c, d in product(range(11), repeat=4):
        m = 10 - a - b - c - d
        if m < 0:
            continue
        w = comb(22, m) * comb(14, a) * comb(14, b) * comb(14, c) \
            * comb(14, d)
        law[(m, a, b, c, d)] = Fraction(w, TOT)
    return law

def distinct_ranks(k):
    # k minors from 56 with all ranks different
    return Fraction(comb(14, k) * 4 ** k, comb(56, k))

if __name__ == "__main__":
    law = suit_law()
    print("   count vectors enumerated: {}; total probability {}".format(
        len(law), sum(law.values())))
    top = {}
    for (m, *s), p in law.items():
        top[max(s)] = top.get(max(s), 0) + p
    print("   largest single-suit count among the ten cards:")
    for k in range(0, 8):
        print("     {:2d}  {:.5f}".format(k, float(top.get(k, 0))))
    ge4 = sum(p for k, p in top.items() if k >= 4)
    print("   P(some suit appears 4+ times) = {:.5f}".format(float(ge4)))
    miss = sum(p for (m, *s), p in law.items() if min(s) == 0)
    print("   P(at least one suit absent)   = {:.5f}".format(float(miss)))
    court = [Fraction(comb(16, k) * comb(62, 10 - k), TOT)
             for k in range(11)]
    print("   courts: E = {:.4f}; P(3+) = {:.5f}; P(0) = {:.5f}".format(
        10 * 16 / 78, float(sum(court[3:])), float(court[0])))
    pair = 0
    for k in range(11):
        pk = Fraction(comb(56, k) * comb(22, 10 - k), TOT)
        pair += pk * (1 - distinct_ranks(k) if k <= 14 else 1)
    print("   P(two minors share a rank)    = {:.5f}".format(float(pair)))
    aces = Fraction(comb(4, 2) * comb(74, 8), TOT)
    print("   P(exactly two aces)           = {:.5f}".format(float(aces)))
#    count vectors enumerated: 1001; total probability 1
#    largest single-suit count among the ten cards:
#       0  0.00000
#       1  0.00409
#       2  0.20619
#       3  0.50294
#       4  0.23173
#       5  0.04850
#       6  0.00607
#       7  0.00045
#    P(some suit appears 4+ times) = 0.28678
#    P(at least one suit absent)   = 0.43334
#    courts: E = 2.0513; P(3+) = 0.33416; P(0) = 0.08545
#    P(two minors share a rank)    = 0.75189
#    P(exactly two aces)           = 0.07186

The program gives the base rates of several kinds of “clustering” readers tend to notice. Some suit appears four or more times with probability 0.28678; at least one suit is missing with probability 0.43334. The expected number of courts in ten cards is 2.0513, three or more occur with probability 0.33416 and none at all with probability 0.08545. Two minors of the same rank (two fives, say) occur with probability 0.75189; exactly two aces with probability 0.07186.

Hypothesis · not established

The author’s hypothesis (not yet tested): readers’ intuitive threshold for “a cluster of one suit” or “a cluster of courts” is generally below the 5% threshold of the hypergeometric law, so they treat combinations with base rates between a fifth and a third as “meaningful patterns”. What would show it wrong: if, under blind conditions, readers asked to mark “noteworthy clusters” in random spreads mark only spreads in which those combinations have base rates below five per cent, the hypothesis fails.

Summary

The counts of each kind of card in a spread follow hypergeometric and multivariate hypergeometric laws and can be computed exactly. In ten cards, three or more majors, four or more of one suit, three or more courts and two cards of the same rank have base rates of about three in five, three in ten, one in three and three in four. These numbers are the baseline that must be on the table before any “pattern” is discussed.

References

Dummett, Michael. 1980. The Game of Tarot: From Ferrara to Salt Lake City. Duckworth.

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