关于「路单没有预测力:连串长度、游程检验与小样本偏差」,《百家乐边际、算牌与破产》给出的定量结论是什么?
结论:第五章在两千副真实发出的牌靴中检验路单,游程检验的拒绝比例为 0.0480,与无信号时的预期一致;单看一张路单得出的「三庄之后开庄」比例平均只有 0.4502,这是小样本偏差。
数据口径:本书只做概率与破产分析,不鼓励任何赌博,不教任何博彩技巧,不推荐任何场所或平台;书中参数为示意,全部计算由书中程序生成;书中内容是非个人化理财建议。 第二章计算移牌效应、模拟整副牌靴并重做小牌堆实验:押庄为正期望的局只占 0.00286,完美信息观察者每一百局只得 0.0014 个单位。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.0480
| decided coups 148591 in 2000 shoes, P(B) | 0.5077 |
| k P(B | k B in a row) n P(B | k P in a row) n | |
| 1 | 0.5063 74437 0.5095 72154 |
| 2 | 0.5094 37205 0.5095 34919 |
| 3 | 0.5089 18704 0.5124 16881 |
| 4 | 0.5140 9396 0.5149 8105 |
| 5 | 0.5117 4772 0.5168 3866 |
| P(same as previous) | 0.4986, expected if independent 0.5001 |
| runs test, share of shoes with |z| > 1.96 | 0.0480 |
| mean z over shoes: +0.0284 |
查看完整验算程序
# Chapter 5. p52: Does the scoreboard predict the next coup? Seeded deal
# of 2,000 real eight-deck shoes by the drawing rules (cards without
# replacement, cut 14 cards from the end, as in p22). Ties are removed,
# as a streak-reading bettor removes them. Reported: the pooled chance of
# Banker after k Banker results in a row and after k Player results in
# a row, the lag-one correlation of decided results, and the share of
# shoes whose Wald-Wolfowitz runs test rejects randomness at the 5 %
# level (about 0.05 is expected if the road carries no signal).
import math
import random
def banker_draws(b, p3):
# 庄家补牌表:b 为庄两张牌点数,p3 为闲第三张牌点数
if b <= 2:
return True
if b == 3:
return p3 != 8
if b == 4:
return 2 <= p3 <= 7
if b == 5:
return 4 <= p3 <= 7
if b == 6:
return p3 in (6, 7)
return False
DRAW = [[banker_draws(b, p3) for p3 in range(10)] for b in range(10)]
# WIN[p][b]:0 庄胜,1 闲胜,2 和
WIN = [[0 if b > p else 1 if p > b else 2 for b in range(10)]
for p in range(10)]
def tally(c):
# 返回 [庄胜, 闲胜, 和] 的整数权重,分母为 n 起连乘六项的降阶乘
c = list(c)
n = 0
for x in c:
n += x
s4, s5 = (n - 4) * (n - 5), n - 5
acc = [0, 0, 0]
vals = range(10)
for p1 in vals:
w1 = c[p1]
if not w1:
continue
c[p1] -= 1
for b1 in vals:
w2 = w1 * c[b1]
if not w2:
continue
c[b1] -= 1
for p2 in vals:
w3 = w2 * c[p2]
if not w3:
continue
c[p2] -= 1
pt = (p1 + p2) % 10
for b2 in vals:
w4 = w3 * c[b2]
if not w4:
continue
c[b2] -= 1
bt = (b1 + b2) % 10
if pt >= 8 or bt >= 8 or (pt >= 6 and bt >= 6):
acc[WIN[pt][bt]] += w4 * s4
elif pt <= 5:
drw = DRAW[bt]
for p3 in vals:
w5 = w4 * c[p3]
if not w5:
continue
pf = (pt + p3) % 10
row = WIN[pf]
if drw[p3]:
c[p3] -= 1
for b3 in vals:
acc[row[(bt + b3) % 10]] += w5 * c[b3]
c[p3] += 1
else:
acc[row[bt]] += w5 * s5
else:
row = WIN[pt]
w = w4 * s5
for b3 in vals:
acc[row[(bt + b3) % 10]] += w * c[b3]
c[b2] += 1
c[p2] += 1
c[b1] += 1
c[p1] += 1
return acc
def play(cards, i):
# 按补牌规则发一局,返回 (结果, 用掉的张数)
p = (cards[i] + cards[i + 2]) % 10
b = (cards[i + 1] + cards[i + 3]) % 10
j = i + 4
if not (p >= 8 or b >= 8 or (p >= 6 and b >= 6)):
if p <= 5:
p3 = cards[j]
j += 1
p = (p + p3) % 10
if DRAW[b][p3]:
b = (b + cards[j]) % 10
j += 1
else:
b = (b + cards[j]) % 10
j += 1
return ("B" if b > p else "P" if p > b else "T"), j - i
def runs_z(seq):
n1 = seq.count("B")
n2 = len(seq) - n1
if n1 == 0 or n2 == 0:
return 0.0
runs = 1
for a, b in zip(seq, seq[1:]):
runs += a != b
n = n1 + n2
mu = 2 * n1 * n2 / n + 1
var = 2 * n1 * n2 * (2 * n1 * n2 - n) / (n * n * (n - 1))
return (runs - mu) / math.sqrt(var)
if __name__ == "__main__":
rng = random.Random(20261112)
deck = []
for r in range(10):
deck += [r] * (128 if r == 0 else 32)
shoes = []
for _ in range(2000):
rng.shuffle(deck)
i, seq = 0, []
while 416 - i >= 14:
res, used = play(deck, i)
i += used
if res != "T":
seq.append(res)
shoes.append(seq)
tot = 0
nb = 0
after = {}
pairs = same = 0
for seq in shoes:
tot += len(seq)
nb += seq.count("B")
for j in range(1, len(seq)):
pairs += 1
same += seq[j] == seq[j - 1]
for k in range(1, 6):
if j >= k:
last = seq[j - k:j]
for s in "BP":
if last == [s] * k:
h = after.setdefault((s, k), [0, 0])
h[0] += 1
h[1] += seq[j] == "B"
pb = nb / tot
print("decided coups %d in 2000 shoes, P(B) = %.4f" % (tot, pb))
print(" k P(B | k B in a row) n P(B | k P in a row) n")
for k in range(1, 6):
a, b = after[("B", k)], after[("P", k)]
print("%2d %.4f %6d %.4f %6d" % (
k, a[1] / a[0], a[0], b[1] / b[0], b[0]))
q = 1 - pb
exp_same = pb * pb + q * q
print("P(same as previous) = %.4f, expected if independent %.4f" % (
same / pairs, exp_same))
zs = [runs_z(s) for s in shoes]
rej = len([z for z in zs if abs(z) > 1.96]) / len(zs)
print("runs test, share of shoes with |z| > 1.96: %.4f" % rej)
print("mean z over shoes: %+.4f" % (math.fsum(zs) / len(zs)))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《百家乐庄闲边际精确枚举、算牌无效性与赌徒破产概率母典》第 5 章「路单没有预测力:连串长度、游程检验与小样本偏差」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-224 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026224,
author = {Fan, Yafu},
title = {Exact Enumeration of Baccarat House Edges, the Futility of Card Counting and Gambler's Ruin Probabilities},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}