5D Library › 四人不完全信息随机博弈、贝叶斯读牌与反事实遗憾最小化 · English

第三章 读牌:筋是一条演绎,不是一条规律

问题的形式

对手已经宣告听牌,而玩家手上有几张牌可以打。哪一张最安全?这是一个贝叶斯问题:对手的听牌形状有一个先验,而对手自己的舍牌通过一条规则——振听,即不能和自己打过的牌——排除掉一部分形状。

注

本章的先验是示意值。 下面的听牌形状先验是作者选定的,不是从牌谱统计出来的。真实的先验依赖规则、点数、巡目与玩家本人。本章要说明的是更新的结构,而不是具体的数字;凡引用具体数字时,请连带这一条限定。

推导

# Chapter 3. Bayesian hand reading. An opponent has declared a ready hand, and
# the only evidence is their discards. The classic heuristics -- a tile is
# safer if its "suji" partner has been discarded, and safer still if only one
# shape could use it -- are consequences of Bayes' rule once a prior over
# waits is written down, and the program derives the numbers rather than
# asserting them. Model (stated, not assumed silently): the opponent's wait is
# one of the tile types in a numbered suit; the prior over WAIT SHAPES is
# taken from the relative frequency with which each shape occurs in ready
# hands, and a shape is impossible if the opponent has discarded a tile that
# the shape would have won on (the furiten rule). All priors here are
# illustrative; the point is the structure of the update.
import math

SHAPES = {
    # name: (list of winning tile values, prior weight)
    "two-sided 23 waiting 1/4": ((1, 4), 0.34),
    "two-sided 34 waiting 2/5": ((2, 5), 0.34),
    "closed 13 waiting 2": ((2,), 0.11),
    "edge 12 waiting 3": ((3,), 0.07),
    "pair 11 waiting 1": ((1,), 0.08),
    "three-sided 234 5 waiting 1/4/6": ((1, 4, 6), 0.06),
}

def normalise(d):
    s = math.fsum(d.values())
    return {k: v / s for k, v in d.items()}

def posterior(discards):
    """Shapes consistent with the furiten rule: an opponent cannot be waiting
    on a
    tile they have themselves discarded."""
    post = {}
    for name, (wins, w) in SHAPES.items():
        if any(t in discards for t in wins):
            continue                                  # furiten: impossible
        post[name] = w
    return normalise(post) if post else {}

def p_deal_in(tile, discards, copies_left=None):
    """Probability that discarding `tile` completes the opponent's hand."""
    post = posterior(discards)
    return math.fsum(p for name, p in post.items() if tile in SHAPES[name][0])

if __name__ == "__main__":
    print("Illustrative prior over wait shapes in one suit:")
    for name, (wins, w) in sorted(SHAPES.items(), key=lambda kv: -kv[1][1]):
        print("   {:34s} wins on {:12s} prior {:.2f}"
              .format(name, str(wins), w))

    print("\nA. No information: probability that each tile value deals in.")
    print("   tile   P(deal in)")
    for t in range(1, 7):
        print("   {:4d} {:12.3f}".format(t, p_deal_in(t, set())))

    print(
        "\nB. The suji rule, derived. The opponent has discarded a 4, so no"
        " shape"
    )
    print("that wins on 4 is possible (furiten). What happens to tile 1?")
    for label, disc in (("nothing discarded", set()), ("4 discarded", {4})):
        print("   {:20s} P(deal in | 1) = {:.3f}"
              .format(label, p_deal_in(1, disc)))
    a, b = p_deal_in(1, set()), p_deal_in(1, {4})
    print(
        "   Discarding 1 becomes {:.1f} times safer, because the 23 two-sided"
        " shape".format(a / b if b else float("inf"))
    )
    print(
        "   that wins on both 1 and 4 is ruled out. That is the whole content"
        " of the"
    )
    print(
        "   suji heuristic: it is a furiten deduction, not a statistical"
        " regularity."
    )

    print(
        "\nC. What suji does NOT rule out. With 4 discarded, tile 1 can still"
        " be won"
    )
    print("   on by:")
    for name, p in sorted(posterior({4}).items(), key=lambda kv: -kv[1]):
        if 1 in SHAPES[name][0]:
            print("      {:34s} posterior {:.3f}".format(name, p))
    print(
        "   So suji lowers the risk without removing it, and the residual"
        " risk is"
    )
    print(
        "   concentrated in the pair wait and the three-sided shape --"
        " precisely the"
    )
    print("   shapes a player holding a strong hand is most likely to keep.")

    print(
        "\nD. Combining with the tile pool. Suji is about which shapes are"
        " possible;"
    )
    print(
        "   the pool (Chapter 2) is about how many copies remain. Both"
        " multiply:"
    )
    print("   tile   suji?   P(shape wins)   copies left   relative danger")
    pool_note = []
    for t, disc, copies in (
        (1, set(), 3),
        (1, {4}, 3),
        (1, {4}, 1),
        (3, set(), 2),
    ):
        ps = p_deal_in(t, disc)
        danger = ps * copies / 3.0
        pool_note.append((t, "yes" if disc else "no", ps, copies, danger))
        print("   {:4d}   {:5s} {:15.3f} {:13d} {:17.3f}"
              .format(t, "yes" if disc else "no", ps, copies, danger))
    print(
        "\n   The last column is the product, scaled so that the first row"
        " is the"
    )
    print(
        "   shape probability itself. A suji tile with three copies live can"
        " be more"
    )
    print(
        "   dangerous than a non-suji tile with one copy live, so the two"
        " heuristics"
    )
    print(
        "   cannot be applied in sequence as a checklist -- they have to be"
    )
    print(
        "   multiplied, which is what a model does and a rule of thumb does"
        " not."
    )

    print(
        "\nE. The model's limits, stated plainly. The prior above is"
        " illustrative,"
    )
    print(
        "   not measured; real priors depend on the rule set, the scores, the"
        " turn"
    )
    print(
        "   and the player. More importantly, the model treats the opponent's"
    )
    print(
        "   discards as INFORMATIVE BUT NOT STRATEGIC: a player who knows"
        " they are"
    )
    print(
        "   being read can discard to mislead, and Chapter 6 shows that"
        " against such"
    )
    print(
        "   an opponent no fixed reading rule is safe. The reading in this"
        " chapter is"
    )
    print(
        "   therefore a best response to a NON-ADAPTIVE opponent, which"
        " is the"
    )
    print(
        "   correct way to describe it and not the way it is usually"
        " described."
    )
# Illustrative prior over wait shapes in one suit:
#    two-sided 23 waiting 1/4           wins on (1, 4)       prior 0.34
#    two-sided 34 waiting 2/5           wins on (2, 5)       prior 0.34
#    closed 13 waiting 2                wins on (2,)         prior 0.11
#    pair 11 waiting 1                  wins on (1,)         prior 0.08
#    edge 12 waiting 3                  wins on (3,)         prior 0.07
#    three-sided 234 5 waiting 1/4/6    wins on (1, 4, 6)    prior 0.06
#
# A. No information: probability that each tile value deals in.
#    tile   P(deal in)
#       1        0.480
#       2        0.450
#       3        0.070
#       4        0.400
#       5        0.340
#       6        0.060
#
# B. The suji rule, derived. The opponent has discarded a 4, so no shape
# that wins on 4 is possible (furiten). What happens to tile 1?
#    nothing discarded    P(deal in | 1) = 0.480
#    4 discarded          P(deal in | 1) = 0.133
#    Discarding 1 becomes 3.6 times safer, because the 23 two-sided shape
#    that wins on both 1 and 4 is ruled out. That is the whole content of the
#    suji heuristic: it is a furiten deduction, not a statistical regularity.
#
# C. What suji does NOT rule out. With 4 discarded, tile 1 can still be won
#    on by:
#       pair 11 waiting 1                  posterior 0.133
#    So suji lowers the risk without removing it, and the residual risk is
#    concentrated in the pair wait and the three-sided shape -- precisely the
#    shapes a player holding a strong hand is most likely to keep.
#
# D. Combining with the tile pool. Suji is about which shapes are possible;
#    the pool (Chapter 2) is about how many copies remain. Both multiply:
#    tile   suji?   P(shape wins)   copies left   relative danger
#       1   no              0.480             3             0.480
#       1   yes             0.133             3             0.133
#       1   yes             0.133             1             0.044
#       3   no              0.070             2             0.047
#
#    The last column is the product, scaled so that the first row is the
#    shape probability itself. A suji tile with three copies live can be more
#    dangerous than a non-suji tile with one copy live, so the two heuristics
#    cannot be applied in sequence as a checklist -- they have to be
#    multiplied, which is what a model does and a rule of thumb does not.
#
# E. The model's limits, stated plainly. The prior above is illustrative,
#    not measured; real priors depend on the rule set, the scores, the turn
#    and the player. More importantly, the model treats the opponent's
#    discards as INFORMATIVE BUT NOT STRATEGIC: a player who knows they are
#    being read can discard to mislead, and Chapter 6 shows that against such
#    an opponent no fixed reading rule is safe. The reading in this chapter is
#    therefore a best response to a NON-ADAPTIVE opponent, which is the
#    correct way to describe it and not the way it is usually described.

筋牌:一条演绎

B 段是本章的主结果。对手打过 4,于是任何以 4 为和牌张之一的形状都不可能(振听)。其后果是:打 1 的放铳概率从 0.480 降到 0.133,即安全约 3.6 倍。

关键在于这是怎么来的。它不是「统计上筋牌比较安全」这样一条经验规律,而是一条演绎:那个同时和 1 与 4 的两面形状被规则排除了。所以

筋是振听的演绎,不是统计规律。

这个区分有实际后果。一条经验规律在不同的玩家群体中强弱不同;一条演绎在规则成立处处成立。但反过来,演绎只排除它所排除的那些形状——C 段列出剩下的:在本书的先验下,打过 4 之后 1 仍然可能被单骑和。所以筋降低风险而不消除风险,而剩余风险集中在单骑与三面听上,也就是手牌强的玩家最可能保留的形状。

两条启发式必须相乘

D 段给出一个容易出错的地方。筋说的是哪些形状可能,牌池(第二章)说的是还剩几张。两者是独立的因子,必须相乘:

一张筋牌若还剩三张(相对危险 0.133),比一张非筋牌只剩一张(相对危险 0.044)更危险。所以不能把两条启发式当成检查清单顺序套用——「先看是不是筋,再看剩几张」会得到错误的排序。模型会相乘,口诀不会。

两条启发式的相乘。横轴为形状可能性(筋与否),纵轴为剩余张数,等值线为两者之积即相对危险。一张三张全活的筋牌与一张只剩一张的非筋牌可以落在不同的等值线上,而顺序套用两条口诀会把它们排错。

这个模型描述的是什么对手

E 段写明本章最重要的限定。模型把对手的舍牌当作有信息但非策略性的:舍牌携带关于手牌的信息,而对手并不因为知道自己被读而改变舍牌。

一个知道自己正被读的对手可以反向利用这一点。第六章的程序 p12 给出形式化的结果:在一个对手能观察并适应的博弈中,任何确定性策略都有一个击败它的最优反应。所以

本章的读牌是对不适应对手的最优反应。

这是对它的正确描述,而不是通常的描述方式。通常的描述把读牌说成逼近真相的技术;按上面的说法,它是针对一类对手的技术,而对另一类对手它恰恰是被利用的入口。第六章同时给出这个担心的上界:读出一个混合比例需要数千手观察,所以在只打了几百手的对局里,谁也读不出谁的混合——包括对手读不出你的。

证据

与信息不对称文献的关系。 第 45 本讨论过订单簿中的信息不对称与毒流,那里的结构相似:一方从可观察的行为流中推断对方的私有信息,而对方可以策略性地塑造那个行为流。两处的共同结论是,推断的价值取决于对方是否在适应,而这是一个关于对手的经验问题,不是一个关于方法的数学问题。

假说 · 尚未验证

作者的假说(尚未确立): 在固定对手池上,逐手牌贝叶斯读牌相对一张固定放铳概率表的边际价值小于每个计分决策 0.01 个买入;而在对手池包含会策略性塑造舍牌的玩家时,读牌策略的表现低于固定表策略。什么样的结果能证明它是错的: 在第八章的设计中以两种对手池各跑一次,若两次的点数差方向相同且置信区间都排除零,则本假说错。

本章小结

读牌是一个贝叶斯问题:听牌形状有先验,而振听规则排除掉一部分形状。本章的主结果是筋牌的地位:它是振听的演绎而不是统计规律,在本书的示意先验下使一张牌安全约 3.6 倍而非安全,剩余风险集中在单骑与三面听上,也就是强手牌最可能保留的形状。筋与牌池是两个独立因子,必须相乘而不能顺序套用:一张三张全活的筋牌可以比一张只剩一张的非筋牌更危险。最后,这一整套读牌是对不适应对手的最优反应,因为它把舍牌当作有信息但非策略性的;第六章给出相应的担心与它的上界——读出一个混合比例需要数千手观察。

Fan, Y. (2026). Imperfect-Information Stochastic Games, Bayesian Hand-Reading and Counterfactual Regret Minimisation in Four-Player Tile Dynamics: From Markov Transitions of the Tile Pool and the Optimal Stopping of Defensive Folding to Kelly Allocation in a Multiplayer Game, with a Textual Examination of the Orthodox and the Unorthodox in the Classical Military Writers [四人不完全信息随机博弈、贝叶斯读牌与反事实遗憾最小化] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24020464 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).