5D Library › Modular Numerology, Character-Stroke Hashes and Residue-Class Distributions · 中文
Chapter 5. The Five Grids and the Eighty-One Numbers: Convolution and Modulo 80
The five grids are sums of strokes
Let a one-character surname have strokes and a two-character given name have and . The five grids are:
- heaven ; person ; earth ;
- outer (the total minus the person grid plus one); total .
One-character given names and two-character surnames have their own rules for adding one or summing; this chapter treats only one-character surnames with two-character given names. Each grid is then looked up in a table of the numbers one to eighty-one; values above 81 are reduced by 80. As a formula this is , exactly the digital root of Chapter 1 with the modulus 80 in place of 9; 81 returns to 1 (“returning to the origin”).
Note
Origin. The five-grid method is usually credited to Kumazaki Kenō in early twentieth-century Japan, who arranged it from older Chinese number lore; it later spread to Hong Kong, Taiwan and the mainland, and the texts of the eighty-one numbers exist in several versions. This is the usual account. This book studies only the structure of the rules and does not judge which version is better.
Calculation
# 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.The program uses a common version of the table, in which 35 of the 81 numbers are good, a share of 0.432; other versions add a class of “half good” numbers. The same invented name, 陈静怡 (Chen Jingyi in the program), counted both ways: simplified gives heaven 8, person 21, earth 22, outer 9, total 29; Kangxi gives heaven 17, person 32, earth 25, outer 10, total 41. All five grids change, but only one of the five labels, the earth grid’s.
How concentrated the grids are
Each grid is a sum of two or three stroke counts, so its distribution is a convolution of the stroke distributions: wider, but still concentrated. The next program combines all 90 surnames and 78 given-name characters of the working table of Chapter 4 (the two given characters may repeat), 547,560 names, each counted once.
Calculation
# 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.With Kangxi counts the total grid reaches 61 of the 81 numbers, but 80 per cent of names fall on 18 of them and 95 per cent on 27; its entropy is 4.82 bits, against 6.34 bits for an even spread over 81 numbers. The person grid reaches 41 numbers, 16 of which hold 80 per cent; the heaven grid reaches only 21 numbers, the outer grid 18. Simplified counts are more concentrated still: the total grid reaches only 43 numbers, and 14 of them hold 80 per cent. The numbers of the table above about 50 almost never appear in any grid of a common name.
So “a few grid numbers hold the great majority of people” is only half right: the distribution is indeed highly concentrated, one to three bits below an even spread; but holding eight names in ten takes nine to eighteen numbers, not a few.
The base rate of good numbers, and flipped labels
Calculation
# 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.A fact easily overlooked is that the good numbers of the table crowd the low end. Of the 29 numbers below 30, 17 are good; of the 52 numbers from 30 up, only 18; and below 30 is just where the person, earth, heaven and outer grids usually fall. So every grid is good more often than the 0.432 of 35/81: under Kangxi counts heaven 0.678, person 0.565, earth 0.553, outer 0.551, total 0.515. All five grids are good for 0.072 of names (Kangxi) or 0.092 (simplified).
Switching from simplified to Kangxi counts flips the label of the heaven grid for 0.244 of names, the person grid for 0.410, the earth grid for 0.430, the outer grid for 0.308 and the total grid for 0.473. For a random name, then, the good-or-bad label of the total grid changes with almost even odds when the stroke convention changes, and whether all five are good changes for 0.135 of names.
The surname decides much on its own: the heaven grid depends only on the surname, and if the surname’s count plus one is not a good number, no given name can make all five grids good. By surname, the share of names with all five good is at lowest 0, at median 0.083 and at highest 0.137.
Hypothesis · not established
The author’s conjecture (not yet tested): the impression in name analysis that “most people have a good such-and-such grid” probably comes from the table’s good numbers crowding the low end, not from any effect of good numbers on people. What would show it wrong: if, in a real register of names and births, the share of good grids were clearly lower than the base rates computed here from the stroke distribution, or if the good numbers of the table were placed by some principle other than size, this explanation would not suffice.
Summary
The five grids are sums of strokes and the eighty-one numbers a digital root modulo 80. With Kangxi counts the total grid can take 61 values, yet 18 of them hold eight names in ten; the other grids take at most 41. The good numbers crowd the low range where stroke sums fall, so each grid is good more often than 0.432. A different stroke convention flips each grid’s label for a quarter to a half of all names, and whether all five can be good is largely decided by the surname.
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).