Lecture 24 · Markov matrix and Fourier series
Understand the stationary state of Markov matrices and the projective structure of Fourier series.
On this page
Markov matrices; fourier series | Gilbert Strang | MIT 18.06 Linear Algebra
Lecture 24 / Total 35 Lectures |Part 3 · Eigenvalues, positive definiteness and linear transformation
Video of this lecture: Bilibili p24 · Markov matrix and Fourier series ↗(51:12)| MIT OCW official page ↗
Illustration: MIT OCW 18.06SC official lecture summary (CC BY-NC-SA 4.0) and Bilibili classroom video frames (time stamped), about 10 frames per lecture.
Introduction to this lecture
In the previous lectures, we have used eigenvalues and eigenvectors to solve difference equations and differential equations: as long as the initial vector can be expanded into a combination of eigenvectors, with can be written and The long-term behavior is determined by the eigenvalue with the largest absolute value (differential case) and the eigenvalue with the largest real part (differential case) respectively. This lecture applies this idea to two types of objects: the first half of the lecture is about probability and population mobility. Markov matrix (Markov matrix), the second half of the lecture is to extend the idea of “expanding under a basis” to function space, and we get Fourier series(Fourier series).
Markov matrices are a very special type of matrix: all elements are non-negative, and the sum of the elements in each column is equal to . These two conditions seem to be just the language of probability theory, but they directly determine its spectral structure—— It must be an eigenvalue, and the absolute value of the other eigenvalues does not exceed . So power will not diverge; as long as there are no other models eigenvalues, with increase, Which one remains to be Steady state (steady state), and all other items are attenuated. In the previous lecture, the steady state of differential equations depends on , but what we rely on here is . This time with The exchange of The difference between the two operations "" and “derivative with respect to time”.
The second half of the lecture changed the stage: Change to function space. Functions can be added and multiplied, so they also form a vector space; the difference between two functions inner product (inner product) uses integral instead of dot product, and Pairs of these inner products are orthogonal, forming a set of infinite-dimensional orthogonal bases. So a periodic function is expanded according to this set of bases, and the coefficients are “sieved” out one by one using inner products just like in the finite-dimensional case - this is the Fourier series, and it is also the most beautiful application of the projection chapter.

MIT OCW Official Lecture Notes Summary Page 1/4 (18.06SC Lecture 24 Summary, CC BY-NC-SA 4.0).
1. Markov matrix and its two properties
A square matrix is called Markov matrix, if it satisfies both conditions:
- Every element is nonnegative: ;
- The sum of the elements in each column is equal to : .
Just write down an example:
The sum of the three columns is , , , the elements also have no negative numbers, so it is indeed a Markov matrix. Elements are allowed to be equal to ——In the example The location is , meaning there is no direct transition from the second state to the third state - it is just not allowed to be negative.
Why do these two properties always appear in pairs? Because they come from the same application scenario: interpreting matrix elements as Probability. No. Column describes “is in state Where does the object go next”, where is from the state transfer to state proportion. The ratio cannot be negative, this is the first point; all objects must have a place to go (including staying in the original state), so the first point The elements of the column add up to exactly , this is the second article.
Viewed this way, matrix powers are easy to understand: The element of is the proportion of “starting from a certain state and reaching another state after two steps”, which is still a probability, and the column sum is still . In general, any power of a Markov matrix is still a Markov matrix. This can also be verified directly. Remember everything The row vector is , “The sum of each column is ” is exactly equivalent to
Take both sides to the right , got , and then the same holds true. So “the column sum is ” This property is not lost when exponentiation is repeated, nor is the non-negativity, because the product of a non-negative matrix remains non-negative.
The equation studied in this lecture is
Among them of the component represents the step in state quantity or proportion. Since the sum of each column is , the total quantity is conserved throughout the process:
This is exactly what “the probabilities add up to ”, a matrix writing method that neither loses nor increases population.

Video 00:05:07 | Approximately corresponding to Section 1 “1. Markov matrix and its two properties”.
2. Steady state: role
The spectral structure of a Markov matrix is characterized by two key facts:
- It must be eigenvalues;
- The absolute values of the remaining eigenvalues are less than (In individual cases it may be equal to , but never greater than ).
In Article 2, “equal to ” exception will make the corresponding item Without decay, the long-term behavior no longer converges to a single direction; as long as there are no such exceptions, the following derivation holds.
Take these two first and see how they determine long-term behavior. Set Yes linearly independent eigenvectors , corresponding to the eigenvalue , among which . Expand the initial vector under these eigenvectors:
Multiply both sides , use , got
There is a premise that must be pointed out here: there must be enough feature vectors to fill the entire space, otherwise It cannot be expanded at all, and the calculation cannot be started-that is, Must be diagonalizable.
now order . In the first item remain unchanged, the other factors And tends to zero, so
The modulus of the remaining eigenvalues are strictly smaller than situation, this is Steady state: No matter what the initial distribution is, the system finally falls on the eigenvector In the direction, the specific multiple is determined by the initial conditions. It will be clearer if you compare it with the differential equation in the previous lecture. Over there The solution contains , steady state corresponding to , because is the only term that does not change with time; here it is replaced by a discrete power, Die in one step, is the unchanging term. So “what’s left after a long time” is taken care of by different eigenvalues, depending on whether time is continuous or discrete.
There is another property: all its components are non-negative; if all components of the initial vector are positive, then all components of the steady state are also positive. This is not a coincidence, but a manifestation of “the probability will not become negative” in the eigenvector. This lecture does not give a proof of this property, but only uses it to check whether the calculated results are reasonable.

Video 00:11:01|Approximately corresponding to Section 2 “2. Steady state: character” nearby.
3. Why Must be an eigenvalue
to prove is an eigenvalue, which is equivalent to proving singular, because the eigenvalues are those that make Strange numbers. The key is to find out from the two properties of the Markov matrix problems.
look of columns. The sum of each column of is ; Identity matrix Each column of has only one , so the sum of each column is also . The two columns are subtracted correspondingly, The sum of each column of is . The example in the previous section gives
Sum the three columns separately: , , , indeed all zeros.
A column sum of zero means that Adding all three rows of will result in zero rows:
thus The three rows are linearly related. The linear correlation between the row vectors of a square matrix means singularity, so , is the characteristic value. This argument is valid for any Markov matrix, and there is no need to calculate the determinant at all - which is exactly what this lecture wants: to read the spectral information directly from the structure of the matrix.
Note appears: it is multiplied to the left, so it is of left null space (left nullspace); in other words, it is About eigenvalues eigenvector of own feature vector. looking for eigenvector , need to see The null space of The coefficients of the columns of combine into zero vectors because
Exactly of deformation. This set of coefficients is the steady state. Looking back, this is the general process for finding feature vectors: first solve Set , then solve Set . The only special thing about Markov matrices is that the first step is free.
Incidentally, you can get a fact about transposition: with The eigenvalues are exactly the same. The reason is
The first step uses “the determinant of a matrix is equal to its transposed determinant”. So Strange if and only if Strange, the eigenvalue sets of both are consistent. Back to the Markov situation: already found About The eigenvector of is , this fact guarantees the same Also eigenvalues. But the eigenvectors on both sides are different, and the left null space and the null space are two different things.
Now take the example Figure it out. solution :
The eigenvectors can be arbitrarily scaled, so shilling . The third equation gives , that is . Back to the first equation: , to reset it to zero, you need , that is . So
Substitute back into the second equation to check: , correct. The three components are all positive numbers, which is consistent with the previous statement of “steady state is non-negative”. If normalized by the sum of the components (), get It is the steady-state probability distribution over the three states.

MIT OCW Official Lecture Notes Summary Page 2/4 (18.06SC Lecture 24 Summary, CC BY-NC-SA 4.0).

Video 00:19:27|Approximately corresponding to Section 3 “3. Why It must be near the “eigenvalue”.
4. An example: Population movement between California and Massachusetts
Where does the Markov matrix come from? The most intuitive source is population migration between two states. Set , respectively For the population of California and Massachusetts in 2015, if the proportion of migration is fixed every year, then
Read this matrix according to the convention of “columns are sources and rows are destinations”: The first column talks about Californians—— Stay in California, Moving to Massachusetts; the second column talks about people from Massachusetts - stay, Moved to California. The sum of both columns is , since everyone is counted once, the total population neither increases nor decreases. The matrix is the same at every step, which is a strong limitation in the example: the migration ratio remains the same from year to year.
Assuming that everyone is in Massachusetts at the initial time, a total of people, that is . Take one step:
People arrived in California. Taking another step, some people moved back:
California has more than , Massachusetts dropped to Below, the sum is still . Want to know For the population after steps or even infinite steps, eigenvalues and eigenvectors must be found.
Eigenvalues are easy to find. From “column sum to “Direct guarantee; use trace (sum of diagonal elements) , obtained by “the sum of eigenvalues is equal to the trace” . You can also check using determinants: ., consistent with key fact two.
Then find the eigenvector. time
The two rows are the opposite numbers of each other, and the null space is given by Zhang Cheng, take , both components are positive. time
The null space is given by Zhang Cheng, take . So
use The initial conditions of are constants: , , the solution is , . So
take Verification: California , Massachusetts , consistent with the result of direct matrix multiplication.
The steady state is the first term in the expression: , it is multiples of the total population Set out. Second term with factor , follow The enlargement disappears rapidly; is already small enough to be ignored, so After this step, the population will be almost . That answers ” of The second power acts on Questions like “How much is the number above?”: There is no need to actually multiply the times, as long as you see clearly How small is this one.
One last note: Some textbooks (especially books on electrical engineering and probability theory) are accustomed to using row vectors, written as . At this time , the condition “column sum is ” becomes “action and behavior” ”. The two ways of writing describe the same thing, the only difference is whether to multiply on the left or the right, and whether to transpose.

Video 00:33:17|Approximately corresponding to Section 4 “4. An example: Population migration between California and Massachusetts”.
5. Expansion under orthonormal basis
Go to the second half of this lecture. Let’s review a fact first: Suppose is a group orthogonal (orthonormal) vectors, that is, two pairs of orthogonal vectors with lengths , and they span into the entire , then they form a set of basis, any vector can be expanded into
The question is how to find these coefficients. The method is surprisingly simple: use Take the inner product with both sides of the equation. due to , while (), with only one item left on the right:
for each In the same way, . Each coefficient is component in the direction of the corresponding basis vector. This is exactly the projection: put projected onto In two mutually perpendicular base directions, the obtained length is the coefficient. In other words, the orthonormal basis turns “expansion” into a series of inner products, without solving equations or inverting matrices.
Write this in matrix form. order to is a column, then the expansion is , the formal solution is . while standard orthogonality gives
i.e. , so . its first The components are of the OK (i.e. ) and The inner product of is exactly the same as the result calculated one by one. see letters should have thought of ——This is the greatest convenience brought by the standard orthonormal basis.
This section is still finite-dimensional, but all the preparations required for the Fourier series are in place: the “basis vectors” there are no longer vector in , but a function.

MIT OCW Official Lecture Notes Summary Page 3/4 (18.06SC Lecture 24 Summary, CC BY-NC-SA 4.0).
6. Fourier series
The problem to be solved by Fourier series is: convert a function Written as a constant term, , , , A linear combination of…,
It looks exactly like the expansion in the previous section, the only difference is that there are infinite polynomials. Why do we need an infinite number of items? Because the function space is infinite dimensions: A function that takes multiple consecutive values in the interval cannot be completely described by a finite number of parameters, so an infinite number of basis functions are needed. This step marks leaving the finite-dimensional vector space and entering the infinite-dimensional situation.
The basis functions used are
They all start with is a period, so it can only be used to express the same is a function of the period, that is ;The integral interval is therefore taken as .
Next we need to define the inner product of the function. The finite dimensional dot product is : Multiply point by point and add the results. The function takes multiple consecutive values in the interval, and the “sum” after point-by-point multiplication becomes an integral:
The reason why this set of basis is useful is that they are orthogonal to each other under this inner product. to with For example:
All other combinations are also zero (with the help of some trigonometric identities). The easiest group to verify is the constant function with :
And the inner product of each basis function and itself is not zero, for example
So this is a set of orthonormal basis, but not yet normalized: , The “length” of is , constant function The “length” of is , neither . What are the coefficients in the formula? The denominator of comes from here.
How to find the coefficient? The method is exactly the same as for finite dimensions: which coefficient you want to find, use the corresponding basis function to do the inner product with both sides of the equation. Find the constant term , just use the constant function To multiply and to integrate. The remaining items on the right are the same as The inner products of are all zero, leaving only
So
it happens to be average over the interval. This is also intuitive: the constant term is the constant that is “contained on average” in the function.
More typically . Multiply both sides of the expansion by Point again. Due to orthogonality, the right-hand side Everything except that item disappears, leaving only
thus
The same approach is given for each and : use or To do the inner product, only the corresponding term on the right side remains, and the denominators are both (The constant term is ). This is the coefficient formula of the Fourier series, often called Euler’s formula. The meaning of the coefficients is very specific: is how many constants the function contains, How much does it contain , How much does it contain , and so on, each , Metric No. The amount of harmonics. The action of finding the coefficients can also be said straightforwardly: multiply the expansion by a certain basis function and then integrate. All other terms will be killed by orthogonality, leaving only the desired term.
Looking back at the structure of the entire derivation, it corresponds verbatim to Section 5: vectors are replaced by functions, dot products are replaced by definite integrals, the addition of finite terms is replaced by infinite series, and orthogonal vectors are replaced by orthogonal function systems; and the rule “the coefficient is equal to the inner product divided by the square of the length of the basis function” has not changed a word. The Fourier series can be established not by analytical skills, but by the existence of orthogonal basis in the function space.

Video 00:40:42 | Approximately corresponding to Section 6 “6. Fourier Series”.

Video 00:46:05 | Approximately corresponding to Section 6 “6. Fourier Series”.

MIT OCW Official Lecture Notes Summary Page 4/4 (18.06SC Lecture 24 Summary, CC BY-NC-SA 4.0).
Summary of this lecture
- Markov matrix (Markov matrix) two defining properties: all elements are non-negative; the sum of the elements in each column is . Example Satisfy these two items.
- Two properties hold during exponentiation: launch , so Still a Markov matrix, the total Conservation.
- Key fact one: It must be an eigenvalue. The reason is not to calculate the determinant, but The sum of each column of is zero, then in In the left null space of , the rows are linearly related, Bizarre.
- Key fact 2: The absolute values of the remaining eigenvalues do not exceed , generally strictly less than ;If there is a modulus other eigenvalues of (such as the permutation matrix ), the power does not converge to a single stable state. in strictly less than situation, , this is the steady state; Determined by the initial vector. Steady-state correspondence of differential equations , here corresponds to .
- The steady-state eigenvector of the example is : take Later by Got , and then determined from the first line , all three components are positive.
- with The eigenvalues of are exactly the same (because ), but the eigenvectors are different: Belong to , the steady state belongs to .
- California-Massachusetts example: , characteristic value with , feature vector with ; by Got , the steady state is .
- orthonormal basis (orthonormal basis) , , the expansion coefficient is the inner product .
- Fourier series (Fourier series): The inner product of a function space is the integral , base Pairs are orthogonal; is the average value of , because .
keywords
| English | Chinese | One sentence explanation |
|---|---|---|
| Markov matrix | Markov matrix | The elements are non-negative and the sum of each column is The square matrix describes the system of transition according to fixed probability |
| steady state | Steady state | The state that the system tends to after a long period of time, that is, The eigenvector direction of |
| left nullspace | left null space | satisfy vector of The space constituted by |
| trace | trace | The sum of the diagonal elements is equal to the sum of all eigenvalues |
| power of a matrix | matrix power | Indicates continuous action times, |
| diagonalizable | diagonalizable | There are enough linearly independent eigenvectors to expand the initial vector. |
| orthonormal | orthogonal | Pairs are orthogonal and both have lengths a set of vectors |
| orthogonal matrix | orthogonal matrix | Column vector orthonormal square matrix , satisfy , so |
| inner product | inner product | The finite dimension is the dot product, and the function space is , used to determine orthogonality and find expansion coefficients |
| Fourier series | Fourier series | Let the period be function press Expand to get the sum of infinite terms |
| orthogonal basis | Orthogonal basis | A set of basis vectors or basis functions that are pairwise orthogonal. The coefficients are calculated one by one through the inner product. |
| periodic function | periodic function | satisfy function, applicable object of Fourier expansion |
| infinite dimensional | infinite dimensions | The function space requires an infinite number of basis functions, so the Fourier series has an infinite number of terms. |
Machine-assisted translation · Read Chinese original
