Basic Concepts
Definition 1: For a Markov chain xn, the hitting time is the time to hit a subset of states A, i.e.
If the Markov chain never hits A, then HA = ∞. If A is a closed class, then the hitting time is also called the absorption time.
The hitting probability for state i to a set of states A is
We can also define
Thus
The expected (aka mean) hitting time is
Clearly, kiA < ∞ only if hiA = 1.
If A consists of a single state j, then we denote HA, hiA, and kiA by Hj, hij and kij, respectively.
Definition 2: For a Markov chain xn, the return time TA is the time to hit a subset of states A, i.e.
TA = min {n : xn ∈ A and n > 0}
If the Markov chain never returns to A, then TA = ∞.
![]()
The expected (aka mean) return time is
niA = E[TA | x0 = i]
Clearly, niA < ∞ only if tiA = 1.
If A consists of a single state j, then we denote TA, tiA, and niA by Tj, tij and nij, respectively. Also, we use ti and ni for tii and nii, respectively.
Hitting probability examples
Example 1: Find h12 for the Markov chain with the transition matrix
We first note
h12 = p11h12 + p12h22 + p13h32 + p14h42
h12 = .2 h12 + .2 h22 + .2 h32 + .4 h42
Thus, to find h12 we also need to find h22, h32, h42. We first note that h22 = 1 by definition, and h42 = 0 since 4 is an absorbing state. We also observe that
h32 = p31h12 + p32h22 + p33h32 + p34h42
h32 = .5 h22 + .5 h42 = .5(1) + .5(0) = .5
Thus
h12 = .2 h12 + .2 h22 + .2 h32 + .4 h42 = .2 h12 + .2(1) + .2(.5) + .4(0)
h12 = .2 h12 + .2 + .1 = .2 h12 + .3
Solving for h12, we have
.8h12 = .3
and so
h12 = 3/8
Example 2: Find h13 for the Markov chain with the transition matrix
This time we observe that
h13 = p11h13 + p12h23 + p13h33
h13 = .25 h13 + .75 h23 + 0 h33
Hence
.75 h13 = .75 h23
h13 = h23
But
h23 = p21h13 + p22h23 + p23h33
h23 = .25 h13 + 0 h23 + .75 h33
h23 = .25 h23 + .75 ⋅ 1
.75 h23 = .75
h13 = h23 = 1
Example 3: Find h1A, h2A, h3A, and h4A where A = {1,3} for the Markov chain with the transition matrix
Clearly, h1A = h3A = 1 since 1, 3 are in A. Also, h4A = 0 since 4 is an absorbing state.
h2A = p21h1A + p22h2A + p23h3A + p24h4A
h2A = .3 (1) + 0 h2A + 0(1) + .7 (0) = .3
Expected hitting time examples
Example 4: Find k13 for the Markov chain in Example 2.
The analysis is similar to that of h13, but this time we need to add 1 since the first step takes one time unit.
k13 = 1 + p11k13 + p12k23 + p13k33
k13 = 1 + .25 k13 + .75 k23 + 0 k33
Thus
. 75 k13 = 1 + .75 k23
k13 = 4/3 + k23
Similarly
k23 = 1 + p21k13 + p22k23 + p23k33
k23 = 1 + .25 k13 + 0 k23 + .75 k33
k23 = 1 + .25 k13
since k33 = 0. From the earlier result, we observe that
k13 = 4/3 + k23 = 4/3 + 1 + .25 k13
.75 k13 = 7/3
k13 = 7/3 ⋅ 4/3 = 28/9 ≈ 3.11111
Example 5: Find k32 for the Markov chain in Example 1.
First note that k22 = 0 since the chain is already at the destination. But k42 = ∞ since once in state 4, you can never enter state 2. But p34 ≠ 0, and so you can go from state 3 to state 4. Thus
k32 = 1 + p31k12 + p32k22 + p33k32 + p34k42
k32 = 1 + 0 ⋅ k12 + .5 ⋅ 0 + 0 ⋅ h32 + .5 ⋅ ∞ = ∞
This is not surprising since h32 ≠ 1.
Properties
Property 1:
If there are multiple solutions, the hitting probabilities are the smallest such non-negative solutions.
Property 2:
If there are multiple solutions, the expected hit times are the smallest such non-negative solutions.
Property 3:
Return Example
Example 6: Determine the return probabilities for states 1, 2, and 3, for the Markov chain transition matrix in Example 2, based on 100 simulation runs, each of size 50, starting with state 1. In each case, also determine the average time until the first return and the frequency of returns, only counting the simulations where there is a return.
The result is shown in Figure 1. The simulation runs are shown in range G1:DB51. Here, we placed the formula =MarkovSim($B2:$D4,51) in range G1:G51, highlighted range G1:DB51, and pressed Ctrl-R.
Only the first 7 and last 7 simulation runs are shown, and only the first 7 and last 2 states in each run are displayed.
Figure 1 – Simulation for Example 4
We see that the return probability for state 1 is 97% (cell DD53); i.e. 3 of the 100 runs did not return to state 1 with 50 steps. We obtained this result by placing the formula =IF(G55>0,1,0) in cell G53, highlighting range G53:DB53, pressing Ctrl-R, and then inserting the formula =AVERAGE(G53:DB53) in cell DD53.
All 100 runs hit (i.e. returned to) states 2 and 3 (as shown in cells DD57 and DD61).
The average time to return for state 1 is 8.175 (cell DD54). We obtained this result by placing the formula =IFERROR(MATCH($E54,G$2:G$51,0),0) in cell G54, highlighting range G54:DB54, pressing Ctrl-R, and then inserting the formula =AVERAGE(G54:DB54)/DD53 in cell DD54.
The average time to return for states 2 and 3 are shown in cells DD58 and DD62.
The expected frequency of returns (as a fraction of the 50 states in each run) is 9.876% (cell DD55). We obtained this result by placing the formula =COUNTIF(G$2:G$51,$E55) in cell G55, highlighting range G55:DB55, pressing Ctrl-R, and then inserting the formula =AVERAGE(G55:DB55)/(DD53*F51) in cell DD55.
The expected frequency of returns for states 2 and 3 are shown in cells DD59 and DD63.
Real Statistics support
Click here for a description of Real Statistics support for hitting and return times and probabilities.
More examples
Click here for a description of the Gambler’s Ruin problem.
Click here for a description of Random Walk Markov chains.
Links
Examples Workbook
Click here to download the Excel workbook for Example 6.
References
Aldridge, M. (2021) Hitting times. Introduction to Markov Processes
https://mpaldridge.github.io/math2750/S08-hitting-times.html
Norris, J. (2004) Discrete-time Markov chains. Cambridge University Press
https://www.statslab.cam.ac.uk/~jrn10//Markov/
Sargent, T. J., Stachurski, J. (2025) Markov chains: Basic concepts. First course in quantitative economics with Python
https://intro.quantecon.org/markov_chains_I.html
Tolver, A. (2016) Introduction to Markov chains
https://www.math.ku.dk/bibliotek/arkivet/noter/stoknoter.pdf
Chao, J. C. (2020) Markov chains
http://econweb.umd.edu/~chao/Teaching/Econ721/Econ721_Lecture_on_Markov_Chains.pdf






