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

第四章 康熙笔画:部首还原是一个确定的映射

两种笔画

姓名学按笔画数计算格数,但「笔画数」至少有两种。一种是今天大陆的规范写法,以《通用规范汉字表》及其配套规范为准 (State Council of the People’s Republic of China 2013);另一种是姓名学书籍通用的「康熙笔画」,以《康熙字典》的部首加余画为准 (Zhang et al. 1716)。两者的差别有三个来源:简化字本身笔画不同(马 3 画,馬 10 画);部首在字中常写作变体,康熙笔画按完整的部首计数;数字按数值计。

部首还原的规则是:字的部首若以变体出现,按原部首的笔画计。氵按水计 4 画,艹按艸计 6 画,辶按辵计 7 画,左阝按阜计 8 画,右阝按邑计 7 画,王字旁按玉计 5 画,作「肉」解的月按肉计 6 画,礻按示计 5 画,衤按衣计 6 画,扌按手计 4 画,忄按心计 4 画,罒按网计 6 画。要点有二:只有作为该字部首的变体才还原,同一形状出现在非部首位置时照写法计;「王」单独成字时按 4 画计。数字一到十按数值计:四写 5 画计 4,五写 4 画计 5,七、八、九各写 2 画,分别计 7、8、9。

这些规则把每个字映射到一个确定的整数。下面的程序把一张常用姓氏与常用名字的工作表写成「拼音:简体笔画:康熙部分」三段:部首完整书写时,康熙部分就是康熙笔画;部首以变体书写时,康熙部分写作「变体代码 + 部外笔画」,由程序还原部首后相加。为了在印刷中保持代码行完整,程序中用带声调数字的拼音指代汉字,汉字本身按同一顺序列在下面的注释框中。

注

工作表。 这张表是作者为本书整理的,共 90 个常见姓氏与 78 个常用名字字,简体笔画按《通用规范汉字表》、康熙笔画按《康熙字典》的部首加余画逐字录入。后面各章的结论只依赖笔画分布的大致形状,个别字在不同字书中的出入不会改变它们。

姓氏(简体笔画/康熙笔画): 王 4/4,李 7/7,张(張) 7/11,刘(劉) 6/15,陈(陳) 7/16,杨(楊) 7/13,黄(黃) 11/12,赵(趙) 9/14,吴(吳) 7/7,周 8/8,徐 10/10,孙(孫) 6/10,马(馬) 3/10,朱 6/6,胡 9/11,郭 10/15,何 7/7,高 10/10,林 8/8,罗(羅) 8/20,郑(鄭) 8/19,梁 11/11,谢(謝) 12/17,宋 7/7,唐 10/10,许(許) 6/11,韩(韓) 12/17,冯(馮) 5/12,邓(鄧) 4/19,曹 11/11,彭 12/12,曾 12/12,田 5/5,董 12/15,潘 15/16,袁 10/10,蔡 14/17,蒋(蔣) 12/17,余 7/7,于 3/3,杜 7/7,叶(葉) 5/15,程 12/12,苏(蘇) 7/22,魏 17/18,吕(呂) 6/7,丁 2/2,任 6/6,沈 7/8,姚 9/9,卢(盧) 5/16,姜 9/9,崔 11/11,钟(鍾) 9/17,谭(譚) 14/19,陆(陸) 7/16,汪 7/8,金 8/8,石 5/5,廖 14/14,贾(賈) 10/13,夏 10/10,韦(韋) 4/9,方 4/4,白 5/5,邹(鄒) 7/17,孟 8/8,熊 14/14,秦 10/10,邱 8/12,江 6/7,段 9/9,雷 13/13,侯 9/9,龙(龍) 5/16,史 5/5,黎 15/15,贺(賀) 9/12,顾(顧) 10/21,毛 4/4,郝 9/14,邵 7/12,万(萬) 3/15,钱(錢) 10/16,严(嚴) 7/20,武 8/8,莫 10/13,孔 4/4,向 6/6,汤(湯) 6/13。

名字字: 伟(偉) 6/11,芳 7/10,秀 7/7,英 8/11,华(華) 6/14,慧 15/15,巧 5/5,美 9/9,静(靜) 14/16,丽(麗) 7/19,强(強) 12/11,磊 15/15,军(軍) 6/9,洋 9/10,勇 9/9,杰(傑) 8/12,娟 10/10,涛(濤) 10/18,明 8/8,超 12/12,霞 17/17,平 5/5,刚(剛) 6/10,桂 10/10,文 4/4,辉(輝) 12/15,玲 9/10,建 8/9,志 7/7,海 10/11,宇 6/6,浩 10/11,思 9/9,怡 8/9,悦(悅) 10/11,晨 11/11,欣 8/8,雨 8/8,子 3/3,涵 11/12,梓 11/11,轩(軒) 7/10,博 12/12,嘉 14/14,俊 9/9,豪 14/14,婷 12/12,琪 12/13,瑶(瑤) 14/15,诗(詩) 8/13,语(語) 9/14,佳 8/8,云(雲) 4/12,龙(龍) 5/16,凤(鳳) 4/14,国(國) 8/11,民 5/5,春 9/9,红(紅) 6/9,兰(蘭) 5/23,梅 11/11,菊 11/14,振 10/11,扬(揚) 6/13,达(達) 6/16,远(遠) 7/17,进(進) 7/15,道 12/16,福 13/14,祥 10/11,祺 12/13,裕 12/13,胜(勝) 9/12,能 10/12,朋 8/8,育 8/10,有 6/6,林 8/8。

部首说明与同音标签。 莫与萬(万)在《康熙字典》中都归艸部:莫 = 艸 6 + 余画 7 = 13,萬 = 艸 6 + 余画 9 = 15。程序中同音的拼音标签加字母后缀区分(按出现顺序):chen2a 陈、chen2b 晨;yang2a 杨、yang2b 洋、yang2c 扬;han2a 韩、han2b 涵;peng2a 彭、peng2b 朋;yu2a 余、yu2b 于;yao2a 姚、yao2b 瑶;jiang1a 姜、jiang1b 江;fang1a 方、fang1b 芳;yu3a 宇、yu3b 雨、yu3c 语;zi3a 子、zi3b 梓;jia1a 嘉、jia1b 佳;qi2a 琪、qi2b 祺;yu4a 裕、yu4b 育。

推导

# Chapter 4. Kangxi stroke counts as a deterministic map.
# Each entry is pinyin:simplified-count:Kangxi-part. The pinyin (with
# tone number) names the character; the characters themselves are
# listed in the text of this chapter, in the same order. The Kangxi part
# is either the Kangxi count itself, when the radical is written in full,
# or code+rest, when the radical is written in a variant form: the full
# radical's strokes are restored and the strokes outside it (as listed in
# the Kangxi Dictionary) are added. Restoration applies only when the
# variant is the character's radical; wang standing alone counts 4.
# Homophones carry a letter suffix (a, b, c) in order of first appearance,
# so that every label names one character.
VARIANT = {   # code: (variant as written, full radical, Kangxi strokes)
    "shui": ("water side", "shui", 4), "cao": ("grass top", "cao", 6),
    "chuo": ("walk side", "chuo", 7), "fuL": ("left ear", "fu", 8),
    "yiR": ("right ear", "yi", 7), "yuW": ("king side", "yu", 5),
    "rou": ("moon as flesh", "rou", 6), "shi": ("show side", "shi", 5),
    "yi": ("cloth side", "yi", 6), "shou": ("hand side", "shou", 4),
    "xin": ("heart side", "xin", 4), "wang": ("net top", "wang", 6)}
NUMERALS = (("yi1", 1, 1), ("er4", 2, 2), ("san1", 3, 3), ("si4", 5, 4),
            ("wu3", 4, 5), ("liu4", 4, 6), ("qi1", 2, 7), ("ba1", 2, 8),
            ("jiu3", 2, 9), ("shi2", 2, 10))   # (name, written, counted)

SURNAMES = """
wang2:4:4 li3:7:7 zhang1:7:11 liu2:6:15 chen2a:7:fuL+8 yang2a:7:13
huang2:11:12 zhao4:9:14 wu2:7:7 zhou1:8:8 xu2:10:10 sun1:6:10 ma3:3:10
zhu1:6:6 hu2:9:rou+5 guo1:10:yiR+8 he2:7:7 gao1:10:10 lin2:8:8
luo2:8:wang+14 zheng4:8:yiR+12 liang2:11:11 xie4:12:17 song4:7:7
tang2:10:10 xu3:6:11 han2a:12:17 feng2:5:12 deng4:4:yiR+12 cao2:11:11
peng2a:12:12 zeng1:12:12 tian2:5:5 dong3:12:cao+9 pan1:15:shui+12
yuan2:10:10 cai4:14:cao+11 jiang3:12:cao+11 yu2a:7:7 yu2b:3:3 du4:7:7
ye4:5:cao+9 cheng2:12:12 su1:7:cao+16 wei4:17:18 lv3:6:7 ding1:2:2
ren2:6:6 shen3:7:shui+4 yao2a:9:9 lu2:5:16 jiang1a:9:9 cui1:11:11
zhong1:9:17 tan2:14:19 lu4:7:fuL+8 wang1:7:shui+4 jin1:8:8 shi2:5:5
liao4:14:14 jia3:10:13 xia4:10:10 wei2:4:9 fang1a:4:4 bai2:5:5
zou1:7:yiR+10 meng4:8:8 xiong2:14:14 qin2:10:10 qiu1:8:yiR+5
jiang1b:6:shui+3 duan4:9:9 lei2:13:13 hou2:9:9 long2:5:16 shi3:5:5
li2:15:15 he4:9:12 gu4:10:21 mao2:4:4 hao3:9:yiR+7 shao4:7:yiR+5
wan4:3:cao+9 qian2:10:16 yan2:7:20 wu3:8:8 mo4:10:cao+7 kong3:4:4
xiang4:6:6 tang1:6:shui+9"""

GIVEN = """
wei3:6:11 fang1b:7:cao+4 xiu4:7:7 ying1:8:cao+5 hua2:6:cao+8 hui4:15:15
qiao3:5:5 mei3:9:9 jing4:14:16 li4:7:19 qiang2:12:11 lei3:15:15 jun1:6:9
yang2b:9:shui+6 yong3:9:9 jie2:8:12 juan1:10:10 tao1:10:shui+14 ming2:8:8
chao1:12:12 xia2:17:17 ping2:5:5 gang1:6:10 gui4:10:10 wen2:4:4 hui1:12:15
ling2:9:yuW+5 jian4:8:9 zhi4:7:7 hai3:10:shui+7 yu3a:6:6 hao4:10:shui+7
si1:9:9 yi2:8:xin+5 yue4:10:xin+7 chen2b:11:11 xin1:8:8 yu3b:8:8 zi3a:3:3
han2b:11:shui+8 zi3b:11:11 xuan1:7:10 bo2:12:12 jia1a:14:14 jun4:9:9
hao2:14:14 ting2:12:12 qi2a:12:yuW+8 yao2b:14:yuW+10 shi1:8:13 yu3c:9:14
jia1b:8:8 yun2:4:12 long2:5:16 feng4:4:14 guo2:8:11 min2:5:5 chun1:9:9
hong2:6:9 lan2:5:cao+17 mei2:11:11 ju2:11:cao+8 zhen4:10:shou+7
yang2c:6:shou+9 da2:6:chuo+9 yuan3:7:chuo+10 jin4:7:chuo+8 dao4:12:chuo+9
fu2:13:shi+9 xiang2:10:shi+6 qi2b:12:shi+8 yu4a:12:yi+7 sheng4:9:12
neng2:10:rou+6 peng2b:8:8 yu4b:8:rou+4 you3:6:6 lin2:8:8"""

def parse(block):
    out = []
    for tok in block.split():
        py, simp, kx = tok.split(":")
        if "+" in kx:
            code, rest = kx.split("+")
            out.append((py, int(simp), VARIANT[code][2] + int(rest), code))
        else:
            out.append((py, int(simp), int(kx), None))
    return out

if __name__ == "__main__":
    sur, giv = parse(SURNAMES), parse(GIVEN)
    print("   {} surnames, {} given-name characters".format(len(sur),
                                                         len(giv)))
    print("   restored radicals: variant -> full radical, strokes, e.g.")
    for code, (form, full, n) in VARIANT.items():
        used = [e for e in sur + giv if e[3] == code]
        if used:
            print("     {:13s} -> {:4s} {}   {}".format(
                form, full, n, " ".join("{} {}->{}".format(e[0], e[1], e[2])
                                        for e in used[:3])))
    print("   numerals count by value (written -> counted):")
    print("     " + "  ".join("{} {}->{}".format(*x) for x in NUMERALS[:5]))
    print("     " + "  ".join("{} {}->{}".format(*x) for x in NUMERALS[5:]))
    for label, pool in (("surnames", sur), ("given", giv)):
        diff = {}
        for e in pool:
            diff[e[2] - e[1]] = diff.get(e[2] - e[1], 0) + 1
        cells = ["{:+d}:{}".format(k, v) for k, v in sorted(diff.items())]
        print("   {}: Kangxi minus simplified (difference:count),"
              " {} of {} differ".format(label, len(pool) - diff.get(0, 0),
                                        len(pool)))
        for i in range(0, len(cells), 9):
            print("     " + " ".join(cells[i:i + 9]))
    lower = [e for e in sur + giv if e[2] < e[1]]
    print("   fewer Kangxi strokes than simplified: " + " ".join(
        "{} {}->{}".format(e[0], e[1], e[2]) for e in lower))
    print("\nReading: the Kangxi count is a fixed function of the")
    print("traditional form and its radical, so it can be computed, not")
    print("looked up by feel. It differs from the simplified count for")
    print("about half of the characters here, by -1 to +18 strokes.")
#    90 surnames, 78 given-name characters
#    restored radicals: variant -> full radical, strokes, e.g.
#      water side    -> shui 4   pan1 15->16 shen3 7->8 wang1 7->8
#      grass top     -> cao  6   dong3 12->15 cai4 14->17 jiang3 12->17
#      walk side     -> chuo 7   da2 6->16 yuan3 7->17 jin4 7->15
#      left ear      -> fu   8   chen2a 7->16 lu4 7->16
#      right ear     -> yi   7   guo1 10->15 zheng4 8->19 deng4 4->19
#      king side     -> yu   5   ling2 9->10 qi2a 12->13 yao2b 14->15
#      moon as flesh -> rou  6   hu2 9->11 neng2 10->12 yu4b 8->10
#      show side     -> shi  5   fu2 13->14 xiang2 10->11 qi2b 12->13
#      cloth side    -> yi   6   yu4a 12->13
#      hand side     -> shou 4   zhen4 10->11 yang2c 6->13
#      heart side    -> xin  4   yi2 8->9 yue4 10->11
#      net top       -> wang 6   luo2 8->20
#    numerals count by value (written -> counted):
#      yi1 1->1  er4 2->2  san1 3->3  si4 5->4  wu3 4->5
#      liu4 4->6  qi1 2->7  ba1 2->8  jiu3 2->9  shi2 2->10
#    surnames: Kangxi minus simplified (difference:count), 46 of 90 differ
#      +0:44 +1:7 +2:1 +3:5 +4:3 +5:10 +6:2 +7:3 +8:1
#      +9:3 +10:2 +11:4 +12:2 +13:1 +15:2
#    given: Kangxi minus simplified (difference:count), 45 of 78 differ
#      -1:1 +0:33 +1:15 +2:3 +3:9 +4:3 +5:3 +7:1 +8:4
#      +10:3 +11:1 +12:1 +18:1
#    fewer Kangxi strokes than simplified: qiang2 12->11
#
# Reading: the Kangxi count is a fixed function of the
# traditional form and its radical, so it can be computed, not
# looked up by feel. It differs from the simplified count for
# about half of the characters here, by -1 to +18 strokes.

90 个姓氏中有 46 个、78 个名字字中有 45 个,康熙笔画与简体笔画不同;差值从 −1 到 +18。唯一变少的是「强」(程序中的 qiang2):简体 12 画,繁体「強」按弓部加 8 画为 11 画。变化最大的来自两类:繁简字形不同的字(蘭 23 画对兰 5 画、龍 16 画对龙 5 画),以及左右阝、艹、辶这几个还原幅度大的部首(陳 16、鄭 19、鄧 19、達 16)。

笔画的分布

推导

# Chapter 4. How stroke counts are distributed, simplified and Kangxi.
# The lists are the counts of the previous program's table, in its order
# (90 surnames, 78 given-name characters). Each character is weighted
# equally: the table is a list of common characters, not a census.
from statistics import mean, pstdev

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()]

if __name__ == "__main__":
    print("   pool      count   n   mean    sd  min  max  middle half")
    for label, s in (("surname", SUR_S), ("surname", SUR_K),
                     ("given", GIV_S), ("given", GIV_K)):
        x = sorted(nums(s))
        kind = "simp" if s in (SUR_S, GIV_S) else "Kangxi"
        q1, q3 = x[len(x) // 4], x[(3 * len(x)) // 4]
        fmt = "   {:8s}  {:6s} {:3d} {:6.2f} {:5.2f} {:4d} {:4d}   {:2d} to"
        print(fmt.format(label, kind, len(x), mean(x), pstdev(x), min(x),
                         max(x), q1), "{:2d}".format(q3))
    for label, s in (("given, Kangxi", GIV_K),):
        x = nums(s)
        hist = {}
        for v in x:
            hist[v] = hist.get(v, 0) + 1
        print("   {} histogram:".format(label))
        for v in sorted(hist):
            print("     {:2d} {}".format(v, "#" * hist[v]))
    print("\nReading: restoring radicals moves the counts up by two to three")
    print("strokes on average and spreads them out; the middle half of each")
    print("pool still falls within a band of four to seven strokes.")
#    pool      count   n   mean    sd  min  max  middle half
#    surname   simp    90   8.22  3.12    2   17    6 to 10
#    surname   Kangxi  90  11.39  4.61    2   22    8 to 15
#    given     simp    78   8.94  2.94    3   17    7 to 11
#    given     Kangxi  78  11.29  3.57    3   23    9 to 14
#    given, Kangxi histogram:
#       3 #
#       4 #
#       5 ###
#       6 ##
#       7 ##
#       8 ######
#       9 #########
#      10 ########
#      11 ############
#      12 ########
#      13 #####
#      14 #######
#      15 #####
#      16 ####
#      17 ##
#      18 #
#      19 #
#      23 #
#
# Reading: restoring radicals moves the counts up by two to three
# strokes on average and spreads them out; the middle half of each
# pool still falls within a band of four to seven strokes.
工作表中 168 个字的笔画分布:简体(蓝)与康熙(金)。

姓氏的平均笔画从简体的 8.22 升到康熙的 11.39,标准差从 3.12 升到 4.61;名字字从 8.94 升到 11.29,标准差从 2.94 升到 3.57。还原把笔画整体抬高两到三画,并把分布拉宽;但每一组中间一半的字仍落在四到七画宽的一个区间里。第五章的格数是这些笔画的和,所以笔画分布的集中直接变成格数分布的集中。

一个映射,两套标签

笔画数本身没有争议:给定字形与计数约定,它是一个确定的函数。争议在于用哪一个约定。同一个名字按简体与康熙两种约定会得到不同的格数,在第五章中,这一差别会变成吉凶标签的差别。软件应当写明它用的是哪一种笔画,并在可能时同时报告两种。

小结

康熙笔画是「完整部首笔画 + 余画」,部首变体只在作为该字部首时还原,数字按数值计;它是字形的确定函数。在本书的工作表中,约一半的字两种笔画不同,差值从 −1 到 +18,还原把平均笔画抬高两到三画并拉宽分布。

参考文献

State Council of the People’s Republic of China. 2013. Tongyong Guifan Hanzi Biao [Table of General Standard Chinese Characters]. In Chinese; Issued 5 June 2013.
Zhang, Yushu, Tingjing Chen, et al. 1716. Kangxi Zidian [Kangxi Dictionary]. Imperial Household (Wuying Dian).

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