第 24 章
Markov 矩阵与傅里叶级数:特征值的两个应用
列和为 1 的非负矩阵必有特征值 1,其正特征向量给出稳态;把同样的「正交基展开」推广到函数空间,就得到傅里叶系数。
Markov Matrices and Fourier Series: Two Uses of Eigenvalues
A nonnegative matrix whose columns sum to one always has eigenvalue 1, and its positive eigenvector is the steady state; the same orthonormal-basis expansion, moved to function space, gives Fourier coefficients.
篇内目录
- What a Markov matrix is
- Timeline
- The key facts
- Why 1 must be an eigenvalue
- Where the steady state comes from
- A population example
- Eigenvalues
- Eigenvectors
- A concrete trajectory
- Projection onto an orthonormal basis
- From vectors to functions: Fourier series
- The inner product of functions
- Orthogonality
- The coefficient formulas
- Core review
- Common misconceptions
- Check your understanding
- How this connects
Markov 矩阵的定义
一个矩阵称为 Markov 矩阵,如果它满足:
- 所有元素非负;
- 每一列的元素之和为 1。
第二条在转置写法中会变成「每一行之和为 1」。本课程用列向量,因此约定列和为一。
课堂上随手写了一个例子:
每列相加都是 1。由于非负性与列和为 1 在矩阵乘法下保持, 的所有幂仍是 Markov 矩阵。
时间轴
| 时间 | 内容 |
|---|---|
| 0:00 | 马尔可夫矩阵与傅里叶级数 |
| 3:05 | 回顾 的稳态例子 |
| 6:45 | 的 分解 |
| 9:56 | 特征值 1 与衰减项 |
| 12:57 | 马尔可夫矩阵:每列和为 1 |
| 16:01 | 列相关,因此存在左零向量 |
| 19:05 | 左特征向量与稳态 |
| 22:29 | 人口流动的转移矩阵 |
| 25:40 | 长期分布的计算 |
| 28:46 | 第二个特征值 0.7 |
| 31:48 | 的完整分解 |
| 35:10 | 转向投影与傅里叶 |
| 38:13 | 用正交基展开向量 |
| 41:25 | 把函数也当作向量 |
| 44:30 | 傅里叶级数的系数 |
| 47:36 | 系数计算的例子 |
关键结论
| 结论 | 内容 |
|---|---|
| 1 | 一定是特征值 |
| 2 | 其余特征值满足 $ |
| 3 | 对应的特征向量所有分量非负,给出稳态 |
为什么 1 一定是特征值
考虑 。由于 每列之和为 1, 的每列之和为 0。换句话说,把 的三行相加,得到零行,因此行线性相关,矩阵奇异。
还有另一种说法:全 1 向量 满足
所以 在 的左零空间里。这个向量不是 的特征向量,而是 的特征向量。由于 与 的特征值相同(),这同样证明了 1 是 的特征值。
稳态从哪里来
差分方程 的解为
当 时,除第一项外全部衰减到零,于是
稳态就是 的特征向量(乘一个由初始总量决定的系数)。
人口流动的例子
设只有两个州:加州(C)与马萨诸塞州(M)。每年:
- 加州 90% 留下,10% 迁往麻省;
- 麻省 80% 留下,20% 迁往加州。
矩阵每列和为 1,总人口守恒。
特征值
迹为 ,所以另一个特征值是 :
特征向量
:解 ,其中
零空间由 张成。
:解 ,得 。
具体演化
设初始 ,即所有人都在麻省。写成特征向量的组合:
解得
于是
当 ,第二项消失:
总人数仍是 1000。第一步验算:,与公式一致。
补充: 这个例子假设转移概率每年不变,且人口只在两个州之间流动。真实人口模型还会有出生、死亡与跨州迁移,那时矩阵不再守恒。
投影到正交基:傅里叶级数的伏笔
设 是 维空间的一组标准正交基。任意向量 可以展开为
两边与 做内积。由于正交性,只有第 项存活:
所以
矩阵形式是 ,而 ,于是 。这正是「正交基让求系数变成一次内积」的意思。
从向量到函数:傅里叶级数
傅里叶的洞见是把上面的结构搬到函数空间:
- 向量 换成函数 ;
- 基向量 换成函数 ;
- 有限维换成无限维。
函数的内积
向量内积是「逐分量相乘再相加」。函数有无穷多个点,求和变成积分:
积分区间取 ,因为所有基函数都以 为周期。
正交性
以 与 为例:
其他组合同样正交(同频率的正弦与余弦、不同频率的三角函数之间内积为零)。
系数公式
把 写成
两边与 做内积(即乘以 再积分)。所有正交项消失,只剩
所以
一般地:
常数项的系数是函数的平均值:
一句话总结: 傅里叶系数就是函数在正交基上的投影坐标,公式与有限维的 完全同构。
核心回顾
- Markov 矩阵:非负、列和为 1;幂仍然是 Markov 矩阵。
- 列和为 1 保证 奇异,因此 1 必是特征值。
- 其余特征值模小于 1,故 收敛到 的特征向量方向。
- 稳态向量非负,由初始总量确定倍数。
- 正交基下,展开系数是一次内积:。
- 函数空间的内积是积分;傅里叶系数就是投影坐标。
常见误区
- 把列和为 1 记成行和为 1。取决于向量写成列还是行;本课程用列。
- 认为所有 Markov 矩阵都收敛到唯一稳态。若存在模为 1 的其他特征值,可能周期振荡;若矩阵可约,稳态可能不唯一。
- 把 的特征向量直接当成任意倍数。倍数由总人口(初始条件)决定。
- 把函数内积写成普通乘积。必须积分。
- 忘记傅里叶系数的归一化因子。、 的平方在 上积分是 ,不是 1。
理解检验
1. 证明 Markov 矩阵的列和为 1 蕴含 奇异。
参考答案:记 。列和为 1 等价于 ( 的每一列与 的内积都是 1)。于是
属于 的左零空间,所以 奇异,即 , 是特征值。也可以直接看: 的每列之和为 0,把它的各行相加得到零行,故矩阵奇异。
2. 为什么全 1 向量在 的零空间而不是 的零空间?
参考答案:上面的关系是 ,转置得 。所以 是 的特征向量(特征值 1),也就是 ,位于 的零空间。对 本身, 的特征向量是稳态分布 (分量非负、按总人口缩放),一般不是全 1 向量;只有行和也全为 1 的特殊矩阵(如双随机矩阵)才有 。行列和条件是两个不同的条件。
3. 在上面的两州模型中,若初始为 ,稳态是什么?
参考答案:特征向量仍为 、。设
得 、,所以 。当 ,,稳态为
与初始在麻省的情形相同:稳态只由总人口 1000 决定,与初始分布无关。
4. 用内积推导 的公式。
参考答案:把 两边乘以 ,在 上积分。由正交性,除 外所有项积分为零(, 当 )。剩下
所以 。关键归一化:,不是 1。
5. 为什么说傅里叶级数是「无限维的正交基展开」?
参考答案:把函数看成向量空间中的元素,内积定义为 。基函数 两两正交,且每个的模长平方为 (常数 1 为 )。因此系数就是投影:
与有限维的 完全同构;区别只是基无穷多、求和变成级数,收敛性需要额外讨论(平方可积意义下成立)。
与前后课程的关系
这一讲把特征值用于概率模型,把投影用于函数空间。下一讲(复习课)串联正交、行列式与特征值三条主线;再之后进入对称矩阵与正定性,那里正交性、特征值与二次型会汇合。
What a Markov matrix is
A matrix is a Markov matrix if
- every entry is nonnegative, and
- every column sums to one.
In a row-vector convention the second condition becomes "every row sums to one". This course uses column vectors, so columns sum to one.
A typical example from the lecture:
Each column adds to 1. Both properties survive matrix multiplication, so every power of is again a Markov matrix.
Timeline
| Time | Topic |
|---|---|
| 0:00 | Markov matrices and Fourier series |
| 3:05 | Recap: an example with |
| 6:45 | Decomposing into terms |
| 9:56 | Eigenvalue 1 and the decaying terms |
| 12:57 | Markov matrices: columns sum to 1 |
| 16:01 | Dependent columns give a left nullvector |
| 19:05 | Left eigenvectors and the steady state |
| 22:29 | A population-mixing matrix |
| 25:40 | The long-run distribution |
| 28:46 | The second eigenvalue 0.7 |
| 31:48 | The full decomposition of |
| 35:10 | Turning to projections and Fourier |
| 38:13 | Expanding in an orthonormal basis |
| 41:25 | Treating functions as vectors |
| 44:30 | The Fourier coefficients |
| 47:36 | A worked coefficient example |
The key facts
| Fact | Statement |
|---|---|
| 1 | is always an eigenvalue |
| 2 | Every other eigenvalue satisfies $ |
| 3 | The eigenvector for has no negative entries and gives the steady state |
Why 1 must be an eigenvalue
Consider . Since each column of sums to 1, each column of sums to 0. Adding the rows of therefore produces the zero row, so the rows are dependent and the matrix is singular:
Another way to say it: the all-ones vector satisfies
so lies in the left null space of . It is not an eigenvector of but of . Since and have the same eigenvalues — — this also proves that 1 is an eigenvalue of .
Where the steady state comes from
The solution of is
When every , all terms except the first decay, so
The steady state is the eigenvector for , scaled by a coefficient fixed by the initial total.
A population example
Two states, California (C) and Massachusetts (M). Each year:
- 90% of California stays, 10% moves to Massachusetts;
- 80% of Massachusetts stays, 20% moves to California.
Each column sums to 1, so the total population is conserved.
Eigenvalues
The trace is , so the other eigenvalue is :
Eigenvectors
For , solve with
whose null space is spanned by .
For , solve to get .
A concrete trajectory
Start with : everyone in Massachusetts. Expand it in eigenvectors:
Solving gives
so
As the second term vanishes:
The total is still 1000. A one-step check: , matching the formula.
Background: This model assumes fixed yearly transition probabilities and no births, deaths, or migration outside the two states. A realistic population model would not conserve the total, and the matrix would not be Markov.
Projection onto an orthonormal basis
Let be an orthonormal basis of . Any vector expands as
Take the inner product of both sides with . Orthogonality kills every term except the -th:
Therefore
In matrix form, and , so . Orthonormality turns finding coefficients into a single inner product.
From vectors to functions: Fourier series
Fourier's insight is to carry this structure into function space:
- the vector becomes a function ;
- the basis vectors become the functions ;
- finite dimension becomes infinite dimension.
The inner product of functions
A vector inner product multiplies components and adds. A function has a continuum of points, so the sum becomes an integral:
The interval is because every basis function has period .
Orthogonality
For and :
Other pairs are orthogonal as well: same-frequency sine and cosine, and different frequencies, all integrate to zero.
The coefficient formulas
Write
Take the inner product with , meaning multiply by and integrate. Every orthogonal term vanishes and only one survives:
Hence
In general,
The constant term is the average value:
One-sentence summary: Fourier coefficients are the coordinates of a function in an orthonormal basis, the exact analogue of .
Core review
- A Markov matrix is nonnegative with columns summing to one; its powers are Markov too.
- Column sums of one make singular, so 1 is an eigenvalue.
- Every other eigenvalue has modulus below 1, so converges to the direction.
- The steady-state vector is nonnegative, scaled by the initial total.
- In an orthonormal basis, coefficients are single inner products: .
- Function inner products are integrals; Fourier coefficients are projection coordinates.
Common misconceptions
- Remembering "rows sum to one" instead of columns. It depends on the vector convention; this course uses columns.
- Assuming every Markov matrix converges to a unique steady state. Other eigenvalues of modulus 1 can produce oscillation, and a reducible matrix may have several steady states.
- Treating the eigenvector as arbitrary up to scale. The scale is fixed by the initial total.
- Writing a function inner product as a plain product. It must be integrated.
- Forgetting the normalization in Fourier formulas. The integral of over is , not 1.
Check your understanding
1. Prove that column sums of one force to be singular.
Reference answer: Write . Column sums equal to 1 mean (each column has inner product 1 with ). Hence
Since lies in the left nullspace of , the matrix is singular: and is an eigenvalue. Equivalently, every column of sums to zero, so adding its rows gives a zero row.
2. Why is the all-ones vector in the null space of rather than of ?
Reference answer: The relation above is ; transposing gives . So is an eigenvector of with eigenvalue 1, i.e. , which places it in the nullspace of . For itself, the eigenvector for is the steady-state vector (nonnegative, scaled by total population), generally not the all-ones vector. Only matrices whose row sums are also 1 (doubly stochastic) satisfy ; column and row sum conditions are different.
3. In the two-state model, what is the steady state if the initial population is ?
Reference answer: The eigenvectors are still and . Write
so and , giving . As , , and the steady state is
It matches the case that started entirely in Massachusetts: the steady state depends only on the total population 1000, not on the initial distribution.
4. Derive the formula for using an inner product.
Reference answer: Multiply by and integrate over . Orthogonality kills everything except ( and for ). What remains is
hence . The normalisation (not 1) is essential.
5. In what sense is a Fourier series an expansion in an infinite orthonormal basis?
Reference answer: Treat functions as vectors with inner product . The functions are pairwise orthogonal, with squared norms (and for the constant 1). The coefficients are therefore projections,
exactly analogous to in finite dimensions. The only differences are that the basis is infinite and the sum becomes a series, whose convergence needs a separate argument (it holds in the square-integrable sense).
How this connects
This lecture applies eigenvalues to probability models and projection to function spaces. The next session reviews orthogonality, determinants, and eigenvalues together; after that the course turns to symmetric matrices and positive definiteness, where orthogonality, eigenvalues, and quadratic forms meet.