The Gambler's Ruin Model and the Drunkard's Journey Home

The Gambler's Ruin Model

Consider a gambler with an initial capital of a yuan, who decides to stop gambling only after winning an additional b yuan. The probability of the gambler winning each round is p , and each round results in either a gain or a loss of 1 yuan. We need to find the probability function of the gambler going bankrupt.

Solution: Define the event A_k as "the gambler ends up bankrupt when starting with an initial capital of k yuan".

Therefore, we analyze the probability by considering two scenarios for the first round: if the gambler wins the first round, the probability of bankruptcy is P(A_{k+1}) ; if the gambler loses the first round, the probability of bankruptcy is P(A_{k-1}) .

Express the probabilities using a sequence: Let P_k represent the probability of bankruptcy when the initial capital is k yuan.

At this point, we have the recurrence relation: P_k = pP_{k+1} + (1-p)P_{k-1} , with boundary conditions P_0 = 1 (bankrupt when having 0 yuan) and P_{a+b} = 0 (no bankruptcy when reaching the target capital of a+b yuan and stopping gambling).

The general term of this sequence can be found using the characteristic equation.

Characteristic Equation:

  1. When p \neq \frac{1}{2}, the characteristic equation has distinct roots, and the general term of the sequence can be written as P_k = A\lambda_1^k + B\lambda_2^k (where \lambda_1 and \lambda_2 are the characteristic roots). Substituting the boundary conditions P_0 = 1 and P_{a+b} = 0 , and simplifying by letting r = \frac{1-p}{p} , we solve to get P_k = \frac{r^{a+b} - r^k}{r^{a+b} - 1} , where r > 0 and r \neq 1 .

  2. When p = \frac{1}{2}, the characteristic equation has a repeated root. It can be directly derived from the recurrence relation that the sequence is an arithmetic sequence. Substituting the boundary conditions, we find the common difference d = -\frac{1}{a+b} , and thus P_k = 1 - \frac{k}{a+b} .

From the final probability function, we can see that the greater the gambler's ambition, the higher the probability of bankruptcy. If the gambler keeps gambling indefinitely, unless the probability of winning each round exceeds 0.5 , they will eventually lose all their money no matter how much initial capital they have. Even if the probability of winning each round exceeds 0.5 , the gambler still has a chance of going bankrupt.

The Gambler's Ruin Model is a one-dimensional random walk problem with absorbing barriers (walls) on both sides.


The Drunkard's Journey Home

There is a well-known problem: A drunkard, who has drunk heavily, stumbles out of a bar in Birmingham, UK, and walks randomly along the street (only left or right). Suppose each step he takes has a fixed length, and the probability of walking left or right is each 0.5 . His home is two blocks to the left of the bar, and his wife is waiting at the door. She will pull him inside as soon as he reaches the doorstep; otherwise, he will wander aimlessly along the street. Will the drunkard eventually get home?

At first glance, it seems quite likely that the drunkard will not be able to get home and might even drift further away. But in reality, this is not the case.

Let's start calculating. First, simplify the model and begin with simpler parts.

This problem is also a one-dimensional random walk model with only a single absorbing barrier. Establish a coordinate system, assuming the home is at coordinate 0 and the bar is at coordinate 2. The drunkard can reach home by walking 1 step to the right; or by walking 1 step to the left first and then 2 steps to the right, totaling 3 steps; or by walking 5 steps, and so on. The idea is simple: sum up the probabilities of reaching home in 1 step, 3 steps, 5 steps, etc., and find the limit of this sum.

There is only one way to reach home in 1 step, and the probability is obviously \frac{1}{2} ; there is only one way to reach home in 3 steps, with a probability of \frac{1}{8} ; there are two ways to reach home in 5 steps, with a probability of \frac{2}{32} ; when we try to calculate the probabilities for more steps, we find that we can no longer enumerate all the ways...

This simple method turns out to be a failure.

However, at this point, we recall the Gambler's Ruin Model.

Establish a coordinate system where the home is at coordinate 0 and the bar is at coordinate n; the street is the x-axis, and each step the drunkard takes is of length 1 . If we regard the drunkard's coordinate value on the axis as his wealth, then n is his initial wealth, and returning home is equivalent to the gambler going bankrupt. Thus, this problem is equivalent to the Gambler's Ruin Model with p = \frac{1}{2} and b \to +\infty (since the drunkard will not stop wandering, which is equivalent to having infinitely great ambition). Therefore, the probability that the drunkard eventually reaches home is 1 , meaning the drunkard will definitely get home.

At this point, someone might ask: What if the streets are in four directions (north, south, east, west), forming a two-dimensional random walk? What will the situation be like then?

The idea to solve this is quite simple.

We can transform this problem into two independent problems. The probability of the drunkard walking north or south is each 0.5 , and the probability of walking east or west is also each 0.5 . Then, in the coordinate system, the probability of him reaching a specific line in the north-south direction is 1 , and the probability of reaching a specific line in the east-west direction is also 1 . Since the east-west and north-south directions are completely independent and do not affect each other, the probability of him reaching any specific point (his home) in the plane is 1 \times 1 = 1 . In other words, the drunkard will definitely get home.

This seems good; once again, we have used elementary mathematical ideas and the transformation method to easily solve a complex problem.

Unfortunately, this simple method is wrong again this time.

A key point of the Gambler's Ruin Model is that the process stops when the gambler loses all their money.

When applied to a two-dimensional random walk, this means stopping when reaching a specific line (such as x = x_0 or y = y_0 ), which ensures the independence of probabilities in the north-south and east-west directions.

Regrettably, the drunkard does not behave like this. In the two-dimensional problem, he will only stop when reaching a specific point (his home). Therefore, it may happen that he reaches the required position in the north-south direction but not in the east-west direction, or reaches the required position in the east-west direction but not in the north-south direction.

In 1921, the Hungarian mathematician George Pólya provided a complete proof (which is beyond the understanding of high school students) showing that a two-dimensional random walk is a Wiener process, following the Rayleigh distribution, and the probability of eventually returning to the starting point (home) is still 1 .

An extended conclusion of this problem is: As long as no one stops the drunkard and given enough time (and the drunkard does not eat, drink, or die), he will eventually walk through the entire city, or even the entire continent. Of course, in practical problems, the drunkard's direction is completely random, and different directions of movement will affect each other. In fact, this is a Brownian motion, which follows a normal distribution (and cannot be solved using only high school knowledge). However, we can still draw the same conclusion: the drunkard can traverse the entire city.

It can be seen that "the broader one's ambition, the wider the world one can explore".

Interestingly, Pólya pointed out that while a drunkard can get home, a "drunk bird" may not. In a three-dimensional random walk model, the probability of eventually returning to the starting point is only 34\% . As the number of dimensions of the random walk increases, the probability of returning to the starting point decreases. In a four-dimensional space, this probability is calculated to be 19.3\% , and in an eight-dimensional space, this number drops to 7.3\% .


The "Evolutionary" Drunkard's Journey Home

Stephen Jay Gould, a neo-Darwinist, proposed a theory called "the Drunkard's Walk Theory of Evolution". It states: "Biological evolution is actually like a drunkard trying to get home. He staggers and wanders randomly on his way home. On the left side of the path home is a wall, and on the right side is a ditch. What will happen to this drunkard in the end? He will definitely fall into the ditch. Because when he hits the wall, he will be bounced back, but falling into the ditch is inevitable."

Species have no goals at all during evolution. If they evolve toward simplicity, they will eventually reach a wall when they simplify to the level of bacteria—they cannot become any simpler. Therefore, the direction of simplicity is blocked. The other direction is that species stagger along, and more or less, they will all fall into the ditch to some extent, which means evolving toward more complex and advanced forms.

From the perspective of the quantity distribution of biological species, there are about 4,000 species of mammals, while the total number of microorganisms is astonishingly large—more than 100,000 species have been named, and there are a large number of microorganisms that have not been named or even observed. A large number of possibilities are concentrated on the side of simplicity, while only a small number of species have truly become advanced and complex.

According to the "Drunkard's Walk Theory of Evolution", the so-called evolution of humans is actually an inevitable "randomness" similar to a drunkard's journey home. The emergence of humans as a species on Earth is just one of countless random possibilities. Humans are only a small, newly grown branch on the huge tree of life, and they may be eliminated or destroyed at any time, just like other species.


赌徒破产模型与醉汉回家

赌徒破产模型 

假设有一名赌徒,初始本金为 a 元,他决定再赢 b 元后就停止赌博。该赌徒每一局赢的概率为 p ,每一局的结果要么赢 1 元,要么输 1 元。我们需要求出该赌徒破产的概率函数。

解答:定义事件 Aₖ 为“赌徒初始本金为 k 元时,最终走向破产”。

因此,我们通过分析第一局的两种情况来计算概率:若赌徒赢了第一局,其破产概率为 P(Aₖ₊₁) ;若赌徒输了第一局,其破产概率为 P(Aₖ₋₁)

用数列表示概率:设 Pₖ 为初始本金为k元时的破产概率。

此时,我们得到递推关系式: Pₖ = pPₖ₊₁ + (1-p)Pₖ₋₁ ,边界条件为 P₀ = 1 (本金为 0 元时已破产)和 Pₐ₊ᵦ = 0 (本金达到 a+b 元目标金额并停止赌博,不会破产)。

该数列的通项可通过特征方程求解。

特征方程:

  1. p≠1/2 时,特征方程有两个不同的根,数列通项可表示为 Pₖ = Aλ₁ᵏ + Bλ₂ᵏ (其中 λ₁λ₂ 为特征根)。代入边界条件 P₀ = 1Pₐ₊ᵦ = 0 ,令 r=(1-p)/p 简化计算,解得 Pₖ = (rᵃ⁺ᵇ - rᵏ)/(rᵃ⁺ᵇ - 1) ,其中 r>0r≠1

  2. p=1/2 时,特征方程有一个重根。由递推关系式可直接推出该数列为等差数列,代入边界条件求得公差 d=-1/(a+b) ,因此 Pₖ = 1 - k/(a+b)

从最终的概率函数可知,赌徒的野心越大,破产概率越高。若赌徒一直赌下去,除非每局赢的概率超过 0.5 ,否则无论初始本金多少,最终都会输光所有钱;即便每局赢的概率超过 0.5 ,赌徒仍有破产的可能。 

赌徒破产模型是一个带有两侧吸收壁(墙)的一维随机游走问题。


醉汉回家 

有一个著名的问题:英国伯明翰一家酒吧里,一名喝得酩酊大醉的人踉跄着走出酒吧,沿着街道随机行走(只能向左或向右)。假设他每一步的步长固定,向左或向右走的概率均为 0.5 。他的家在酒吧左侧两个街区处,妻子正在家门口等他,只要他走到家门口,妻子就会把他拉进屋,否则他会继续在街上游荡。这名醉汉最终能回家吗?

乍一看,醉汉似乎很可能回不了家,甚至会离家越来越远,但实际情况并非如此。

我们先开始计算,首先简化模型,从简单的部分入手。

这个问题同样是一个仅含单侧吸收壁的一维随机游走模型。建立坐标系,假设家的坐标为 0 ,酒吧的坐标为 2 。醉汉向右走 1 步就能到家;或者先向左走 1 步,再向右走 2 步,总共走 3 步到家;也可能走 5 步到家,以此类推。思路很简单:将走 1 步、 3 步、 5 步……到家的概率相加,再求这个和的极限。

1 步到家的方式只有 1 种,概率显然是 1/2 ;走 3 步到家的方式也只有 1 种,概率为 1/8 ;走 5 步到家的方式有 2 种,概率为 2/32 。但当我们尝试计算更多步数的概率时,发现已经无法枚举所有走法了……

这种简单的方法以失败告终。

不过,这时我们想到了赌徒破产模型。

建立坐标系,设家的坐标为 0 ,酒吧的坐标为 n ,街道为 x 轴,醉汉每步的步长为 1 。若将醉汉在坐标轴上的坐标值视为他的“财富”,那么 n 就是他的初始“财富”,回家就相当于赌徒破产。因此,这个问题等价于 p=1/2b→+∞ (因为醉汉不会停止游荡,相当于“野心无限大”)的赌徒破产模型。由此可知,醉汉最终到家的概率为 1 ,也就是说,醉汉一定能回家。

这时可能有人会问:如果街道是东南西北四个方向的(形成二维随机游走),情况会怎样呢?

解决这个问题的思路其实很简单。

我们可以将这个问题拆分为两个独立的问题:醉汉向北或向南走的概率均为 0.5 ,向东或向西走的概率也均为 0.5 。那么在坐标系中,他到达南北方向某条特定直线的概率为 1 ,到达东西方向某条特定直线的概率也为 1 。由于东西方向和南北方向完全独立、互不影响,所以他到达平面内任意一个特定点(家)的概率为 1×1=1 。换句话说,醉汉一定能回家。

这看起来不错,我们又一次用初等数学思想和转化法轻松解决了复杂问题。

可惜,这次这个简单方法又错了。

赌徒破产模型有一个关键要点:赌徒输光钱后,过程就会停止。

将其应用到二维随机游走中,意味着走到某条特定直线(如 x=x₀y=y₀ )时停止,只有这样才能保证南北方向和东西方向的概率相互独立。

但遗憾的是,醉汉并不会这样做。在二维问题中,他只会走到某个特定点(家)时才停止。因此,可能会出现一种情况:他在南北方向到达了目标位置,但东西方向没到;或者东西方向到达了目标位置,但南北方向没到。

1921年,匈牙利数学家乔治·波利亚给出了完整证明(该证明超出了高中生的理解范围):二维随机游走是维纳过程,符合瑞利分布,最终回到起点(家)的概率仍为 1

这个问题的延伸结论是:只要没人阻拦醉汉,且时间足够(同时醉汉不吃不喝、不会死亡),他最终能走遍整座城市,甚至整片大陆。当然,在实际问题中,醉汉的行走方向完全随机,不同方向的移动会相互影响,这本质上是布朗运动,符合正态分布(仅用高中知识无法解决)。但我们仍能得出相同结论:醉汉可以走遍整座城市。

由此可见,“心有多大,舞台就有多大”。

有趣的是,波利亚指出,醉汉能回家,但“喝醉的小鸟”却未必。在三维随机游走模型中,最终回到起点的概率仅为 34\% 。随着随机游走维度的增加,回到起点的概率会逐渐降低:在四维空间中,该概率经计算为 19.3\% ;在八维空间中,这个数字降至 7.3\%


“进化版”醉汉回家

新达尔文主义者斯蒂芬·杰伊·古尔德提出了一套名为“进化的醉汉回家理论”的学说。该理论指出:“生物进化其实就像醉汉回家,他在回家的路上跌跌撞撞、漫无目的地游荡。回家路线的左侧是一堵墙,右侧是一条沟。这名醉汉最终会怎样?他一定会掉进沟里。因为撞到墙会被弹回来,但掉进沟里是不可避免的。”

物种在进化过程中毫无目标可言。若朝着简单化方向进化,最终会简化到细菌层面,此时就像撞到了墙——无法再继续简化,因此简单化的方向被阻断。而另一个方向上,物种跌跌撞撞地进化,或多或少都会“掉进沟里”,也就是朝着更复杂、更高级的方向进化。

从生物物种的数量分布来看,哺乳动物约有 4000 种,而微生物的总数却多到惊人——已命名的就有 10多万 种,还有大量微生物未被命名,甚至未被观测到。大量进化可能性集中在简单化一侧,而真正进化成高级、复杂物种的却寥寥无几。

根据“进化的醉汉回家理论”,人类所谓的进化,其实是一种类似醉汉回家的、必然的“偶然性”。人类这一物种在地球上的出现,只是无数种随机可能性中的一种。人类只是生命这棵大树上新生的细小枝丫,和其他物种一样,随时可能被淘汰、被毁灭。

评论