5D Library › Modular Numerology, Character-Stroke Hashes and Residue-Class Distributions · 中文
Chapter 3. The Alphabet Modulo 9: Name Numbers and Two Letter Tables
The Pythagorean letter table
Western numerology turns names into numbers as well. The most common table is the so-called Pythagorean one: A to I are 1 to 9, J starts again at 1, and so on. As a formula, the -th letter (A = 1, Z = 26) has value , the digital root of its position (Dudley 1997). A name’s “expression number” is the digital root of the sum of all its letter values; the “soul number” takes the vowels only. By the homomorphism of Chapter 1, this is the sum of the letter positions modulo 9.
Twenty-six letters fall on nine values: values 1 to 8 have three letters each, value 9 only two, I and R. So a single letter’s value is not perfectly even. How fast does the sum of a few randomly drawn letters become even modulo 9? The answer is set by the Fourier coefficients of a single letter’s distribution on : the coefficients of a sum of independent letters are the single letter’s coefficients raised to the -th power (Diaconis 1988).
Calculation
# Chapter 3. The Pythagorean letter table is the alphabet modulo 9.
# Letter number i (A = 1 ... Z = 26) has value 1 + ((i - 1) mod 9).
# A name's number is the residue of the sum of its letter values. If
# letters were drawn at random, how fast would that residue become even
# over 1-9? The answer is set by the Fourier coefficients of a single
# letter's distribution on Z_9: the sum of k letters has coefficients
# raised to the k-th power. Vowels alone (A E I O U) are far slower.
import cmath
import string
def value(ch):
return 1 + (string.ascii_uppercase.index(ch)) % 9
def residue_dist(letters):
p = [0.0] * 9
for ch in letters:
p[value(ch) % 9] += 1 / len(letters)
return p
def convolve(p, q):
r = [0.0] * 9
for i in range(9):
for j in range(9):
r[(i + j) % 9] += p[i] * q[j]
return r
def tv_uniform(p):
return 0.5 * sum(abs(x - 1 / 9) for x in p)
def max_coeff(p):
return max(abs(sum(p[x] * cmath.exp(-2j * cmath.pi * k * x / 9)
for x in range(9))) for k in range(1, 9))
if __name__ == "__main__":
print(" value: " + " ".join(
"{}={}".format(v, "".join(c for c in string.ascii_uppercase
if value(c) == v)) for v in range(1, 10)))
sets = (("all 26 letters", string.ascii_uppercase), ("vowels AEIOU",
"AEIOU"))
for label, letters in sets:
p1 = residue_dist(letters)
print("\n {}: largest Fourier coefficient {:.4f}".format(
label, max_coeff(p1)))
print(" letters k " + "".join("{:>7d}".format(k)
for k in range(1, 9)))
p, row = p1, []
for k in range(1, 9):
row.append(tv_uniform(p))
p = convolve(p, p1)
print(" TV from even " + "".join("{:7.4f}".format(x)
for x in row))
print("\nReading: with random letters the name number is even to about a")
print("thousandth after two letters. Vowels take only five values, and")
print("the vowel number of a short name stays far from even: one vowel")
print("leaves 0.4444 of the probability misplaced, two leave 0.1244.")
# value: 1=AJS 2=BKT 3=CLU 4=DMV 5=ENW 6=FOX 7=GPY 8=HQZ 9=IR
#
# all 26 letters: largest Fourier coefficient 0.0385
# letters k 1 2 3 4 5 6 7 8
# TV from even 0.0342 0.0013 0.0001 0.0000 0.0000 0.0000 0.0000 0.0000
#
# vowels AEIOU: largest Fourier coefficient 0.4000
# letters k 1 2 3 4 5 6 7 8
# TV from even 0.4444 0.1244 0.0604 0.0188 0.0086 0.0028 0.0013 0.0004
#
# Reading: with random letters the name number is even to about a
# thousandth after two letters. Vowels take only five values, and
# the vowel number of a short name stays far from even: one vowel
# leaves 0.4444 of the probability misplaced, two leave 0.1244.With all letters, the largest Fourier coefficient is only 0.0385; one letter is 0.0342 from even in total variation and two letters only 0.0013. So if letters were random, the expression number of a name of ordinary length would be spread almost exactly evenly over 1 to 9. Vowels are different: the five vowels have values 1, 5, 9, 6 and 3, with largest coefficient 0.4000; one vowel is 0.4444 from even and two vowels still 0.1244. The soul number of a short name is far from even, and some values seldom occur.
Note
Real names are not random letters. English letters are used with very unequal frequencies, and names follow fashions of place and period, so the distribution of expression numbers among real people must be computed from real lists of names. The calculation above shows only the structure: a long string of letters is quickly “washed even”, a few vowels are not.
Two letter tables and three spellings
Another common table, called Chaldean, gives letters the values 1 to 8 by sound, with no letter worth 9; it was popularised by Cheiro in the early twentieth century (Cheiro 1926). How often do the two tables give the same number for the same string of letters? And a Chinese name must first be written in Latin letters before these tables apply: how much does the spelling change?
Calculation
# Chapter 3. Two letter tables and three spellings of one name.
# Pythagorean: A=1 ... I=9, J=1 ... (alphabet mod 9).
# Chaldean: values 1-8 by sound, no letter worth 9 (the table below is
# the one usually printed). For random strings, how often do the two
# tables give the same reduced number? And how much does the spelling of
# a Chinese name in Latin letters move it?
import random
import string
PYTH = {c: 1 + i % 9 for i, c in enumerate(string.ascii_uppercase)}
CHAL = dict(zip(string.ascii_uppercase,
(1, 2, 3, 4, 5, 8, 3, 5, 1, 1, 2, 3, 4,
5, 7, 8, 1, 2, 3, 4, 6, 6, 6, 5, 1, 7)))
def number(name, table):
s = sum(table[c] for c in name if c.isalpha())
return 1 + (s - 1) % 9
if __name__ == "__main__":
rng = random.Random(65)
print(" letters P(same number under both tables), 200,000 strings")
for n in (4, 6, 8, 12, 16):
same = 0
for _ in range(200000):
w = "".join(rng.choice(string.ascii_uppercase) for _ in range(n))
same += number(w, PYTH) == number(w, CHAL)
print(" {:5d} {:.4f}".format(n, same / 200000))
print(" independent tables would agree with chance 1/9 = {:.4f}"
.format(1 / 9))
print("\n one name (Zhang Wei in pinyin), three romanizations:")
for spelling in ("ZHANG WEI", "CHANG WEI", "CHEUNG WAI"):
print(" {:11s} Pythagorean {} Chaldean {}".format(
spelling, number(spelling, PYTH), number(spelling, CHAL)))
print("\nReading: the two tables agree about as often as two unrelated")
print("random numbers. The same Chinese name gets a different number")
print("under each common spelling, so a Latin-letter number of a Chinese")
print("name is a property of the spelling, not of the name.")
# letters P(same number under both tables), 200,000 strings
# 4 0.0974
# 6 0.1026
# 8 0.1094
# 12 0.1129
# 16 0.1117
# independent tables would agree with chance 1/9 = 0.1111
#
# one name (Zhang Wei in pinyin), three romanizations:
# ZHANG WEI Pythagorean 3 Chaldean 6
# CHANG WEI Pythagorean 7 Chaldean 2
# CHEUNG WAI Pythagorean 1 Chaldean 8
#
# Reading: the two tables agree about as often as two unrelated
# random numbers. The same Chinese name gets a different number
# under each common spelling, so a Latin-letter number of a Chinese
# name is a property of the spelling, not of the name.For four to sixteen random letters, the two tables give the same number in between 0.0974 and 0.1129 of strings, indistinguishable from the 0.1111 at which two unrelated random numbers agree. In other words, the two tables judge the same name almost independently of each other.
The same Chinese name 张伟 (Zhang Wei in the program) is written ZHANG WEI in Hanyu Pinyin, CHANG WEI in Wade-Giles and CHEUNG WAI in a Cantonese spelling; the three spellings give 3, 7 and 1 under the Pythagorean table and 6, 2 and 8 under the Chaldean. A number computed from the Latin spelling of a Chinese name is a property of the spelling, not of the name.
Summary
The Pythagorean table is the alphabet modulo 9. If letters were random, a name’s number would be almost even after two letters; with vowels alone it is far from even. The two common tables give the same number for random strings about one time in nine, no differently from independent numbers; three spellings of one Chinese name give three different numbers.
References
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).