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

第三章 字母表模 9:名字数与两种字母表

毕达哥拉斯字母表

西方数字命理把名字也变成数。最常见的是所谓毕达哥拉斯字母表:A 到 I 依次为 1 到 9,J 重新从 1 开始,依此类推。用公式写,第 ii 个字母(A 为 1,Z 为 26)的值是 1+((i−1)mod⁡9)1 + ((i – 1) \bmod 9),也就是字母序号的数字根 (Dudley 1997)。名字的「表达数」是全部字母值之和的数字根,「灵魂数」只取元音。由第一章的同态性质,这等于字母序号之和模 9。

二十六个字母分到九个值上,值 1 到 8 各有三个字母,值 9 只有 I 与 R 两个。所以单个字母的值并不完全均匀。随机抽取的几个字母之和模 9 多快趋于均匀?答案由单个字母分布在 ℤ9\mathbb{Z}_9 上的傅里叶系数决定:kk 个独立字母之和的系数是单个字母系数的 kk 次方 (Diaconis 1988)。

推导

# 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.
名字数与均匀分布的总变差距离随字母数的变化:全部字母(蓝)与仅元音(紫),纵轴为对数刻度。

全部字母时,最大的傅里叶系数只有 0.0385,一个字母与均匀分布的总变差距离为 0.0342,两个字母就降到 0.0013。所以如果字母是随机的,一个普通长度的名字的表达数几乎精确地均匀分布在 1 到 9 上。元音则不同:五个元音的值是 1、5、9、6、3,最大系数为 0.4000;一个元音的距离为 0.4444,两个元音仍有 0.1244。短名字的灵魂数远不均匀,某些值很少出现。

注

真实名字不是随机字母。 英文字母的使用频率很不均匀,名字更有地区与时代的风尚,所以真实人群中表达数的分布需要用真实名单来算。上面的计算只说明了结构:长串字母之和会迅速被「冲匀」,只取几个元音则不会。

两种字母表与三种拼法

另一种通行的字母表称为迦勒底表,按读音给字母赋值 1 到 8,没有字母值 9,由 20 世纪初的 Cheiro 推广 (Cheiro 1926)。两种字母表对同一串字母给出的数相同的机会有多大?中文名字要先写成拉丁字母才能用这些表,拼法又会改变多少?

推导

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

对四到十六个随机字母,两表给出相同数的比例在 0.0974 与 0.1129 之间,与两个互不相关的随机数相同的机会 0.1111 无法区分。换言之,两种字母表对同一个名字的判断几乎互相独立。

同一个中文名字「张伟」(程序中写作 Zhang Wei)按汉语拼音写作 ZHANG WEI,按威妥玛式写作 CHANG WEI,按粤语拼写可写作 CHEUNG WAI,三种拼法在毕达哥拉斯表下分别得 3、7、1,在迦勒底表下分别得 6、2、8。用拉丁字母为中文名字算出的数,是拼法的性质,而不是名字的性质。

小结

毕达哥拉斯字母表是字母序号模 9。若字母随机,两个字母之后名字数就几乎均匀;只取元音时则远不均匀。两种通行字母表对随机字符串给出相同数的比例约为九分之一,与互相独立无异;同一个中文名字的三种拼法给出三个不同的数。

参考文献

Cheiro. 1926. Cheiro’s Book of Numbers. Herbert Jenkins.
Diaconis, Persi. 1988. Group Representations in Probability and Statistics. Institute of Mathematical Statistics.
Dudley, Underwood. 1997. Numerology: Or What Pythagoras Wrought. Mathematical Association of America.

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