Tutorials › Stochastic Processes › Constructing Finite Chains from Independent Uniforms

Markov Chains: Definitions and Transition Matrices · Tutorial 96 of 994

Constructing Finite Chains from Independent Uniforms

Learn how state-dependent interval partitions and independent uniform random variables produce a chain with a prescribed transition matrix.

Beginner 11 min read

What You'll Learn

  • Define disjoint interval sets from each row of a finite transition matrix.
  • Handle zero transition probabilities and the endpoint 1 correctly.
  • Prove that the uniform-driven recursion has the specified conditional transition probabilities.
  • Derive the probability of a finite state path from the construction.
  • Check exact transition probabilities and sample paths in worked examples.
  • Identify why endpoint conventions matter even when an endpoint has probability zero.

From Transition Probabilities to Random Updates

A transition matrix describes the probabilities of moving from each state, but it does not by itself specify how to generate a sample path. A useful construction turns each row of the matrix into a partition of the unit interval. At time \(n\), the current state selects the row, and an independent uniform random variable selects a part of that row’s partition. This gives a direct way to build a chain with the desired transitions.

Let \(S=\{s_1,\ldots,s_m\}\) be a finite state space with a fixed ordering, and let \(P=(p_{ij})\) be a row-stochastic matrix: \(p_{ij}\ge 0\) and \(\sum_{j=1}^m p_{ij}=1\) for every \(i\). Work on a probability space \((\Omega,\mathcal F,\mathbb P)\). Let \(U_0,U_1,\ldots\) be independent random variables, each uniform on \([0,1]\), and let \(X_0\) be an \(S\)-valued random variable independent of all the \(U_n\), with initial distribution \(\mu\). For row \(i\), form the cumulative sums

$$ c_{i0}=0,\qquad c_{ij}=\sum_{\ell=1}^{j}p_{i\ell}\quad (1\le j\le m). $$

Thus \(c_{im}=1\). To make a disjoint partition, assign the intervals \([c_{i,j-1},c_{ij})\) to states \(s_j\) for \(j<m\), and assign \([c_{i,m-1},1)\cup\{1\}\) to the last state \(s_m\). Denote the assigned set by \(A_{ij}\). The singleton \(\{1\}\) is included so the construction is defined for every possible value of a uniform variable, not just almost surely.

Definition: The uniform-driven recursion associated with \(P\) is \(X_{n+1}=s_j\) when \(X_n=s_i\) and \(U_n\in A_{ij}\). The interval lengths are the transition probabilities: \(\mathbb P(U_n\in A_{ij})=p_{ij}\). If \(p_{im}=0\), then \([c_{i,m-1},1)=[1,1)\) is empty, but \(A_{im}\) still contains \(\{1\}\); this singleton has probability zero, so the transition probability remains zero.

The convention at 1 resolves a small but important issue. Half-open intervals avoid overlap at interior cut points, and assigning 1 to the final state completes the partition of \([0,1]\). When a final transition probability is zero, the resulting assigned set is not empty: it is the singleton \(\{1\}\), whose probability is nevertheless zero.

Why the Construction Has the Required Transitions

Theorem: The recursion above defines an \(S\)-valued process whose one-step conditional probabilities satisfy \(\mathbb P(X_{n+1}=s_j\mid\mathcal F_n)=p_{ij}\) on \(\{X_n=s_i\}\), almost surely, where \(\mathcal F_n=\sigma(X_0,U_0,\ldots,U_{n-1})\). Consequently, \((X_n)_{n\ge0}\) is a time-homogeneous Markov chain with transition matrix \(P\) and initial distribution \(\mu\).

Proof. The sets \(A_{i1},\ldots,A_{im}\) are disjoint and have union \([0,1]\), so exactly one next state is assigned for every current state and every value of \(U_n\). The random variable \(X_n\) is \(\mathcal F_n\)-measurable, while \(U_n\) is independent of \(\mathcal F_n\), because \(X_0\) and the uniforms are independent and the variables \(U_0,\ldots,U_{n-1}\) are the only uniforms in \(\mathcal F_n\). For each \(i,j\), the set \(A_{ij}\) has Lebesgue measure \(p_{ij}\): its interval part has length \(c_{ij}-c_{i,j-1}=p_{ij}\), and adding the singleton \(\{1\}\), when applicable, does not change its measure. Therefore, using the independence of \(U_n\) from \(\mathcal F_n\),

$$ \begin{aligned} \mathbb P(X_{n+1}=s_j\mid\mathcal F_n) &=\sum_{i=1}^m \mathbf 1_{\{X_n=s_i\}}\, \mathbb P(U_n\in A_{ij}\mid\mathcal F_n)\\ &=\sum_{i=1}^m \mathbf 1_{\{X_n=s_i\}}p_{ij} =p_{ij}\quad\text{on }\{X_n=s_i\}. \end{aligned} $$

This conditional probability depends on the past only through \(X_n\), which is the Markov property, and it uses the same matrix \(P\) at every time, which makes the chain time-homogeneous. Since \(X_0\) has distribution \(\mu\), the chain has the stated initial distribution. \(\square\)

The same construction also gives the probability of any finite state path. This is useful for checking that it has the intended law, not just the intended one-step probabilities.

Path probability formula: For \(k\ge 1\) and states \(i_0,\ldots,i_k\in\{1,\ldots,m\}\), the constructed chain satisfies \(\mathbb P(X_0=s_{i_0},\ldots,X_k=s_{i_k})=\mu_{i_0}\prod_{r=0}^{k-1}p_{i_r i_{r+1}}\).

Proof. For \(k=1\), condition on \(\mathcal F_0=\sigma(X_0)\). On the event \(\{X_0=s_{i_0}\}\), the conditional probability of \(X_1=s_{i_1}\) is \(p_{i_0i_1}\), so the joint probability is \(\mu_{i_0}p_{i_0i_1}\). For a general \(k\), the event \(\{X_0=s_{i_0},\ldots,X_{k-1}=s_{i_{k-1}}\}\) belongs to \(\mathcal F_{k-1}\). Conditioning on \(\mathcal F_{k-1}\), the probability of the additional event \(X_k=s_{i_k}\) is \(p_{i_{k-1}i_k}\) on that path event. Thus each added step multiplies the preceding path probability by its corresponding transition probability. Starting with \(\mathbb P(X_0=s_{i_0})=\mu_{i_0}\) gives the formula. \(\square\)

In particular, the construction specifies all finite path probabilities from \(\mu\) and \(P\). Different choices on probability-zero endpoints would not change those probabilities, but a complete endpoint convention makes the recursion an unambiguous function for every input.

Worked Constructions

Worked Example: A Three-State Chain

Let \(S=\{A,B,C\}\), in that order, and take

$$ P= \begin{bmatrix} \tfrac12&\tfrac13&\tfrac16\\ 0&\tfrac23&\tfrac13\\ 1&0&0 \end{bmatrix}. $$

Before using the matrix, check each row: \(\tfrac12+\tfrac13+\tfrac16=\tfrac36+\tfrac26+\tfrac16=1\); \(0+\tfrac23+\tfrac13=1\); and \(1+0+0=1\). The cumulative sums and assigned sets are therefore as follows. From \(A\), the cut points are \(0,\tfrac12,\tfrac56,1\), giving \(A_{A,A}=[0,\tfrac12)\), \(A_{A,B}=[\tfrac12,\tfrac56)\), and \(A_{A,C}=[\tfrac56,1]\). From \(B\), the cut points are \(0,0,\tfrac23,1\), giving \(\varnothing\), \([0,\tfrac23)\), and \([\tfrac23,1]\). From \(C\), the cut points are \(0,1,1,1\), giving \([0,1)\), \(\varnothing\), and \(\{1\}\).

For example, if the current state is \(A\), then \(U_n=\tfrac23\) lies in \([\tfrac12,\tfrac56)\), so the next state is \(B\). If the current state is \(B\) and \(U_n=\tfrac34\), the next state is \(C\). If the current state is \(C\) and \(U_n=\tfrac12\), the next state is \(A\). Thus those three specified input values produce the path \(A,B,C,A\) when the starting state is \(A\). Its probability, conditional on starting at \(A\), is \(\tfrac13\cdot\tfrac13\cdot1=\tfrac19\), by the path probability formula. The numerical product is \(\tfrac13\cdot\tfrac13=\tfrac19\), and \(\tfrac19\cdot1=\tfrac19\), as required.

Check: The interval lengths for the row of \(C\) are \(1,0,0\): the first interval has length \(1-0=1\), the second is empty, and the interval part of the final assigned set \(\{1\}\) has length \(0\). Hence the endpoint assignment does not change the row’s transition probabilities.

Worked Example: A Two-State Chain and Its Initial Law

Let \(S=\{1,2\}\) and

$$ P= \begin{bmatrix} \tfrac34&\tfrac14\\ \tfrac13&\tfrac23 \end{bmatrix}, \qquad \mu=\left(\tfrac25,\tfrac35\right). $$

The first row sums to \(\tfrac34+\tfrac14=1\), and the second sums to \(\tfrac13+\tfrac23=1\). In state 1, use \([0,\tfrac34)\) for the next state 1 and \([\tfrac34,1]\) for the next state 2. In state 2, use \([0,\tfrac13)\) for the next state 1 and \([\tfrac13,1]\) for the next state 2.

To check the initial distribution’s one-step consequences, compute each coordinate of \(\mu P\). The probability of state 1 at time 1 is \(\tfrac25\cdot\tfrac34+\tfrac35\cdot\tfrac13=\tfrac3{10}+\tfrac15=\tfrac12\). The probability of state 2 is \(\tfrac25\cdot\tfrac14+\tfrac35\cdot\tfrac23=\tfrac1{10}+\tfrac25=\tfrac12\). Thus \(\mu P=(\tfrac12,\tfrac12)\), which sums to 1.

For a sample-path calculation, take \(X_0=1\) and suppose the successive uniform inputs are \(\tfrac18,\tfrac78,\tfrac12\). Since \(\tfrac18<\tfrac34\), the first update gives \(X_1=1\). Since \(\tfrac78\ge\tfrac34\), the second gives \(X_2=2\). Since \(\tfrac12\ge\tfrac13\), the third gives \(X_3=2\). The resulting path is \(1,1,2,2\). Its probability conditional on \(X_0=1\) is \(\tfrac34\cdot\tfrac14\cdot\tfrac23\). Recomputing, \(\tfrac34\cdot\tfrac14=\tfrac3{16}\) and \(\tfrac3{16}\cdot\tfrac23=\tfrac6{48}=\tfrac18\).

Check: The interval rules give the three path transitions probabilities \(\tfrac34,\tfrac14,\tfrac23\), respectively; their product is \(\tfrac18\), matching the path formula.

Worked Example: A Zero Final Probability

Consider two states and the matrix

$$ P= \begin{bmatrix} 1&0\\ \tfrac12&\tfrac12 \end{bmatrix}. $$

The first row sums to \(1+0=1\), and the second to \(\tfrac12+\tfrac12=1\). In state 1, the cut points are \(0,1,1\). The first state is assigned \([0,1)\), while the last state is assigned \([1,1)\cup\{1\}=\{1\}\). The interval part \([1,1)\) is empty, but the assigned set for state 2 is not empty: it contains the endpoint 1.

If the chain is in state 1, then \(\mathbb P(X_{n+1}=1\mid X_n=1)=\mathbb P(U_n\in[0,1))=1\), because a uniform variable on \([0,1]\) equals 1 with probability zero. Also, \(\mathbb P(X_{n+1}=2\mid X_n=1)=\mathbb P(U_n=1)=0\). Yet the update is still defined when \(U_n=1\): in that exceptional case it sends the chain to state 2. This is consistent with the transition matrix, since the exceptional input has probability zero.

Check: The first assigned set has length \(1-0=1\); the interval part of the second has length \(1-1=0\), and its added singleton has probability zero. The resulting transition probabilities are exactly \(1\) and \(0\).

Endpoint Conventions and a Common Error

At a cut point \(c_{ij}\), the half-open convention assigns the point to the interval on its right, except at 1, which belongs to the final state’s assigned set. For example, in the three-state example, a uniform value of \(\tfrac12\) from state \(A\) belongs to \([\tfrac12,\tfrac56)\), so it selects \(B\), not \(A\). The choice at a single cut point does not alter transition probabilities because any specified point has uniform probability zero; it does matter for making the update rule single-valued.

Common mistake. Replacing every interval by a closed interval can make the update ambiguous. In the row for state \(A\) in the first example, the incorrect sets \([0,\tfrac12]\) and \([\tfrac12,\tfrac56]\) both contain \(\tfrac12\). One input would then prescribe two next states. Use \([0,\tfrac12)\) and \([\tfrac12,\tfrac56)\) instead, and assign 1 only to the final set. A related error is to say that a zero-length final set is always empty: when the last transition probability is zero, its interval part is \([1,1)=\varnothing\), but the endpoint convention adds \(\{1\}\). That singleton is nonempty and has probability zero.

The construction is useful for simulating a finite chain and for specifying its transitions explicitly from independent randomness. Its justification depends on two ingredients: each row partitions the unit interval into sets of the prescribed lengths, and the uniform variable used at step \(n\) is independent of the information available through time \(n\). If the uniforms were dependent on the past, the conditional transition probabilities need not equal the row entries, even if each uniform separately had a uniform distribution.

Check Your Understanding

Use the stated interval convention in each question, and show the row-sum and probability calculations that support your answers.

  1. For the row \((\tfrac14,\tfrac34)\), write the assigned sets and determine which state is selected when \(U_n=\tfrac14\).
  2. For the row \((0,1,0)\) on three ordered states, write all three assigned sets. Which set contains 1, and what is its probability?
  3. Explain why independence of \(U_n\) from \(\mathcal F_n\) is needed to obtain the conditional transition probabilities.
  4. For a path \(s_1,s_2,s_1\), write its probability in terms of \(\mu\) and the entries of \(P\).
  5. Give one reason that closed intervals at every cut point fail to define an unambiguous update rule.