A Closed Form Probability Mass Function for Occupation Times in a Three-State Markov Chain

Abstract

We obtain a closed form expression for the joint probability mass function of the occupation times for a Three-State Markov chain. Our representation extends the long-standing result for a Two-State Markov chain by utilizing the method of probability generating functions given in Pedler.

Share and Cite:

Evans, J. and Korzeniowski, A. (2025) A Closed Form Probability Mass Function for Occupation Times in a Three-State Markov Chain. Advances in Pure Mathematics, 15, 554-561. doi: 10.4236/apm.2025.158029.

1. Introduction

The probability mass function of the occupation time for a Markov chain was the subject of intense research during the 50s, 60s, and 70s as seen in the work of Pedler , Darroch [2], Gabriel [3], and Good [4] and has re-emerged as a topic of interest with recent notable work by Shah [5] and Pollett [6]. The aforementioned authors, through various methods, were able to obtain the probability mass function of the occupation time for a Two-State Markov chain. In this paper, we extend the method given by Pedler and provide an explicit closed form expression for the occupation time probability mass function of a Three-State Markov chain. This new expression is the first extension beyond two states and provides much-needed insight in the search for an occupation time formula of an arbitrary M-State Markov chain.

2. Occupation time for a Three-State Markov Chain

Consider a three state time homogeneous Markov chain ( M k ) k=0 n with states E 1 , E 2 , E 3 . Define p ij =P[ M k = E j | M k1 = E i ]>0 to be the probability of transitioning from state E i to E j in one step. Since p ij is strictly positive, ( M k ) k=0 n is ergodic. Further define 0 π i 1 to be the probability that M 0 = E i where π 1 + π 2 + π 3 =1 . Let X n = k=1 n 1 l E 1 , Y n = k=1 n 1 l E 2 , Z n = k=1 n 1 l E 3 be the occupation time of state E 1 , E 2 , E 3 during the interval { 1,,n } . The initial state not being counted towards the occupation time of any state. Then given X n =x, Y n =y, Z n =z we have x+y+z=n and the joint probability mass function of the occupation times by time n reads p n ( x,y,z )=P( X n =x, Y n =y, Z n =z )= p n ( x,y,nxy ) .

Theorem 1 The probability mass function of the occupation time for a Three-State Markov chain is given by

p n ( x,y,nxy ) =F( x,y,nxy )+( π 1 d 1 + π 3 d 8 )F( x,y1,nxy ) +( π 1 d 2 + π 2 d 5 )F( x,y,nxy1 ) +( π 2 d 4 + π 3 d 7 )F( x1,y,nxy )+ π 3 d 9 F( x1,y1,nxy ) + π 2 d 6 F( x1,y,nxy1 )+ π 1 d 3 F( x,y1,nxy1 ) (1)

where

d 1 = p 12 p 22

d 2 = p 13 p 33

d 3 = p 22 p 33 p 23 p 32 + p 12 p 23 + p 13 p 32 p 12 p 33 p 13 p 22

d 4 = p 21 p 11

d 5 = p 23 p 33

d 6 = p 13 p 21 p 11 p 23 p 13 p 31 + p 23 p 31 + p 11 p 33 p 21 p 33

d 7 = p 31 p 11

d 8 = p 32 p 22

d 9 = p 12 p 21 + p 11 p 22 + p 12 p 31 p 22 p 31 p 11 p 32 + p 21 p 32

λ st = p 12 p 21 p 11 p 22 ; λ su = p 13 p 31 p 11 p 33 ; λ tu = p 23 p 32 p 22 p 33 ;

λ stu = p 13 p 22 p 31 + p 12 p 23 p 31 + p 13 p 21 p 32 p 11 p 23 p 32 p 12 p 21 p 33 p 33 p 22 p 11

F( x,y,z )= k=0 j=0 i=0 l=0 ( x+i l )( y+j l )( z+k l )( l k )( lk j )( lkj i ) [ λ st k λ su j λ tu i λ stu lkji p 11 x p 22 y p 33 z ]

Remark. In fact, as Lemma 2 shows, F( x,y,z ) is the sum of finitely many known terms.

3. Derivation of Three-State Occupation Time Probability Mass Function

The proof of Theorem 1 is based on the following Lemmas:

Lemma 2

k=0 j=0 i=0 l=0 ( x+i l )( y+j l )( z+k l )( l k )( lk j )( lkj i ) = k=0 n j=0 n i=0 n l=0 min[ x+i,y+j,z+k ] ( x+i l )( y+j l )( z+k l )( l k )( lk j )( lkj i ) (2)

Proof of Lemma 2. For occupation times x,y,z , we have x+y+z=n and

recall that for m0 , k<0 or k>m implies ( m k )=0 . Then (2) simplifies to

k=0 j=0 i=0 l=0 min[ x+i,y+j,z+k ] ( x+i l )( y+j l )( z+k l )( l k )( lk j )( lkj i ) (3)

Using ( r m )( m c )= r!m! m!c!( rm )!( mc! ) = r!( rc )! ( rc )!c!( rcm+c )!( mc )! =( r c )( rc mc ) three times for ( r m )( m c )=( z+k l )( l k ) , ( r m )( m c )=( z lk )( lk j ) , and ( r m )( m c )=( zj lkj )( lkj i ) in that specific order, (3) may be written as

k=0 j=0 i=0 l=0 min[ x+i,y+j,z+k ] ( x+i l )( y+j l )( z+k k )( z j )( zj i )( zji lkji ) (4)

Note that from ( z j ) , (4) reduces to 0 for j<0 or j>z , thus j ranges from

0 to z . However, we may pick an upper bound mz for j without altering the final summation of (4). Then from 0jzx+y+z=n , (4) becomes

k=0 j=0 n i=0 l=0 min[ x+i,y+j,z+k ] ( x+i l )( y+j l )( z+k k )( z j )( zj i )( zji lkji ) (5)

Applying a similar argument for 0izjn and 0klx+ix+zn , (5) may be re-written as

k=0 n j=0 n i=0 n l=0 min[ x+i,y+j,z+k ] ( x+i l )( y+j l )( z+k k )( z j )( zj i )( zji lkji ) (6)

Then from the equality of (6) and (2), the index bounds of (6) may be applied to (2) to give us the desired result. □

Lemma 3

l=0 k=0 j=0 i=0 ζ=k γ=j χ=i ( χ+i l )( γ+j l )( ζ+k k )( l k )( lk j )( lkj i ) [ λ st k λ su j λ tu i λ stu lkji σ χ τ γ υ ζ ] = ζ= γ= χ= F ( χ,γ,ζ ) ( σ p 11 ) χ ( τ p 22 ) γ ( υ p 33 ) ζ 1 l [ ζk ] 1 l [ γj ] 1 l [ χi ] = 1 ( 1σ )( 1τ )( 1υ )( λ st στ+ λ su συ+ λ tu τυ+ λ stu στυ ) (7)

where 1 l A denotes the indicator function on A .

Proof of Lemma 3. By factoring (7), we obtain

( 1 [ λ st στ+ λ su συ+ λ tu τυ+ λ stu στυ ] [ ( 1σ )( 1τ )( 1υ ) ] ) 1 ( ( 1σ )( 1τ )( 1υ ) ) 1

which can be rewritten using a geometric series as

l=0 [ λ st στ+ λ su συ+ λ tu τυ+ λ stu στυ ] l [ ( 1σ )( 1τ )( 1υ ) ] l1

Expand the multinomial and negative binomial(s), write (7) as

l=0 [ k=0 j=0 i=0 ( l k )( lk j )( lkj i ) λ st k λ su j λ tu i λ stu lkji σ li τ lj υ lk ] [ ζ=0 γ=0 χ=0 ( l+χ χ )( l+γ γ )( l+ζ ζ ) σ χ τ γ υ ζ ] (8)

and apply the product of series convolution formula

q=0 r=0 a q b r =( q=0 a q )( r=0 b r )= r=0 q=0 r a q b rq to (8) three times for

r=χ,r=γ,r=ζ and q=l to obtain

l=0 [ k=0 j=0 i=0 ( l k )( lk j )( lkj i ) λ st k λ su j λ tu i λ stu lkji σ li τ lj υ lk ] [ ζ=0 γ=0 χ=0 ( χ l )( γ l )( ζ l ) σ χl τ γl υ ζl ] (9)

Substituting χ,γ,ζ with χ+i,γ+j,ζ+k respectively, (9) becomes

l=0 k=0 j=0 i=0 ζ=k γ=j χ=i ( χ+i l )( γ+j l )( ζ+k k )( l k )( lk j )( lkj i ) [ λ st k λ su j λ tu i λ stu lkji σ χ τ γ υ ζ ] = ζ= γ= χ= k=0 j=0 i=0 l=0 ( χ+i l )( γ+j l )( ζ+k k )( l k )( lk j ) [ ( lkj i ) λ st k λ su j λ tu i λ stu lkji σ χ τ γ υ ζ 1 l [ ζk ] 1 l [ γj ] 1 l [ χi ] ] = ζ= γ= χ= F ( χ,γ,ζ ) ( σ p 11 ) χ ( τ p 22 ) γ ( υ p 33 ) ζ 1 l [ ζk ] 1 l [ γj ] 1 l [ χi ]

which completes the proof of Lemma 3. □

Proof of Theorem 1. Given Markov chain ( M k ) k=0 n we define Π to be the initial distribution of states E 1 , E 2 , E 3 at time 0. Set

P( s,t,u )=[ s p 11 t p 12 u p 13 s p 21 t p 22 u p 23 s p 31 t p 32 u p 33 ],Π=[ π 1 π 2 π 3 ],1=[ 1 1 1 ]

and notice that P( 1,1,1 ) is the one-step transition probability matrix. The probability generating function of p n ( x,y,z ) is given by

G n ( s,t,u )= z=0 y=0 x=0 s x t y u z p n ( x,y,z ) n0 (10)

and we define p 0 ( 0,0,0 )=P( X 0 =0, Y 0 =0, Z 0 =0 )= G 0 ( s,t,u )=1 . Since z=nxy , 0xny , and 0yn , (10) simplifies to

G n ( s,t,u )= y=0 n x=0 ny s x t y u z p n ( x,y,z ) (11)

Since the spectral radius of P( 1,1,1 ) is exactly 1, restricting s,t,u between 0 and 1 allows us to sum (11) over n to obtain

n=0 G n ( s,t,u ) = n=0 y=0 n x=0 ny s x t y u z p n ( x,y,z ) = n=0 ΠP ( s,t,u ) n 1 =Π [ IP( s,t,u ) ] 1 1

which is equal to

π 1 ( d 1 t+ d 2 u+ d 3 tu )+ π 2 ( d 4 s+ d 5 u+ d 6 su )+ π 3 ( d 7 s+ d 8 t+ d 9 st ) ( 1σ )( 1τ )( 1υ )( λ st στ+ λ su συ+ λ tu τυ+ λ stu στυ ) (12)

where σ=s p 11 ,τ=t p 22 ,υ=u p 33 . Defining the numerator of (12) as N and applying Lemma 3 to (12), we have

ζ= γ= χ= NF( χ,γ,ζ ) s χ t γ u ζ 1 l [ ζk ] 1 l [ γj ] 1 l [ χi ] (13)

Now note that for a given n , if znxy then p n ( x,y,z )=0 and (11) reduces to 0. Then from the equality of (11) and (13), (13) must also be 0 and simplifies to

γ= χ= NF( χ,γ,ζ ) s χ t γ u ζ 1 l [ γj ] 1 l [ χi ] (14)

for ζ=nxy . Further note that if x<0 or x>ny , then p n ( x,y,z )=0 and using a similar argument for y , (14) becomes

γ=0 n χ=0 nγ NF( χ,γ,ζ ) s χ t γ u ζ (15)

Since (15) is another representation of (11), they are equal.

y=0 n x=0 ny p n ( x,y,z ) s x t y u z = γ=0 n χ=0 nγ NF( χ,γ,ζ ) s χ t γ u ζ

The above shows p n ( x,y,z )=NF( χ,γ,ζ ) hence by applying (12) gives

p n ( x,y,z )=F( χ,γ,ζ )+t( π 1 d 1 + π 3 d 8 )F( χ,γ,ζ ) +u( π 1 d 2 + π 2 d 5 )F( χ,γ,ζ )+s( π 2 d 4 + π 3 d 7 )F( χ,γ,ζ ) +st π 3 d 9 F( χ,γ,ζ )+su π 2 d 6 F( χ,γ,ζ )+tu π 1 d 3 F( χ,γ,ζ ) (16)

Finally, substituting the power of s,t,u with x,y,z in each individual summand in (16) and then setting s,t,u=1 gives (1) as claimed. □

4. Illustrative Example

Consider one-step transition probability matrix and initial distribution as follows

P=[ 1 2 1 8 3 8 1 5 12 25 8 25 3 10 6 10 1 10 ],Π=[ 1 2 1 4 1 4 ]

The occupation time probabilities for n=5 were calculated by Wolfram Mathematica implementation of (1). Furthermore, 107 Monte Carlo paths of the Markov chain during times { 0,1,,5 } were simulated using C++, and the proportion of paths satisfying x,y{ 0,1,,5 } were computed. The results are given in Table 1 and Table 2. Note that using the exact probabilities from Table 2 gives

y=0 5 x=0 5y p ( x,y,5xy )=1

Table 1. Comparison of (1) with a path simulation.

p 5 ( x,y,5xy )

x = 0

x = 1

x = 2

x = 3

x = 4

x = 5

y = 0

0.00002925

0.00121556

0.0136948

0.0485930

0.0601875

0.0234375

y = 1

0.0019667

0.03310590

0.1049150

0.0925238

0.0212031

0

y = 2

0.0289906

0.12225600

0.1058140

0.0232519

0

0

y = 3

0.0897800

0.09565950

0.0221396

0

0

0

y = 4

0.0753021

0.01828400

0

0

0

0

y = 5

0.0176505

0

0

0

0

0

Path Simulation

x = 0

x = 1

x = 2

x = 3

x = 4

x = 5

y = 0

0.0000289

0.0012255

0.0136814

0.0486363

0.0601069

0.0234127

y = 1

0.0019584

0.0331114

0.1049500

0.0922447

0.0212642

0

y = 2

0.0289699

0.1222960

0.1059210

0.0232506

0

0

y = 3

0.0897527

0.0956537

0.0221802

0

0

0

y = 4

0.0752589

0.0182716

0

0

0

0

y = 5

0.0176218

0

0

0

0

0

Table 2. Exact values obtained by (1).

p 5 ( x,y,5xy )

x = 0

x = 1

x = 2

x = 3

x = 4

x = 5

y = 0

117 4000000

19449 16000000

175293 12800000

62199 1280000

963 16000

3 128

y = 1

19667 10000000

2648469 80000000

6714561 64000000

74019 800000

1357 64000

0

y = 2

181191 6250000

764099 6250000

8465129 80000000

37203 1600000

0

0

y = 3

350703 3906250

2989359 31250000

1771169 80000000

0

0

0

y = 4

735372 9765625

285687 15625000

0

0

0

0

y = 5

172368 9765625

0

0

0

0

0

5. Discussion

We would like to point out that in principle the method given in Pedler [1] could be extended to any finite-state Markov chain provided tractability of the large number of terms involved, however to the best of our knowledge no such result appears in existing literature. The derivation would be analogous to the proof of Theorem 1. Granted, Gabriel [3] and Shah [5] present a method that enumerates transition paths which is straightforward in the Two-State case, but becomes increasingly involved as the number of states grows. On the other hand, Pollett [6], Sericola [7], and Darroch [8] employ methods that could extend to any finite state Markov chain, but depend on an often unknown transition matrix between subsets of states. In contrast, Pedler’s method is conceptually straightforward, as it relies on rudimentary level identities and algebraic manipulations to obtain the key result.

Acknowledgements

The authors would like to thank the reviewers for their valuable suggestions that considerably improved the presentation of our findings in the revised version of the manuscript.

Conflicts of Interest

The authors declare no conflicts of interest regarding the publication of this paper.

References

[1] Pedler, P.J. (1971) Occupation Times for Two State Markov Chains. Journal of Applied Probability, 8, 381-390.[CrossRef]
[2] Darroch, J.N. and Morris, K.W. (1968) Passage-Time Generating Functions for Continuous-Time Finite Markov Chains. Journal of Applied Probability, 5, 414-426.[CrossRef]
[3] Gabriel, K.R. (1959) The Distribution of the Number of Successes in a Sequence of Dependent Trials. Biometrika, 46, 454-460.[CrossRef]
[4] Good, I.J. (1961) The Frequency Count of a Markov Chain and the Transition to Continuous Time. The Annals of Mathematical Statistics, 32, 41-48.[CrossRef]
[5] Shah, M.T. (2025) A Note on Exact State Visit Probabilities in Two-State Markov Chains. arXiv:2502.03073.
[6] Pollett, P. (2025) A Note on the State Occupancy Distribution for Markov Chains. arXiv:2503.17647.
[7] Sericola, B. (2000) Occupation Times in Markov Processes. Communications in Statistics. Stochastic Models, 16, 479-510.[CrossRef]
[8] Darroch, J.N. and Morris, K.W. (1967) Some Passage-Time Generating Functions for Discrete-Time and Continuous-Time Finite Markov Chains. Journal of Applied Probability, 4, 496-507.[CrossRef]

Copyright © 2026 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.