关于「按价值放大采样:重要性采样与置信上界」,《量子启发与猜想证伪》给出的定量结论是什么?
结论:按价值放大采样,经典统计有两种成熟做法。重要性采样换一个对准目标的分布、用权重纠偏:估计正态尾部概率时,平移量取 4.5,单次相对标准差从 542.5 降到 2.3;平移不足或过头,效果都打折。多臂老虎机边抽边学:十个方向两千次检验,ε 贪心的遗憾 77.9,UCB1 为 188.0,平均分配为 300.0。两者都依赖对价值的知识,先验与学习速度才是放大的真正来源。
数据口径:书中参数为示意,全部计算由书中程序生成。 本书不构成投资、学术评审或量子硬件方面的建议。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 2.3, 4.5, 542.5
| A. P(Z > 4.5) exact | 3.3977e-06; 100,000 draws per batch |
| proposal mean batch estimates (x 1e-6) rel.sd theory | |
| mu | 0.0 0.000 0.000 0.000 0.000 0.000 542.5 |
| mu | 2.0 3.717 3.518 3.660 3.344 3.617 13.7 |
| mu | 4.5 3.358 3.351 3.391 3.381 3.435 2.3 |
| mu | 6.5 3.459 3.286 3.407 3.350 3.287 6.0 |
| B. draws to see one marked item, marked fraction p = exact | |
| classical 1/p | 294,319; sqrt-law (pi/4)/sqrt(p) = 426 |
| proposal mu | 2.0: P(draw lands in event) = 0.006 |
| proposal mu | 4.5: P(draw lands in event) = 0.500 |
查看完整验算程序
# Chapter 4. p41: importance sampling as classical "amplification".
# Target: the rare-event probability P(Z > 4.5), Z standard normal,
# exact value 0.5 * erfc(4.5 / sqrt 2). Plain Monte Carlo with 100,000
# draws almost never sees the event. Drawing from a shifted normal
# N(mu, 1) and reweighting by exp(-mu x + mu^2 / 2) is unbiased for any
# mu; a well-placed mu concentrates the draws where the value is, a
# badly placed one is worse than doing nothing. Part B compares the draw
# counts with the square-root law for amplitude amplification of a marked
# fraction p (a calculation of query counts only, no hardware). Seeded.
import math
import random
import statistics
A, DRAWS, BATCHES = 4.5, 100000, 5
def q(z):
return 0.5 * math.erfc(z / math.sqrt(2))
def rel_sd(mu, p):
# second moment of the weighted indicator: exp(mu^2) Q(A + mu)
return math.sqrt(math.exp(mu * mu) * q(A + mu) - p * p) / p
def estimate(rng, mu):
vals = []
for _ in range(DRAWS):
x = rng.gauss(mu, 1.0)
vals.append(math.exp(-mu * x + mu * mu / 2) if x > A else 0.0)
return statistics.fmean(vals), statistics.pstdev(vals)
if __name__ == "__main__":
exact = q(A)
print("A. P(Z > 4.5) exact = {:.4e}; {:,} draws per batch".format(
exact, DRAWS))
print(" proposal mean batch estimates (x 1e-6) rel.sd theory")
rng = random.Random(20261120)
for mu in (0.0, 2.0, 4.5, 6.5):
ests = [estimate(rng, mu)[0] for _ in range(BATCHES)]
cells = " ".join("{:6.3f}".format(e * 1e6) for e in ests)
print(" mu = {:<4} {} {:>10.1f}".format(
mu, cells, rel_sd(mu, exact)))
print("B. draws to see one marked item, marked fraction p = exact")
p = exact
print(" classical 1/p = {:,.0f}; sqrt-law (pi/4)/sqrt(p) = {:,.0f}"
.format(1 / p, math.pi / 4 / math.sqrt(p)))
for mu in (2.0, 4.5):
print(" proposal mu = {}: P(draw lands in event) = {:.3f}".format(
mu, q(A - mu)))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《量子启发式组合寻优、拉马努金式直觉猜想与突破性著作推演母典》第 4 章「按价值放大采样:重要性采样与置信上界」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-364 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026364,
author = {Fan, Yafu},
title = {Quantum-Inspired Combinatorial Search, Abductive Intuition and Computationally Verified Breakthrough Monograph Engineering},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}