赌徒破产定理:为什么赌博最终会归零

引言

在概率论中,"赌徒破产定理"(Gambler's Ruin)是一个经典的结果,它表明在一个公平的赌博游戏中,如果赌徒拥有有限的本金而庄家拥有无限的资金,赌徒最终破产的概率是1。即使游戏是公平的(胜负概率各50%,赔率1:1),随机游走的性质决定了赌徒几乎必然会失去所有资金。

数学证明

问题设定

考虑一个赌徒参与一个公平的赌博游戏:

  • 每局赌注固定为1单位
  • 获胜概率为p,失败概率为q,且p = q = 0.5(公平游戏)
  • 赌徒初始本金为A单位
  • 庄家资金无限(或远大于赌徒本金)

赌徒的目标是达到B单位资金(B > A),但如果资金降至0,则破产。

随机游走模型

赌徒的资金变化可以建模为一个随机游走过程。令Xₙ表示第n局后的资金额,则:

Xₙ₊₁ = Xₙ + Zₙ

其中Zₙ是一个随机变量,取值为+1(获胜)或-1(失败),各以概率0.5发生。

这是一个无偏的随机游走(martingale)。

破产概率推导

令Pₖ表示当当前资金为k时,最终破产的概率。

我们有以下边界条件:

  • P₀ = 1(资金为0时已破产)
  • P_B = 0(达到目标资金B,不再赌博)

对于0 < k < B,根据全概率公式:

Pₖ = p · Pₖ₊₁ + q · Pₖ₋₁

由于p = q = 0.5,可得:

Pₖ = (1/2)Pₖ₊₁ + (1/2)Pₖ₋₁

rearranging:

2Pₖ = Pₖ₊₁ + Pₖ₋₁

Pₖ₊₁ - Pₖ = Pₖ - Pₖ₋₁

这表明相邻状态的破产概率之差是常数。令Δ = P₁ - P₀ = P₁ - 1

那么:
P₂ - P₁ = Δ
P₃ - P₂ = Δ
...
Pₖ - Pₖ₋₁ = Δ
...
P_B - P_B₋₁ = Δ

将这些方程相加,得到:

P_B - P₀ = B · Δ

但P_B = 0, P₀ = 1,所以:

0 - 1 = B · Δ
Δ = -1/B

因此:
Pₖ - Pₖ₋₁ = -1/B

现在从P₀开始求和:

Pₖ = P₀ + (P₁ - P₀) + (P₂ - P₁) + ... + (Pₖ - Pₖ₋₁)
= 1 + k · Δ
= 1 + k · (-1/B)
= 1 - k/B

当B → ∞(庄家资金无限),Pₖ → 1 - k/∞ = 1

这意味着对于任何有限本金k,当对手资金无限时,破产概率为1。

期望时间直到破产

即使破产概率为1,赌徒可能希望知道平均需要多少局才会破产。可以证明,从本金k开始,期望的赌博局数直到破产是k × (B - k)。当B → ∞时,这趋于无穷,但破产仍然几乎必然发生。

代码演示

以下C++程序模拟了描述的场景:初始本金10000元,单局赌注100元,一直押注"大"(11点以上),3个骰子。

#include <iostream>
#include <cstdlib>
#include <ctime>
#include <random>

using namespace std;

// Function to roll three dice and return the sum
int rollDice() {
    random_device rd;
    mt19937 gen(rd());
    uniform_int_distribution<> dis(1, 6);
    
    int dice1 = dis(gen);
    int dice2 = dis(gen);
    int dice3 = dis(gen);
    
    return dice1 + dice2 + dice3;
}

// Function to determine if the result is "big" (11 points or more)
bool isBig(int total) {
    return total >= 11;
}

int main() {
    // Initialize random seed
    srand(time(0));
    
    // Game parameters
    int capital = 10000;  // Initial capital
    const int betAmount = 100;  // Bet per game
    int totalGames = 0;
    int gamesWon = 0;
    int gamesLost = 0;
    
    // Get number of games to play
    cout << "欢迎来到猜大小游戏!" << endl;
    cout << "初始本金: " << capital << "元" << endl;
    cout << "单局赌注: " << betAmount << "元" << endl;
    cout << "游戏规则: 3个骰子,11点以上为大" << endl;
    cout << "你将一直押注'大'" << endl << endl;
    
    cout << "请输入要进行的游戏次数: ";
    cin >> totalGames;
    
    // Validate input
    if (totalGames <= 0) {
        cout << "游戏次数必须大于0!" << endl;
        return 1;
    }
    
    cout << "\n开始游戏..." << endl;
    cout << "==========================================" << endl;
    
    // Play the specified number of games
    for (int game = 1; game <= totalGames; game++) {
        if (capital < betAmount) {
            cout << "本金不足,无法继续游戏!游戏提前结束。" << endl;
            break;
        }
        
        // Place bet
        capital -= betAmount;
        
        // Roll dice
        int diceSum = rollDice();
        bool isBigResult = isBig(diceSum);
        
        // Check result
        if (isBigResult) {
            // Win - get 2x bet back (bet amount + winnings)
            int winAmount = betAmount * 2;
            capital += winAmount;
            gamesWon++;
            cout << "第" << game << "局: 骰子点数=" << diceSum << " (大) - 赢了! +" << betAmount << "元" << endl;
        } else {
            // Lose - bet is lost
            gamesLost++;
            cout << "第" << game << "局: 骰子点数=" << diceSum << " (小) - 输了! -" << betAmount << "元" << endl;
        }
        
        cout << "当前本金: " << capital << "元" << endl;
        cout << "------------------------------------------" << endl;
    }
    
    // Display final results
    cout << "\n游戏结束!" << endl;
    cout << "==========================================" << endl;
    cout << "总局数: " << (gamesWon + gamesLost) << endl;
    cout << "获胜局数: " << gamesWon << endl;
    cout << "失败局数: " << gamesLost << endl;
    cout << "最终本金: " << capital << "元" << endl;
    
    int profit = capital - 10000;
    if (profit > 0) {
        cout << "总盈利: +" << profit << "元" << endl;
    } else if (profit < 0) {
        cout << "总亏损: " << profit << "元" << endl;
    } else {
        cout << "不赚不赔" << endl;
    }
    
    cout << "胜率: " << (static_cast<double>(gamesWon) / (gamesWon + gamesLost) * 100) << "%" << endl;
    
    return 0;
}

模拟结果分析

运行这个程序多次,可以观察到:

  1. 短期波动:在少数游戏中,赌徒可能盈利,这是由于随机性。
  2. 长期趋势:随着游戏次数增加,资金倾向于回归初始值附近(随机游走的回归性)。
  3. 破产风险:如果游戏次数足够多,资金几乎必然会触及下限(赌注以下),导致无法继续。

即使游戏完全公平(11点以上概率确实为50%),且赔率1:1,但由于赌徒本金有限而庄家资金无限,长期来看破产是必然的。

结论

赌徒破产定理揭示了赌博的数学本质:无论游戏多么公平,有限本金对抗无限资金几乎必然导致破产。这是因为随机游走的性质决定了资金几乎必然会触及吸收边界(零资金)。

这个结果不仅适用于赌博,也适用于任何类似随机游走的场景,如股票市场短期交易、保险风险等。理解这一点有助于认识到"快速致富"的赌博策略在数学上是不可行的。

道德: 最好的赌博策略是不赌博。

以上博文基于 DEEPSEEK

posted on 2025-09-13 20:49  HDU李少帅  阅读(25)  评论(0)    收藏  举报