확통1 LectureNote08 on Markov Chains
확통1 LectureNote08 on Markov Chains
Introduction
◼ Markov Process (MP) and Markov Chain (MC)
◼ Discrete Time Markov Chains (DTMC)
◼ Homogeneous and non-homogeneous Markov chains
◼ Transient and steady state Markov chains
◼ Continuous Time Markov Chains (CTMC)
◼ Homogeneous and non-homogeneous Markov chains
◼ Transient and steady state Markov chains
2
Relationship among Random
Processes
SMP
𝑝𝑖𝑗 arbitrary
𝑓𝜏 arbitrary RW
MP 𝑝𝑖𝑗 = 𝑑(𝑗 − 𝑖)
𝑝𝑖𝑗 arbitrary 𝑓𝜏 arbitrary
𝑓𝜏 memoryless BD
Poisson
𝑝𝑖𝑗 = 0 for 𝑗 − 𝑖 > 1 RP
𝜆𝑖 = 𝜆
𝑓𝜏 memoryless 𝑓𝜏 memoryless 𝑝𝑖𝑗 = 𝑑(1)
𝑓𝜏 arbitrary
PB
𝜆𝑖 > 0, 𝜇𝑖 = 0
𝑓𝜏 memoryless
5
Chapman-Kolmogorov Equations (1)
◼ A Markov chain is specified by identifying the set of its
states, i.e., state space and the set of its transition
probabilities.
◼ Define the one-step transition probabilities
𝑝𝑖𝑗 𝑘 ≡ 𝐏{𝑋𝑘+1 = 𝑗|𝑋𝑘 = 𝑖}
▪ Let 𝐴(𝑖) be the set of states that are accessible from
state 𝑖. Clearly, for all time instants 𝑘, and for all states 𝑖
𝑝𝑖𝑗 𝑘 = 1
𝑗∈𝐴(𝑖)
▪ Also, define the 𝑛-step transition probabilities
𝑝𝑖𝑗 𝑘, 𝑘 + 𝑛 ≡ 𝐏{𝑋𝑘+𝑛 = 𝑗|𝑋𝑘 = 𝑖}
6
Chapman-Kolmogorov Equations (2)
1
𝑖 𝑗
…
◼ Using the total probability rule,
𝑅
𝑝𝑖𝑗 𝑘, 𝑘 + 𝑛
𝑅 𝑘 𝑢 𝑘+𝑛
= 𝐏 𝑋𝑘+𝑛 = 𝑗 𝑋𝑢 = 𝑟, 𝑋𝑘 = 𝑖 𝐏{𝑋𝑢 = 𝑟|𝑋𝑘 = 𝑖}
𝑟=1
◼ Using the memoryless property of MC, we obtain the
Chapman-Kolmogorov equation, for 𝑘 ≤ 𝑢 ≤ 𝑘 + 𝑛,
𝑝𝑖𝑗 𝑘, 𝑘 + 𝑛
𝑅
7
CKE in Matrix Form (1)
◼ Define the one-step and 𝑛-step transition probability
matrices, respectively,
𝐏 𝑘 ≡ 𝑝𝑖𝑗 𝑘 ,
𝐇 𝑘, 𝑘 + 𝑛 ≡ 𝑝𝑖𝑗 𝑘, 𝑘 + 𝑛
◼ Then, we can re-write the Chapman-Kolmogorov
Equation as
𝐇 𝑘, 𝑘 + 𝑛 = 𝐇 𝑘, 𝑢 𝐇(𝑢, 𝑘 + 𝑛)
◼ Choose 𝑢 = 𝑘 + 𝑛 − 1, then
𝐇 𝑘, 𝑘 + 𝑛 = 𝐇 𝑘, 𝑘 + 𝑛 − 1 𝐇 𝑘 + 𝑛 − 1, 𝑘 + 𝑛
= 𝐇 𝑘, 𝑘 + 𝑛 − 1 𝐏 𝑘 + 𝑛 − 1
Forward Chapman- One step transition
Kolmogorov Equation probability matrix
8
CKE in Matrix Form (2)
▪ Choose, 𝑢 = 𝑘 + 1, then
𝐇 𝑘, 𝑘 + 𝑛 = 𝐇 𝑘, 𝑘 + 1 𝐇 𝑘 + 1, 𝑘 + 𝑛
= 𝐏 𝑘 𝐇 𝑘 + 1, 𝑘 + 𝑛
9
State Probabilities
◼ We define the state probability as
𝜋𝑖 (𝑘) ≡ 𝐏{𝑋𝑘 = 𝑖}
◼ We also define the state probability vector as
𝝅 𝑘 ≡ 𝜋0 𝑘 𝜋1 𝑘 𝜋2 𝑘 …
◼ Using the total probability rule, we can write
𝜋𝑖 𝑘 = 𝐏 𝑋𝑘 = 𝑖 = 𝐏 𝑋𝑘−1 = 𝑗 𝐏{𝑋𝑘 = 𝑖|𝑋𝑘−1 = 𝑗}
𝑗
= 𝜋𝑗 (𝑘 − 1)𝑝𝑗𝑖 (𝑘 − 1)
𝑗
▪ In vector form, one can write
𝝅 𝑘 = 𝝅 𝑘 − 1 𝐏(𝑘 − 1)
10
Homogeneous Markov Chains (1)
◼ Markov Chain is called homogeneous when the
transition probabilities are independent of time 𝑘. In that
case, we have the one-step transition matrix as
𝑝𝑖𝑗 𝑘 = 𝑝𝑖𝑗 or 𝐏 𝑘 = 𝐏
◼ Also, the 𝑛-step transition matrix is
(𝑛)
𝑝𝑖𝑗 𝑘, 𝑘 + 𝑛 = 𝑝𝑖𝑗 or 𝐇 𝑘, 𝑘 + 𝑛 = 𝐏 (𝑛) = 𝐏 𝑛
◼ The forward and backward CKEs are, respectively, given
by
(𝑛) (𝑛−1)
𝑝𝑖𝑗 = 𝑝𝑖𝑟 𝑝𝑟𝑗 ,
𝑟
(𝑛) (𝑛−1)
𝑝𝑖𝑗 = 𝑝𝑖𝑟 𝑝𝑟𝑗 .
𝑟
11
Homogeneous Markov Chains (2)
◼ For each 𝑗, the steady-state probability is defined as
𝜋𝑗 ≡ lim 𝜋𝑗 (𝑘).
𝑘→∞
Also, the stationary probability vector can be defined as
𝝅 ≡ lim 𝝅(𝑘) ,
𝑘→∞
assuming the limit exists.
▪ The {𝜋𝑗 } are unique solution to the system of equation
below:
𝜋𝑗 = 𝜋𝑖 𝑝𝑖𝑗 ,
𝑖
𝜋𝑗 = 1
𝑗
12
Homogeneous Markov Chains (3)
▪ Since lim 𝛑(𝑘) = lim 𝝅(𝑘 − 1) = 𝝅 and lim 𝐏(𝑘 −
𝑘→∞ 𝑘→∞ 𝑘→∞
1) = 𝐏, for homogeneous MC we have the following
well-known relation:
𝝅 𝑘 = 𝝅 𝑘 − 1 𝐏(𝑘 − 1)
⟹ 𝝅 = 𝝅𝐏
13
Homogeneous Markov Chains (4)
Example: One-Step Transition Matrix
p11
14
Homogeneous Markov Chains (5)
Example: Transient State Vector
◼ Suppose that 𝝅(0) = [1 0 0] and
0.5 0.5 0
𝐏 = 0.35 0.5 0.15
0.245 0.455 0.3
◼ Find 𝝅 𝑘 for 𝑘 = 1,2, ….
0.5 0.5 0
𝝅 1 = 1 0 0 0.35 0.5 0.15
0.245 0.455 0.3
= 0.5 0.5 0
◼ In general, the transient behavior is obtained by solving
the difference equation
𝝅 𝑘 = 𝝅 𝑘 − 1 𝐏 = 𝝅(0)𝐏 𝑘
15
State Holding Times (1)
◼ Suppose that at point 𝑘, the Markov Chain has changed
into state 𝑖, i.e., 𝑋𝑘 = 𝑖. An interesting question is how
long it will stay at state 𝑖.
◼ Let 𝑇𝑖 be a state holding time that represents the number
of time slots during which the MC stays at state 𝑖.
◼ We are interested on the quantity 𝐏{𝑇𝑖 = 𝑛}
𝐏 𝑇𝑖 = 𝑛 = 𝐏 𝑋𝑘+𝑛 ≠ 𝑖, 𝑋𝑘+𝑛−1 = 𝑖, … , 𝑋𝑘+1 = 𝑖 𝑋𝑘 = 𝑖
= 𝐏{𝑋𝑘+𝑛 ≠ 𝑖|𝑋𝑘+𝑛−1 = 𝑖, … , 𝑋𝑘+1 = 𝑖, 𝑋𝑘 = 𝑖}
× 𝐏 𝑋𝑘+𝑛−1 = 𝑖, … , 𝑋𝑘+1 = 𝑖 𝑋𝑘 = 𝑖 Due to the Markovian
= 𝐏 𝑋𝑘+𝑛 ≠ 𝑖 𝑋𝑘+𝑛−1 = 𝑖 property
17
Classification of States
◼ Definitions
◼ State 𝑗 is reachable from state 𝑖 if the probability to go
from 𝑖 to 𝑗 in 𝑛 > 0 steps is greater than zero (Two
states 𝑖 and 𝑗 accessible to each other are said to
communicate, and we write 𝑖 𝑗).
◼ A subset 𝑆 of the state space is closed if 𝑝𝑖𝑗 = 0 for
every 𝑖 ∈ 𝑆 and 𝑗 ∉ 𝑆.
◼ A state 𝑖 is said to be absorbing if it is a single element
closed set.
◼ A closed set (class) 𝑆 of states is irreducible if any
state 𝑗 ∈ 𝑆 is reachable from every state 𝑖 ∈ 𝑆.
◼ A Markov chain is said to be irreducible if whose state
space is irreducible (or one communicating class).
18
Example: Reducible/Irreducible MC
◼ Irreducible Markov Chain
p01 p12 p22
p00 0 1 2
p10 p21
23
Positive/Negative Recurrent States
◼ Let 𝑀𝑖𝑖 be the mean recurrence∞time of state 𝑖
(𝑛)
𝑀𝑖𝑖 ≡ 𝐄 𝑇𝑖𝑖 = 𝑛𝑓𝑖𝑖
𝑛=1
◼ A state is said to be positive (or nonnull) recurrent if 𝑀𝑖𝑖 <
∞. If 𝑀𝑖𝑖 = ∞ then the state is said to be negative (or null)
recurrent.
◼ Notes for recurrence (transience) property
◼ If state 𝑖 is positive (null) recurrent and 𝑖 𝑗, then state
𝑗 is also positive (null) recurrent. Positive (or Null)
recurrence is class property.
◼ If state 𝑖 is transient and 𝑖 𝑗, then state 𝑗 is also
transient. Transience is also class property.
24
Example: Positive Recurrence
26
Properties about Finite MC
◼ In an MC with a finite number of states, the following
properties hold:
◼ There should be no null recurrent state
positive recurrent
27
Periodic and Aperiodic States
◼ Suppose that the structure of the MC is such that state 𝑖
is visited repeatedly after a number of steps that are an
integer multiple of an integer 𝑑 > 1. Then the state is
called periodic with period 𝑑.
◼ If no such integer exists (i.e., 𝑑 = 1) then the state is
called aperiodic. A Markov chain is aperiodic if every
state is aperiodic.
◼ Example: state 1 is periodic
1 0.5
0 1 2
0.5 1
Periodic State 𝑑 = 2
28
Class Periodicity (1)
◼ Consider a recurrent class 𝑅.
◼ The recurrent class 𝑅 is called periodic if its states can
be grouped in 𝑚 > 1 disjoint subsets 𝑆1 , … , 𝑆𝑚 , so that
all transitions from 𝑆𝑘 lead to 𝑆𝑘+1 (or to 𝑆1 if 𝑘 = 𝑚)
◼ Example:
(𝑛)
𝑝𝑖𝑗 → 0
◼ if 𝑗 is positive recurrent and aperiodic, then
(𝑛) 1
𝑝𝑖𝑗 →
𝑀𝑗𝑗
◼ if 𝑗 is positive recurrent and periodic with period 𝑑(𝑗),
then
(𝑛𝑑(𝑗)) 𝑑(𝑗)
𝑝𝑖𝑗 →
𝑀𝑗𝑗
31
Example of Limit Theorem
◼ Consider an irreducible the Markov chain with
0 1 0 0.5 0 0.5
𝐏 = 0.5 0 0.5 , 𝐏 2 = 0 1 0 , 𝐏 3 = 𝐏, 𝐏 4 = 𝐏 2 , … ,
0 1 0 0.5 0 0.5
⟹ 𝐏 (2𝑛) = 𝐏 2 , 𝐏 (2𝑛+1) = 𝐏
(2𝑛) (2𝑛+1)
We note 𝑝𝑖𝑖 > 0, 𝑝𝑖𝑖 = 0 for each 𝑖 and all the states
are periodic with 𝑑 = 2.
(1) (2) (𝑛)
◼ Now 𝑓11 = 0, 𝑓11 = 1 so that 𝑓11 = σ∞ 1 11 = 1, i.e., state
𝑓
1 is recurrent and by the Solidarity Theorem, states 0 and 2
are also recurrent.
(𝑛)
◼ 𝑀11 = σ∞1 𝑛𝑓11 = 1 × 0 + 2 × 1 = 2. State 1 is positive
recurrent, and states 0 and 2 are also positive recurrent.
(2𝑛) 𝑑 2
◼ By the Limit Theorem, 𝑝11 → = = 1.
𝑀11 2 32
Ergodicity
◼ A state 𝑖 is said to be ergodic if it is aperiodic and
positive recurrent. If all states in an irreducible Markov
chain are ergodic, then the chain is said to be ergodic.
◼ Ergodicity is a class property.
◼ It can be shown that a finite state irreducible Markov
chain is ergodic if it has at least one aperiodic state.
Why? Aperiodicity is also a class property!
◼ More generally, a Markov chain is ergodic if there is a
number 𝑁 such that any state can be reached from any
other state in any number of steps less or equal to a
number 𝑁.
33
Steady State Analysis (1)
◼ Recall that the probability of finding the DTMC at state 𝑗
after the 𝑘th step is given by 𝜋𝑗 𝑘 = 𝐏{𝑋𝑘 = 𝑗}
◼ An interesting question is what happens in the “long run”,
i.e., 𝜋𝑗 ≡ lim 𝜋𝑗 (𝑘) ?
𝑘→∞
◼ This is referred to as steady (stationary) state or
equilibrium state probability
◼ Questions:
◼ Do these limits exist ?
39
Relationship between Stationary and
Limiting distributions for DTMC
Condition Resulting Properties Comment
40
Summary about State Distributions
◼ An irreducible and positive recurrent DTMC has a unique
solution to the stationary equations
𝝅 = 𝝅𝐏 and σ𝑗 𝜋𝑗 = 1,
namely, 𝜋𝑗 = 1Τ𝑀𝑗𝑗 . Furthermore, if the chain is aperiodic,
the limiting distribution exists and is equal to the
stationary distribution.
◼ By this, there are two main ways to interpret 𝜋𝑗 . The first
interpretation is that 𝜋𝑗 is the long run fraction of time
spent in state 𝑗. The second interpretation is that 𝜋𝑗 is the
probability of being in state 𝑗 a long time from now.
◼ If the chain has a limiting distribution, then it becomes the
only stationary distribution. However, the converse is not
necessarily true. 41
Birth-Death Example (1)
1−𝑝 1−𝑝 1−𝑝
0 1 ⋯ 𝑖
𝑝 𝑝 𝑝 𝑝
𝑝 1−𝑝 0 ⋯
𝑝 0 1−𝑝 ⋯
𝐏=
0 𝑝 0 ⋯
⋮ ⋮ ⋮ ⋱
◼ Thus, to find the steady state vector π we need to solve
𝝅 = 𝝅𝐏 and σ𝑗 𝜋𝑗 = 1
42
Birth-Death Example (2)
◼ In other words,
𝜋0 = 𝜋0 𝑝 + 𝜋1 𝑝,
𝜋𝑗 = 𝜋𝑗−1 1 − 𝑝 + 𝜋𝑗+1 𝑝, 𝑗 = 1,2, …
◼ Solving these equations, we get
2
1−𝑝 1−𝑝
𝜋1 = 𝜋0 , 𝜋2 = 𝜋0
𝑝 𝑝
1−𝑝 𝑗
◼ In general, 𝜋𝑗 = 𝜋0
𝑝
◼ Summing all terms and using σ𝑗 𝜋𝑗 = 1, we get
∞ 𝑗
1−𝑝 1
𝜋0 = 1 ⟹ 𝜋0 = 𝑗
𝑝 1−𝑝
𝑗=0 σ∞
𝑗=0 𝑝
43
Birth-Death Example (3)
◼ Therefore, for all states 𝑗 we get
𝑗 ∞ 𝑖
1 1−𝑝 1−𝑝
𝜋𝑗 = with 𝐶 =
𝐶 𝑝 𝑝
𝑖=0
◼ If 𝑝 < 1/2, then 𝐶 = ∞
⇒ 𝜋𝑗 = 0, for all 𝑗, all states are transient
𝑝
◼ If 𝑝 > 1/2, then 𝐶 = >0
2𝑝−1
2𝑝−1 1−𝑝 𝑗
⇒ 𝜋𝑗 = for all 𝑗, all positive recurrent
𝑝 𝑝
◼ If 𝑝 = 1/2, then 𝐶 = ∞
⇒ 𝜋𝑗 = 0, for all 𝑗, all null recurrent
44
Reducible Markov Chains (1)
Transient Irreducible
Set 𝑇 Set 𝑆1
Irreducible
Set 𝑆2
◼ In steady state, we know that the Markov chain will
eventually end in an irreducible set and the previous
analysis still holds.
◼ The only question that arises, in case there are two or
more irreducible sets, is the probability it will end in each
set. 45
Reducible Markov Chains (2)
Transient Irreducible
Set 𝑇 Set 𝑆
s1
r
sn
i
= 𝑝𝑖𝑗 𝑎𝑗
48
𝑗
Example: Absorption Probability
◼ Note that there are two recurrent classes in Fig(a), {1} and
{4,5}. We lump {4,5} into state 6 as in Fig(b).
➢ What is the prob. of eventually reaching state 6?
◼ Starting from transient states 2 and 3, we have
we obtain
𝑎2 = 21/31,
𝑎3 = 29/31.
49
Example: Gambler’s Ruin
◼ A gambler wins $1 at each round with probability 𝑝 and
loses $1 with probability 1 − 𝑝. He plays repeatedly until
either wins a target of $𝑚 or loses all his money.
➢ What is the probability of winning the game?
◼ In the figure, for 𝑚 = 4, states {0, 4} are absorbing, and
50
Expected Time to Absorption
◼ Consider the expected number of steps until a recurrent
state is entered, starting from a particular transient state 𝑖,
𝜇𝑖 ≡ 𝐄 min 𝑛 ≥ 0: 𝑋𝑛 is recurrent 𝑋0 = 𝑖}
◼ If 𝑖 is recurrent, 𝜇𝑖 = 0 from the definition.
◼ Otherwise, for all transient states 𝑖, we have
𝜇𝑖 = 𝐄[min{𝑛 ≥ 0: 𝑋𝑛 is recurrent | 𝑋0 = 𝑖}]
= 𝐄[min{𝑛 ≥ 0: 𝑋𝑛 is recurrent | 𝑋0 = 𝑖, 𝑋1 = 𝑗}]
𝑗
∙ 𝐏{𝑋1 = 𝑗|𝑋0 = 𝑖}
= (1 + 𝜇𝑗 )𝑝𝑖𝑗
𝑗
= 1 + 𝜇𝑗 𝑝𝑖𝑗
𝑗
51
Example: Spider-and-Fly Model
◼ Consider the spider-and-fly model. The states
correspond to possible fly positions, and the absorbing
states 1 and 𝑚 correspond to capture by a spider.
◼ Let us calculate the expected number of steps until the
fly is captured. We have
𝜇𝑖 = 1 + 0.3𝜇𝑖−1 + 0.4𝜇𝑖 + 0.3𝜇𝑖+1 , for 𝑖 = 2, … , 𝑚 − 1
𝜇1 = 𝜇𝑚 = 0
◼ For 𝑚 = 4, we obtain 𝜇2 = 𝜇3 = 10/3.
52
Mean First Passage and Recurrence
Times
◼ Let us consider the mean first passage time to reach a
particular recurrent state 𝑠, starting from any other state 𝑖,
𝑡𝑖 = 𝐄[min{𝑛 ≥ 0: 𝑋𝑛 = 𝑠| 𝑋0 = 𝑖}]
Using the similar approach given earlier, we have
𝑡𝑖 = 1 + 𝑡𝑗 𝑝𝑖𝑗 , for all 𝑖 ≠ 𝑠,
𝑗
𝑡𝑠 = 0.
◼ We also want to calculate the mean recurrence time of
the special state 𝑠, which is given by
𝑡𝑠∗ = 𝐄[number of transitions up to the first return to 𝑠, from 𝑠]
= 𝐄[min{𝑛 ≥ 1: 𝑋𝑛 = 𝑠| 𝑋0 = 𝑖}]
= 1 + 𝑡𝑗 𝑝𝑠𝑗
𝑗
53
Example: “Up-to-Date”-”Behind” Model
◼ Consider the ‘up-to-date’ and ‘behind’ model. Alice is
taking an on-line probability class, and in each week, she
can be up-to-date or may have fallen behind, attending
the class.
59
Homogeneous Case (1)
◼ In the homogeneous case, the transition functions do not
depend on 𝑠 and 𝑡, but only on the difference τ = 𝑡 − 𝑠,
thus 𝑝𝑖𝑗 𝑠, 𝑡 becomes the one-argument transition
function 𝑝𝑖𝑗 (𝜏 = 𝑡 − 𝑠) defined as
𝑝𝑖𝑗 𝜏 ≡ 𝐏 𝑋 𝑠 + 𝜏 = 𝑗 𝑋 𝑠 = 𝑖
▪ Note that the transition function holds the following
identity
𝑝𝑖𝑗 (𝜏) = 1 for all 𝑖
𝑗
▪ The one-argument transition function 𝑝𝑖𝑗 (𝜏) now means
the probability that the CTMC, presently in state 𝑖, will be
in state 𝑗 after an additional time 𝜏, or means the
probability that there is a transition in an interval of 𝜏.
60
Homogeneous Case (2)
▪ Also, 𝐇 𝑠, 𝑡 becomes a one-argument type that depends
only on the difference between the two instances,
𝐇 𝜏 = 𝑡 − 𝑠 , and let us denote by 𝐏(𝜏) this one-argument
function as
𝐇 𝜏 ≡ 𝐏 𝜏 ≡ 𝑝𝑖𝑗 𝜏 , 𝑖, 𝑗 ∈ ℕ.
◼ It follows that the transition rate matrix becomes constant
𝐇 𝑡, 𝑡 + ∆𝑡 − 𝐈 𝐏 ∆𝑡 − 𝐈
𝐐 𝑡 = lim = lim =𝐐
∆𝑡→0 ∆𝑡 ∆𝑡→0 ∆𝑡
▪ Thus, the forward CKE becomes
𝑑𝐏(𝜏) 1 if 𝑖 = 𝑗
= 𝐏 𝜏 𝐐 with 𝑝𝑖𝑗 0 = ቊ
𝑑𝜏 0 if 𝑖 ≠ 𝑗
⇒ 𝐏 𝜏 = 𝑒 𝐐𝜏 (This implies 𝐏 0 = 𝐈)
61
State Holding Time
◼ We know that the time the CTMC will spend at state 𝑖, 𝑇𝑖 , is
memoryless and thus exponentially distributed by
𝐏{𝑇𝑖 ≤ 𝑡} = 1 − 𝑒 −𝜆𝑖𝑡
where 𝜆𝑖 is called the transition rate out of state 𝑖 to any
states 𝑗 that is reachable from state 𝑖, 𝑗 ≠ 𝑖, and is
interpreted as the average number of transitions out of
state 𝑖 per unit time when the CTMC stays at state 𝑖.
◼ Since only a fraction 𝑃𝑖𝑗 of the transitions out of state 𝑖 will
lead to state 𝑗, 𝑗 ≠ 𝑖, 𝜆𝑖𝑗 = 𝜆𝑖 𝑃𝑖𝑗 is considered as the
average number of transitions from 𝑖 to 𝑗 per unit time
spent at 𝑖.
◼ We call 𝜆𝑖𝑗 the transition rate from 𝑖 to 𝑗. We obtain 𝜆𝑖 as
𝜆𝑖 = 𝜆𝑖𝑗 62
𝑗≠𝑖
Transition Rate Matrix Q (1)
◼ Recall that
𝑑𝐏(𝑡) 𝑑𝑝𝑖𝑗 (𝑡)
=𝐏 𝑡 𝐐⇒ = 𝑝𝑖𝑘 (𝑡)𝑞𝑘𝑗
𝑑𝑡 𝑑𝑡 𝑘
➢ Case 1) First consider the 𝑞𝑖𝑗 , 𝑗 ≠ 𝑖. Then the above becomes
𝑑𝑝𝑖𝑗 (𝑡)
= 𝑝𝑖𝑖 𝑡 𝑞𝑖𝑗 + 𝑝𝑖𝑘 (𝑡)𝑞𝑘𝑗
𝑑𝑡 𝑘≠𝑖
◼ Evaluating this at 𝑡 = 0, we have
𝑑𝑝𝑖𝑗 (𝑡)
ቤ = 𝑞𝑖𝑗 𝑝𝑖𝑖 0 = 1, 𝑝𝑖𝑘 0 = 0 for all 𝑘 ≠ 𝑖
𝑑𝑡 𝑡=0
▪ The event that will take the state from 𝑖 to j has exponential
lifetime with rate 𝜆𝑖𝑗 . Therefore, given that such a transition
has occurred in the interval of length 𝑡, the probability of this
transition, 𝑝𝑖𝑗 (𝑡), is given by 𝑝𝑖𝑗 𝑡 = 1 − 𝑒 −𝜆𝑖𝑗 𝑡 . 63
Transition Rate Matrix Q (2)
◼ Thus,
𝑑𝑝𝑖𝑗 (𝑡) 𝑑(1 − 𝑒 −𝜆𝑖𝑗 𝑡 )
ቤ = ቤ = 𝜆𝑖𝑗 𝑒 𝜆𝑖𝑗 𝑡 ቚ = 𝜆𝑖𝑗
𝑑𝑡 𝑡=0 𝑑𝑡 𝑡=0 (1)
𝑡=0
64
Transition Rate Matrix Q (3)
𝑝𝑖𝑗 (𝑡) = 1
𝑑[1 − σ𝑗≠𝑖 𝑝𝑖𝑗 𝑡 ] 𝑗
⇒ อ = 𝑞𝑖𝑖
𝑑𝑡
𝑡=0
𝑑[1 − σ𝑗≠𝑖 𝑝𝑖𝑗 𝑡 ] 𝑑𝑝𝑖𝑗 𝑡
⇒ อ = − ቤ Using (1)
𝑑𝑡 𝑗≠𝑖 𝑑𝑡 𝑡=0
𝑡=0
= − 𝜆𝑖𝑗 = −𝜆𝑖 = 𝑞𝑖𝑖 (3)
𝑗≠𝑖
◼ In summary, − 𝑞𝑖𝑖 equals to the transition rate out of state 𝑖,
that is, − 𝑞𝑖𝑖 = 𝜆𝑖 .
◼ Note that for each row 𝑖 of 𝐐, the sum is from (2) and (3)
𝑞𝑖𝑗 = 𝑞𝑖𝑗 + 𝑞𝑖𝑖 = 𝜆𝑖𝑗 − 𝜆𝑖𝑗 = 0.
𝑗 𝑗≠𝑖 𝑗≠𝑖 𝑗≠𝑖
65
Transition Probabilities 𝑃𝑖𝑗
◼ After deriving the transition rates, it is easy to calculate the
transition probabilities. State transitions occur at random
points in time 𝑌1 < ⋯ < 𝑌𝑘 < ⋯. Let 𝑋𝑘 be the state right
after the transition at 𝑌𝑘 , which we call the embedded state.
◼ Define the transition probability of this embedded MC as
𝑃𝑖𝑗 = 𝐏{𝑋𝑘+1 = 𝑗|𝑋𝑘 = 𝑖} with 𝑃𝑖𝑗 = 1
𝑗≠𝑖
◼ Starting from state 𝑖, 𝑃𝑖𝑗 corresponds to the fraction 𝜆𝑖𝑗 of
the transitions to state 𝑗 to the total transitions 𝜆𝑖 out of
state 𝑖.
◼ Then, we have
𝜆𝑖𝑗 𝑞𝑖𝑗
𝑃𝑖𝑗 = = , 𝑗 ≠ 𝑖, and 𝑃𝑖𝑖 = 0.
𝜆𝑖 −𝑞𝑖𝑖
66
Example: Computer System (1)
◼ Assume a computer system where jobs arrive according to
a Poisson process with rate 𝜆. Each job is processed
using a First-In-First-Out (FIFO) policy. The processing
time of each job is exponential with rate 𝜇. The computer
has buffer to store up to two jobs that wait for being
processed. Jobs that find the buffer full are lost.
◼ Draw the transition rate diagram.
◼ Find the transition rate matrix 𝐐.
◼ Find the transition probability matrix 𝐏.
67
Example: Computer System (2)
𝜆 𝜆 𝜆
0 1 2 3 𝜆
𝜇 𝜇 𝜇
◼ The transition rate matrix is given by
−𝜆 𝜆 0 0
𝜇 −(𝜆 + 𝜇) 𝜆 0
𝐐=
0 𝜇 −(𝜆 + 𝜇) 𝜆
0 0 𝜇 −𝜇
◼ The transition probability matrix is given by
0 𝜆/𝜆 0 0
𝜇/(𝜆 + 𝜇) 0 𝜆/(𝜆 + 𝜇) 0
𝐏=
0 𝜇/(𝜆 + 𝜇) 0 𝜆/(𝜆 + 𝜇)
0 0 𝜇/𝜇 0
68
Transient State Analysis
▪ Similar to the discrete-time case, we define
𝜋𝑗 𝑡 ≡ 𝐏{𝑋 𝑡 = 𝑗}
▪ In vector form, For the non-
𝝅 𝑡 = [𝜋0 𝑡 𝜋1 𝑡 𝜋2 𝑡 … ] homogeneous case,
▪ With initial probabilities obtaining a general
𝝅 0 = [𝜋0 0 𝜋1 0 𝜋2 0 … ] solution is not easy!
69
“Probability Fluid” view
◼ We view 𝜋𝑗 (𝑡) as the level of a “probability fluid” that is
stored at each node 𝑗 (0 = empty, 1 = full).
𝑑𝜋𝑗 (𝑡)
= 𝑞𝑖𝑗 𝜋𝑖 (𝑡) − 𝑞𝑗𝑘 𝜋𝑗 𝑡
𝑑𝑡 𝑘≠𝑗
𝑖≠𝑗
change in the
probability fluid inflow outflow
i 𝑞𝑖𝑗 𝑞𝑗𝑘 k
…
…
j 𝑞𝑗𝑘 𝜋𝑗 𝑡
𝑘≠𝑗
= −𝑞𝑗𝑗 𝜋𝑗 𝑡
Inflow Outflow
70
Steady State Analysis (1)
…
𝑘≠𝑗 j
𝑖≠𝑗
0 1 2 3 𝜆
𝜇 𝜇 𝜇
◼ For the previous computer system example, what are the
steady state probabilities?
◼ Solve
−𝜆 𝜆 0 0
𝜇 − 𝜆+𝜇 𝜆 0
𝝅𝐐 = 𝜋0 𝜋1 𝜋2 𝜋3 =𝟎
0 𝜇 − 𝜆+𝜇 𝜆
0 0 𝜇 −𝜇
𝜋0 + 𝜋1 + 𝜋2 + 𝜋3 = 1
73
Example: Computer System (2)
◼ The solution is obtained as
𝜆
−𝜆𝜋0 + 𝜇𝜋1 = 0 ⇒ 𝜋1 = 𝜋0
𝜇
2
𝜆
𝜆𝜋0 − 𝜆 + 𝜇 𝜋1 + 𝜇𝜋2 = 0 ⇒ 𝜋2 = 𝜋0
𝜇
3
𝜆
𝜆𝜋1 − 𝜆 + 𝜇 𝜋2 + 𝜇𝜋3 = 0 ⇒ 𝜋3 = 𝜋0
𝜇
1
𝜋0 + 𝜋1 + 𝜋2 + 𝜋3 = 1 ⇒ 𝜋0 = 2 3
𝜆 𝜆 𝜆
1+ + +
𝜇 𝜇 𝜇
74
Example: Birth-Death Chain (1)
λ0 λi-1 λi
0 1 … μi …
μ1 i μi+1
𝝅𝐐 = 𝟎 and 𝜋𝑖 = 1
𝑖=0
75
Example: Birth-Death Chain (2)
◼ The solution is obtained
𝜆0
−𝜆0 𝜋0 + 𝜇1 𝜋1 = 0 ⇒ 𝜋1 = 𝜋0
𝜇1
𝜆0 𝜆1
𝜆0 𝜋0 − 𝜆1 + 𝜇1 𝜋1 + 𝜇2 𝜋2 = 0 ⇒ 𝜋2 = 𝜋0
𝜇1 𝜇2
◼ In general,
𝜆0 ⋯ 𝜆𝑗−1
𝜆𝑗−1 𝜋𝑗−1 − 𝜆𝑗 + 𝜇𝑗 𝜋𝑗 + 𝜇𝑗+1 𝜋𝑗+1 = 0 ⇒ 𝜋𝑗 = 𝜋0
𝜇1 ⋯ 𝜇𝑗
◼ Making the sum equal to 1
∞
Solution exists if
∞
𝜆0 ⋯ 𝜆𝑗−1 𝜆0 ⋯ 𝜆𝑗−1
𝜋0 1+ =1 𝑆 =1+ <∞
𝜇1 ⋯ 𝜇𝑗 𝜇1 ⋯ 𝜇𝑗
𝑗=1 𝑗=1
76
Homework #8
Textbook “Introduction to Probability”, 2nd Edition, D. Bertsekas and J. Tsitsiklis
Chapter7 p.380-p.405, Problems 1, 4, 5, 10, 11, 13, 18
Due date:아주BB 과제출제 확인
Homework #9
Textbook “Introduction to Probability”, 2nd Edition, D. Bertsekas and J. Tsitsiklis
Chapter7 p.380-p.405, Problems 28, 29, 30, 32, 36, 37, 38
Due date: 아주BB 과제출제 확인
77