Computer Simulations and Analyses on Parrondos’s Paradox
廖润龙 2021141500076
Abstract
本研究探讨了两个独立赌局 A A A 和 B B B 的组合模型。在长期单独进行赌局 A A A 或 B B B 时,每个赌局的期望收益均为亏损。然而,当这两个赌局交替进行时,便呈现出一种盈利的策略。本文首先采用马尔可夫链和迭代方法,对单一赌局的期望收益进行定量分析。接着,我们利用离散马尔可夫链对帕隆多悖论中的标准模型和交叉模型进行建模,提出了一种计算单次赌局期望收益的通用方法。通过马尔可夫矩阵的视角,我们对这一反直觉的现象进行了定量分析,并借鉴 Harmer 等人使用布朗棘轮作类比,为此现象提供了直观的理解。我们发现,尽管单独进行赌局 A A A 或 B B B 通常会产生负收益,但当赌局 A B AB A B 以特定模式交替进行时,期望收益却转为正值。我们详细阐述了这一模式,并通过计算机模拟加以验证。这种现象,被称为帕隆多悖论,在金融市场中具有广泛的应用潜力。
关键字:Parrondo’s Paradox, Markov Chain, Random Walk, Graph Theory, Probability
1. Introduction
概率理论的研究可追溯至十七世纪,始于数学家们对赌博问题的探索。在当今时代,概率理论在神经网络和计算智能领域展现出显著的应用价值。特别地,马尔可夫模型 [1] 已在互联网生态系统中发挥广泛作用,例如在谷歌的网页排名算法中得到应用。Parrondo 提出的悖论 [2] 则是一个通过结合两个失效策略来产生成功策略的反直觉模型,此模型可由马尔可夫链构建。本文首先详细介绍帕隆多悖论中的基本模型及其定量分析方法,并阐释为何将预期亏损的游戏组合起来会产生正收益。
1.1 Parrondo’s Games [2]
1.1.1 游戏 A
让我们考虑游戏 A A A :玩家初始资金为 0 0 0 ,每轮游戏抛掷一枚不公平的硬币,胜利则赚得一块钱,失败则损失一块钱。其概率模型定义如下:
Game A: P [ winning ] = 1 2 − ε P [ losing ] = 1 2 + ε \begin{aligned}
\textrm{Game A: }& \mathbf P[\textrm{winning}] = \frac1 2 - \varepsilon \\
&\mathbf P[\textrm{losing}] = \frac1 2 + \varepsilon \\
\end{aligned} Game A: P [ winning ] = 2 1 − ε P [ losing ] = 2 1 + ε
其中,ε \varepsilon ε 是调整胜败概率的超参数。
令随机变量 Y Y Y 表示 n n n 局游戏 A 中胜利的次数,即 Y ∼ B ( n , p = 1 2 − ε ) Y \sim B(n, p = \frac{1}{2} - \varepsilon) Y ∼ B ( n , p = 2 1 − ε ) 。根据中心极限定理,Y Y Y 可近似为连续分布 N ( n p , n p q ) N(np, npq) N ( n p , n pq ) 。考虑资金亏损服从分布 2 Y − n 2Y - n 2 Y − n ,可近似为:
capital ∼ N ( n ( p − q ) , 4 n p q ) \textrm{capital} \sim N(n(p-q),4npq) capital ∼ N ( n ( p − q ) , 4 n pq )
当 ε \varepsilon ε 取 0.005 0.005 0.005 时,游戏平均每局亏损 0.010 0.010 0.010 .
1.1.2 游戏 B
1.1.2.1 游戏 B定义
游戏 B B B 的规则取决于当前资金的数额。具体来说,如果当前资金是 M M M 的整数倍,则玩家赢得该轮游戏并获得一块钱的概率为 p 1 p_1 p 1 ;反之,则赢得游戏的概率为 p 2 p_2 p 2 。
以 M = 3 M = 3 M = 3 ,p 1 = 1 10 − ε p_1 = \frac{1}{10} - \varepsilon p 1 = 10 1 − ε ,p 2 = 3 4 − ε p_2 = \frac{3}{4} - \varepsilon p 2 = 4 3 − ε 为例,游戏 B B B 的概率模型可表示如下:
Game B: P [ winning ∣ captial mod 3 = 0 ] = 1 10 − ε P [ losing ∣ captial mod 3 = 0 ] = 9 10 + ε P [ winning ∣ captial mod 3 ≠ 0 ] = 3 4 − ε P [ losing ∣ captial mod 3 ≠ 0 ] = 1 4 + ε \begin{aligned}
\textrm{Game B: }& \mathbf P[\textrm{winning} \mid \textrm{captial mod 3 = }0] = \frac1 {10} - \varepsilon \\
&\mathbf P[\textrm{losing}\mid \textrm{captial mod 3 = }0] = \frac9 {10} + \varepsilon \\
&\mathbf P[\textrm{winning}\mid \textrm{captial mod 3}\ne0] = \frac 3 {4} - \varepsilon \\
&\mathbf P[\textrm{losing}\mid \textrm{captial mod 3}\ne 0] = \frac 1 {4} + \varepsilon \\
\end{aligned} Game B: P [ winning ∣ captial mod 3 = 0 ] = 10 1 − ε P [ losing ∣ captial mod 3 = 0 ] = 10 9 + ε P [ winning ∣ captial mod 3 = 0 ] = 4 3 − ε P [ losing ∣ captial mod 3 = 0 ] = 4 1 + ε
下令 ε = 0.005 \varepsilon=0.005 ε = 0.005 ,模拟分析单独进行游戏 B B B 的收益。
1.1.2.2 游戏 B 的模拟计算
下图为不同次数的计算机模拟,观察出游戏 B 的收益和次数的线性关系。 (Appendix code i)
1.1.2.3 游戏 B 的定量分析
设现在的资金为 n n n ,则根据游戏概率不同划分为三种状态:A , B , C A,B,C A , B , C ,
A : n m o d 3 = 0 A:n \bmod 3 =0 A : n mod 3 = 0
B : n m o d 3 = 1 B:n \bmod 3=1 B : n mod 3 = 1
C : n m o d 3 = 2 C:n \bmod 3 =2 C : n mod 3 = 2
根据游戏 B B B 的定义建立状态转移概率图,容易验证该转移满足马氏性与时齐性:
设 A i , B i , C i A_i,B_i,C_i A i , B i , C i 表示这个人在第 i i i 次游走后分别在 A , B , C A,B,C A , B , C 状态的概率分布,有递推关系:
{ 0.255 B i + 0.745 C i = A i + 1 0.095 A i + 0.255 C i = B i + 1 0.745 B i + 0.905 C i = C i + 1 (1) \begin{cases}
0.255B_i + 0.745C_i = A_{i+1} \\
0.095A_i + 0.255C_i = B_{i+1} \\
0.745B_i + 0.905C_i = C_{i+1} \\
\end{cases}\tag{1} ⎩ ⎨ ⎧ 0.255 B i + 0.745 C i = A i + 1 0.095 A i + 0.255 C i = B i + 1 0.745 B i + 0.905 C i = C i + 1 ( 1 )
由于该马氏链有限,则存在平稳分布:
{ − A + 0.255 B + 0.745 C = 0 0.095 A − B + 0.255 C = 0 0.905 A + 0.745 B − C = 0 ⟹ [ − 1 0.255 0.745 0.095 − 1 0.255 0.905 0.745 − 1 ] ⋅ [ A B C ] = [ 0 0 0 ] ⟺ P ⋅ y = 0 (2) \begin{cases}
-A + 0.255B + 0.745C = 0 \\
0.095A - B + 0.255C = 0 \\
0.905A + 0.745B - C = 0 \\
\end{cases}\tag{2}
\implies
\begin{bmatrix}
-1 &0.255 &0.745\\
0.095 &-1 &0.255\\
0.905 &0.745 &-1\\
\end{bmatrix} \cdot \begin{bmatrix}
A \\
B \\
C\\
\end{bmatrix} = \begin{bmatrix}
0 \\
0 \\
0\\
\end{bmatrix}
\iff \mathbf P \cdot \mathbf y = \mathbf 0 ⎩ ⎨ ⎧ − A + 0.255 B + 0.745 C = 0 0.095 A − B + 0.255 C = 0 0.905 A + 0.745 B − C = 0 ⟹ − 1 0.095 0.905 0.255 − 1 0.745 0.745 0.255 − 1 ⋅ A B C = 0 0 0 ⟺ P ⋅ y = 0 ( 2 )
构造常数概率方程 ( 2 ) (2) ( 2 ) ,该方程有无穷解,即概率常数矩阵并不是满秩。由矩阵树定理(附录)可得,对于一个强连通图构造的马尔可夫矩阵 P \mathbf P P 其秩为 n − 1 n-1 n − 1 。这时候我们只需要再加入 A + B + C = 1 A+B+C=1 A + B + C = 1 这个初始限定条件即可构造满秩矩阵 (注意到这个初始条件一定不能被任何概率转移式线性表出),即可构造满秩矩阵从而解出平稳分布:
同样,我们可以考虑 lim n → ∞ P n \lim_{n\to \infty} \mathbf P^{n} lim n → ∞ P n :
设初始状态 y 0 = [ A 0 B 0 C 0 ] = [ 1 0 0 ] \mathbf{y}_0=\begin{bmatrix}
A_0 \\
B_0 \\
C_0\\
\end{bmatrix} = \begin{bmatrix}
1 \\
0 \\
0\\
\end{bmatrix} y 0 = A 0 B 0 C 0 = 1 0 0
根据方程 ( 1 ) (1) ( 1 ) 构造迭代方程 ( 4 ) (4) ( 4 ) :
y ( k + 1 ) = [ 0 0.255 0.745 0.095 0 0.255 0.905 0.745 0 ] ⋅ y ( k ) = P ⋅ y ( k ) (4) \mathbf y^{(k+1)} =
\begin{bmatrix}
0 &0.255 &0.745\\
0.095 &0 &0.255\\
0.905 &0.745 &0\\
\end{bmatrix} \cdot \mathbf y^{(k)} = \mathbf P \cdot y^{(k)}
\tag{4} y ( k + 1 ) = 0 0.095 0.905 0.255 0 0.745 0.745 0.255 0 ⋅ y ( k ) = P ⋅ y ( k ) ( 4 )
根据附录的迭代法收敛定理,对 任意 x ( 0 ) \mathbf x^{(0)} x ( 0 ) 序列 { x ( k ) } \{\mathbf x^{(k)}\} { x ( k ) } 收敛的 充要条件 迭代矩阵的谱半径小于一:
ρ ( P ) < 1 \rho (\mathbf P) < 1 ρ ( P ) < 1
计算得,迭代矩阵 ρ ( P ) ≤ 1 \rho(\mathbf P) \le 1 ρ ( P ) ≤ 1 ,则该迭代矩阵不一定对任意初始向量均收敛(但从马氏链的相关知识可以得知,对定义在 S \mathcal S S 上概率测度向量一定收敛)。
计算 P \mathbf P P 的特征值及特征向量有:
P = [ 0 0.255 0.745 0.095 0 0.255 0.905 0.745 0 ] = X Λ X − 1 = [ 0.3816 0.3970 − 0.3970 0.1543 0.1030 0.5000 0.4621 − 0.5000 − 0.1030 ] ⋅ [ 1.0000 0 0 0 − 0.8721 0 0 0 − 0.1279 ] ⋅ [ 1.0000 1.0000 1.0000 1.0315 0.6014 − 1.0571 − 0.5009 1.5676 − 0.0909 ] \begin{aligned}
\mathbf P &= \begin{bmatrix}
0 &0.255 &0.745\\
0.095 &0 &0.255\\
0.905 &0.745 &0\\
\end{bmatrix}
= \mathbf X \mathbf \Lambda \mathbf X^{-1} \\\\
&=
\begin{bmatrix}
0.3816 &0.3970 &-0.3970\\
0.1543 &0.1030 &0.5000\\
0.4621 &-0.5000 &-0.1030\\
\end{bmatrix} \cdot
\begin{bmatrix}
1.0000 &0 &0\\
0 &-0.8721 &0\\
0 &0 &-0.1279\\
\end{bmatrix} \cdot
\begin{bmatrix}
1.0000 &1.0000 &1.0000\\
1.0315 &0.6014 &-1.0571\\
-0.5009 &1.5676 &-0.0909\\
\end{bmatrix}
\end{aligned} P = 0 0.095 0.905 0.255 0 0.745 0.745 0.255 0 = XΛ X − 1 = 0.3816 0.1543 0.4621 0.3970 0.1030 − 0.5000 − 0.3970 0.5000 − 0.1030 ⋅ 1.0000 0 0 0 − 0.8721 0 0 0 − 0.1279 ⋅ 1.0000 1.0315 − 0.5009 1.0000 0.6014 1.5676 1.0000 − 1.0571 − 0.0909
则迭代 n n n 次后可表示为 P n ⋅ y \mathbf P^n \cdot \mathbf y P n ⋅ y :
P n = X Λ n X − 1 = [ x 1 x 2 x 3 ] ⋅ [ 1 λ 2 n λ 3 n ] ⋅ [ X − 1 ] lim n → ∞ P n = [ x 1 x 1 x 1 ] \begin{aligned}
\mathbf P^n &= \mathbf X \mathbf \Lambda ^n \mathbf X^{-1}\\
&=
\begin{bmatrix}
& &\\
\mathbf x_1 &\mathbf x_2 &\mathbf x_3\\
& &\\
\end{bmatrix} \cdot
\begin{bmatrix}
1 & & \\
&\lambda_2^n &\\
& &\lambda_3^n\\
\end{bmatrix} \cdot
\begin{bmatrix}
& &\\
&\mathbf X^{-1} &\\
& &\\
\end{bmatrix} \\
\lim_{n\to\infty} \mathbf P^n &=
\begin{bmatrix}
& &\\
\mathbf x_1 &\mathbf x_1 &\mathbf x_1\\
& &\\
\end{bmatrix}
\end{aligned} P n n → ∞ lim P n = X Λ n X − 1 = x 1 x 2 x 3 ⋅ 1 λ 2 n λ 3 n ⋅ X − 1 = x 1 x 1 x 1
注意到 X − 1 \mathbf X^{-1} X − 1 第一行均为一 (实际上 Markov 矩阵的左特征值恒为 1 ⊤ \mathbf 1^\top 1 ⊤ )
则当进行无穷次迭代后,由于初始状态 A 0 + B 0 + C 0 = 1 A_0+B_0+C_0=1 A 0 + B 0 + C 0 = 1 ,则 ( 4 ) (4) ( 4 ) 式可写为
$$
\lim_{n\to\infty} \mathbf P^n \cdot \mathbf y_0=
\begin{bmatrix}
& &\
\mathbf x_1 &\mathbf x_1 &\mathbf x_1\
& &\
\end{bmatrix}
\cdot
\begin{bmatrix}
A_0\
B_0\
C_0\
\end{bmatrix}
\begin{bmatrix}
\
\mathbf x_1\
\
\end{bmatrix}
$$
P.S. 这里 A 0 + B 0 + C 0 = 1 A_0 + B_0 + C_0 = 1 A 0 + B 0 + C 0 = 1 即验证了讲义中证明「极限分布存在则为平稳分布」中最后一步,∑ π 0 ( x ) = 1 \sum \pi_0(x)=1 ∑ π 0 ( x ) = 1
则说明最后概率一定收敛于矩阵 P \mathbf P P 特征值为 1 1 1 对应的特征向量,只要初始状态概率和为 1 1 1 ,则最终结果初始状态无关。
由上文分析,则长远来看,P ( A ) = 0.3836 , P ( B ) = 0.1543 , P ( C ) = 0.4621 P(A)=0.3836, P(B)=0.1543,P(C)=0.4621 P ( A ) = 0.3836 , P ( B ) = 0.1543 , P ( C ) = 0.4621 。故平均每次赌局的期望收益为:
E ( x ˉ ) = E ( x ∣ A ) ⋅ P ( A ) + E ( x ∣ B ) ⋅ P ( B ) + E ( x ∣ C ) ⋅ P ( C ) ≈ − 0.008724 \mathbb E(\bar x) = \mathbb E(x\mid A)\cdot P(A) + \mathbb E(x\mid B)\cdot P(B) + \mathbb E(x\mid C)\cdot P(C) \approx -0.008724 E ( x ˉ ) = E ( x ∣ A ) ⋅ P ( A ) + E ( x ∣ B ) ⋅ P ( B ) + E ( x ∣ C ) ⋅ P ( C ) ≈ − 0.008724
与程序模拟算出的单次期望相契合,得出结论:单独进行游戏 B B B 平均每局亏损 − 0.008724 -0.008724 − 0.008724
1.2 对马氏链转移矩阵的讨论
1.2.1 马尔可夫矩阵
对于不同的参数 M M M , ε \varepsilon ε ,问题 B B B 及后面的 A , B A,B A , B 混合问题均可转化为一个有限图上的概率转移模型,因此有必要复述关于 Markov Chains 的一些性质。[3]
考虑问题 B B B 构造的状态转移矩阵,满足:
转移矩阵中的元素 p i j p_{ij} p ij 代表在 n n n 时刻位于点 j j j ,n + 1 n+1 n + 1 时刻走向点 i i i 的概率。且 p i j p_{ij} p ij 与 n n n 无关。即下一个概率状态 y n + 1 \mathbf y_{n+1} y n + 1 只与 n n n 时刻状态 y n \mathbf y_{n} y n 有关,与历史状态无关 (时齐性、马氏性);
所有的 p i j > 0 p_{ij}>0 p ij > 0 且 P \mathbf P P 的每一列之和为一,即所有的概率为正数且每个点的概率出度为一。那么 1 ⊤ P = 1 ⊤ \mathbf 1^\top \mathbf P = \mathbf 1^\top 1 ⊤ P = 1 ⊤ ,即 p 1 j + p 2 j + ⋯ + p N j = 1 p_{1j}+p_{2j}+\cdots+p_{Nj}=1 p 1 j + p 2 j + ⋯ + p N j = 1 . (随机矩阵)
状态转移矩阵有最大特征值 λ 1 = 1 \lambda_1=1 λ 1 = 1 且其对应的特征向量 x 1 > 0 \mathbf x_1 >0 x 1 > 0 (为正) ;
已知初始概率 y 0 \mathbf y_{0} y 0 或其满足的条件。
构造对应概率转移图,例如:
FIG. 7.
转移方程 y n + 1 = P ⋅ y n \mathbf y_{n+1} = \mathbf P \cdot \mathbf y_{n} y n + 1 = P ⋅ y n 形如:
y n + 1 = [ Prob { x ( n + 1 ) = 1 } ⋮ Prob { x ( n + 1 ) = N } ] = [ p 11 ⋯ p 1 N ⋮ ⋱ ⋮ p N 1 ⋯ p N N ] [ Prob { x ( n ) = 1 } ⋮ Prob { x ( n ) = N } ] (5) \mathbf y_{n+1} =
\begin{bmatrix}
\text{Prob } \{x(n+1)=1\} \\
\vdots \\
\text{Prob } \{x(n+1)=N\}
\end{bmatrix}
=
\begin{bmatrix}
p_{11} &\cdots &p_{1N}\\
\vdots &\ddots &\vdots\\
p_{N1} &\cdots &p_{NN}\\
\end{bmatrix}
\begin{bmatrix}
\text{Prob } \{x(n)=1\} \\
\vdots \\
\text{Prob } \{x(n)=N\}
\end{bmatrix} \tag{5} y n + 1 = Prob { x ( n + 1 ) = 1 } ⋮ Prob { x ( n + 1 ) = N } = p 11 ⋮ p N 1 ⋯ ⋱ ⋯ p 1 N ⋮ p N N Prob { x ( n ) = 1 } ⋮ Prob { x ( n ) = N } ( 5 )
转移方程 y n + 1 = P ⋅ y n \mathbf y_{n+1} = \mathbf P \cdot \mathbf y_{n} y n + 1 = P ⋅ y n ,这些向量 y i \mathbf y_{i} y i 包含时刻 i i i 的信息。所以在所有时刻,y n \mathbf y_{n} y n 的元素和应为一,且 P n \mathbf P^n P n 的每一列之和也应为 1 1 1 .
1 ⊤ y n + 1 = 1 ⊤ ( P ⋅ y n ) = ( 1 ⊤ P ) ⋅ y n = 1 ⊤ ⋅ y n = 1 (6) \mathbf 1^\top \mathbf y_{n+1} = \mathbf 1^\top (\mathbf P\cdot\mathbf y_{n}) = \mathbf (1^\top \mathbf P)\cdot\mathbf y_{n} = \mathbf 1^\top \cdot\mathbf y_{n} = 1
\tag{6} 1 ⊤ y n + 1 = 1 ⊤ ( P ⋅ y n ) = ( 1 ⊤ P ) ⋅ y n = 1 ⊤ ⋅ y n = 1 ( 6 )
既然所有的 y n \mathbf y_{n} y n 都满足概率分布,那么 y n = P n y 0 \mathbf y_{n} = \mathbf P^n \mathbf y_{0} y n = P n y 0 当 n → ∞ n\to \infty n → ∞ 时极限 y ∞ \mathbf y_{\infty} y ∞ 是否存在?如果极限存在,则此极限可以告诉我们最终状态下在每个概率点的期望频率 。
注意到并非所有的情况下均会收敛,虽然随机矩阵不会爆炸,但是可能出现跳跃的情况(不收敛),例如 P = [ 0 1 1 0 ] \mathbf P = \begin{bmatrix}0 &1 \\ 1 &0\end{bmatrix} P = [ 0 1 1 0 ] .
1.2.2 Positive P or Nonegative P
对于转移概率矩阵,P > 0 \mathbf P>0 P > 0 和 P ≥ 0 \mathbf P \ge 0 P ≥ 0 有较大区别。[3]
由于 P \mathbf P P 的每一列之和为一,则 P − I \mathbf P - \mathbf I P − I 的每一行加起来为零行,所以 λ = 1 \lambda=1 λ = 1 是 P \mathbf P P 的特征值。由于所有元素为正,则不会有其他特征值 ∣ λ ∣ > 1 |\lambda|>1 ∣ λ ∣ > 1 。但是零元素的存在会有特殊情况:
P 2 \mathbf P_2 P 2 包含零元素。则可能存在第二个大小为 1 1 1 特征向量 λ 2 \lambda_2 λ 2
P 1 \mathbf P_1 P 1 中的元素严格大于零。则可保证第二大的特征值 ∣ λ 2 ∣ < 1 |\lambda_2|<1 ∣ λ 2 ∣ < 1 . Perron-Frobenius Theorem 对 P 1 > 0 \mathbf P_1>0 P 1 > 0 保证:
最大的特征值 λ 1 \lambda_1 λ 1 及其对应的特征向量 v 1 \mathbf v_1 v 1 是严格大于零的。
其他特征值 λ 2 , ⋯ , λ N \lambda_2,\cdots,\lambda_N λ 2 , ⋯ , λ N 有 ∣ λ ∣ < λ 1 |\lambda| < \lambda_1 ∣ λ ∣ < λ 1 ,对 Markov 矩阵有 λ 1 = 1 \lambda_1 = 1 λ 1 = 1 。
对所有元素严格为正的矩阵 P 1 \mathbf P_1 P 1 且假定其有 n n n 个独立特征向量,由 Perron-Frobenius Theorem,有满足最大的特征值 λ 1 > 0 \lambda_1>0 λ 1 > 0 且对应的特征向量 x 1 > 0 \mathbf x_1 >0 x 1 > 0 。而矩阵每一列之和为一保证 P ⊤ 1 = 1 \mathbf P^\top \mathbf 1 = \mathbf 1 P ⊤ 1 = 1 , λ 1 = 1 \lambda _1 = 1 λ 1 = 1 。由于特征向量线性无关,则可对角化,且其它特征值均有 ∣ λ ∣ < 1 |\lambda|<1 ∣ λ ∣ < 1 ,所以对角矩阵 Λ n \Lambda^n Λ n 最终会变为只有左上角为 1 1 1 的矩阵。所以,最终概率转移矩阵 P ( ∞ ) \mathbf P^{(\infty)} P ( ∞ ) 是特征向量 x 1 \mathbf x_1 x 1 的倍数:
P n = X Λ n X − 1 = [ x 1 x 2 ⋯ x 3 ] ⋅ [ 1 λ 2 n ⋱ ] ⋅ [ X − 1 ] lim n → ∞ P n = [ x 1 x 1 ⋯ x 1 ] \begin{aligned}
\mathbf P^n &= \mathbf X \mathbf \Lambda ^n \mathbf X^{-1}\\
&=
\begin{bmatrix}
& &\\
\mathbf x_1 &\mathbf x_2 &\cdots &\mathbf x_3\\
& &\\
\end{bmatrix} \cdot
\begin{bmatrix}
1 & & \\
&\lambda_2^n &\\
& &\ddots
\end{bmatrix} \cdot
\begin{bmatrix}
& &\\
&\mathbf X^{-1} &\\
& &\\
\end{bmatrix} \\
\lim_{n\to\infty} \mathbf P^n &=
\begin{bmatrix}
& &\\
\mathbf x_1 &\mathbf x_1 &\cdots &\mathbf x_1\\
& &\\
\end{bmatrix}
\end{aligned} P n n → ∞ lim P n = X Λ n X − 1 = x 1 x 2 ⋯ x 3 ⋅ 1 λ 2 n ⋱ ⋅ X − 1 = x 1 x 1 ⋯ x 1
所以 P ⊤ \mathbf P^\top P ⊤ 是一个非负矩阵,特征值其一为 λ = 1 \lambda=1 λ = 1 ,对应的特征向量 1 = ( 1 , 1 , ⋯ , 1 ) ⊤ \mathbf 1 = (1,1,\cdots,1)^\top 1 = ( 1 , 1 , ⋯ , 1 ) ⊤
对于一般情况,即矩阵 P \mathbf P P 可能包含零元素,或者没有 n n n 个独立的特征向量,我们仍想证明:
P n → P ∞ = [ v 1 v 1 ⋯ v 1 ] , whenever ∣ λ 2 ∣ < 1 \mathbf P^n \to \mathbf P^\infty = [\mathbf v_1\; \mathbf v_1\cdots \mathbf v_1], \textrm{ whenever } |\lambda_2| <1 P n → P ∞ = [ v 1 v 1 ⋯ v 1 ] , whenever ∣ λ 2 ∣ < 1
考虑将特征值小于一的部分单独分解出来,构造 X , A \mathbf X,\mathbf A X , A 满足:
X − 1 P X = [ 1 0 0 A ] , the eigenvalues of A have ∣ λ 2 ∣ < 1 , … , ∣ λ n ∣ < 1 \mathbf X^{-1}\mathbf P\mathbf X =
\begin{bmatrix}
1 &\mathbf 0\\
\mathbf 0 &\mathbf A
\end{bmatrix} , \textrm {the eigenvalues of }\mathbf A \textrm{ have } |\lambda_2| < 1,\ldots, |\lambda_n|<1 X − 1 PX = [ 1 0 0 A ] , the eigenvalues of A have ∣ λ 2 ∣ < 1 , … , ∣ λ n ∣ < 1
那么,n n n 次转移矩阵可改写为:
P n = X ( X − 1 P X ) n X − 1 = X [ 1 0 0 A n ] X − 1 , converges to v 1 1 ⊤ and A n → 0 \mathbf P^n = \mathbf X(\mathbf X^{-1}\mathbf P\mathbf X)^n \mathbf X^{-1} =
\mathbf X\begin{bmatrix}
1 &\mathbf 0\\
\mathbf 0 &\mathbf A^n
\end{bmatrix} \mathbf X ^{-1},
\textrm{ converges to } \mathbf v_1\mathbf 1^\top \textrm{ and }\mathbf A^n \to \mathbf 0 P n = X ( X − 1 PX ) n X − 1 = X [ 1 0 0 A n ] X − 1 , converges to v 1 1 ⊤ and A n → 0
A \mathbf A A 的所有特征值 ∣ λ ∣ < 1 |\lambda|<1 ∣ λ ∣ < 1 ,所以 lim n → ∞ A n = 0 \lim_{n\to \infty}\mathbf A^n = \mathbf 0 lim n → ∞ A n = 0
找到一个上三角矩阵 S = M − 1 A M \mathbf S = \mathbf M^{-1} \mathbf A\mathbf M S = M − 1 AM ,其范数 ∣ ∣ S ∣ ∣ < 1 ||\mathbf S||<1 ∣∣ S ∣∣ < 1
那么 A n = ( M S M − 1 ) n = M S n M − 1 \mathbf A^n = (\mathbf M\mathbf S\mathbf M^{-1})^n = \mathbf M \mathbf S^n\mathbf M^{-1} A n = ( MS M − 1 ) n = M S n M − 1 ,有 ∣ ∣ A n ∣ ∣ ≤ ∣ ∣ M ∣ ∣ ∣ ∣ S ∣ ∣ n ∣ ∣ M − 1 ∣ ∣ → 0 ||\mathbf A^n|| \le ||\mathbf M||||\mathbf S||^n||\mathbf M^{-1}||\to0 ∣∣ A n ∣∣ ≤ ∣∣ M ∣∣∣∣ S ∣ ∣ n ∣∣ M − 1 ∣∣ → 0
由于 S = M − 1 A M \mathbf S = \mathbf M^{-1} \mathbf A\mathbf M S = M − 1 AM ,即相似于 A \mathbf A A 。而 S \mathbf S S 的特征值又在其主对角线上:
S = [ λ 2 a b 0 λ 3 c 0 0 λ 4 ] has ∣ ∣ S ∣ ∣ < 1 if a , b , c are very small \mathbf S =
\begin{bmatrix}
\lambda_2 &a &b\\
0 &\lambda_3 &c\\
0 &0 &\lambda_4
\end{bmatrix}
\textrm{ has } || \mathbf S|| <1 \textrm{ if }a,b,c \textrm{ are very small} S = λ 2 0 0 a λ 3 0 b c λ 4 has ∣∣ S ∣∣ < 1 if a , b , c are very small
最大的特征值并不是矩阵范数,如果 a , b , c a,b,c a , b , c 很大 S 2 , S 3 \mathbf S^2,\mathbf S^3 S 2 , S 3 仍然会增长,直至 n n n 较大时特征值将 S n \mathbf S^n S n 拉回零矩阵。如果要一开始即保证不增长需要 ∣ ∣ S ∣ ∣ < 1 ||\mathbf S||<1 ∣∣ S ∣∣ < 1 .
我们已经有 ∣ λ i ∣ < 1 |\lambda_i| <1 ∣ λ i ∣ < 1 ,如果 a , b , c a,b,c a , b , c 非常小,则 S \mathbf S S 的范数仍然小于一
∣ ∣ S ∣ ∣ ≤ ∣ ∣ diagonal part ∣ ∣ + ∣ ∣ off-diagonal part ∣ ∣ < 1 ||\mathbf S|| \le ||\textrm{diagonal part}|| + ||\textrm{off-diagonal part}|| < 1 ∣∣ S ∣∣ ≤ ∣∣ diagonal part ∣∣ + ∣∣ off-diagonal part ∣∣ < 1
由 Schur’s Theorem, 任意矩阵 A \mathbf A A 均相似于某个上三角矩阵 T = Q − 1 A Q \mathbf T = \mathbf Q^{-1}\mathbf A\mathbf Q T = Q − 1 AQ ,则可构造
D − 1 T D = [ 1 1 / d 1 / d 2 ] [ λ 2 A B 0 λ 3 C 0 0 λ 4 ] [ 1 d d 2 ] = [ λ 2 d A d 2 B 0 λ 3 d C 0 0 λ 4 ] = S \mathbf D^{-1}\mathbf T \mathbf D =
\begin{bmatrix}
1& &\\
&1/d &\\
& &1/d^2
\end{bmatrix}
\begin{bmatrix}
\lambda_2 &A &B\\
0 &\lambda_3 &C\\
0 &0 &\lambda_4
\end{bmatrix}
\begin{bmatrix}
1& &\\
&d &\\
& &d^2
\end{bmatrix}
=
\begin{bmatrix}
\lambda_2 &dA &d^2B\\
0 &\lambda_3 &dC\\
0 &0 &\lambda_4
\end{bmatrix}
= \mathbf S D − 1 TD = 1 1/ d 1/ d 2 λ 2 0 0 A λ 3 0 B C λ 4 1 d d 2 = λ 2 0 0 d A λ 3 0 d 2 B d C λ 4 = S
则对非常小的 d d d ,对角线上方元素可以做到任意小,此时 S = D − 1 ( Q − 1 A Q ) D = M − 1 A M \mathbf S = \mathbf D^{-1}(\mathbf Q^{-1} \mathbf A \mathbf Q) \mathbf D = \mathbf M^{-1}\mathbf A \mathbf M S = D − 1 ( Q − 1 AQ ) D = M − 1 AM 。至此构造完毕。
至此,我们证明了 P n → P ∞ = [ v 1 v 1 ⋯ v 1 ] , whenever ∣ λ 2 ∣ < 1 \mathbf P^n \to \mathbf P^\infty = [\mathbf v_1\; \mathbf v_1\cdots \mathbf v_1], \textrm{ whenever } |\lambda_2| <1 P n → P ∞ = [ v 1 v 1 ⋯ v 1 ] , whenever ∣ λ 2 ∣ < 1 。需要注意的是概率矩阵收敛的充分条件是 ∣ λ 2 ∣ < 1 |\lambda_2|<1 ∣ λ 2 ∣ < 1 ,当 λ 2 = − 1 \lambda_2=-1 λ 2 = − 1 时,最终概率可能会跳跃,为周期的情况。
1.3 Brownian Ratchets
FIG. 8. 含有棘轮和棘爪的机械设备。设备由两个盒子组成,其中一个装有单向旋转的轮子,另一个装有棘轮和棘爪。每个盒子均置于处于热平衡状态的气体分子中。这两个盒子通过一个隔热轴机械连接。整个装置设计得极其微小,以使气体分子能随机撞击叶片产生运动。[6]
上图展示了一个含有棘轮和棘爪的机械装置,最初由费曼在 1962 年提出作为一种理论上的永动机。该设计基于波兰物理学家斯莫卢霍夫斯基 (M. Smoluchowski, 1912) 的早期研究。斯莫卢霍夫斯基构想了一种能够从处于温度平衡状态的系统中提取有用功的微观机器,这通过利用气体分子的热布朗运动来实现。如图所示,该机器由一个小桨轮和一个通过轮轴连接的棘轮组成,均置于温度相同 ( T 1 = T 2 = T ) (T_1 = T_2 = T) ( T 1 = T 2 = T ) 的气体热浴中。气体分子对叶片的撞击使其振动和抖动,而防止棘轮逆转的制转杆确保了桨轮只能沿一个方向转动。这种单向运动可被用来做功,比如提升重物,从而在理论上产生机械能。然而,从分子动力学的角度来看,这种机器的工作原理存在问题。作功通常是大量分子的有序运动,而热运动则是大量分子的无序运动。从无序状态到有序状态的转变概率极低,而相反的过程概率则相对较高。在一个孤立系统中,自发发生的过程总是从概率较低的状态向概率较高的状态转变。因此,从热力学的角度来看,热能不可能自发地转化为功。这种机械装置似乎违背了热力学第二定律,即热量不能自发地从低温体转移到高温体。
费曼对斯莫卢霍夫斯基的假设性实验进行了校正 [7],并证明了棘轮并不会持续沿同一方向转动 [6]。这是因为制转杆本身也会展现布朗运动,即上下抖动,导致棘轮的齿轮有时向后滑动而非前进。费曼对该设备进行了首次定量分析,得出结论:随时间推移,机器向后转动的次数将与向前转动次数相等,从而抵消任何做功的可能性。而且,如果没有外部能量输入,这种装置最终可能会失去能量。
Magnasco 在 1993 年发表的一篇论文 [8] 进一步发展了布朗棘轮的概念。在这篇论文中,他阐述了布朗微粒可以在特定的空间非对称能量势场下产生定向移动。
一个引人注目的例子 ——“交错棘轮”,这是一种被周期性地“开启”和“关闭”的倾斜系统。通过解福克-普朗克方程,研究者发现,在这样的系统中,布朗粒子可以实现“上坡”移动(Doering, 1995)。相反地,如果电位始终保持在“开启”或“关闭”状态,粒子则会“下坡”移动。这种现象成为帕朗多悖论的灵感来源:尽管每个单独的状态都似乎是一个“失败”的游戏,但当这些状态交替进行时,它们可以产生使粒子“上坡移动”的综合效果,或者说是产生“获胜”的期望。
2.1 结果
2.2.1 AB 轮流进行的模拟计算
在前文中,我们已经对游戏 B B B 的盈亏情况进行了定性和定量的系统分析,并探讨了此类问题的马尔可夫链解法。当取 ε = 0.05 \varepsilon = 0.05 ε = 0.05 时,我们发现单独进行游戏 A A A 或游戏 B B B 的期望收益均为负。
然而,一个非常反直觉的现象是:如果我们交替进行游戏 A B AB A B ,比如交替进行两局游戏 A A A 和两局游戏 B B B ,结果表明我们将开始盈利。这意味着,通过以特定方式交替进行两种本质上是亏损的游戏,我们最终能实现正的期望收益。即便是随机交替进行这两种游戏,同样会产生盈利的期望值。这一现象不仅反直觉,而且揭示了在特定条件下策略组合的潜力。
以下图表展示了在四种不同情况下进行 10 7 10^7 1 0 7 次游戏的计算机模拟资金变化情况。对于交替进行的游戏 A B AB A B ,我们还可以利用类似于 1.2 节中描述的转移矩阵来计算精确的期望收益。然而,此文的重点不在于计算精确的期望收益,而在于提出一个反直觉的观点:通过合理地组合两个失败的策略,可以产生赢利的结果。因此,在接下来的讨论中,我们将仅针对一种情况进行详细的收益计算,以更好地说明这一点(详见附录代码 ii)。
图 9.
[ a = 1 , b = 1 ] [a=1,b=1] [ a = 1 , b = 1 ] 表示游戏模式为先进行一局游戏 A A A ,然后一局游戏 B B B ,即A B A B A B ⋯ ABABAB\cdots A B A B A B ⋯ 交替进行。
[ a = 2 , b = 2 ] [a=2,b=2] [ a = 2 , b = 2 ] 表示游戏模式为 A A B B A A B B ⋯ AABBAABB\cdots AA B B AA B B ⋯ 交替进行。
[ a = 0 , b = 0 ] [a=0,b=0] [ a = 0 , b = 0 ] 表示两种游戏随机交替进行,这对应于问题 (3)。可以观察到,此模式的期望收益为正数。
现在我们引入一种新的表示方法来描述这些游戏。当游戏 A A A 和游戏 B B B 采用参数 ε \varepsilon ε ,若 ε \varepsilon ε 取零则两个游戏单独进行时均不会产生收益;若取正值,则会产生负收益。我们将两种游戏记为 A ε , B ε A_{\varepsilon},B_\varepsilon A ε , B ε 。接下来,我们考虑一种交替进行的模式:先进行 a a a 局游戏 A A A ,再进行 b b b 局游戏 B B B ,然后继续 a a a 局游戏 A A A ,以此类推。这种交替总共进行 n n n 轮,表示为 ( A ε a , B ε b ) n (A_{\varepsilon}^a,B_\varepsilon^b)^n ( A ε a , B ε b ) n . 游戏的初始资金记为 ( A ε a , B ε b ) n ( x ) (A_{\varepsilon}^a,B_\varepsilon^b)^n(x) ( A ε a , B ε b ) n ( x ) ,其中默认 x = 0 x=0 x = 0 .
下图绘制了A 0.005 a B 0.005 b A_{0.005}^aB_{0.005}^b A 0.005 a B 0.005 b 在 [ a , b ] ∈ [ 1 , 10 ] × [ 1 , 10 ] [a,b]\in[1,10]\times[1,10] [ a , b ] ∈ [ 1 , 10 ] × [ 1 , 10 ] 的模拟期望收益 (Appendix code iii),每对 [ a , b ] [a,b] [ a , b ] 进行 10 7 10^7 1 0 7 局模拟。可以发现在 [ a = 1 , b = 2 ] [a=1,b=2] [ a = 1 , b = 2 ] 时有极大值。下表给出了 a , b a,b a , b 取具体值的期望。
代码 复制 expectation[b, a] =
a = 1 , 6 a = 2 , 7 a = 3 , 8 a = 4 , 9 a = 5 , 10
[b = 1 [- 6.77011 e- 03 8.87010 e- 03 6.24250 e- 03 3.27970 e- 03 1.61430 e- 03
- 2.98100 e- 04 - 1.68310 e- 03 - 2.80670 e- 03 - 3.20330 e- 03 - 3.40810 e- 03 ]
b = 2 [* 5.71431 e- 02 * 1.46251 e- 02 2.00657 e- 02 1.01691 e- 02 9.72610 e- 03
6.65650 e- 03 4.37210 e- 03 2.86550 e- 03 2.28210 e- 03 1.31050 e- 03 ]
b = 3 [- 2.78710 e- 03 1.08350 e- 03 4.72100 e- 04 - 1.57590 e- 03 - 2.45330 e- 03
- 3.42490 e- 03 - 3.61850 e- 03 - 4.36010 e- 03 - 4.80130 e- 03 - 5.23950 e- 03 ]
b = 4 [ 2.95377 e- 02 5.19630 e- 03 1.04617 e- 02 4.97170 e- 03 4.93490 e- 03
3.07010 e- 03 2.23470 e- 03 8.96900 e- 04 - 1.38900 e- 04 - 9.17900 e- 04 ]
b = 5 [ 1.31690 e- 03 - 1.12750 e- 03 - 2.01900 e- 04 - 2.09470 e- 03 - 2.47510 e- 03
- 2.94870 e- 03 - 3.95350 e- 03 - 4.50690 e- 03 - 4.75770 e- 03 - 4.84930 e- 03 ]
b = 6 [ 1.69829 e- 02 1.71130 e- 03 5.72630 e- 03 1.63050 e- 03 1.79270 e- 03
3.77000 e- 05 - 8.15100 e- 04 - 1.08530 e- 03 - 1.48770 e- 03 - 2.21610 e- 03 ]
b = 7 [ 1.96870 e- 03 - 2.52430 e- 03 - 1.15450 e- 03 - 2.93830 e- 03 - 3.36250 e- 03
- 3.58910 e- 03 - 3.94910 e- 03 - 4.84870 e- 03 - 4.83650 e- 03 - 4.57230 e- 03 ]
b = 8 [ 1.05479 e- 02 - 9.95900 e- 04 2.50430 e- 03 5.30000 e- 06 - 3.58900 e- 04
- 1.74130 e- 03 - 2.01530 e- 03 - 2.35070 e- 03 - 2.81710 e- 03 - 3.41350 e- 03 ]
b = 9 [ 1.25310 e- 03 - 3.56370 e- 03 - 2.05030 e- 03 - 3.86810 e- 03 - 2.76850 e- 03
- 4.27150 e- 03 - 4.09670 e- 03 - 4.78250 e- 03 - 5.19590 e- 03 - 5.46930 e- 03 ]
b = 10 [ 6.43670 e- 03 - 2.20150 e- 03 3.11900 e- 04 - 2.10310 e- 03 - 1.19350 e- 03
- 3.07450 e- 03 - 2.87650 e- 03 - 3.68650 e- 03 - 3.58370 e- 03 - 3.52730 e- 03 ]]
2.2.2 对 ( A 0.005 1 B 0.005 1 ) n (A_{0.005}^1B_{0.005}^1)^n ( A 0.005 1 B 0.005 1 ) n 的定量分析
下针对游戏 ( A 0.005 1 B 0.005 1 ) n (A_{0.005}^1B_{0.005}^1)^n ( A 0.005 1 B 0.005 1 ) n 进行定量分析,即 A B A B ⋯ A B A B ABAB\cdots ABAB A B A B ⋯ A B A B (问题一)。
画出 A B A B ABAB A B A B 的状态转移图:记 A 0 , A 1 , A 2 A_0,A_1,A_2 A 0 , A 1 , A 2 表示即将进行游戏 A A A 时的三种状态,B 0 , B 1 , B 2 B_0,B_1,B_2 B 0 , B 1 , B 2 表示即将进行游戏 B B B 时的三种状态。容易发现,该马氏链的周期为 2 2 2 .
FIG. 11. 该情形下的状态转移图
我们记状态 : y n = [ A 0 A 1 A 2 B 0 B 1 B 2 ] ⊤ \mathbf y_n = [A_0 \; A_1\; A_2\; B_0\; B_1\; B_2]^\top y n = [ A 0 A 1 A 2 B 0 B 1 B 2 ] ⊤ ,根据上图构造状态转移:
y n + 1 = P ⋅ y n = [ 0 0 0 0 0.255 0.745 0 0 0 0.095 0 0.255 0 0 0 0.905 0.745 0 0 0.505 0.495 0 0 0 0.495 0 0.505 0 0 0 0.505 0.495 0 0 0 0 ] ⋅ [ A 0 ( n ) A 1 ( n ) A 2 ( n ) B 0 ( n ) B 1 ( n ) B 2 ( n ) ] (10) \begin{aligned}
\mathbf y_{n+1} &= \mathbf P\cdot \mathbf y_{n}\\
&=
\begin{bmatrix}
0 &0&0&0&0.255&0.745\\
0 &0&0 &0.095 &0 & 0.255\\
0 &0&0 &0.905 &0.745 &0 \\
0 &0.505 &0.495 &0 &0 &0 \\
0.495&0 &0.505 &0 &0 &0 \\
0.505&0.495 &0&0 &0 &0
\end{bmatrix} \cdot
\begin{bmatrix}
A_0^{(n)}\\
A_1^{(n)}\\
A_2^{(n)}\\
B_0^{(n)}\\
B_1^{(n)}\\
B_2^{(n)}
\end{bmatrix}
\end{aligned}
\tag{10} y n + 1 = P ⋅ y n = 0 0 0 0 0.495 0.505 0 0 0 0.505 0 0.495 0 0 0 0.495 0.505 0 0 0.095 0.905 0 0 0 0.255 0 0.745 0 0 0 0.745 0.255 0 0 0 0 ⋅ A 0 ( n ) A 1 ( n ) A 2 ( n ) B 0 ( n ) B 1 ( n ) B 2 ( n ) ( 10 )
如上预期,P \mathbf P P 的两个极大特征值为 − 1 -1 − 1 和 1 1 1 ,最终概率向量将在两个特征向量中来回切换,即该马氏链的周期为 2 2 2
幸运的是,这个矩阵是可以对角化的,我们将 P P P 对角化:
matlab 复制 A = [0 0 0 0 .255 .745;
0 0 0 .095 0 .255;
0 0 0 .905 .745 0;
0 .505 .495 0 0 0;
.495 0 .505 0 0 0;
.505 .495 0 0 0 0]
[V, D] = eig(A)
V = normalize(V, 'norm', 1).*2
特征矩阵 V \mathbf V V
其对应的特征值
其中,得到保留的特征向量 v 1 , v 3 \mathbf v_1,\mathbf v_3 v 1 , v 3 应具有特殊的性质 ( λ 1 = − 1 , λ 3 = 1 \lambda_1 = -1, \lambda_3 = 1 λ 1 = − 1 , λ 3 = 1 )
v 1 = [ 0.2347 0.0759 0.6895 − 0.3796 − 0.4643 − 0.1561 ] , v 3 = [ 0.2347 0.0759 0.6895 0.3796 0.4643 0.1561 ] \mathbf v_1 =
\begin{bmatrix}
0.2347\\
0.0759\\
0.6895\\
-0.3796\\
-0.4643\\
-0.1561
\end{bmatrix},
\mathbf v_3 =
\begin{bmatrix}
0.2347\\
0.0759\\
0.6895\\
0.3796\\
0.4643\\
0.1561
\end{bmatrix} v 1 = 0.2347 0.0759 0.6895 − 0.3796 − 0.4643 − 0.1561 , v 3 = 0.2347 0.0759 0.6895 0.3796 0.4643 0.1561
考虑任意初始概率向量 y \mathbf y y 由 v 1 , v 2 , ⋯ , v n \mathbf v_1,\mathbf v_2,\cdots, \mathbf v_n v 1 , v 2 , ⋯ , v n 线性表出。取其中不会衰减的两个特征值:
y ^ = c 1 ⋅ v 1 + c 3 ⋅ v 3 (11) \hat {\mathbf y }= c_1\cdot \mathbf v_1 + c_3\cdot \mathbf v_3 \tag{11} y ^ = c 1 ⋅ v 1 + c 3 ⋅ v 3 ( 11 )
考虑递推关系 :
y n + 1 = P ⋅ y n = − c 1 ⋅ v 1 + c 3 ⋅ v 3 y n + 2 = P ⋅ y n + 1 = c 1 ⋅ v 1 + c 3 ⋅ v 3 (12) \begin{aligned}
\mathbf y_{n+1} &= \mathbf P\cdot \mathbf y_{n} = -c_1\cdot \mathbf v_1 + c_3\cdot \mathbf v_3 \\
\mathbf y_{n+2} &= \mathbf P\cdot \mathbf y_{n+1} = c_1\cdot \mathbf v_1 + c_3\cdot \mathbf v_3 \\
\end{aligned}
\tag{12} y n + 1 y n + 2 = P ⋅ y n = − c 1 ⋅ v 1 + c 3 ⋅ v 3 = P ⋅ y n + 1 = c 1 ⋅ v 1 + c 3 ⋅ v 3 ( 12 )
考虑 1 ⊤ y n = 1 ⊤ y n + 1 = 1 \mathbf 1^\top \mathbf y_{n} = \mathbf 1^\top \mathbf y_{n+1}=1 1 ⊤ y n = 1 ⊤ y n + 1 = 1 , 带入 ( 12 ) (12) ( 12 ) 有 c 3 = 1 / 2 c_3=1/2 c 3 = 1/2 ,带入 ( 11 ) (11) ( 11 ) 有 :
y ^ = c 1 ⋅ [ 0.2347 0.0759 0.6895 − 0.3796 − 0.4643 − 0.1561 ] + [ 0.2347 0.0759 0.6895 0.3796 0.4643 0.1561 ] \hat y=
c_1\cdot
\begin{bmatrix}
0.2347\\
0.0759\\
0.6895\\
-0.3796\\
-0.4643\\
-0.1561
\end{bmatrix}+
\begin{bmatrix}
0.2347\\
0.0759\\
0.6895\\
0.3796\\
0.4643\\
0.1561
\end{bmatrix} y ^ = c 1 ⋅ 0.2347 0.0759 0.6895 − 0.3796 − 0.4643 − 0.1561 + 0.2347 0.0759 0.6895 0.3796 0.4643 0.1561
考虑两个状态下分别前三个元素和后三个元素为零,则有 c 1 = 1 / 2 c_1=1/2 c 1 = 1/2
所以对于任意初始向量,当前特征值 v 1 , v 3 \mathbf v_1,\mathbf v_3 v 1 , v 3 的组合系数均为二分之一 。
即
\lim_{n\to\infty} \mathbf y_n&=
\frac 1 2(-1)^n\begin{bmatrix}
0.2347\\
0.0759\\
0.6895\\
-0.3796\\
-0.4643\\
-0.1561
\end{bmatrix}+
\frac 1 2
\begin{bmatrix}
0.2347\\
0.0759\\
0.6895\\
0.3796\\
0.4643\\
0.1561
\end{bmatrix}
\tag{13}
即得 A A A 游戏三种状态的概率,B B B 游戏三种状态的概率:
Game A : x A = [ A 0 A 1 A 2 B 0 B 1 B 2 ] = [ 0.2347 0.0759 0.6895 0 0 0 ] , Game B : x B = [ A 0 A 1 A 2 B 0 B 1 B 2 ] = [ 0 0 0 0.3796 0.4643 0.1561 ] \textrm{Game A : }
\mathbf x_A=
\begin{bmatrix}
A_0\\
A_1\\
A_2\\
B_0\\
B_1\\
B_2
\end{bmatrix}=
\begin{bmatrix}
0.2347\\
0.0759\\
0.6895\\
0\\
0\\
0
\end{bmatrix},
\textrm{Game B : }
\mathbf x_B=
\begin{bmatrix}
A_0\\
A_1\\
A_2\\
B_0\\
B_1\\
B_2
\end{bmatrix}=
\begin{bmatrix}
0\\
0\\
0\\
0.3796\\
0.4643\\
0.1561
\end{bmatrix} Game A : x A = A 0 A 1 A 2 B 0 B 1 B 2 = 0.2347 0.0759 0.6895 0 0 0 , Game B : x B = A 0 A 1 A 2 B 0 B 1 B 2 = 0 0 0 0.3796 0.4643 0.1561
带入验证,可以发现 P 2 n = [ x A x A ⋯ x A ] , P 2 n + 1 = [ x B x B ⋯ x B ] \mathbf P^{2n} = [\mathbf x_A\;\mathbf x_A\cdots\mathbf x_A], \mathbf P^{2n+1} = [\mathbf x_B\;\mathbf x_B\cdots\mathbf x_B] P 2 n = [ x A x A ⋯ x A ] , P 2 n + 1 = [ x B x B ⋯ x B ] 符合预期。( 13 ) (13) ( 13 ) 这种情形,即 1.2 所述的 λ 2 = − 1 \lambda_2 = -1 λ 2 = − 1 时的概率跳跃。
由于交替进行,并且游戏 B B B 中亏钱的概率降低,所以导致最终结果向正期望偏移。如果能矫正概率分布使得 B 0 B_0 B 0 的比率尽量小,则可以做到正数收益。所以本质上说由于游戏 A A A 与游戏 B B B 的交互,导致游戏 B B B 的概率分布变化,从而导致游戏期望收益变成正数。
计算最终单次期望:
E ( x ˉ ) = ∑ i = 1 3 E ( x ∣ A i ) ⋅ P ( A i ) + E ( x ∣ B i ) ⋅ P ( B i ) = − 0.010 / 2 + ( 0.3796 ⋅ − 0.81 + 0.4643 ⋅ 0.49 + 0.1561 ⋅ 0.49 ) / 2 = − 0.00674 \begin{aligned}
\mathbb E(\bar{x}) &= \sum_{i=1}^3\mathbb E(x \mid A_i)\cdot P(A_i) + \mathbb E(x \mid B_i)\cdot P(B_i) \\
&=-0.010/2+ (0.3796\cdot-0.81+0.4643\cdot0.49+0.1561\cdot 0.49)/2\\
&=-0.00674
\end{aligned} E ( x ˉ ) = i = 1 ∑ 3 E ( x ∣ A i ) ⋅ P ( A i ) + E ( x ∣ B i ) ⋅ P ( B i ) = − 0.010/2 + ( 0.3796 ⋅ − 0.81 + 0.4643 ⋅ 0.49 + 0.1561 ⋅ 0.49 ) /2 = − 0.00674
对比程序模拟期望: -6.77011e-03
2.2.3 讨论
对于上面交替进行两种赌局,实际上可以等价考虑为粒子在交替出现的势能场下的布朗运动。考虑一个一维的坐标轴中交替出现两个势能 U on U_{\text{on}} U on 和 U o f f U_{\rm{off}} U off 系统。[2]
FIG. 12. 棘轮势的作用机理。左边的图表,( a ) − ( c ) (a)-(c) ( a ) − ( c ) ,展示了没有宏观梯度存在且粒子的净运动的方向向右(箭头方向)。右边的图表 ( d ) − ( f ) (d)-(f) ( d ) − ( f ) 有轻微的梯度,这导致粒子在 U off U_{\text{off}} U off 作用后整体向做移动,尽管正向粒子的净流量减少了,但粒子整体仍在向右移动。
势能场 U on U_{\text{on}} U on 的分布由 α ( 0 ≤ α ≤ 1 ) \alpha\;(0\le \alpha\le 1) α ( 0 ≤ α ≤ 1 ) 来确定。当 α = 1 / 2 \alpha= 1/2 α = 1/2 时,该势能场是三角对称的;其他情况下则呈现非对称状,如图 12(a) 所示。最终达到平衡状态时,若势场对粒子的作用大于噪音,粒子将汇聚于势能最低点。然而,如果我们交替施加两个势场,在 τ o n \tau_{\rm{on}} τ on 时施加 U on U_{\text{on}} U on ,在时 τ o n \tau_{\rm{on}} τ on 施加 U o f f U_{\rm{off}} U off ,便会导致粒子整体向右平移。当施加势场 U on U_{\text{on}} U on 时,粒子汇聚在势的最低点。当移除 U on U_{\text{on}} U on 施加 U off U_{\text{off}} U off 时,粒子可以自由地扩散,其扩散的分布为关于势能最低点对称的高斯曲线。当再次施加 U on U_{\text{on}} U on 时,记粒子聚集在 L L L 处 (势的最低点) 的概率为 P fwd P_{\text{fwd}} P fwd ,其与曲线的深色阴影区域面积成正比,即与在 α L \alpha L α L 右端的粒子数量成正比。同理,记粒子聚集在 − L -L − L 的最低点概率 P bck P_{\text{bck}} P bck ,其与曲线的浅色阴影区域面积成正比,即与在 − ( 1 − α ) L -(1-\alpha)L − ( 1 − α ) L 左端的粒子数量成正比。因为势能分布是不对称的,如图所示,当 α < 1 / 2 \alpha < 1/2 α < 1/2 时,P fwd > P bck P_{\text{fwd}} > P_{\text{bck}} P fwd > P bck ,此时粒子的整体移动是向右的。据此我们可以定义概率流 J = P fwd − P bck J = P_{\text{fwd}} - P_{\text{bck}} J = P fwd − P bck 。
考虑到上文中所述的棘轮势,其与赌局结果的相似性令人瞩目。当 ε > 0 \varepsilon > 0 ε > 0 时,单独进行两种赌局均可能导致负收益,然而,当交替进行这两种赌局时,收益却有可能转变为正数。类似地,在布朗棘轮模型中,如果单独施加两种势场,粒子将总体上呈现向负方向的移动趋势;但当两种势场交替作用时,粒子则表现出向正方向的移动趋势。随着 ε \varepsilon ε 的增加,收益会逐渐降低,直至达到一个临界点,此时交替进行的游戏不再带来正的期望收益。同理,随着宏观梯度的增加,粒子的净移动将减少,直至达到一个使粒子无净移动的临界值。
鉴于这两个模型的相似性,我们可以提出一个合理的假设:上述的赌局游戏也有一个和资金状况相关联的 “势场”。如果这个势场存在,为了如何找到这个势场?在一个真实的物理系统中,一种可行的测定方法是将粒子均匀地放置在电势存在的地方,记录它们的起始位置,然后释放这些粒子,直至它们达到平衡,然后记录其停止的位置。例如,如果存在一个如图 12(a) 所示的未知的势,那么结果将如图 13(a) 所示。粒子的轨迹模式与电势的形状直接相关。对于游戏 B,我们可以把本金看作布朗棘轮中的粒子。因此,为了找到游戏 B 的势,我们从不同数量的本金开始,玩一些游戏,直到达到稳定状态,并记录最终的资金。结果如图 13(a) 所示。游戏 B 的资金流动图示为 13(b) 中,每当资金达到 3 3 3 的倍数时,状态重复,与 1.1.2.3 中按照同余类定义三种等价状态相同。由此得到的势以图 13(c) 中的实线表示。尽管本金不同,但最终的资金结果可能汇聚在一起(例如,本金分别为 2.3 和 2.5),在结果产生的势中就会形成狭窄的峰。通过将尖刺两侧的分布分布近似为单一分布,可以去除尖刺,以提供更清晰的势图。所得到的动态结果如图 13(c) 中的虚线所示。这由一个对称势和一个不对称势组成,因此可以认为最后的等价势在整个周期内是不对称的。
两个模型都有非常相似的势。因此,我们期望这两个系统的基本特征也是相似的。我们从图 12(b) 中的 U o f f U_{\rm{off}} U off 和 1.1.1 中的游戏 A 的分布中注意到,它们分布均为正态分布。同时,我们可以考虑游戏 B 的势是类似于 U o n U_{\rm{on}} U on 的。假设我们最初从游戏 B 开始,资金被势的最低点固定在某个值里,如图 13(a) 所示。切换到游戏 A 时,被捕获的资金便可以“扩散”或随机行走,如图 13(b)。游戏 A 进行的时间越长,资金的趋向的正态分布就会越宽广。当游戏 B 再次进行时,其对应的势可能会导致逐渐资金转移到如图 13(c) 所示的势的最低点。增大 ε \varepsilon ε 可以使游戏 A 对应的正态分布整体向左平移。至此即可类比,获得 AB 交替进行会产生正向收益的一个直观理解。
References
Norris J R, Norris J R. Markov chains[M]. Cambridge university press, 1998.
Harmer G P, Abbott D. Losing strategies can win by Parrondo’s paradox[J]. Nature, 1999, 402(6764): 864-864.
Strang G, Strang G, Strang G, et al. Introduction to linear algebra[M]. Wellesley, MA: Wellesley-Cambridge Press, 1993.
Perron–Frobenius theorem - Wikipedia (https://en.wikipedia.org/wiki/Perron–Frobenius_theorem )
IOI2019 中国国家候选队论文集, 浅谈图模型上的随机游走问题, 成都市第七中学,王修涵
Harmer G P, Abbott D. Parrondo’s paradox[J]. Statistical Science, 1999: 206-213.
Parrondo and Espafiol disagree with the efficiency of the ratchet and pawl engine calculated by Feynman; Parrondo and Espaniol, 1996
Magnasco M O. Forced thermal ratchets[J]. Physical Review Letters, 1993, 71(10): 1477.
Appendix
A. Code
i. Game B
Python 复制 # 模拟游戏 B 的期望收益
% matplotlib inline
import math
import time
import numpy as np
import torch
from d2l import torch as d2l
import random
x = []
y = []
n = 0
def play (n): # 模拟单次游戏
x = random.randint(1 , 10000 )
if (n % 3 == 0 ): # 如果是三倍数
if (x <= 950 ): return 1
else : return - 1
else :
if (x <= 7450 ): return 1 # 如果不是三的倍数
else : return - 1
for i in range (1 , 10000000 ):
n = n + play(n)
y.append(n)
x.append(i)
d2l.plot(x[::], y[::], xlabel = 'times' ,
ylabel = 'money' , figsize = (9 , 5 ))
ii. 2D image of [ A 0.005 a B 0.005 b ] [A_{0.005}^aB_{0.005}^b] [ A 0.005 a B 0.005 b ]
Python 复制 # 绘制 AB 轮流进行的二维收益线性图
% matplotlib inline
import math
import time
import numpy as np
import torch
from d2l import torch as d2l
import random
def play1 (n):
x = random.randint(1 , 10000 )
if (n % 3 == 0 ):
if (x <= 950 ): return 1
else : return - 1
else :
if (x <= 7450 ): return 1
else : return - 1
def play2 ():
x = random.randint(1 , 1000 )
if (x <= 495 ): return 1
else : return - 1
times = 10000
def simulate (a = 0 , b = 0 ):
y = []
n = 0
roundcnt = a + b
if (a != 0 and b != 0 ):
for i in range (1 , times):
if (i % roundcnt < a): n = n + play1(n)
else : n = n + play2()
y.append(n)
else : # 随机进行
for i in range (1 , times):
if (random.randint(1 , 10 ) > 5 ): n = n + play1(n)
else : n = n + play2()
y.append(n)
return y
x = list (range (1 , times))
params = [(1 , 1 ), (1 , 2 ), (0 , 0 ), (2 , 2 )]
d2l.plot(x, [simulate(a, b) for a, b in params], xlabel = 'times of gambling' ,ylabel = 'gain' , figsize = (9 , 5 ),
legend = [f '[a= { a} , b= { b} ]' for a, b in params])
d2l.plot(x, [simulate(a, b) for a, b in params], xlabel = 'times of gambling' ,ylabel = 'gain' , figsize = (9 , 5 ),
legend = [f '[a= { a} , b= { b} ]' for a, b in params])
iii. 3D image of [ A 0.005 a B 0.005 b ] [A_{0.005}^aB_{0.005}^b] [ A 0.005 a B 0.005 b ]
Python 复制 # 绘制 [10,10] 的三维收益关系图
% matplotlib inline
import math
import time
import numpy as np
import torch
import random
from mpl_toolkits import mplot3d
import numpy as np
import matplotlib.pyplot as plt
def play1 (n):
x = random.randint(1 , 10000 )
if (n % 3 == 0 ):
if (x <= 950 ): return 1
else : return - 1
else :
if (x <= 7450 ): return 1
else : return - 1
def play2 ():
x = random.randint(1 , 1000 )
if (x <= 495 ): return 1
else : return - 1
times = 10000000
def simulate (a = 0 , b = 0 ): # 模拟游戏
y = []
n = 0
roundcnt = a + b
if (a != 0 and b != 0 ):
for i in range (1 , times):
if (i % roundcnt < a): n = n + play1(n)
else : n = n + play2()
y.append(n)
else : # 随机进行
for i in range (1 , times):
if (random.randint(1 , 10 ) > 5 ): n = n + play1(n)
else : n = n + play2()
y.append(n)
return y[- 1 ] / times
x = list (range (1 , times))
params = [(1 , 1 ), (1 , 2 ), (0 , 0 ), (2 , 2 )]
X = []
Y = []
Z = []
for x in range (1 , 11 ):
for y in range (1 , 11 ):
X.append(x), Y.append(y), Z.append(simulate(x, y))
X = np.arange(1 , 11 )
Y = np.arange(1 , 11 )
X, Y = np.meshgrid(X, Y)
Z = np.array(Z)
Z = Z.reshape((10 , 10 ))
maxz = np.max(Z)
print (Z)
font= {'family' :'serif' ,
'style' :'italic' ,
'weight' :'normal' ,
'color' :'red' ,
'size' :16
}
fig = plt.figure(figsize = (15 , 15 ))
ax = plt.axes(projection = '3d' )
XX = np.arange(0.5 , 11.5 , 1 )
YY = np.arange(0.5 , 11.5 , 1 )
XX , YY = np.meshgrid(XX , YY )
Z2 = np.zeros((11 , 11 ))
ax.set_xlim(10 , 0 )
ax.set_ylim(0 , 10 )
# 调用plot_surface()函数
ax.plot_surface(X, Y, Z,cmap = 'plasma' , edgecolor = 'white' , alpha = 1 )
ax.plot_surface(XX , YY , Z2,cmap = 'plasma' ,alpha = 0.3 )
ax.set_title('Simulations' )
ax.set_xlabel('times of A' )
ax.set_ylabel('times of B' )
ax.set_zlabel('Gains ratio' )
ax.set(zticklabels = [])
plt.xticks(np.arange(1 , 11 , 1 ))
plt.yticks(np.arange(1 , 11 , 1 ))
ax.text(1 + 1.6 , 2 , maxz, "Maximum at [1, 2]" , fontdict = font)
# ax.invert_xaxis()
plt.show()
B. 迭代方程
向量收敛
向量收敛本质为 n n n 维空间中的点列收敛,收敛即为点列到极限点距离趋近于零,收敛即 lim k → ∞ ∣ ∣ x ( k ) − x ∗ ∣ ∣ = 0 \lim_{k\to \infty}||\mathbf x^{(k)}-\mathbf x^{*}|| = 0 lim k → ∞ ∣∣ x ( k ) − x ∗ ∣∣ = 0
一个 n n n 维向量和 n n n 维空间中的一个点是一一对应的。
常见向量范数
L 2 L_2 L 2 范数:∣ ∣ x ∣ ∣ 2 = ( ∑ i = 1 n x i 2 ) 1 / 2 ||x||_2=\left(\sum_{i=1}^n x_i^2\right)^{1/2} ∣∣ x ∣ ∣ 2 = ( ∑ i = 1 n x i 2 ) 1/2
L 1 L_1 L 1 范数:∣ ∣ x ∣ ∣ 1 = ∑ i = 1 n ∣ x i ∣ ||x||_1=\sum_{i=1}^n |x_i| ∣∣ x ∣ ∣ 1 = ∑ i = 1 n ∣ x i ∣
∞ \infty ∞ 范数:∣ ∣ x ∣ ∣ ∞ = max 1 ≤ i ≤ n ∣ x i ∣ ||x||_{\infty} = \max_{1\le i\le n}|x_i| ∣∣ x ∣ ∣ ∞ = max 1 ≤ i ≤ n ∣ x i ∣
范数等价性
对于 R n \mathbb R^{n} R n 上定义的任意两种范数 ∣ ∣ ⋅ ∣ ∣ α , ∣ ∣ ⋅ ∣ ∣ β ||\cdot ||_{\alpha}, ||\cdot ||_{\beta} ∣∣ ⋅ ∣ ∣ α , ∣∣ ⋅ ∣ ∣ β ,则必存在两正常数 m , M m,M m , M 满足
∀ x ∈ R n , m ∣ ∣ x ∣ ∣ β ≤ ∣ ∣ x ∣ ∣ α ≤ M ∣ ∣ x ∣ ∣ β \forall \mathbf x \in \mathbb R ^n,\;m||\mathbf x||_{\beta} \le ||\mathbf x||_{\alpha} \le M||x||_{\beta} ∀ x ∈ R n , m ∣∣ x ∣ ∣ β ≤ ∣∣ x ∣ ∣ α ≤ M ∣∣ x ∣ ∣ β
一个点列如果在任意一个范数意义下收敛,则在其它所有范数意义下收敛。
那么只用验证无穷范数意义下收敛。
依坐标收敛
满足 ∀ i ∈ [ 1 , n ] , lim k → ∞ x i ( k ) = x i ∗ \forall i\in[1,n],\,\lim_{k\to \infty} x_i^{(k)}=x_i^* ∀ i ∈ [ 1 , n ] , lim k → ∞ x i ( k ) = x i ∗ ,则称 x ( k ) \mathbf x^{(k)} x ( k ) 依坐标收敛到 x ∗ \mathbf x^* x ∗ 。
依范数收敛
满足 lim k → ∞ ∣ ∣ x ( k ) − x ∗ ∣ ∣ = 0 \lim_{k\to \infty}||\mathbf x^{(k)}-\mathbf x^{*}|| = 0 lim k → ∞ ∣∣ x ( k ) − x ∗ ∣∣ = 0 。这两种收敛是等价的。
矩阵范数 Matrix Norms
满足条件:
非负性
齐次性
∣ ∣ c ⋅ A ∣ ∣ = ∣ c ∣ ⋅ ∣ ∣ A ∣ ∣ || c \cdot \mathbf A|| = |c| \cdot||\mathbf A|| ∣∣ c ⋅ A ∣∣ = ∣ c ∣ ⋅ ∣∣ A ∣∣
三角不等式 Triangle Inequality
∣ ∣ A + B ∣ ∣ ≤ ∣ ∣ A + B ∣ ∣ ||\mathbf A + \mathbf B|| \le || \mathbf A + \mathbf B || ∣∣ A + B ∣∣ ≤ ∣∣ A + B ∣∣
相融性 Growth factor ∣ ∣ A ∣ ∣ ||\mathbf A|| ∣∣ A ∣∣
相融性:设 ∣ ∣ x ∣ ∣ , ∣ ∣ A ∣ ∣ ||\mathbf x||,||\mathbf A|| ∣∣ x ∣∣ , ∣∣ A ∣∣ 分别为 R n , R n × n \mathbb R^n, \mathbb R^{n\times n} R n , R n × n 上的范数,如果满足 ∣ ∣ A x ∣ ∣ ≤ ∣ ∣ A ∣ ∣ ⋅ ∣ ∣ x ∣ ∣ ||\mathbf{Ax}|| \le ||\mathbf A|| \cdot ||\mathbf x|| ∣∣ Ax ∣∣ ≤ ∣∣ A ∣∣ ⋅ ∣∣ x ∣∣ ,则称该矩阵范数与此向量范数相融
∣ ∣ A x ∣ ∣ ≤ ∣ ∣ A ∣ ∣ ⋅ ∣ ∣ x ∣ ∣ and ∣ ∣ A B ∣ ∣ ≤ ∣ ∣ A ∣ ∣ ⋅ ∣ ∣ B ∣ ∣ || \mathbf A \mathbf x|| \le ||\mathbf A||\cdot||\mathbf x|| \textrm{ and } ||\mathbf {AB}|| \le ||\mathbf A||\cdot ||\mathbf B|| ∣∣ Ax ∣∣ ≤ ∣∣ A ∣∣ ⋅ ∣∣ x ∣∣ and ∣∣ AB ∣∣ ≤ ∣∣ A ∣∣ ⋅ ∣∣ B ∣∣
定义:矩阵的算子范数:设 ∣ ∣ x ∣ ∣ ∈ R n , ∣ ∣ A ∣ ∣ ∈ R n × n ||\mathbf x|| \in \mathbb R^n, ||\mathbf A|| \in \mathbb R^{n\times n} ∣∣ x ∣∣ ∈ R n , ∣∣ A ∣∣ ∈ R n × n ,给出某种向量范数 ∣ ∣ x ∣ ∣ p ||\mathbf x||_p ∣∣ x ∣ ∣ p ,对应定义矩阵的非负函数满足:
∣ ∣ A ∣ ∣ p = sup x ≠ 0 ∣ ∣ A x ∣ ∣ p ∣ ∣ x ∣ ∣ p = max ∣ ∣ x ∣ ∣ p = 1 ∣ ∣ A x ∣ ∣ p ||\mathbf A||_p= \sup_{\mathbf x \ne 0} \frac{||\mathbf{Ax}||_p}{||\mathbf x||_p}=\max _{||\mathbf x||_p=1} ||\mathbf{Ax}||_p ∣∣ A ∣ ∣ p = x = 0 sup ∣∣ x ∣ ∣ p ∣∣ Ax ∣ ∣ p = ∣∣ x ∣ ∣ p = 1 max ∣∣ Ax ∣ ∣ p
称为矩阵的算子范数
例如 ∣ ∣ I ∣ ∣ = ∣ ∣ Q ∣ ∣ = 1 ||\mathbf I || = ||\mathbf Q|| =1 ∣∣ I ∣∣ = ∣∣ Q ∣∣ = 1 : errors don’t grow
根据定义有 ∣ ∣ A x ∣ ∣ ≤ ∣ ∣ A ∣ ∣ ⋅ ∣ ∣ x ∣ ∣ || \mathbf A \mathbf x|| \le ||\mathbf A||\cdot||\mathbf x|| ∣∣ Ax ∣∣ ≤ ∣∣ A ∣∣ ⋅ ∣∣ x ∣∣
对角矩阵的矩阵范数等于其最大元素(最大特征值)
若矩阵为对称正定矩阵,则
∣ ∣ A ∣ ∣ = λ max ( A ) ||\mathbf A|| = \lambda_{\max}(\mathbf A) ∣∣ A ∣∣ = λ m a x ( A )
对任意矩阵,推广为
∣ ∣ A ∣ ∣ 2 = max x ≠ 0 ∣ ∣ A x ∣ ∣ 2 ∣ ∣ x ∣ ∣ 2 = max x ≠ 0 x ⊤ A ⊤ A x x ⊤ x = λ max ( A ⊤ A ) ||\mathbf A||^2 = \max_{\mathbf x \ne 0} \frac{|| \mathbf A \mathbf x || ^2}{||\mathbf x||^2} = \max_{\mathbf x \ne 0} \frac{\mathbf x^\top \mathbf A^\top \mathbf A \mathbf x}{\mathbf x^\top \mathbf x} = \lambda_{\max} (\mathbf A ^\top \mathbf A) ∣∣ A ∣ ∣ 2 = x = 0 max ∣∣ x ∣ ∣ 2 ∣∣ Ax ∣ ∣ 2 = x = 0 max x ⊤ x x ⊤ A ⊤ Ax = λ m a x ( A ⊤ A )
证明:
设 A ⊤ A \mathbf A^\top \mathbf A A ⊤ A 的特征向量为 q 1 , q 2 , ⋯ , q n \mathbf q_1, \mathbf q_2,\cdots, \mathbf q_n q 1 , q 2 , ⋯ , q n . 则任意向量 x \mathbf x x 均可由特征向量线性表出,且 q i ⊤ q j = 0 \mathbf q_i^\top \mathbf q_j=0 q i ⊤ q j = 0
max x ≠ 0 x ⊤ A ⊤ A x x ⊤ x = ( c 1 q 1 + ⋯ + c n q n ) ⊤ ( c 1 λ 1 q 1 + ⋯ + c n λ n q n ) ( c 1 q 1 + ⋯ + c n q n ) ⊤ ( c 1 q 1 + ⋯ + c n q n ) = c 1 2 λ 1 + ⋯ + c n 2 λ n c 1 2 + ⋯ + c n 2 ≤ λ max \begin{aligned}
\max_{\mathbf x \ne 0} \frac{\mathbf x^\top \mathbf A^\top \mathbf A \mathbf x}{\mathbf x^\top \mathbf x} &= \frac{(c_1\mathbf q_1 + \cdots + c_n \mathbf q_n)^\top (c_1\lambda_1\mathbf q_1 + \cdots + c_n \lambda_n \mathbf q_n)}{(c_1\mathbf q_1 + \cdots + c_n \mathbf q_n)^\top (c_1\mathbf q_1 + \cdots + c_n \mathbf q_n)} \\
&= \frac{c_1^2 \lambda_1 + \cdots + c_n^2 \lambda_n}{c_1^2 + \cdots + c_n^2} \le \lambda_{\max}
\end{aligned} x = 0 max x ⊤ x x ⊤ A ⊤ Ax = ( c 1 q 1 + ⋯ + c n q n ) ⊤ ( c 1 q 1 + ⋯ + c n q n ) ( c 1 q 1 + ⋯ + c n q n ) ⊤ ( c 1 λ 1 q 1 + ⋯ + c n λ n q n ) = c 1 2 + ⋯ + c n 2 c 1 2 λ 1 + ⋯ + c n 2 λ n ≤ λ m a x
补充:∣ ∣ A ∣ ∣ || \mathbf A|| ∣∣ A ∣∣ equals the largest singular value σ max \sigma_{\max} σ m a x of A \mathbf A A
又若 A \mathbf A A 非奇异,则 ∣ ∣ A − 1 ∣ ∣ 2 = λ min ( A ) − 1 ||\mathbf A^{-1}||_2 = \lambda_{\min} (\mathbf A)^{-1} ∣∣ A − 1 ∣ ∣ 2 = λ m i n ( A ) − 1
三种常见的算子范数:
谱范数:∣ ∣ A ∣ ∣ 2 = λ max ( A ⊤ A ) ||\mathbf A||_2 = \sqrt{\lambda_{\max} (\mathbf A^\top \mathbf A)} ∣∣ A ∣ ∣ 2 = λ m a x ( A ⊤ A )
列范数:∣ ∣ A ∣ ∣ 1 = max 1 ≤ j ≤ n ∑ i = 1 n ∣ a i , j ∣ ||\mathbf A||_1 = \max_{1 \le j\le n} \sum_{i=1}^n|a_{i,j}| ∣∣ A ∣ ∣ 1 = max 1 ≤ j ≤ n ∑ i = 1 n ∣ a i , j ∣
行范数:∣ ∣ A ∣ ∣ ∞ = max 1 ≤ i ≤ n ∑ j = 1 n ∣ a i , j ∣ ||\mathbf A||_\infty = \max_{1 \le i\le n} \sum_{j=1}^n|a_{i,j}| ∣∣ A ∣ ∣ ∞ = max 1 ≤ i ≤ n ∑ j = 1 n ∣ a i , j ∣
F-范数 ∣ ∣ A ∣ ∣ F = ( ∑ i = 1 n ∑ i = 1 n a i , j 2 ) 1 / 2 ||\mathbf A||_F = (\sum_{i=1}^n \sum_{i=1}^n a_{i,j}^2)^{1/2} ∣∣ A ∣ ∣ F = ( ∑ i = 1 n ∑ i = 1 n a i , j 2 ) 1/2 ,不是算子范数
谱半径
设 λ i ( 1 ≤ i ≤ n ) \lambda_i\;(1\le i\le n) λ i ( 1 ≤ i ≤ n ) 为矩阵 A n × n \mathbf A_{n\times n} A n × n 的特征值,则称 ρ ( A ) = max 1 ≤ i ≤ n ∣ λ i ∣ \rho(\mathbf A)= \max_{1\le i\le n}|\lambda_i| ρ ( A ) = max 1 ≤ i ≤ n ∣ λ i ∣ 为矩阵的谱半径。注意到 λ i \lambda_i λ i 可能为复数,所以要取模。满足:
ρ ( A ) ≤ ∣ ∣ A ∣ ∣ \rho(\mathbf A) \le ||\mathbf A|| ρ ( A ) ≤ ∣∣ A ∣∣ ,这里 ∣ ∣ A ∣ ∣ ||\mathbf A|| ∣∣ A ∣∣ 为矩阵的任一范数
设 ε \varepsilon ε 为任意指定小正数,则必存在算子范数 ∣ ∣ ⋅ ∣ ∣ ∗ ||\cdot||_* ∣∣ ⋅ ∣ ∣ ∗ 满足
∣ ∣ A ∣ ∣ ∗ ≤ ρ ( A ) + ε ||\mathbf A||_* \le \rho(\mathbf A) + \varepsilon ∣∣ A ∣ ∣ ∗ ≤ ρ ( A ) + ε
lim n → ∞ A n = 0 ⟺ ∣ ∣ A ∣ ∣ < 1 ⟺ ρ ( A ) < 1 \lim_{n\to \infty} \mathbf A^n = 0 \iff ||\mathbf A|| < 1 \iff \rho(\mathbf A) < 1 n → ∞ lim A n = 0 ⟺ ∣∣ A ∣∣ < 1 ⟺ ρ ( A ) < 1
定理:
若 ∣ ∣ A ∣ ∣ < 1 || \mathbf A|| < 1 ∣∣ A ∣∣ < 1 则 I + A \mathbf I + \mathbf A I + A 非奇异,且
∣ ∣ ( I ± A ) − 1 ∣ ∣ ≤ 1 1 − ∣ ∣ A ∣ ∣ ||(\mathbf I \pm \mathbf A)^{-1} || \le \frac{1}{1- || \mathbf A||} ∣∣ ( I ± A ) − 1 ∣∣ ≤ 1 − ∣∣ A ∣∣ 1
迭代法
改写方程 A x = b ⟹ S x = T x + b \mathbf A \mathbf x = \mathbf b \implies \mathbf S \mathbf x = \mathbf T \mathbf x + \mathbf b Ax = b ⟹ Sx = Tx + b
则迭代矩阵为:
S x k + 1 = T x k + b \mathbf S \mathbf x_{k+1} = \mathbf T \mathbf x_{k} + \mathbf b S x k + 1 = T x k + b
The speed of each step depends on S \mathbf S S and the speed of convergence depends on S − 1 T \mathbf S^{-1}\mathbf T S − 1 T .
收敛性
迭代法收敛基本定理:
线性方程组 A x = b \mathbf A \mathbf x = \mathbf b Ax = b ,迭代形式 x ( k + 1 ) = B x k + g \mathbf x^{(k+1)} = \mathbf B \mathbf x^{k} + \mathbf g x ( k + 1 ) = B x k + g
对 任意 x ( 0 ) \mathbf x^{(0)} x ( 0 ) 序列 { x ( k ) } \{\mathbf x^{(k)}\} { x ( k ) } 收敛的 充要条件 为
ρ ( B ) < 1 \rho (\mathbf B) < 1 ρ ( B ) < 1
证明:
x ( k ) − x ∗ = B ( x ( k − 1 ) − x ∗ ) = ⋯ = B k ( x ( 0 ) − x ∗ ) \mathbf x^{(k)} - \mathbf x^* = \mathbf B (\mathbf x^{(k-1)}-\mathbf x ^*)= \cdots = \mathbf B^k (\mathbf x^{(0)}-\mathbf x^*) x ( k ) − x ∗ = B ( x ( k − 1 ) − x ∗ ) = ⋯ = B k ( x ( 0 ) − x ∗ )
lim k → ∞ B k → 0 ⟺ ρ ( B ) < 1 \lim_{k\to\infty}\mathbf B^{k} \to 0 \iff \rho(\mathbf B) < 1 k → ∞ lim B k → 0 ⟺ ρ ( B ) < 1
或者从误差向量的角度来理解,矩阵 B \mathbf B B 对误差向量 e \mathbf e e 压缩
注意 ρ ( B ) ≥ 1 \rho (\mathbf B) \ge 1 ρ ( B ) ≥ 1 时不能说对任意 x ( 0 ) \mathbf x^{(0)} x ( 0 ) 都不收敛
误差估计:
设 B = S − 1 T \mathbf B = \mathbf S^{-1}\mathbf T B = S − 1 T ,若 B \mathbf B B 的某一算子范数 ∣ ∣ B ∣ ∣ < 1 ||\mathbf B|| <1 ∣∣ B ∣∣ < 1 ,则对任意初始向量 x ( 0 ) \mathbf x^{(0)} x ( 0 ) 均收敛到方程的解 x ∗ \mathbf x^* x ∗ ,且有误差估计:
∣ ∣ x ( k ) − x ∗ ∣ ∣ ≤ ∣ ∣ B ∣ ∣ k 1 − ∣ ∣ B ∣ ∣ ∣ ∣ x ( 1 ) − x ( 0 ) ∣ ∣ ∣ ∣ x ( k ) − x ∗ ∣ ∣ ≤ ∣ ∣ B ∣ ∣ 1 − ∣ ∣ B ∣ ∣ ∣ ∣ x ( k ) − x ( k − 1 ) ∣ ∣ || \mathbf x^{(k)} - \mathbf x^{*}|| \le \frac{||\mathbf B||^k}{1-||\mathbf B||} ||\mathbf x^{(1)} - \mathbf x^{(0)}||\\
|| \mathbf x^{(k)} - \mathbf x^{*}|| \le \frac{||\mathbf B||}{1-||\mathbf B||} ||\mathbf x^{(k)} - \mathbf x^{(k-1)}|| ∣∣ x ( k ) − x ∗ ∣∣ ≤ 1 − ∣∣ B ∣∣ ∣∣ B ∣ ∣ k ∣∣ x ( 1 ) − x ( 0 ) ∣∣ ∣∣ x ( k ) − x ∗ ∣∣ ≤ 1 − ∣∣ B ∣∣ ∣∣ B ∣∣ ∣∣ x ( k ) − x ( k − 1 ) ∣∣
或估计残差 r = b − A x ( k ) \mathbf r = \mathbf b - \mathbf A \mathbf x^{(k)} r = b − A x ( k )
对角占优矩阵
定义:
若矩阵 A n × n \mathbf A_{n\times n} A n × n 满足对所有的行 i i i ,有 ∣ a i , i ∣ ≥ ∑ j ≠ i ∣ a i , j ∣ |a_{i,i}| \ge \sum_{j \ne i} |a_{i,j}| ∣ a i , i ∣ ≥ ∑ j = i ∣ a i , j ∣ 且至少有一个严格不等式成立,则称 A \mathbf A A 为弱对角占优矩阵。若所有不等式均为严格大于,则称为(行)严格对角占优矩阵.
∣ a i , i ∣ > ∑ j ≠ i ∣ a i , j ∣ , where i = 1 , 2 , ⋯ , n |a_{i,i}| > \sum_{j \ne i} |a_{i,j}|, \textrm{ where } i=1,2,\cdots,n ∣ a i , i ∣ > j = i ∑ ∣ a i , j ∣ , where i = 1 , 2 , ⋯ , n
对 A x = b \mathbf A \mathbf x = \mathbf b Ax = b ,若 A \mathbf A A 为严格占优矩阵,则
A \mathbf A A is non-singular
Jacobi 和 Gauss-Seidel 迭代均收敛
C. 矩阵树定理及其推论