5D Library › 离散周期网络中的双尺度重整化、占位数分布熵与推力波叠加定理 · English
第二章 占位分布的香农熵与峰值:熵—峰值界定理
十四颗粒子,十二个格子
把 个相同的粒子放进 个格子,第 个格子里有 个,。这一章只关心占位数,不关心格子在环上的位置,所以一个状态可以用占位向量 描述;而熵、空位数、峰值与方差这几个量只依赖于占位数的多重集合,也就是把 14 拆成至多 12 个正整数之和的一种「整数分拆」。这样的分拆共有 133 种,本章的所有定理都可以在这 133 种上逐一验证。
作者框架中的两种典型状态是:「固定模式」,十个格子各 1 个、两个格子各 2 个,没有空位;「乘波模式」,粒子集中在少数格子里,留下许多空位。作者认为两者在方差、极值与重尾概率上呈「反向关系」,并称之为「占位熵与峰值推力反比定理」。这一章把能严格证明的部分写成定理,把不能证明的部分写成统计倾向。
推导
定义(作者的模型变量)。 记份额 ,以比特为单位的香农熵 (约定 )(Shannon 1948);空位数 ;峰值(最大占位);占位方差 。另外两种熵:雷尼 2 阶熵(碰撞熵) 与最小熵 (Rényi 1961)。
熵—峰值界定理
推导
定理 2.1(熵—峰值界定理;作者框架称「占位熵与峰值推力反比定理」)。 对任意占位向量:
空位界: 。熵在只有 个非空格子的分布中,以均匀分布为最大 (Cover and Thomas 2006)。等价地,:熵越高,空位越少。
峰值上界: 若 ,则 并且 在 时严格递减。证明:最大份额固定为 时,其余 分给另外 个格子,以均分时熵最大,得到 ;求导得 ,当且仅当 。这与信息论中的法诺不等式同一形式。
峰值下界: ,于是 。证明: 是詹森不等式(对数的凹性); 给出 。
方差恒等式: ;结合 (c) 得 。方差与碰撞熵是一一对应的,香农熵越低,方差的下界越高。
整数约束下的最均匀形态: 在 、 的整数占位中,熵最大的形态唯一,是「十个 1、两个 2」, 比特,低于连续情形的上限 。证明见下一节的优超论证。
推导
程序在全部 133 种形态上逐一检验 (a) 到 (d) 中的六条关系(程序输出中的 (a)—(f)),并列出熵最高的三种形态,以及每个峰值 下实际能达到的最大熵与界 的比较。
推导
# N = 14 particles in K = 12 cells. Entropy, vacancies, peak and variance depend only on
# the multiset of occupations, so the integer partitions of 14 into at most 12 parts
# cover every case. Check the entropy-peak bounds on all of them.
import math
N, K = 14, 12
def partitions(n, k, top=None):
if n == 0:
yield (); return
for f in range(min(n, n if top is None else top), 0, -1):
if k: yield from ((f,) + r for r in partitions(n - f, k - 1, f))
def stats(part):
p = [x / N for x in part]
h = -sum(q * math.log2(q) for q in p) # Shannon entropy, bits
h2 = -math.log2(sum(q * q for q in p)) # Renyi-2 (collision) entropy
var = sum(x * x for x in part) / K - (N / K) ** 2 # variance over all 12 cells
return h, h2, -math.log2(max(p)), K - len(part), max(part), var
def fano(q):
"""Largest entropy when the biggest share is q >= 1/K (rest spread evenly)."""
r = (1 - q) / (K - 1)
return -q * math.log2(q) - (0 if r == 0 else (1 - q) * math.log2(r))
if __name__ == "__main__":
rows = [(stats(p), p) for p in partitions(N, K)]; e = 1e-12
print("partitions of 14 into at most 12 parts:", len(rows))
checks = {"(a) H <= log2(K - V)": lambda s: s[0] <= math.log2(K - s[3]) + e,
"(b) H <= fano(m / N)": lambda s: s[0] <= fano(s[4] / N) + e,
"(c) H >= H2 >= Hmin": lambda s: s[0] >= s[1] - e and s[1] >= s[2] - e,
"(d) m >= N * 2^(-H)": lambda s: s[4] >= N * 2 ** -s[0] - e,
"(e) Var = (N^2/K)(2^-H2 - 1/K)":
lambda s: abs(s[5] - N * N / K * (2 ** -s[1] - 1 / K)) < 1e-9,
"(f) Var >= (N^2/K)(2^-H - 1/K)":
lambda s: s[5] >= N * N / K * (2 ** -s[0] - 1 / K) - e}
for name, ok in checks.items():
print(f"{name:31s}", all(ok(s) for s, _ in rows))
rows.sort(key=lambda r: -r[0][0])
print("highest-entropy configurations (H in bits; log2 12 = %.4f):" % math.log2(K))
for s, p in rows[:3]:
print(f" {str(p):40s} H {s[0]:.4f} V {s[3]} m {s[4]} Var {s[5]:.3f}")
print("max H for each peak m, against the bound fano(m / N):")
for m in range(2, 8):
best = max(s[0] for s, p in rows if s[4] == m)
print(f" m = {m}: max H {best:.4f} bound {fano(m / N):.4f}")
print("fano(m / N) for m = 2 ... 14 is decreasing:",
all(fano(m / N) > fano((m + 1) / N) for m in range(2, 14)))
# partitions of 14 into at most 12 parts: 133
# (a) H <= log2(K - V) True
# (b) H <= fano(m / N) True
# (c) H >= H2 >= Hmin True
# (d) m >= N * 2^(-H) True
# (e) Var = (N^2/K)(2^-H2 - 1/K) True
# (f) Var >= (N^2/K)(2^-H - 1/K) True
# highest-entropy configurations (H in bits; log2 12 = 3.5850):
# (2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) H 3.5216 V 0 m 2 Var 0.139
# (3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) H 3.4677 V 0 m 3 Var 0.306
# (2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1) H 3.3788 V 1 m 2 Var 0.306
# max H for each peak m, against the bound fano(m / N):
# m = 2: max H 3.5216 bound 3.5569
# m = 3: max H 3.4677 bound 3.4677
# m = 4: max H 3.2359 bound 3.3341
# m = 5: max H 2.9781 bound 3.1642
# m = 6: max H 2.6995 bound 2.9620
# m = 7: max H 2.4037 bound 2.7297
# fano(m / N) for m = 2 ... 14 is decreasing: True六条不等式与恒等式在全部 133 种形态上都成立。熵最高的是「十个 1、两个 2」(3.5216 比特,方差 0.139)。第二高的「一个 3、十一个 1」也没有空位,熵为 3.4677,方差 0.306;第三高的「三个 2、八个 1」有一个空位,熵为 3.3788,方差也是 0.306。这说明作者框架中「均匀 = 零空位」的说法需要限定:零空位的形态不止一种,熵与方差都不能只由空位数决定。
峰值上界 随 单调递减,这是「峰值越高、熵越低」的严格部分:一旦有一个格子装了 个粒子,熵就不可能超过 。但这个界不总是能达到: 时界与实际最大值相等(3.4677), 时实际最大值 3.5216 低于界 3.5569, 时实际最大值 2.4037 远低于界 2.7297,因为整数约束使剩下的粒子不能真正「均分」。
优超:什么时候「熵低、峰高」是定理
定理 2.1 给出的是界,而不是「熵与峰值一一对应」。两者之间能严格成立的单调关系,需要一个比较工具:优超。
推导
定义与定理 2.2(优超)。 把两个总数相同的占位向量各自按从大到小排序,若 的每一个前 项之和都不小于 的前 项之和(),则称 优超 ,记作 。直观地说, 比 更「集中」: 可以由 经过一系列「从多的格子挪一个粒子到少的格子」的操作得到 (Marshall et al. 2011)。
若 ,则 ,,,。前三条是因为熵是舒尔凹函数、最大值与平方和是舒尔凸函数;第四条的证明:设 有 个非零项, 前 项之和不小于 前 项之和 ,所以 的非零项不超过 个。
推论:「十个 1、两个 2」被所有 133 种形态优超,因此它的熵最大、峰值最小、方差最小、空位最少,而且是唯一的(定理 2.1(e))。
问题在于,优超只是一个偏序:很多对形态互相不能比较。
推导
程序检查全部形态对:可以比较的对中定理 2.2 有没有例外;不可比较的对中,熵较低的一方峰值是否也较低。
推导
# a MAJORIZES b if, both sorted in decreasing order, every partial sum of a is >= that of
# b. Then H(a) <= H(b) and max(a) >= max(b) are forced; for incomparable pairs nothing is.
# Count both kinds among the 133 occupancy partitions of 14 into 12 cells.
import math
from itertools import accumulate, combinations
N, K = 14, 12
def partitions(n, k, top=None):
if n == 0:
yield (); return
for f in range(min(n, n if top is None else top), 0, -1):
if k: yield from ((f,) + r for r in partitions(n - f, k - 1, f))
def majorizes(a, b):
pa, pb = list(a) + [0] * (K - len(a)), list(b) + [0] * (K - len(b))
return all(x >= y for x, y in zip(accumulate(pa), accumulate(pb)))
def H(p):
return -sum(x / N * math.log2(x / N) for x in p)
if __name__ == "__main__":
comp = inc = against = 0; viol = {"H": 0, "max": 0, "var": 0, "vacancies": 0}
for a, b in combinations(list(partitions(N, K)), 2):
if majorizes(b, a): a, b = b, a
if majorizes(a, b):
comp += 1
viol["H"] += H(a) > H(b) + 1e-12; viol["max"] += max(a) < max(b)
viol["var"] += sum(x * x for x in a) < sum(x * x for x in b)
viol["vacancies"] += len(a) > len(b)
else: # lower entropy but ALSO lower peak?
inc += 1; lo, hi = (a, b) if H(a) < H(b) else (b, a)
against += max(lo) < max(hi)
print(f"pairs: {comp + inc}; comparable {comp} ({comp / (comp + inc):.1%}),"
f" incomparable {inc}")
print("comparable pairs violating the theorem:", viol)
print(f"incomparable pairs where the lower-entropy one has the LOWER peak: {against}"
f" ({against / inc:.1%})")
a, b = (4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), (3, 3, 2, 2, 1, 1, 1, 1)
print(f"example: {str(a):34s} H {H(a):.3f}, max {max(a)}")
print(f" {str(b):34s} H {H(b):.3f}, max {max(b)}")
# pairs: 8778; comparable 7373 (84.0%), incomparable 1405
# comparable pairs violating the theorem: {'H': 0, 'max': 0, 'var': 0, 'vacancies': 0}
# incomparable pairs where the lower-entropy one has the LOWER peak: 926 (65.9%)
# example: (4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) H 3.236, max 4
# (3, 3, 2, 2, 1, 1, 1, 1) H 2.842, max 3133 种形态两两配对,共 8,778 对;其中 7,373 对(84.0%)可以用优超比较,在这些对中定理 2.2 没有一次例外。另外 1,405 对互不优超,其中 926 对(65.9%)是熵较低的一方峰值反而也较低。程序给出的例子:「一个 4、十个 1」的熵为 3.236,峰值为 4;「两个 3、两个 2、四个 1」的熵更低(2.842),峰值却只有 3。前者把多余的粒子堆在一个格子里,后者把它们分散在几个格子里,同时留下四个空位。所以「熵越低、峰值越高」作为一般命题是错的;它在优超可比的形态之间是定理,在不可比的形态之间什么也不能保证。
随机分配下的联合分布
如果 14 个粒子各自独立、等概率地落入 12 个格子,各种形态出现的概率可以精确计算:一种分拆对应的格子排列数,乘以多项式系数 ,再除以 。这是经典的占位问题 (Feller 1968)。
推导
程序用分数精确计算每种形态的概率,求出空位数、峰值与熵的分布及相关系数,并用 10 万次随机投放核对。
推导
# Throw N = 14 particles independently and uniformly into K = 12 cells. Each occupancy
# partition has an exact probability: (labelled arrangements) x multinomial / 12^14.
import math, random
from fractions import Fraction
from collections import Counter
N, K = 14, 12
def partitions(n, k, top=None):
if n == 0:
yield (); return
for f in range(min(n, n if top is None else top), 0, -1):
if k: yield from ((f,) + r for r in partitions(n - f, k - 1, f))
def prob(part):
cells = math.factorial(K) // math.factorial(K - len(part))
for c in Counter(part).values(): cells //= math.factorial(c)
ways = math.factorial(N)
for x in part: ways //= math.factorial(x)
return Fraction(cells * ways, K ** N)
def entropy(part):
return -sum(x / N * math.log2(x / N) for x in part)
def corr(xs, ys, ws):
mx = sum(w * x for x, w in zip(xs, ws)); my = sum(w * y for y, w in zip(ys, ws))
cov = sum(w * (x - mx) * (y - my) for x, y, w in zip(xs, ys, ws))
vx = sum(w * (x - mx) ** 2 for x, w in zip(xs, ws))
return cov / math.sqrt(vx * sum(w * (y - my) ** 2 for y, w in zip(ys, ws)))
if __name__ == "__main__":
parts = list(partitions(N, K)); ps = [prob(p) for p in parts]
print("total probability:", sum(ps))
w = [float(p) for p in ps]
H = [entropy(p) for p in parts]; V = [K - len(p) for p in parts]
M = [max(p) for p in parts]; S = [sum(x * x for x in p) / K for p in parts]
ev = sum(wi * v for wi, v in zip(w, V))
print(f"E[vacancies] = {ev:.4f}; formula K(1 - 1/K)^N = {K * (1 - 1 / K) ** N:.4f}")
dist = Counter()
for wi, v in zip(w, V): dist[v] += wi
print("P(V = v): " + " ".join(f"{v}:{dist[v]:.4f}" for v in range(0, 8)))
uni = ps[parts.index((2, 2) + (1,) * 10)]
print(f"P(most even state, ten 1s and two 2s) = {float(uni):.6f}"
f" (1 in {1 / uni:,.0f})")
for m in (3, 4, 5, 6):
print(f"P(peak m >= {m}) = {sum(wi for wi, x in zip(w, M) if x >= m):.4f}")
print(f"E[H] = {sum(wi * h for wi, h in zip(w, H)):.4f} bits (maximum 3.5216)")
print("exact correlations under random allocation:")
print(f" H with V {corr(H, V, w):+.3f} | H with m {corr(H, M, w):+.3f}"
f" | H with Var {corr(H, S, w):+.3f} | V with m {corr(V, M, w):+.3f}")
rng = random.Random(14); hs, vs = [], [] # Monte Carlo check
for _ in range(100000):
part = tuple(Counter(rng.randrange(K) for _ in range(N)).values())
hs.append(entropy(part)); vs.append(K - len(part))
print(f"Monte Carlo (100,000 throws): E[V] {sum(vs) / len(vs):.4f},"
f" corr(H, V) {corr(hs, vs, [1 / len(hs)] * len(hs)):+.3f},"
f" P(V = 0) {vs.count(0) / len(vs):.4f}")
# total probability: 1
# E[vacancies] = 3.5493; formula K(1 - 1/K)^N = 3.5493
# P(V = v): 0:0.0013 1:0.0246 2:0.1404 3:0.3193 4:0.3251 5:0.1534 6:0.0329 7:0.0030
# P(most even state, ten 1s and two 2s) = 0.001120 (1 in 893)
# P(peak m >= 3) = 0.8493
# P(peak m >= 4) = 0.2798
# P(peak m >= 5) = 0.0507
# P(peak m >= 6) = 0.0067
# E[H] = 2.9135 bits (maximum 3.5216)
# exact correlations under random allocation:
# H with V -0.959 | H with m -0.708 | H with Var -0.956 | V with m +0.514
# Monte Carlo (100,000 throws): E[V] 3.5482, corr(H, V) -0.959, P(V = 0) 0.0011精确计算给出:平均空位数为 3.5493,与公式 一致;完全没有空位的概率只有 0.0013,最均匀的「十个 1、两个 2」只有 0.00112,约 893 次中出现 1 次。最常见的是 3 个或 4 个空位(概率分别为 0.3193 与 0.3251)。峰值至少为 4 的概率为 0.2798,至少为 5 的为 0.0507,至少为 6 的只有 0.0067。平均熵为 2.9135 比特,比最大值低约 0.6 比特。
四个量之间的精确相关系数是:熵与空位数 −0.959,熵与方差 −0.956,熵与峰值 −0.708,空位数与峰值 +0.514。10 万次蒙特卡洛模拟给出几乎相同的数字。所以,在随机分配下,熵与空位数、方差几乎是同一个量的不同读法;熵与峰值的关系则松得多,相关系数的平方只有 0.50。作者所说的「反向关系」,在随机分配下确实存在,但它是一个统计倾向,强弱取决于用哪一个量来衡量「峰值」;把它称为「守恒」或「反比定律」都不准确。
注
两种「熵」。 这里的熵是香农熵,衡量的是「一个粒子落在哪个格子」的不确定性,单位是比特。它与热力学熵在数学形式上相同(玻尔兹曼熵是微观状态数的对数),但书中没有温度、能量或热力学第二定律:粒子不会自发地「趋向高熵」,除非我们规定了某种随机的重新分配过程。本书称某种形态「高熵」,只是在描述它的分布形状。
假说 · 尚未验证
作者的假说:集中度与极端值(尚未确立)。作者推测,在资金、注意力或人员在固定数目的类别之间分配的真实系统中,分配熵较低的时期,随后出现极端变动(例如某一类别的份额在一期内变化超过事先规定的阈值)的频率较高。这一假说超出了定理 2.1 的内容:定理只说同一时刻的熵与峰值之间有界,并不说低熵预测未来的极端变动。可以检验的预测是:在事先登记的数据集与阈值下,低熵五分位组的下一期极端变动频率高于高熵五分位组。如果两者之差的 95% 置信区间不包含正值,这一假说就被推翻。第五章的程序会说明,即使在没有任何机制的零模型中,这种相关也可能出现,所以检验必须与合适的零模型比较。
本章小结
能严格证明的是界:;给定峰值时 ,且 在 时递减;;方差与碰撞熵之间有恒等式。在 14 个粒子、12 个格子中,熵最大的整数形态唯一,是「十个 1、两个 2」(3.5216 比特)。「熵越低、峰值越高」只在优超可比的形态之间是定理;8,778 对形态中有 1,405 对不可比,其中 65.9% 方向相反。在随机分配下,平均空位 3.55 个,零空位的概率只有 0.0013,熵与峰值的相关系数为 −0.708,这是统计倾向,不是守恒律。下一章在占位之上加入作者规定的激发规则,看「空位从对面借一半」会带来什么。
参考文献
Fan, Y. (2026). Two-Scale Renormalization, Occupancy Entropy and Thrust-Wave Superposition in Discrete Cyclical Networks: Algebraic Topology and Monte Carlo Verification on a Twelve-Node Ring Lattice [离散周期网络中的双尺度重整化、占位数分布熵与推力波叠加定理] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.23796761 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).