Alessandro Palliccia

Stochastic Dynamical Models

Exercises on the Markov property, classification of states and period

1,929 words, , published

The exercises of this session concern the Markov property, the classification of states and the period.

A Markov chain on three states

Exercise 1. Let (Xn)n≥0(X_n)_{n \ge 0} be a Markov chain with state space I={1,2,3}{I = \{1, 2, 3\}} and transition matrix

P=(02/31/31/302/32/31/30),P = \begin{pmatrix} 0 & 2/3 & 1/3 \\ 1/3 & 0 & 2/3 \\ 2/3 & 1/3 & 0 \end{pmatrix},

as in Figure 1. Suppose that the initial distribution λ\lambda of X0X_0 is uniform on I,{I,} that is, λ=(1/3,1/3,1/3).{\lambda = (1/3, 1/3, 1/3).}
(1) Compute P{X3=2}.{\mathbb{P}\{X_3 = 2\}.}
(2) Compute P{X0=1,X2=3}{\mathbb{P}\{X_0 = 1, X_2 = 3\}} and P{X0+X2=4}.{\mathbb{P}\{X_0 + X_2 = 4\}.}
(3) Compute P{X0=1,X2=3∣X0+X2=4}.{\mathbb{P}\{X_0 = 1, X_2 = 3 \mid X_0 + X_2 = 4\}.}
(4) Determine the joint distribution of (X3,X4)(X_3, X_4) and compute E[X3X4].{\mathbb{E}[X_3 X_4].}

2/31/31/32/32/31/3123

Figure 1. The chain of Exercise 1. Each arrow carries the probability of the jump.

Solution 1. All four questions are about the chain at fixed times, and the tool for them is the nn-step transition matrix of the first post. The probability of going from ii to jj in nn steps is the entry (i,j)(i, j) of the power Pn,{P^n,} that is pij(n)=P{Xn=j∣X0=i}=(Pn)ij,{p^{(n)}_{ij} = \mathbb{P}\{X_n = j \mid X_0 = i\} = (P^n)_{ij},} and the distribution of XnX_n is the row vector λPn:{\lambda P^n{:}} P{Xn=j}=(λPn)j.{\mathbb{P}\{X_n = j\} = (\lambda P^n)_j.} Both come from the product formula (1.1) of the first post, summed over the states the chain visits between time 0 and time n.n.

The powers are computed with the product of matrices: the entry (i,j)(i, j) of a product ABAB is ∑kaikbkj,{\sum_k a_{ik} b_{kj},} the row ii of AA multiplied term by term with the column jj of BB and summed. For P2P^2 each entry is a sum of three products, and the products with a zero factor drop out. The other entries of PP are 1/31/3 and 2/3,{2/3,} so each product is 1/9,{1/9,} 2/92/9 or 4/9,{4/9,} a multiple of 1/9,{1/9,} and

P2=19(2+21442+21142+2)=(4/91/94/94/94/91/91/94/94/9).P^2 = \frac19 \begin{pmatrix} 2 + 2 & 1 & 4 \\ 4 & 2 + 2 & 1 \\ 1 & 4 & 2 + 2 \end{pmatrix} = \begin{pmatrix} 4/9 & 1/9 & 4/9 \\ 4/9 & 4/9 & 1/9 \\ 1/9 & 4/9 & 4/9 \end{pmatrix}.

For instance, the entry (1,1)(1, 1) is p12p21+p13p31=29+29=49,{p_{12} p_{21} + p_{13} p_{31} = \frac29 + \frac29 = \frac49,} since p11=0.{p_{11} = 0.} Then P3=P2P.{P^3 = P^2 P.} An entry of P2P^2 is a multiple of 1/91/9 and an entry of PP a multiple of 1/3,{1/3,} so every product is a multiple of 1/27,{1/27,} and

P3=P2P=127(1+88+44+24+28+14+84+82+41+8)=(1/34/92/92/91/34/94/92/91/3).P^3 = P^2 P = \frac{1}{27} \begin{pmatrix} 1 + 8 & 8 + 4 & 4 + 2 \\ 4 + 2 & 8 + 1 & 4 + 8 \\ 4 + 8 & 2 + 4 & 1 + 8 \end{pmatrix} = \begin{pmatrix} 1/3 & 4/9 & 2/9 \\ 2/9 & 1/3 & 4/9 \\ 4/9 & 2/9 & 1/3 \end{pmatrix}.

Here the entry (1,1)(1, 1) is 49⋅0+19⋅13+49⋅23=127+827,{\frac49 \cdot 0 + \frac19 \cdot \frac13 + \frac49 \cdot \frac23 = \frac{1}{27} + \frac{8}{27},} and the others are computed in the same way. Doing matrix multiplication one therefore gets P2P^2 and P3P^3 as above, and

λP3=(1/3,1/3,1/3) P3=(1/3,1/3,1/3).\lambda P^3 = (1/3, 1/3, 1/3) \, P^3 = (1/3, 1/3, 1/3).

In detail, the entry jj of λP3\lambda P^3 is ∑iλi(P3)ij=13∑i(P3)ij,{\sum_i \lambda_i (P^3)_{ij} = \frac13 \sum_i (P^3)_{ij},} one third of the sum of the column jj of P3.{P^3.} Every column of P3P^3 contains the three numbers 1/3,{1/3,} 2/92/9 and 4/9,{4/9,} whose sum is 3/9+2/9+4/9=1,{3/9 + 2/9 + 4/9 = 1,} so every entry of λP3\lambda P^3 is 1/3.{1/3.} Therefore

P{X3=i}=(λP3)i=13,i∈I,P{X0=1,X2=3}=P{X2=3∣X0=1} P{X0=1}=49⋅13=427.\begin{aligned} \mathbb{P}\{X_3 = i\} &= (\lambda P^3)_i = \frac13, \qquad i \in I, \\ \mathbb{P}\{X_0 = 1, X_2 = 3\} &= \mathbb{P}\{X_2 = 3 \mid X_0 = 1\} \, \mathbb{P}\{X_0 = 1\} = \frac49 \cdot \frac13 = \frac{4}{27}. \end{aligned}

The first line answers (1): P{X3=2}=1/3,{\mathbb{P}\{X_3 = 2\} = 1/3,} and the same holds for the other two states. The second line uses the definition of conditional probability: for events AA and BB with P(B)>0,{\mathbb{P}(B) > 0,} one sets P(A∣B)=P(A∩B)/P(B),{\mathbb{P}(A \mid B) = \mathbb{P}(A \cap B) / \mathbb{P}(B),} so that P(A∩B)=P(A∣B) P(B).{\mathbb{P}(A \cap B) = \mathbb{P}(A \mid B) \, \mathbb{P}(B).} Here B={X0=1}{B = \{X_0 = 1\}} has probability λ1=1/3>0,{\lambda_1 = 1/3 > 0,} and P{X2=3∣X0=1}=p13(2)=4/9,{\mathbb{P}\{X_2 = 3 \mid X_0 = 1\} = p^{(2)}_{13} = 4/9,} the entry (1,3)(1, 3) of P2.{P^2.} The same number comes from the paths of two steps from 1 to 3:{3{:}} the path 1→2→3{1 \to 2 \to 3} has probability p12p23=23⋅23=49,{p_{12} p_{23} = \frac23 \cdot \frac23 = \frac49,} and the paths through 1 or 3 have probability 0, because p11=p33=0.{p_{11} = p_{33} = 0.}

For the event {X0+X2=4}{\{X_0 + X_2 = 4\}} we use the law of total probability. The events {X0=1},{\{X_0 = 1\},} {X0=2}{\{X_0 = 2\}} and {X0=3}\{X_0 = 3\} are pairwise disjoint and their union is the whole space, because X0X_0 takes values in I.{I.} By additivity, for every event AA we have P(A)=∑kP(A∩{X0=k}),{\mathbb{P}(A) = \sum_k \mathbb{P}(A \cap \{X_0 = k\}),} and each term is P(A∣X0=k) P{X0=k}{\mathbb{P}(A \mid X_0 = k) \, \mathbb{P}\{X_0 = k\}} by the definition of conditional probability, since P{X0=k}=1/3>0.{\mathbb{P}\{X_0 = k\} = 1/3 > 0.} Hence

P{X0+X2=4}=∑k=13P{X0+X2=4∣X0=k} P{X0=k}=13∑k=13P{X2=4−k∣X0=k}=13(49+49+19)=13,\begin{aligned} \mathbb{P}\{X_0 + X_2 = 4\} &= \sum_{k=1}^{3} \mathbb{P}\{X_0 + X_2 = 4 \mid X_0 = k\} \, \mathbb{P}\{X_0 = k\} \\ &= \frac13 \sum_{k=1}^{3} \mathbb{P}\{X_2 = 4 - k \mid X_0 = k\} \\ &= \frac13 \Big( \frac49 + \frac49 + \frac19 \Big) = \frac13, \end{aligned}

so that

P{X0=1,X2=3∣X0+X2=4}=P{X0=1,X2=3,X0+X2=4}P{X0+X2=4}=P{X0=1,X2=3}P{X0+X2=4}=427⋅3=49.\begin{aligned} \mathbb{P}\{X_0 = 1, X_2 = 3 \mid X_0 + X_2 = 4\} &= \frac{\mathbb{P}\{X_0 = 1, X_2 = 3, X_0 + X_2 = 4\}}{\mathbb{P}\{X_0 + X_2 = 4\}} \\ &= \frac{\mathbb{P}\{X_0 = 1, X_2 = 3\}}{\mathbb{P}\{X_0 + X_2 = 4\}} = \frac{4}{27} \cdot 3 = \frac49. \end{aligned}

In the first of these two displays, the second equality holds because on the event {X0=k}{\{X_0 = k\}} the sum X0+X2X_0 + X_2 equals 4 exactly when X2=4−k.{X_2 = 4 - k.} So the events {X0+X2=4}{\{X_0 + X_2 = 4\}} and {X2=4−k}{\{X_2 = 4 - k\}} have the same intersection with {X0=k},{\{X_0 = k\},} and a conditional probability given {X0=k}\{X_0 = k\} depends only on that intersection. The three conditional probabilities are entries of P2:{P^2{:}} p13(2)=4/9{p^{(2)}_{13} = 4/9} for k=1,{k = 1,} p22(2)=4/9{p^{(2)}_{22} = 4/9} for k=2{k = 2} and p31(2)=1/9{p^{(2)}_{31} = 1/9} for k=3.{k = 3.} Their sum is 9/9=1,{9/9 = 1,} which gives 1/3.{1/3.}

The second display answers (3). Its first equality is the definition of conditional probability, which applies because P{X0+X2=4}=1/3>0.{\mathbb{P}\{X_0 + X_2 = 4\} = 1/3 > 0.} Its second equality holds because 1+3=4:{1 + 3 = 4{:}} the event {X0=1,X2=3}{\{X_0 = 1, X_2 = 3\}} is contained in {X0+X2=4},{\{X_0 + X_2 = 4\},} so their intersection is {X0=1,X2=3}{\{X_0 = 1, X_2 = 3\}} itself.

Finally, to determine the joint distribution of (X3,X4),{(X_3, X_4),} one has to compute, as in Figure 2,

P{X3=i,X4=j}=P{X4=j∣X3=i} P{X3=i}=pij3,i,j∈{1,2,3}.\mathbb{P}\{X_3 = i, X_4 = j\} = \mathbb{P}\{X_4 = j \mid X_3 = i\} \, \mathbb{P}\{X_3 = i\} = \frac{p_{ij}}{3}, \qquad i, j \in \{1, 2, 3\}.

Since X3X_3 and X4X_4 take finitely many values, their joint distribution is given by these nine numbers: the probability of any set of pairs is the sum of the numbers of its pairs. The first equality is again the definition of conditional probability, with P{X3=i}=1/3>0{\mathbb{P}\{X_3 = i\} = 1/3 > 0} by (1). The factor P{X4=j∣X3=i}{\mathbb{P}\{X_4 = j \mid X_3 = i\}} is pij:{p_{ij}{:}} by (1.1) of the first post, summed over the states i0,i1,i2{i_0, i_1, i_2} at times 0, 1 and 2,{2,}

P{X3=i,X4=j}=∑i0,i1,i2λi0pi0i1pi1i2pi2i pij=P{X3=i} pij,\mathbb{P}\{X_3 = i, X_4 = j\} = \sum_{i_0, i_1, i_2} \lambda_{i_0} p_{i_0 i_1} p_{i_1 i_2} p_{i_2 i} \, p_{ij} = \mathbb{P}\{X_3 = i\} \, p_{ij},

since the same sum without the factor pijp_{ij} is P{X3=i}.{\mathbb{P}\{X_3 = i\}.} The nine numbers pij/3{p_{ij}/3} are the entries of PP divided by 3,{3,} drawn in Figure 2;{2;} they add up to 1,{1,} because each row of PP adds up to 1.{1.} Then

E[X3X4]=∑i,j=13i⋅j⋅pij3=13(2⋅23+3⋅13+2⋅13+6⋅23+3⋅23+6⋅13)=113.\begin{aligned} \mathbb{E}[X_3 X_4] &= \sum_{i,j=1}^{3} i \cdot j \cdot \frac{p_{ij}}{3} \\ &= \frac13 \Big( 2 \cdot \frac23 + 3 \cdot \frac13 + 2 \cdot \frac13 + 6 \cdot \frac23 + 3 \cdot \frac23 + 6 \cdot \frac13 \Big) = \frac{11}{3}. \end{aligned}

The first equality is the expectation of a function of a random vector that takes finitely many values: E[g(X3,X4)]{\mathbb{E}[g(X_3, X_4)]} is the sum of g(i,j) P{X3=i,X4=j}{g(i, j) \, \mathbb{P}\{X_3 = i, X_4 = j\}} over all pairs (i,j),{(i, j),} here with g(i,j)=ij.{g(i, j) = i j.} In the second, the three pairs with i=j{i = j} are missing because p11=p22=p33=0,{p_{11} = p_{22} = p_{33} = 0,} and the six remaining terms are, in order, the pairs (1,2),{(1, 2),} (1,3),{(1, 3),} (2,1),{(2, 1),} (2,3),{(2, 3),} (3,1)(3, 1) and (3,2).{(3, 2).} Their sum is 43+1+23+4+2+2=11,{\frac43 + 1 + \frac23 + 4 + 2 + 2 = 11,} and one third of it is 11/3.{11/3.}

i = 102/91/9i = 21/902/9i = 32/91/90j = 1j = 2j = 3

Figure 2. The joint distribution of (X3,X4):{(X_3, X_4){:}} the cell in row ii and column jj holds P{X3=i,X4=j}=pij/3.{\mathbb{P}\{X_3 = i, X_4 = j\} = p_{ij}/3.}

A mouse in a maze

Exercise 2. A mouse runs through the maze of Figure 3. At each step it leaves the room it is in by choosing randomly, and with equal probability, one of the doors out of the room. Suppose there is always a door between two neighbouring rooms, and let XnX_n represent the position of the mouse at time n.n.
(1) Give the transition matrix PP for the Markov chain (Xn)n≥0.{(X_n)_{n \ge 0}.}
(2) Suppose that the mouse starts in room 1,{1,} that is, X0=1.{X_0 = 1.} Compute the probability that it arrives in room 6 after 3 steps.

123456

Figure 3. The maze of Exercise 2,{2,} with a door between any two neighbouring rooms. Dashed, the two routes of 3 steps from room 1 to room 6 of Solution 2.

Solution 2. The entry pijp_{ij} is the probability that the mouse, in room i,{i,} goes to room jj at the next step. It always leaves the room, so pii=0.{p_{ii} = 0.} If room ii has did_i doors, each door is chosen with probability 1/di,{1/d_i,} and each leads to a different neighbouring room: pij=1/di{p_{ij} = 1/d_i} when jj is a neighbour of i,{i,} and pij=0{p_{ij} = 0} otherwise. In Figure 3,{3,} rooms 1 and 2 have one door, to room 3;{3;} room 3 has four, to rooms 1,{1,} 2,{2,} 4 and 5;{5;} rooms 4 and 5 have two, to rooms 3 and 6;{6;} room 6 has two, to rooms 4 and 5.{5.} Row by row, the transition matrix PP is

P=(0010000010001/41/401/41/40001/2001/2001/2001/20001/21/20).P = \begin{pmatrix} 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 \\ 1/4 & 1/4 & 0 & 1/4 & 1/4 & 0 \\ 0 & 0 & 1/2 & 0 & 0 & 1/2 \\ 0 & 0 & 1/2 & 0 & 0 & 1/2 \\ 0 & 0 & 0 & 1/2 & 1/2 & 0 \end{pmatrix}.

Each row adds up to 1,{1,} as the row of a transition matrix must. Moreover, for the probability P{X3=6∣X0=1},{\mathbb{P}\{X_3 = 6 \mid X_0 = 1\},} one could compute p16(3)p^{(3)}_{16} directly. However, starting from the state 1,{1,} the mouse can reach the state 6 in 3 steps only along two routes, 1→3→4→6{1 \to 3 \to 4 \to 6} and 1→3→5→6,{1 \to 3 \to 5 \to 6,} drawn in Figure 3,{3,} thus

P{X3=6∣X0=1}=1⋅14⋅12+1⋅14⋅12=14.\mathbb{P}\{X_3 = 6 \mid X_0 = 1\} = 1 \cdot \frac14 \cdot \frac12 + 1 \cdot \frac14 \cdot \frac12 = \frac14.

To see why only these two routes count, recall that by the product formula (1.1) of the first post, p16(3)p^{(3)}_{16} is the sum, over the rooms kk and ll visited at times 1 and 2,{2,} of the probabilities of the paths from 1 to 6 through kk and l:{l{:}}

p16(3)=∑k,lp1k pkl pl6.p^{(3)}_{16} = \sum_{k, l} p_{1k} \, p_{kl} \, p_{l6}.

A term is positive only if its three factors are. From room 1 the only possible step is to room 3,{3,} since p13=1;{p_{13} = 1;} room 6 can be entered only from rooms 4 and 5;{5;} and from room 3 the mouse goes to 4 or to 5 with probability 1/41/4 each. So the sum has exactly two positive terms, p13 p34 p46=1⋅14⋅12=18{p_{13} \, p_{34} \, p_{46} = 1 \cdot \frac14 \cdot \frac12 = \frac18} and p13 p35 p56=18,{p_{13} \, p_{35} \, p_{56} = \frac18,} one for each route, and they add up to 1/4.{1/4.}

Communicating classes and periods

Exercise 3. Let (Xn)n≥0(X_n)_{n \ge 0} be a Markov chain with state space I={1,2,3,4,5}{I = \{1, 2, 3, 4, 5\}} and transition matrix

P=(01/61/301/21/2001/201/2001/2001/104/501/1000001).P = \begin{pmatrix} 0 & 1/6 & 1/3 & 0 & 1/2 \\ 1/2 & 0 & 0 & 1/2 & 0 \\ 1/2 & 0 & 0 & 1/2 & 0 \\ 0 & 1/10 & 4/5 & 0 & 1/10 \\ 0 & 0 & 0 & 0 & 1 \end{pmatrix}.

(1) Identify the communicating classes.
(2) Find the period of each state.

Solution 3. There are two communicating classes C1={1,2,3,4}{\mathcal{C}_1 = \{1, 2, 3, 4\}} and C2={5}.{\mathcal{C}_2 = \{5\}.} Moreover, C1\mathcal{C}_1 has period 2 and C2\mathcal{C}_2 has period 1.

C₁C₂11/61/21/31/21/21/101/24/51/21/1012345

Figure 4. The chain of Exercise 3 and its communicating classes C1\mathcal{C}_1 and C2.{\mathcal{C}_2.} Each arrow carries the probability of the jump.

A Markov chain defined inductively

Exercise 4. Let X0 ⁣:(Ω,F,P)→(I,2I){X_0 \colon (\Omega, \mathcal{F}, \mathbb{P}) \to (I, 2^I)} be a random variable, where II is a countable subset of R\mathbb{R} and 2I2^I is the power set of I.{I.} Let (Zn)n≥0(Z_n)_{n \ge 0} be a sequence of independent and identically distributed random variables from (Ω,F,P){(\Omega, \mathcal{F}, \mathbb{P})} to (E,E).{(E, \mathcal{E}).} Assume that X0X_0 and the sequence (Zn)n≥0(Z_n)_{n \ge 0} are also independent. Given a 2I⊗E{2^I \otimes \mathcal{E}}-measurable function f ⁣:I×E→I,{f \colon I \times E \to I,} define inductively

Xn+1:=f(Xn,Zn),n≥0.X_{n+1} := f(X_n, Z_n), \qquad n \ge 0.

Show that (Xn)n≥0(X_n)_{n \ge 0} is a Markov chain.

Solution 4. We first show that ZnZ_n is independent of (X0,…,Xn),{(X_0, \dots, X_n),} written Zn⊥(X0,…,Xn).{Z_n \perp (X_0, \dots, X_n).} Two random variables, or random vectors, are independent when the σ\sigma-algebras they generate are: P(A∩B)=P(A) P(B){\mathbb{P}(A \cap B) = \mathbb{P}(A) \, \mathbb{P}(B)} for every AA in the first and BB in the second. The σ\sigma-algebra σ{Y1,…,Ym}{\sigma\{Y_1, \dots, Y_m\}} generated by random variables is the smallest one that contains every event {Yk∈S}{\{Y_k \in S\}} with SS measurable. Note that by construction

X1=f(X0,Z0)=:g1(X0,Z0),X2=f(X1,Z1)=f(f(X0,Z0),Z1)=:g2(X0,Z0,Z1),X3=f(X2,Z2)=f(f(f(X0,Z0),Z1),Z2)=:g3(X0,Z0,Z1,Z2),\begin{aligned} X_1 &= f(X_0, Z_0) =: g_1(X_0, Z_0), \\ X_2 &= f(X_1, Z_1) = f(f(X_0, Z_0), Z_1) =: g_2(X_0, Z_0, Z_1), \\ X_3 &= f(X_2, Z_2) = f(f(f(X_0, Z_0), Z_1), Z_2) =: g_3(X_0, Z_0, Z_1, Z_2), \end{aligned}

and so on, where gi ⁣:I×Ei→I{g_i \colon I \times E^i \to I} is a 2I⊗E⊗i{2^I \otimes \mathcal{E}^{\otimes i}}-measurable function. In general g1=f{g_1 = f} and gi+1(x,z0,…,zi)=f(gi(x,z0,…,zi−1),zi),{g_{i+1}(x, z_0, \dots, z_i) = f(g_i(x, z_0, \dots, z_{i-1}), z_i),} so that Xi+1=gi+1(X0,Z0,…,Zi){X_{i+1} = g_{i+1}(X_0, Z_0, \dots, Z_i)} by induction. Each gi+1g_{i+1} is measurable: it is ff composed with the map that sends (x,z0,…,zi){(x, z_0, \dots, z_i)} to (gi(x,z0,…,zi−1),zi),{(g_i(x, z_0, \dots, z_{i-1}), z_i),} a map into a product whose two components are measurable, hence measurable, and a composition of measurable maps is measurable.

Since Zn⊥(X0,Z0,…,Zn−1),{Z_n \perp (X_0, Z_0, \dots, Z_{n-1}),} we have

σ{Zn}⊥σ{(X0,Z0,…,Zn−1)}=σ{X0,Z0,…,Zn−1}⊇σ{X0,…,Xn}=σ{(X0,…,Xn)},\begin{aligned} \sigma\{Z_n\} \perp \sigma\{(X_0, Z_0, \dots, Z_{n-1})\} &= \sigma\{X_0, Z_0, \dots, Z_{n-1}\} \\ &\supseteq \sigma\{X_0, \dots, X_n\} = \sigma\{(X_0, \dots, X_n)\}, \end{aligned}

that is, Zn⊥(X0,…,Xn).{Z_n \perp (X_0, \dots, X_n).} The hypothesis at the start holds because X0,Z0,Z1,…{X_0, Z_0, Z_1, \dots} are independent, the ZnZ_n among themselves and X0X_0 from all of them, and a variable of an independent family is independent of any group of the others. A random vector generates the same σ\sigma-algebra as its components, which gives both equalities. The inclusion holds because every XkX_k with k≤n{k \le n} is gk(X0,Z0,…,Zk−1),{g_k(X_0, Z_0, \dots, Z_{k-1}),} a measurable function of (X0,Z0,…,Zn−1):{(X_0, Z_0, \dots, Z_{n-1}){:}} each event {Xk=i}{\{X_k = i\}} is the preimage of a measurable set under this vector, so it belongs to its σ\sigma-algebra, which then contains σ{X0,…,Xn}.{\sigma\{X_0, \dots, X_n\}.} Independence of two σ\sigma-algebras passes to any smaller one, which gives the conclusion.

Denote by i0,i1,…,in,j{i_0, i_1, \dots, i_n, j} the states in I,{I,} with P{Xn=in,…,X0=i0}>0,{\mathbb{P}\{X_n = i_n, \dots, X_0 = i_0\} > 0,} so that the conditional probabilities below are defined. Then

P{Xn+1=j∣Xn=in,…,X0=i0}=P{f(Xn,Zn)=j∣Xn=in,…,X0=i0}=P{f(in,Zn)=j∣Xn=in,…,X0=i0}=P{f(in,Zn)=j∣Xn=in}=P{f(Xn,Zn)=j∣Xn=in}=P{Xn+1=j∣Xn=in}.\begin{aligned} \mathbb{P}\{X_{n+1} = j \mid X_n = i_n, \dots, X_0 = i_0\} &= \mathbb{P}\{f(X_n, Z_n) = j \mid X_n = i_n, \dots, X_0 = i_0\} \\ &= \mathbb{P}\{f(i_n, Z_n) = j \mid X_n = i_n, \dots, X_0 = i_0\} \\ &= \mathbb{P}\{f(i_n, Z_n) = j \mid X_n = i_n\} \\ &= \mathbb{P}\{f(X_n, Z_n) = j \mid X_n = i_n\} \\ &= \mathbb{P}\{X_{n+1} = j \mid X_n = i_n\}. \end{aligned}

The first equality is the definition Xn+1=f(Xn,Zn).{X_{n+1} = f(X_n, Z_n).} The second holds because on the event {Xn=in}{\{X_n = i_n\}} the variable f(Xn,Zn)f(X_n, Z_n) equals f(in,Zn),{f(i_n, Z_n),} so the two events {f(Xn,Zn)=j}{\{f(X_n, Z_n) = j\}} and {f(in,Zn)=j}{\{f(i_n, Z_n) = j\}} have the same intersection with the conditioning event, and a conditional probability depends only on that intersection. The fourth equality holds for the same reason, with the event {Xn=in}{\{X_n = i_n\}} alone, and the fifth is again the definition of Xn+1.{X_{n+1}.} The third equality is the Markov property itself, and it rests on the independence just shown.

To see it, write A={f(in,Zn)=j}{A = \{f(i_n, Z_n) = j\}} and C={Xn−1=in−1,…,X0=i0}.{C = \{X_{n-1} = i_{n-1}, \dots, X_0 = i_0\}.} The event AA belongs to σ{Zn}:{\sigma\{Z_n\}{:}} it is {Zn∈S}{\{Z_n \in S\}} with S={z∈E:f(in,z)=j},{S = \{z \in E : f(i_n, z) = j\},} and SS belongs to E\mathcal{E} because, for a fixed in,{i_n,} the map z↦f(in,z){z \mapsto f(i_n, z)} is measurable, as every section of a product-measurable function is. The events {Xn=in}{\{X_n = i_n\}} and {Xn=in}∩C{\{X_n = i_n\} \cap C} belong to σ{X0,…,Xn}.{\sigma\{X_0, \dots, X_n\}.} Here the third equality holds since

P{f(in,Zn)=j,Xn−1=in−1,…,X0=i0∣Xn=in}=P{f(in,Zn)=j,Xn=in,…,X0=i0}/P{Xn=in}=P{f(in,Zn)=j} P{Xn=in,…,X0=i0}/P{Xn=in}=P{f(in,Zn)=j∣Xn=in} P{Xn−1=in−1,…,X0=i0∣Xn=in},\begin{aligned} &\mathbb{P}\{f(i_n, Z_n) = j, X_{n-1} = i_{n-1}, \dots, X_0 = i_0 \mid X_n = i_n\} \\ &\quad = \mathbb{P}\{f(i_n, Z_n) = j, X_n = i_n, \dots, X_0 = i_0\} / \mathbb{P}\{X_n = i_n\} \\ &\quad = \mathbb{P}\{f(i_n, Z_n) = j\} \, \mathbb{P}\{X_n = i_n, \dots, X_0 = i_0\} / \mathbb{P}\{X_n = i_n\} \\ &\quad = \mathbb{P}\{f(i_n, Z_n) = j \mid X_n = i_n\} \, \mathbb{P}\{X_{n-1} = i_{n-1}, \dots, X_0 = i_0 \mid X_n = i_n\}, \end{aligned}

where P{f(in,Zn)=j}=P{f(in,Zn)=j∣Xn=in}{\mathbb{P}\{f(i_n, Z_n) = j\} = \mathbb{P}\{f(i_n, Z_n) = j \mid X_n = i_n\}} as Zn⊥Xn.{Z_n \perp X_n.} The first line of this display is P(A∩C∣Xn=in),{\mathbb{P}(A \cap C \mid X_n = i_n),} and the first equality is the definition of conditional probability, with P{Xn=in}>0{\mathbb{P}\{X_n = i_n\} > 0} because this event contains the one of positive probability fixed above. The second equality is the independence of AA and {Xn=in}∩C.{\{X_n = i_n\} \cap C.} The third splits the quotient into two factors: the independence of AA and {Xn=in}\{X_n = i_n\} gives P(A)=P(A∩{Xn=in})/P{Xn=in}=P(A∣Xn=in),{\mathbb{P}(A) = \mathbb{P}(A \cap \{X_n = i_n\}) / \mathbb{P}\{X_n = i_n\} = \mathbb{P}(A \mid X_n = i_n),} and the second factor is the definition of P(C∣Xn=in).{\mathbb{P}(C \mid X_n = i_n).}

The display says that, given {Xn=in},{\{X_n = i_n\},} the event AA is independent of the past C.{C.} Dividing it by P(C∣Xn=in),{\mathbb{P}(C \mid X_n = i_n),} which is positive because P{Xn=in,…,X0=i0}>0,{\mathbb{P}\{X_n = i_n, \dots, X_0 = i_0\} > 0,} gives the third equality:

P(A∣{Xn=in}∩C)=P(A∩C∣Xn=in)P(C∣Xn=in)=P(A∣Xn=in).\mathbb{P}(A \mid \{X_n = i_n\} \cap C) = \frac{\mathbb{P}(A \cap C \mid X_n = i_n)}{\mathbb{P}(C \mid X_n = i_n)} = \mathbb{P}(A \mid X_n = i_n).

The first equality here writes both conditional probabilities as quotients by P{Xn=in},{\mathbb{P}\{X_n = i_n\},} which cancels. It remains to see that the transition probabilities do not depend on n.{n.} By the independence of AA and {Xn=i},{\{X_n = i\},} as above, P{Xn+1=j∣Xn=i}=P{f(i,Zn)=j}=P{Zn∈S},{\mathbb{P}\{X_{n+1} = j \mid X_n = i\} = \mathbb{P}\{f(i, Z_n) = j\} = \mathbb{P}\{Z_n \in S\},} with S={z:f(i,z)=j}.{S = \{z : f(i, z) = j\}.} The ZnZ_n are identically distributed, that is, P{Zn∈S}=P{Z0∈S}{\mathbb{P}\{Z_n \in S\} = \mathbb{P}\{Z_0 \in S\}} for every SS in E,{\mathcal{E},} so this number is pij:=P{f(i,Z0)=j}{p_{ij} := \mathbb{P}\{f(i, Z_0) = j\}} for every n.{n.}

The numbers pijp_{ij} form a transition matrix: they are nonnegative, and ∑jpij=1{\sum_j p_{ij} = 1} by countable additivity, because f(i,Z0)f(i, Z_0) takes exactly one value in the countable set I.{I.} With λ\lambda the distribution of X0,{X_0,} conditions (i) and (ii) of Definition 1.2 of the first post hold, so (Xn)n≥0(X_n)_{n \ge 0} is Markov(λ,P).{\mathrm{Markov}(\lambda, P).}

A Markov chain from Bernoulli variables

Exercise 5. Let (Zn)n≥1(Z_n)_{n \ge 1} be a sequence of independent and identically distributed random variables with Bernoulli distribution B(1,q),{\mathcal{B}(1, q),} where 0<q<1,{0 < q < 1,} and let (Yn)n≥0(Y_n)_{n \ge 0} be the sequence of random variables defined by

Y0:=1,Yn+1:=Yn(2Zn+1−1).Y_0 := 1, \qquad Y_{n+1} := Y_n (2 Z_{n+1} - 1).

Prove that (Yn)n≥0(Y_n)_{n \ge 0} is a Markov chain and find its transition matrix.

Solution 5. The Markov property can be verified directly in terms of Exercise 4. Namely,

P{Yn+1=j∣Yn=in,…,Y0=i0}=P{Yn(2Zn+1−1)=j∣Yn=in,…,Y0=i0}=P{Yn+1=j∣Yn=in}.\begin{aligned} \mathbb{P}\{Y_{n+1} = j \mid Y_n = i_n, \dots, Y_0 = i_0\} &= \mathbb{P}\{Y_n (2 Z_{n+1} - 1) = j \mid Y_n = i_n, \dots, Y_0 = i_0\} \\ &= \mathbb{P}\{Y_{n+1} = j \mid Y_n = i_n\}. \end{aligned}

Indeed, Yn+1=f(Yn,Zn+1){Y_{n+1} = f(Y_n, Z_{n+1})} with f(y,z):=y(2z−1),{f(y, z) := y (2z - 1),} and Exercise 4 applies to the independent and identically distributed variables Z1,Z2,…,{Z_1, Z_2, \dots,} which are independent of the constant Y0=1.{Y_0 = 1.} In the notation of Exercise 4,{4,} the chain is Xn=Yn{X_n = Y_n} and the noise at time nn is Zn+1,{Z_{n+1},} with values in E={0,1}{E = \{0, 1\}} and its power set. A constant is independent of every random variable, because the events it generates are the empty set and the whole space. The function ff is measurable: the set I×E{I \times E} is countable, so each of its subsets is a countable union of points {(y,z)}={y}×{z},{\{(y, z)\} = \{y\} \times \{z\},} which belong to the product σ\sigma-algebra.

On the other hand, since Zn∼B(1,q),{Z_n \sim \mathcal{B}(1, q),} the variable 2Zn+1−1{2 Z_{n+1} - 1} takes values in {−1,+1},{\{-1, +1\},} so YnY_n also takes values in {−1,+1}\{-1, +1\} for all n≥0.{n \ge 0.} The Bernoulli distribution B(1,q){\mathcal{B}(1, q)} gives P{Z=1}=q{\mathbb{P}\{Z = 1\} = q} and P{Z=0}=1−q,{\mathbb{P}\{Z = 0\} = 1 - q,} so 2Zn+1−1{2 Z_{n+1} - 1} is +1+1 with probability qq and −1-1 with probability 1−q.{1 - q.} By induction, Y0=1,{Y_0 = 1,} and if YnY_n is ±1\pm 1 then Yn+1=±Yn{Y_{n+1} = \pm Y_n} is ±1{\pm 1} too: at each step the sign of YnY_n is kept when Zn+1=1{Z_{n+1} = 1} and changes when Zn+1=0.{Z_{n+1} = 0.} Thus the transition matrix PP of the Markov chain (Yn)n≥0(Y_n)_{n \ge 0} is a 2×2{2 \times 2} matrix, and

P=(p−1,−1p−1,+1p+1,−1p+1,+1)=(q1−q1−qq).P = \begin{pmatrix} p_{-1,-1} & p_{-1,+1} \\ p_{+1,-1} & p_{+1,+1} \end{pmatrix} = \begin{pmatrix} q & 1 - q \\ 1 - q & q \end{pmatrix}.

By Exercise 4,{4,} pij=P{f(i,Z1)=j}.{p_{ij} = \mathbb{P}\{f(i, Z_1) = j\}.} For i=−1{i = -1} this is P{−(2Z1−1)=j},{\mathbb{P}\{-(2 Z_1 - 1) = j\},} so p−1,−1=P{Z1=1}=q{p_{-1,-1} = \mathbb{P}\{Z_1 = 1\} = q} and p−1,+1=P{Z1=0}=1−q.{p_{-1,+1} = \mathbb{P}\{Z_1 = 0\} = 1 - q.} For i=+1{i = +1} it is P{2Z1−1=j},{\mathbb{P}\{2 Z_1 - 1 = j\},} so p+1,+1=q{p_{+1,+1} = q} and p+1,−1=1−q.{p_{+1,-1} = 1 - q.} The chain starts at +1,{+1,} its initial distribution is the point mass δ+1,{\delta_{+1},} and it keeps its sign with probability qq at every step.

+1−1010203040n

Figure 5. An instance: a path Y0,…,Y40{Y_0, \dots, Y_{40}} for the qq set by the slider, with the changes of sign marked. The button draws another path.