Tutorials › Stochastic Processes › Expected Visits from the Fundamental Matrix

Absorption, Hitting Times and First-Step Analysis · Tutorial 241 of 994

Expected Visits from the Fundamental Matrix

Use the fundamental matrix to calculate expected visits to transient states, with the initial visit included when the chain starts there.

Intermediate 10 min read

What You'll Learn

  • Define the visit count to a transient state before absorption.
  • Interpret each entry of the fundamental matrix as an expected visit count.
  • Determine whether the starting visit is included.
  • Derive the first-step recursion for expected visits.
  • Compute and verify expected visit counts in finite absorbing chains.
  • Identify and correct the common off-by-one error.

What Does an Entry of the Fundamental Matrix Count?

In an absorbing Markov chain, the fundamental matrix records more than a matrix inverse: each of its entries has a direct counting interpretation. Starting from one transient state, an entry tells us the expected number of visits to another transient state before absorption. The convention about time zero matters. If the chain starts in the state being counted, that initial visit is included.

Work on a probability space \((\Omega,\mathcal{F},\mathbb{P})\), and let \((X_n)_{n\ge0}\) be a discrete-time Markov chain on a finite state space \(S\), with transition matrix \(P=(p_{ij})\). Its natural filtration is \(\mathcal{F}_n=\sigma(X_0,\ldots,X_n)\). A state \(i\) is absorbing if \(p_{ii}=1\). A state \(i\) is transient if its probability of ever returning after time zero is less than one: \(\mathbb{P}_i(T_i^+<\infty)<1\), where \(T_i^+=\inf\{n\ge1:X_n=i\}\). In particular, merely leaving a state with probability one on the next step does not make it transient.

Suppose the states have been ordered so that the transient states come first and the absorbing states last, and write the transition matrix in canonical form as

$$ P= \begin{bmatrix} Q&R\\ 0&I \end{bmatrix}. $$

Here \(Q\) gives transitions between transient states, and \(R\) gives transitions from transient to absorbing states. Every row of \(P\) sums to one. Assume absorption occurs almost surely from each transient starting state. The fundamental-matrix result for finite absorbing chains gives convergence of \(\sum_{n=0}^{\infty}Q^n\) and the identity \(N=(I-Q)^{-1}=\sum_{n=0}^{\infty}Q^n\). This tutorial focuses on what the entries of \(N\) count.

Definition: For transient states \(i\) and \(j\), let \(T_A=\inf\{n\ge0:X_n\in A\}\), where \(A\) is the set of absorbing states. Starting from \(i\), define the number of visits to \(j\) before absorption by \(V_j=\sum_{n=0}^{T_A-1}\mathbf{1}_{\{X_n=j\}}\). The sum includes time \(n=0\); it stops just before the first visit to an absorbing state. Then \(N(i,j)\) is the expected value \(\mathbb{E}_i[V_j]\).

Because the chain starts in a transient state, \(T_A\ge1\). Thus the visit at time zero is counted if and only if the starting state is \(j\). Visits after the chain enters an absorbing state are not counted. Under the almost-sure absorption assumption, the count \(V_j\) is finite almost surely.

Why the Entry Gives an Expected Visit Count

The key connection is between powers of \(Q\) and visits at a fixed time. For transient states \(i,j\), the entry \(Q^n(i,j)\) is the probability that the chain is at \(j\) at time \(n\) without having entered an absorbing state. In particular, for \(n=0\), \(Q^0=I\), so \(Q^0(i,j)\) is one when \(i=j\) and zero otherwise. This identity at time zero is precisely where the initial visit enters.

Theorem: For a finite absorbing chain whose absorption time \(T_A\) is almost surely finite from every transient state, the expected number of visits to transient state \(j\), before absorption and including time zero, when the chain starts at transient state \(i\), is \(N(i,j)\).

Proof. Fix transient states \(i\) and \(j\), and start the chain at \(i\). For each \(n\ge0\), the event \(\{n<T_A,\ X_n=j\}\) says that the chain is in \(j\) at time \(n\) before absorption. Since every state visited before \(T_A\) is transient, the Markov property and multiplication of transition probabilities give \(\mathbb{P}_i(n<T_A,\ X_n=j)=Q^n(i,j)\). This also holds for \(n=0\), because \(Q^0(i,j)=\mathbf{1}_{\{i=j\}}\). The visit count can therefore be written as \(V_j=\sum_{n\ge0}\mathbf{1}_{\{n<T_A,\ X_n=j\}}\). Its partial sums increase to \(V_j\), so the monotone convergence theorem gives \(\mathbb{E}_i[V_j]=\sum_{n\ge0}\mathbb{P}_i(n<T_A,\ X_n=j)=\sum_{n\ge0}Q^n(i,j)=N(i,j)\). The last equality is the fundamental-matrix identity under the stated absorption assumption. \(\square\)

The same interpretation gives a useful recursion. From state \(i\), there is an immediate visit to \(j\) exactly when \(i=j\). After one step, if the chain moves to transient state \(k\), its expected number of subsequent visits to \(j\) is \(N(k,j)\); if it moves to an absorbing state, there are no further visits before absorption. Thus the expected count consists of the time-zero contribution plus the expected count after the first step.

Proposition: For any transient states \(i,j\), \(N(i,j)=\mathbf{1}_{\{i=j\}}+\sum_k q_{ik}N(k,j)\), where the sum is over transient states \(k\). Equivalently, \(N=I+QN\).

Proof. Start at transient state \(i\). Separate the count \(V_j\) into its time-zero contribution \(\mathbf{1}_{\{i=j\}}\) and the visits after the first transition. Conditional on \(X_1=k\) for a transient state \(k\), the Markov property says that the expected number of later visits to \(j\) is \(N(k,j)\). The probability of this transition is \(q_{ik}\). A transition to an absorbing state contributes zero later visits. Taking expectations gives \(N(i,j)=\mathbf{1}_{\{i=j\}}+\sum_k q_{ik}N(k,j)\). Applying this identity to every pair of transient states yields \(N=I+QN\). \(\square\)

Taking \(i=j\) in the definition, the chain is already at \(j\) at time zero, so \(V_j\ge1\) for every path started at \(j\). Consequently \(N(j,j)\ge1\). For \(i\ne j\), no such initial visit is present, and \(N(i,j)\) counts only visits after the chain has moved away from its starting state.

Worked Visit Counts

Worked Example: Two Transient States with Repeated Returns

Consider states \(1,2\) as transient and state \(3\) as absorbing, with transition matrix

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

Check the rows before calculating: row \(1\) sums to \(\tfrac12+\tfrac14+\tfrac14=1\), row \(2\) sums to \(\tfrac14+\tfrac12+\tfrac14=1\), and row \(3\) sums to \(0+0+1=1\). From each transient state there is probability \(\tfrac14\) of absorption at each step, so absorption is almost sure. The transient block is \(Q=\begin{bmatrix}\tfrac12&\tfrac14\\\tfrac14&\tfrac12\end{bmatrix}\).

Compute \(I-Q=\begin{bmatrix}\tfrac12&-\tfrac14\\-\tfrac14&\tfrac12\end{bmatrix}\). Its determinant is \(\tfrac12\cdot\tfrac12-(-\tfrac14)(-\tfrac14)=\tfrac14-\tfrac1{16}=\tfrac3{16}\). Therefore

$$ N=(I-Q)^{-1} =\frac{16}{3} \begin{bmatrix} \tfrac12&\tfrac14\\ \tfrac14&\tfrac12 \end{bmatrix} = \begin{bmatrix} \tfrac83&\tfrac43\\ \tfrac43&\tfrac83 \end{bmatrix}. $$

Starting at state \(1\), the expected number of visits to state \(1\) before absorption is \(N(1,1)=\tfrac83\), including the initial visit. The expected number of visits to state \(2\) is \(N(1,2)=\tfrac43\). Starting at state \(2\), the corresponding expected counts are \(N(2,1)=\tfrac43\) and \(N(2,2)=\tfrac83\).

Check: The first row of \(I+QN\) is \((1,0)+(\tfrac12,\tfrac14)\begin{bmatrix}\tfrac83&\tfrac43\\\tfrac43&\tfrac83\end{bmatrix}=(1,0)+(\tfrac53,\tfrac43)=(\tfrac83,\tfrac43)\). The second row is \((0,1)+(\tfrac14,\tfrac12)N=(0,1)+(\tfrac43,\tfrac53)=(\tfrac43,\tfrac83)\). Thus the calculated matrix satisfies the visit recursion.

Worked Example: A Deterministic Path and the Initial Visit

Let the chain move from state \(1\) to state \(2\) with probability one, then from state \(2\) to absorbing state \(3\) with probability one; state \(3\) stays at \(3\). The full matrix is

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

Each row sums to one: \(0+1+0=1\), \(0+0+1=1\), and \(0+0+1=1\). Absorption occurs from either transient starting state. Here \(Q=\begin{bmatrix}0&1\\0&0\end{bmatrix}\), so \(Q^2=\begin{bmatrix}0&0\\0&0\end{bmatrix}\). Hence

$$ N=I+Q+Q^2+\cdots =\begin{bmatrix}1&0\\0&1\end{bmatrix} +\begin{bmatrix}0&1\\0&0\end{bmatrix} =\begin{bmatrix}1&1\\0&1\end{bmatrix}. $$

Starting at state \(1\), the chain visits state \(1\) once, at time zero, and state \(2\) once, at time one. The first row \((1,1)\) records those counts. Starting at state \(2\), the chain visits state \(1\) zero times and state \(2\) once, giving the second row \((0,1)\).

Check: \(I+QN=\begin{bmatrix}1&0\\0&1\end{bmatrix}+\begin{bmatrix}0&1\\0&0\end{bmatrix}\begin{bmatrix}1&1\\0&1\end{bmatrix}=\begin{bmatrix}1&0\\0&1\end{bmatrix}+\begin{bmatrix}0&1\\0&0\end{bmatrix}=N\), as required.

Worked Example: Expected Visits with a Self-Loop

Consider the transition matrix

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

where states \(1,2\) are transient and state \(3\) is absorbing. The row sums are \(\tfrac12+\tfrac12+0=1\), \(0+\tfrac13+\tfrac23=1\), and \(0+0+1=1\). From state \(1\), the chain reaches state \(2\) with probability one eventually, and from state \(2\), it exits to state \(3\) with probability one eventually. The transient block is \(Q=\begin{bmatrix}\tfrac12&\tfrac12\\0&\tfrac13\end{bmatrix}\), and

$$ I-Q= \begin{bmatrix} \tfrac12&-\tfrac12\\ 0&\tfrac23 \end{bmatrix}, \qquad N=(I-Q)^{-1} = \begin{bmatrix} 2&\tfrac32\\ 0&\tfrac32 \end{bmatrix}. $$

Starting at state \(1\), the expected number of visits to state \(1\) is \(2\), including the starting visit; the expected number of visits to state \(2\) is \(\tfrac32\). Starting at state \(2\), the expected visits to state \(1\) are zero and the expected visits to state \(2\) are \(\tfrac32\). The diagonal value at state \(2\) exceeds one because the chain may remain there for several steps before absorption.

Check: The first row of \(I+QN\) is \((1,0)+(\tfrac12,\tfrac12)N=(1,0)+(1,\tfrac34+\tfrac34)=(2,\tfrac32)\). The second row is \((0,1)+(0,\tfrac13)N=(0,1)+(0,\tfrac12)=(0,\tfrac32)\). Both rows agree with \(N\).

Common Pitfall: Subtracting the Initial Visit

A frequent off-by-one error is to omit the \(n=0\) term and interpret \(N(i,j)\) as the expected number of visits strictly after time zero. The deterministic example makes the error visible. Starting at state \(1\), the chain is at state \(1\) once before absorption: at time zero. Thus \(N(1,1)=1\). The incorrect calculation \(\sum_{n=1}^{\infty}Q^n(1,1)=0\) counts only visits after time zero and misses that starting visit. The correct count is \(\sum_{n=0}^{\infty}Q^n(1,1)=1\).

More generally, if one specifically wants to count visits after time zero, the expected number is \(N(i,j)-\mathbf{1}_{\{i=j\}}\), because the only possible visit at time zero is present when the chain starts at \(j\). This adjustment changes the count convention, not the fundamental matrix itself.

The diagonal has a particularly useful interpretation: \(N(i,i)\) is the expected total number of visits to \(i\) before absorption when starting at \(i\), with the initial visit included. It is not the expected number of returns after time zero. In contrast, for \(i\ne j\), \(N(i,j)\) counts visits to \(j\) reached after starting from \(i\). Keeping those meanings distinct prevents confusion between a visit count and a return count.

Check Your Understanding

For each question, use the convention that the time-zero visit is included in \(N(i,j)\).

  1. In the deterministic chain \(1\to2\to3\), where \(3\) is absorbing, how many visits to state \(1\) does a path starting at \(1\) make before absorption?
  2. For \(Q=\begin{bmatrix}0&1\\0&0\end{bmatrix}\), calculate \(N\) from the series \(I+Q+Q^2+\cdots\). What does \(N(1,2)\) count?
  3. State the event whose probability is \(Q^n(i,j)\) for transient states \(i,j\).
  4. Why is the initial visit relevant to \(N(i,i)\) but not to \(N(i,j)\) when \(i\ne j\)?
  5. For a transient block \(Q\), write the first-step recursion for \(N(i,j)\) and identify the term that accounts for the time-zero visit.