5D Library › 姓名笔画、生命灵数与手机号码的同余映射和分布论 · English

第五章 五格与八十一数理:卷积与模 80

五格是笔画的和

设单姓的笔画为 ss,双字名的两个字为 aa、bb。五格的定义是:

  • 天格 =s+1= s + 1;人格 =s+a= s + a;地格 =a+b= a + b;
  • 外格 =b+1= b + 1(即总格减人格加一);总格 =s+a+b= s + a + b。

单名与复姓各有补一或相加的变通规则,本章只讨论单姓双名。每一格的值再查一张一到八十一的数理表;超过 81 的减去 80。用公式写,这是 g↦1+((g−1)mod⁡80)g \mapsto 1 + ((g – 1) \bmod 80),与第一章的数字根完全同构,只是模数从 9 换成 80,81 回到 1(「还本归元」)。

注

来历。 五格剖象法通常被认为是 20 世纪初日本的熊崎健翁据中国旧有的数理之说整理而成,后来传入港台与大陆;八十一数理的吉凶文字有多种版本。这是通行的说法。本书只研究规则的结构,不评判哪一种版本更好。

推导

# Chapter 5. The five grids and the 81 numbers as arithmetic.
# For a one-character surname S and a two-character given name A B
# (stroke counts s, a, b):
#   heaven = s + 1      person = s + a      earth = a + b
#   outer  = b + 1      total  = s + a + b
# (outer = total - person + 1). Grid values above 81 are reduced by
# subtracting 80, i.e. g -> 1 + ((g - 1) mod 80): the digital root again,
# with modulus 80 in place of 9. The "good" list is one commonly printed
# version (other versions add a class of "half good" numbers).
GOOD = {1, 3, 5, 6, 7, 8, 11, 13, 15, 16, 17, 18, 21, 23, 24, 25, 29,
        31, 32, 33, 35, 37, 39, 41, 45, 47, 48, 52, 57, 61, 63, 65, 67,
        68, 81}

def r81(g):
    return 1 + (g - 1) % 80

def grids(s, a, b):
    return {"heaven": s + 1, "person": s + a, "earth": a + b,
            "outer": b + 1, "total": s + a + b}

if __name__ == "__main__":
    print("   good numbers in the list: {} of 81 ({:.3f})".format(
        len(GOOD), len(GOOD) / 81))
    print("   reduction: 81 -> {}, 82 -> {}, 97 -> {}, 161 -> {}".format(
        r81(81), r81(82), r81(97), r81(161)))
    # one invented name, Chen Jingyi, counted both ways
    for label, s, a, b in (("simplified", 7, 14, 8), ("Kangxi", 16, 16, 9)):
        g = grids(s, a, b)
        print("   Chen Jingyi, {}:".format(label))
        print("     " + "  ".join(
            "{} {}{}".format(k, v, "+" if r81(v) in GOOD else "-")
            for k, v in g.items()))
    print("   (+ good, - not good)")
    print("\nReading: each grid is a sum of at most three stroke counts, so")
    print("it is a convolution of the stroke distributions; the same name")
    print("counted the two ways changes all five grids, but only one of")
    print("the five labels.")
#    good numbers in the list: 35 of 81 (0.432)
#    reduction: 81 -> 1, 82 -> 2, 97 -> 17, 161 -> 1
#    Chen Jingyi, simplified:
#      heaven 8+  person 21+  earth 22-  outer 9-  total 29+
#    Chen Jingyi, Kangxi:
#      heaven 17+  person 32+  earth 25+  outer 10-  total 41+
#    (+ good, - not good)
#
# Reading: each grid is a sum of at most three stroke counts, so
# it is a convolution of the stroke distributions; the same name
# counted the two ways changes all five grids, but only one of
# the five labels.

程序采用的吉数表是一种常见版本,81 个数中有 35 个吉数,占 0.432;另有版本增设「半吉」一类。同一个虚构的名字「陈静怡」(程序中写作 Chen Jingyi)按两种笔画计算:简体是天 8、人 21、地 22、外 9、总 29,康熙是天 17、人 32、地 25、外 10、总 41。五个格数全部改变,但五个标签中只有地格一个改变。

格数有多集中

每一格是两三个笔画的和,所以格数的分布是笔画分布的卷积,比笔画分布更宽,但仍然集中。下面的程序把第四章工作表中的 90 个姓氏与 78 个名字字(名字两字可重复)全部组合,共 547,560 个名字,每个名字计一次。

推导

# Chapter 5. How concentrated the five grids are.
# Every combination of a surname and two given-name characters from the
# table of Chapter 4 (Kangxi counts; the lists are copied from p08) is
# counted once: 90 x 78 x 78 names. For each grid we ask how many of the
# 81 numbers carry 80 per cent of the names, and compare the entropy with
# the 6.34 bits that an even spread over 81 numbers would have.
import math

SUR_S = """4 7 7 6 7 7 11 9 7 8 10 6 3 6 9 10 7 10 8 8 8 11 12 7 10 6 12 5
4 11 12 12 5 12 15 10 14 12 7 3 7 5 12 7 17 6 2 6 7 9 5 9 11 9 14 7 7 8 5
14 10 10 4 4 5 7 8 14 10 8 6 9 13 9 5 5 15 9 10 4 9 7 3 10 7 8 10 4 6 6"""
SUR_K = """4 7 11 15 16 13 12 14 7 8 10 10 10 6 11 15 7 10 8 20 19 11 17 7 10
11 17 12 19 11 12 12 5 15 16 10 17 17 7 3 7 15 12 22 18 7 2 6 8 9 16 9 11
17 19 16 8 8 5 14 13 10 9 4 5 17 8 14 10 12 7 9 13 9 16 5 15 12 21 4 14
12 15 16 20 8 13 4 6 13"""
GIV_S = """6 7 7 8 6 15 5 9 14 7 12 15 6 9 9 8 10 10 8 12 17 5 6 10 4 12 9 8 7
10 6 10 9 8 10 11 8 8 3 11 11 7 12 14 9 14 12 12 14 8 9 8 4 5 4 8 5 9 6 5
11 11 10 6 6 7 7 12 13 10 12 12 9 10 8 8 6 8"""
GIV_K = """11 10 7 11 14 15 5 9 16 19 11 15 9 10 9 12 10 18 8 12 17 5 10 10 4
15 10 9 7 11 6 11 9 9 11 11 8 8 3 12 11 10 12 14 9 14 12 13 15 13 14 8 12
16 14 11 5 9 9 23 11 14 11 13 16 17 15 16 14 11 13 13 12 12 8 10 6 8"""

def nums(s):
    return [int(x) for x in s.split()]

def r81(g):
    return 1 + (g - 1) % 80

def grid_counts(sur, giv):
    out = {k: {} for k in ("heaven", "person", "earth", "outer", "total")}
    for s in sur:
        for a in giv:
            for b in giv:
                for k, v in (("heaven", s + 1), ("person", s + a),
                             ("earth", a + b), ("outer", b + 1),
                             ("total", s + a + b)):
                    v = r81(v)
                    out[k][v] = out[k].get(v, 0) + 1
    return out

def cover(dist, share):
    tot, run, n = sum(dist.values()), 0, 0
    for c in sorted(dist.values(), reverse=True):
        run, n = run + c, n + 1
        if run >= share * tot:
            return n

def entropy(dist):
    tot = sum(dist.values())
    return -sum(c / tot * math.log2(c / tot) for c in dist.values())

if __name__ == "__main__":
    for label, sur, giv in (("Kangxi", SUR_K, GIV_K),
                            ("simplified", SUR_S, GIV_S)):
        g = grid_counts(nums(sur), nums(giv))
        n = sum(g["total"].values())
        print("   {} counts, {:,d} names".format(label, n))
        print("     grid     values   numbers holding   entropy  range of")
        print("              used     50%   80%   95%    bits    middle 90%")
        for k, d in g.items():
            vals, tot, run, lo = sorted(d), sum(d.values()), 0, None
            for v in vals:
                run += d[v]
                if lo is None and run >= 0.05 * tot:
                    lo = v
                if run >= 0.95 * tot:
                    hi = v
                    break
            row = ("     {:7s}  {:5d}    {:5d} {:5d} {:5d}   {:5.2f}"
                   "    {:2d}-{:2d}")
            print(row.format(k, len(d), cover(d, 0.5), cover(d, 0.8),
                             cover(d, 0.95), entropy(d), lo, hi))
    print("   even spread over 81 numbers: {:.2f} bits".format(math.log2(81)))
    print("\nReading: with Kangxi counts the total grid reaches 61 of the 81")
    print("numbers, yet 80 per cent of names fall on 18 of them; every other")
    print("grid reaches at most 41 numbers and needs 9 to 16 to hold 80 per")
    print("cent. Simplified counts concentrate the names further still.")
#    Kangxi counts, 547,560 names
#      grid     values   numbers holding   entropy  range of
#               used     50%   80%   95%    bits    middle 90%
#      heaven      21        7    12    17    4.13     5-20
#      person      41        9    16    23    4.58    13-32
#      earth       38        7    13    20    4.37    14-31
#      outer       18        5     9    15    3.76     6-18
#      total       61       10    18    27    4.82    23-45
#    simplified counts, 547,560 names
#      grid     values   numbers holding   entropy  range of
#               used     50%   80%   95%    bits    middle 90%
#      heaven      15        4     8    12    3.55     5-15
#      person      29        6    11    17    4.13    11-25
#      earth       28        6    11    17    4.09    11-25
#      outer       14        4     8    11    3.47     5-15
#      total       43        8    14    21    4.42    18-35
#    even spread over 81 numbers: 6.34 bits
#
# Reading: with Kangxi counts the total grid reaches 61 of the 81
# numbers, yet 80 per cent of names fall on 18 of them; every other
# grid reaches at most 41 numbers and needs 9 to 16 to hold 80 per
# cent. Simplified counts concentrate the names further still.
康熙笔画下人格(上)与总格(下)的分布;金色为吉数表中的吉数。

用康熙笔画,总格能取到 81 个数中的 61 个,但 80% 的名字落在其中 18 个数上,95% 落在 27 个数上,熵为 4.82 比特,而 81 个数均匀分布的熵是 6.34 比特。人格取到 41 个数,16 个数容纳 80%;天格只取到 21 个数,外格 18 个。用简体笔画更集中:总格只取到 43 个数,14 个数容纳 80%。数理表上大于 50 左右的数,几乎不会出现在一个常见名字的任何一格中。

所以「某几个格数占了人群的绝大部分」只对了一半:分布确实高度集中,熵比均匀分布少一到三比特;但容纳八成名字需要九到十八个数,而不是几个。

吉数的基率与标签翻转

推导

# Chapter 5. Labels, base rates and what changes with the counting rule.
# The same 547,560 names as in p10, now counted both ways at once (the
# lists are aligned character by character). For each grid: the share of
# names whose grid falls on a "good" number, against the 35/81 that an
# even spread would give; the share whose label flips between simplified
# and Kangxi counts; and how strongly the surname alone fixes the result.
from statistics import median

GOOD = {1, 3, 5, 6, 7, 8, 11, 13, 15, 16, 17, 18, 21, 23, 24, 25, 29,
        31, 32, 33, 35, 37, 39, 41, 45, 47, 48, 52, 57, 61, 63, 65, 67,
        68, 81}
KEYS = ("heaven", "person", "earth", "outer", "total")

SUR_S = """4 7 7 6 7 7 11 9 7 8 10 6 3 6 9 10 7 10 8 8 8 11 12 7 10 6 12 5
4 11 12 12 5 12 15 10 14 12 7 3 7 5 12 7 17 6 2 6 7 9 5 9 11 9 14 7 7 8 5
14 10 10 4 4 5 7 8 14 10 8 6 9 13 9 5 5 15 9 10 4 9 7 3 10 7 8 10 4 6 6"""
SUR_K = """4 7 11 15 16 13 12 14 7 8 10 10 10 6 11 15 7 10 8 20 19 11 17 7 10
11 17 12 19 11 12 12 5 15 16 10 17 17 7 3 7 15 12 22 18 7 2 6 8 9 16 9 11
17 19 16 8 8 5 14 13 10 9 4 5 17 8 14 10 12 7 9 13 9 16 5 15 12 21 4 14
12 15 16 20 8 13 4 6 13"""
GIV_S = """6 7 7 8 6 15 5 9 14 7 12 15 6 9 9 8 10 10 8 12 17 5 6 10 4 12 9 8 7
10 6 10 9 8 10 11 8 8 3 11 11 7 12 14 9 14 12 12 14 8 9 8 4 5 4 8 5 9 6 5
11 11 10 6 6 7 7 12 13 10 12 12 9 10 8 8 6 8"""
GIV_K = """11 10 7 11 14 15 5 9 16 19 11 15 9 10 9 12 10 18 8 12 17 5 10 10 4
15 10 9 7 11 6 11 9 9 11 11 8 8 3 12 11 10 12 14 9 14 12 13 15 13 14 8 12
16 14 11 5 9 9 23 11 14 11 13 16 17 15 16 14 11 13 13 12 12 8 10 6 8"""

def nums(s):
    return [int(x) for x in s.split()]

def labels(s, a, b):
    vals = (s + 1, s + a, a + b, b + 1, s + a + b)
    return tuple((1 + (v - 1) % 80) in GOOD for v in vals)

if __name__ == "__main__":
    sur = list(zip(nums(SUR_S), nums(SUR_K)))
    giv = list(zip(nums(GIV_S), nums(GIV_K)))
    n = 0
    good = {"simp": [0] * 5, "kx": [0] * 5}
    allgood = {"simp": 0, "kx": 0}
    flip, allflip = [0] * 5, 0
    per_surname = []
    for ss, sk in sur:
        n_s, all_s = 0, 0
        for as_, ak in giv:
            for bs, bk in giv:
                ls, lk = labels(ss, as_, bs), labels(sk, ak, bk)
                n += 1
                n_s += 1
                for i in range(5):
                    good["simp"][i] += ls[i]
                    good["kx"][i] += lk[i]
                    flip[i] += ls[i] != lk[i]
                allgood["simp"] += all(ls)
                allgood["kx"] += all(lk)
                allflip += all(ls) != all(lk)
                all_s += all(lk)
        per_surname.append(all_s / n_s)
    print("   even spread over the 81 numbers: good share {:.3f}".format(
        35 / 81))
    print("   grid      good share       label flips between the two counts")
    print("             simp   Kangxi")
    for i, k in enumerate(KEYS):
        print("   {:7s}   {:.3f}   {:.3f}       {:.3f}".format(
            k, good["simp"][i] / n, good["kx"][i] / n, flip[i] / n))
    print("   all five good:  simp {:.3f}   Kangxi {:.3f}   flips {:.3f}"
          .format(allgood["simp"] / n, allgood["kx"] / n, allflip / n))
    per_surname.sort()
    print("   all five good, by surname (Kangxi):")
    print("     lowest {:.3f}, median {:.3f}, highest {:.3f}".format(
        per_surname[0],
                                          median(per_surname),
                                          per_surname[-1]))
    print("\nReading: good numbers crowd the low end of the list, where")
    print("stroke sums fall, so each grid is good more often than 35/81.")
    print("Changing the counting rule flips a grid's label for one name")
    print("in four to one in two. Whether all five are good depends heavily")
    print("on the surname: for some surnames it never happens.")
#    even spread over the 81 numbers: good share 0.432
#    grid      good share       label flips between the two counts
#              simp   Kangxi
#    heaven    0.722   0.678       0.244
#    person    0.612   0.565       0.410
#    earth     0.608   0.553       0.430
#    outer     0.628   0.551       0.308
#    total     0.539   0.515       0.473
#    all five good:  simp 0.092   Kangxi 0.072   flips 0.135
#    all five good, by surname (Kangxi):
#      lowest 0.000, median 0.083, highest 0.137
#
# Reading: good numbers crowd the low end of the list, where
# stroke sums fall, so each grid is good more often than 35/81.
# Changing the counting rule flips a grid's label for one name
# in four to one in two. Whether all five are good depends heavily
# on the surname: for some surnames it never happens.

一个容易忽视的事实是:吉数表中的吉数集中在低段。小于 30 的 29 个数中有 17 个是吉数,30 及以上的 52 个数中只有 18 个;而 30 以下正是人格、地格、天格、外格常落的区间。所以每一格为吉的比例都高于 35/81 的 0.432:康熙笔画下天格 0.678、人格 0.565、地格 0.553、外格 0.551、总格 0.515。五格全吉的比例为 0.072(康熙)或 0.092(简体)。

从简体改为康熙笔画,标签翻转的比例为:天格 0.244、人格 0.410、地格 0.430、外格 0.308、总格 0.473。也就是说,对一个随机名字,换一种笔画约定,总格的吉凶有将近一半的机会改变;「五格全吉」与否对 0.135 的名字改变。

姓氏本身决定了很多:天格只取决于姓,若姓的笔画加一不是吉数,任何名字都不可能五格全吉。按姓氏分组,五格全吉的比例最低为 0,中位数 0.083,最高 0.137。

假说 · 尚未验证

作者的推测(尚未验证): 姓名学中「某格吉者多」的经验印象,很可能来自吉数表本身集中在低段,而不来自吉数对人的作用。什么会证明这一推测错:若在一份真实的姓名与出生登记中,吉数格的比例显著低于本章按笔画分布算出的基率,或者吉数表按其他原则(不按大小)分布,这一解释就不足。

小结

五格是笔画的和,八十一数理是模 80 的数字根。用康熙笔画,总格能取到 61 个数,但 18 个数容纳了八成名字;其余各格取到的数最多 41 个。吉数集中在笔画之和常落的低段,所以每一格为吉的比例都高于 0.432。换一种笔画约定,各格标签对四分之一到一半的名字翻转;能否五格全吉在很大程度上由姓氏决定。

Fan, Y. (2026). Modular Numerology, Character-Stroke Hashes and Residue-Class Distributions: Digital-Root Arithmetic, Kangxi Radical Restorations, Modulo-80 Grid Mappings and Empirical Base-Rate Concentration [姓名笔画、生命灵数与手机号码的同余映射和分布论] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090178 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).