Tutorials › Stochastic Processes › Boolean Reachability From a Transition Matrix

Classification of States · Tutorial 128 of 994

Boolean Reachability From a Transition Matrix

Track positive transition probabilities and iteratively collect reachable states, stopping when a cumulative reachability set no longer grows.

Intermediate 12 min read

What You'll Learn

  • Translate a transition matrix into its zero-one support matrix.
  • Use Boolean matrix multiplication to track positive entries of successive powers.
  • Build cumulative reachable sets from a chosen initial state.
  • Prove why a stable cumulative set contains every accessible state.
  • Recognize why periodic powers can change after the reachability search is complete.
  • Check reachability calculations with exact transition probabilities.

From Transition Probabilities to Reachability

A transition matrix records more than the probabilities of individual moves: its powers also encode which states can be reached in a specified number of steps. For accessibility, the exact values often matter less than whether an entry is zero or positive. Replacing each positive entry by \(1\) turns the calculation into a finite bookkeeping problem, provided we keep track of paths of different lengths and stop only when no new states can be added.

Let \((X_n)_{n\ge0}\) be a discrete-time Markov chain on a finite state space \(S\), defined on a probability space \((\Omega,\mathcal{F},\mathbb{P})\), with row-stochastic transition matrix \(P=(p_{ij})\). Thus \(p_{ij}\ge0\) and \(\sum_{j\in S}p_{ij}=1\) for each \(i\). Write \(P^{(n)}=P^n\), with \(P^{(0)}=I\). We say \(j\) is accessible from \(i\) if \(p_{ij}^{(n)}>0\) for some integer \(n\ge0\). The choice \(n=0\) makes every state accessible from itself by a path of length zero; it does not assert that the chain returns there at a positive time.

Definition: The support matrix \(B=(b_{ij})\) of \(P\) is the zero-one matrix defined by \(b_{ij}=1\) if \(p_{ij}>0\), and \(b_{ij}=0\) if \(p_{ij}=0\). For zero-one matrices \(C,D\), their Boolean product is the matrix \(C\odot D\) with \((C\odot D)_{ij}=1\) exactly when there is some \(k\in S\) such that \(c_{ik}=1\) and \(d_{kj}=1\); otherwise \((C\odot D)_{ij}=0\).

Boolean multiplication uses “and” along a two-step route and “or” across possible intermediate states. In contrast, ordinary matrix multiplication multiplies probabilities along each route and adds over routes. Since all transition probabilities are nonnegative, a sum of route probabilities is positive exactly when at least one route has positive probability.

Theorem (Support of a matrix power): For every integer \(n\ge0\), the \((i,j)\) entry of \(B^{\odot n}\) is \(1\) exactly when \(p_{ij}^{(n)}>0\), where \(B^{\odot0}=I\) and \(B^{\odot(n+1)}=B^{\odot n}\odot B\).

Proof. For \(n=0\), \(P^{(0)}=I\), so its positive entries are exactly the diagonal entries, which are also the \(1\) entries of \(B^{\odot0}=I\). Suppose the assertion holds at \(n\). Matrix multiplication gives \(p_{ij}^{(n+1)}=\sum_{k\in S}p_{ik}^{(n)}p_{kj}\). Every term is nonnegative, so this sum is positive if and only if at least one term is positive. A term is positive exactly when \(p_{ik}^{(n)}>0\) and \(p_{kj}>0\). By the induction hypothesis and the definition of \(B\), this is exactly the condition \((B^{\odot n}\odot B)_{ij}=1\). This proves the assertion at \(n+1\), and induction completes the proof. \(\square\)

The theorem gives an exact test for accessibility, but checking powers one at a time is not the safest stopping rule. A chain can move among the same states in a repeating pattern, so the support of \(P^{(n)}\) may keep changing even after every accessible state has been found. Instead, take the union of states reached at all lengths up to the current step.

Definition: For a starting state \(i\), let \(R_0(i)=\{i\}\) and define \(R_{m+1}(i)=R_m(i)\cup\{j\in S:\text{ there is }k\in R_m(i)\text{ with }p_{kj}>0\}\). Thus \(R_m(i)\) contains the states accessible from \(i\) in at most \(m\) steps.
Theorem (Finite reachability algorithm): For finite \(S\), the iteration for \(R_m(i)\) stops adding states: for some \(m\le |S|-1\), \(R_{m+1}(i)=R_m(i)\). At that point \(R_m(i)\) is exactly the set of states accessible from \(i\). Consequently, repeating the procedure for each \(i\in S\) determines all accessibility relations.

Proof. First, \(R_m(i)\) contains exactly the states accessible in at most \(m\) steps. This holds for \(m=0\) by the definition of a length-zero path. If it holds at \(m\), a path of at most \(m+1\) steps either already has length at most \(m\), or ends with one positive-probability transition from a state reached in at most \(m\) steps. Those are precisely the two parts of the definition of \(R_{m+1}(i)\), proving the claim by induction.

Each set contains its predecessor. If an iteration adds a state, its size increases by at least one; since \(R_0(i)\) has size one and \(S\) has \(|S|\) states, there can be at most \(|S|-1\) such increases. If \(R_{m+1}(i)=R_m(i)\), every one-step successor of every state in \(R_m(i)\) is already in \(R_m(i)\). Inductively, a path starting in \(R_m(i)\) stays in that set at every later step. In particular, no later path from \(i\) can reach a state outside it. The first part of the proof shows every state in \(R_m(i)\) is accessible, so the set is exactly the accessible set. This proves both termination and correctness. \(\square\)

Worked Reachability Calculations

Worked Example: A Chain with Successive New States

For \(S=\{1,2,3,4\}\), consider

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

Each row sums to \(1\): the row sums are \(\tfrac12+\tfrac12=1\), \(\tfrac13+\tfrac23=1\), \(\tfrac14+\tfrac34=1\), and \(1=1\). From state \(1\), the positive one-step transitions give \(R_0(1)=\{1\}\) and \(R_1(1)=\{1,2\}\). State \(2\) can move to \(3\), so \(R_2(1)=\{1,2,3\}\). State \(3\) can move to \(4\), so \(R_3(1)=\{1,2,3,4\}\). All states are now included, and the next iteration adds none.

For a numerical check against the powers, the first row of \(P^2\) is found by multiplying the first row of \(P\) by \(P\): its entries are \(\tfrac14\), \(\tfrac14+\tfrac16=\tfrac5{12}\), \(\tfrac13\), and \(0\). They sum to \(\tfrac14+\tfrac5{12}+\tfrac13=1\). The first row of \(P^3\) is then \((\tfrac18,\tfrac{19}{72},\tfrac{13}{36},\tfrac14)\). Its entries sum to \(\tfrac9{72}+\tfrac{19}{72}+\tfrac{26}{72}+\tfrac{18}{72}=1\). The positive entries show state \(4\) is reached from state \(1\) in three steps, matching the cumulative-set calculation.

Worked Example: A Reachable State That Takes Three Steps

Consider the transition matrix on \(S=\{1,2,3,4\}\):

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

The row sums are \(\tfrac12+\tfrac12=1\), \(\tfrac12+\tfrac12=1\), \(\tfrac13+\tfrac23=1\), and \(1=1\). Start from state \(2\). The sets are \(R_0(2)=\{2\}\), \(R_1(2)=\{1,2\}\), and \(R_2(2)=\{1,2,3\}\). To check the second step directly, the row for state \(2\) in \(P^2\) is \((\tfrac14,\tfrac12,\tfrac14,0)\): it is one-half of row \(1\) plus one-half of row \(2\). The entries sum to \(\tfrac14+\tfrac12+\tfrac14=1\).

At the next step, state \(3\) can move to \(4\), so \(R_3(2)=\{1,2,3,4\}\). In fact, the probability of the three-step route \(2\to1\to3\to4\) is \(\tfrac12\cdot\tfrac12\cdot\tfrac23=\tfrac16>0\), confirming \(p_{24}^{(3)}>0\). Since the set now contains every state, no further iteration can add a state.

Worked Example: Periodic Powers and a Stable Cumulative Set

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

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

Every row sums to \(1\). From state \(1\), \(R_0(1)=\{1\}\), \(R_1(1)=\{1,2\}\), and \(R_2(1)=\{1,2\}\), so the cumulative set has stopped growing. Yet the exact powers alternate: \(P^2=I\) and \(P^3=P\). For example, the support of row \(1\) is \(\{1\}\) at \(n=2\) and \(\{2\}\) at \(n=3\). Those changes do not indicate new accessibility: both states were already in the cumulative set. State \(3\) is never added, because neither \(1\) nor \(2\) has a positive transition to it.

Practical Checks and a Common Mistake

The reachability computation depends only on which entries are exactly positive, not on their magnitudes. With exact fractions, the distinction between zero and positive is unambiguous. When probabilities are represented by rounded numerical values, a small computed value should not automatically be treated as a positive transition: the support matrix must come from the specified transition matrix, not from an arbitrary numerical tolerance.

Common mistake: checking only one step. For example, on \(S=\{1,2,3\}\), let

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

Each row sums to \(1\). Since \(p_{13}=0\), it is wrong to conclude that \(3\) is inaccessible from \(1\). The two-step probability is \(p_{13}^{(2)}=p_{12}p_{23}=1\cdot1=1\), so \(3\in R_2(1)\). The correction is to follow positive transitions repeatedly and stop only when the cumulative set does not grow.

For each starting state, the method can be summarized as follows:

1
Record the support.
Set \(b_{ij}=1\) for a positive transition and \(b_{ij}=0\) for a zero transition.
2
Initialize the search.
Begin with the starting state alone, \(R_0(i)=\{i\}\).
3
Add one-step successors.
Include every state with a positive transition from a state already in the set.
4
Test for growth.
If the set is unchanged, it contains exactly the accessible states; otherwise repeat.

The finite-state assumption is what guarantees that this cumulative search terminates after finitely many additions. It is not necessary for the exact support identity for a fixed power, but without a finite state space this finite stopping argument does not apply. Also keep the length-zero convention in mind: the identity matrix makes \(i\) accessible from itself, while a question about a positive-time return requires checking a positive-length path instead.

Check Your Understanding

Use positive transitions and cumulative reachable sets; where asked, verify the calculation from a matrix power.

  1. For the chain in the first worked example, list \(R_1(2)\), \(R_2(2)\), and the final stable set starting from \(2\).
  2. Explain why a positive entry of \(P^n\) corresponds to at least one positive-probability path of length \(n\).
  3. In the second worked example, calculate the probability of the path \(2\to1\to3\to4\) and state what it implies about \(p_{24}^{(3)}\).
  4. For the periodic three-state example, why is it incorrect to stop merely because the support of one power is being compared with the support of the next?
  5. Under the length-zero convention, is each state accessible from itself? What would need to be checked to establish a positive-time return?