mas1l_2022
mas1l_2022
by
Dr Patricia Wong
Office: S1-B1b-58
Tel: 67904219
Random Processes:
1. Geometric random variable
2. Exponential random variable
3. Stochastic process
4. Poisson process
5. Discrete time Markov chain
6. Chapman-Kolmogorov equation
7. Continuous time Markov chain
8. Chapman-Kolmogorov equation
9. Kolmogorov differential equation
10. Birth-death process
1
Mean of X = E(X)
1
= (prove this, problem 1.1) (2)
p
3
Memoryless Property (or Markovian property)
P (X = m + n | X > m) = P (X = n), m, n ≥ 1.
(3)
Proof. We have
P (X = m + n and X > m)
P (X = m + n | X > m) =
P (X > m)
P (X = m + n)
= .
P (X > m)
Since
= (1 − p)n−1p
= P (X = n).
4
Problem 1.3: Show that
P (X > m + n | X > m) = P (X > n), m, n ≥ 1
(5)
P (X ≤ m + n | X > m) = P (X ≤ n), m, n ≥ 1
(6)
1 1
E(X) = = = 100
p 0.01
The tool will last an average of 100 opera-
tions.
(b) If the tool has already lasted 10 operations,
what is the probability that it will last 30
more operations?
= (1 − 0.01)30 = 0.7397.
5
(c) It is known that the tool is still working after
m (< 40) operations. Find the probability
that it will still work after 40 operations.
= P (X > 40 − m)
= (1 − 0.01)40−m = 0.9940−m.
9
Memoryless Property (or Markovian property)
P (X > x + y)
=
P (X > x)
e−λ(x+y) −λy
= = e = P (X > y).
e−λx
3. Stochastic Processes
12
The set of all values that X(t) may assume is
called the state space, denoted by S.
13
Eg 3.1. Let Xi denote the state of a certain
machine at time ti, i = 1, 2, 3, · · · .
Then, S = {0, 1}. The index set is T = {t1, t2, t3, · · ·}.
The stochastic process {Xi : i = 1, 2, 3, · · ·} is a
discrete time, discrete state space process (dis-
crete time chain).
4. Poisson Process
e−λt(λt)k
P (X(t) = k) = , k = 0, 1, 2, · · · (11)
k!
15
Problem 4.1: Show that the mean of the Pois-
son r.v. X(t) with probability mass funtion (pmf )
given by (11) is λt.
16
The probability of no arrival in the interval
[0, t] is given by
It follows that
In summary,
17
5. Discrete Time Markov Chain (DTMC)
20
One-Step Transition Probability
pij ≡ pij (1) = P (Xn = j | Xn−1 = i), n ≥ 1 (18)
0 ≤ pij ≤ 1, i, j ∈ N
pij = 1, i∈N (20)
X
22
Sojourn Time
Given a state i of a DTMC {Xn ∈ S : n ∈ N },
the sojourn time Ti of the state i is the discrete
r.v. that gives the no. of time steps for which
the DTMC resides in state i before transiting
to a different state.
We shall show that Ti is a geometric r.v. First,
we note that
P (Ti > n)
= P (Xn = i | Xn−1 = i)P (Xn−1 = i | Xn−2 = i) · · ·
· · · P (X2 = i | X1 = i)P (X1 = i | X0 = i)
= pnii. (21)
Now, using (21) we find
∞ ∞
P (Ti = n) = P (Ti = k) − P (Ti = k)
X X
k=n k=n+1
spends in state i
1
=
1 − pii
pii = 0 =⇒ E(Ti) = 1
pii = 1 =⇒ E(Ti) = ∞
24
a = probability that machine fails in a given
hour
= p01, and
= p10.
The TPM is
1−a a
P = , 0 ≤ a, b ≤ 1.
b 1−b
25
Let there be a single job in the system. The
job can be in (m + 1) states:
0 (if getting serviced by AGV)
i (if getting serviced by Mi), 1 ≤ i ≤ m
The flow of the job can be described by a DTMC
model. The TPM of the DTMC model is
q 0 q 1 q2 · · · qm
1 0 0 · · · 0
1 0 0 · · · 0
P =
.
· · · · · · ·
· · · · · · ·
1 0 0 ··· 0
29
The TPM is
2 2
(1 − a) 2a(1 − a) a
P = 0 1−a a .
0 0 1
= (1 − a)2
= a(1 − a) + a(1 − a)
= 2a(1 − a)
= P (Xm+n = j | X0 = i)
= P (Xm+n = j, Xm = k | X0 = i)
X
k∈S
k∈S
k∈S
(Markov property)
k∈S
=⇒ P (m + n) = P (m)P (n).
34
Let P (n) = [pij (n)] be the matrix of n-step tran-
sition probabilities. Note that P (0) = I. Let
m = n − 1 and n = 1 in (22). Then, we have
k∈S
or
P (n) = P (n − 1) · P, n≥1 (23)
P (n) = P n, n ≥ 1. (24)
State Probabilities
35
By total probability thm,
pj (n) = P (Xn = j)
= P (Xn = j, X0 = i)
X
i∈S
i∈S
i∈S
Let
π(n) gives the pmf of the r.v. Xn. π(0) gives the
pmf of the initial r.v. X0. Eqn (26) gives
36
Eg 6.1. Consider the 2-state DTMC of Eg 5.1.
The TPM is
1−a a
P = , 0 ≤ a, b ≤ 1.
b 1−b
Case 1: a = b = 0
1 0
P = = I
0 1
37
Case 2: a = b = 1
0 1
P =
1 0
Clearly,
P 2 = I, P 3 = P 2P = IP = P,
P 4 = P 3P = P P = I, P 5 = P 4P = P, ···.
Hence,
I, if n is even
P n =
P, if n is odd.
Suppose the initial state is 0, i.e., π(0) = [1 0].
From (28) we have
π(0)I, if n is even
π(n) = π(0)P n =
π(0)P, if n is odd
[1 0], if n is even
= [0
1], if n is odd.
38
Case 3: a, b ∈ (0, 1). In this case, |1 − a − b| < 1.
1 − a a
P =
b 1−b
a+b a+b
Pn =
(29)
b−bxn a+bxn
a+b a+b
where x = 1 − a − b, |x| < 1. Note that
b a
a+b a+b
n
lim
n→∞
P =
. (30)
b a
a+b a+b
π(n) = π(0)P n = ,
n ≥ 0.
a+b a+b
(31)
If the initial state is 1, then π(0) = [0 1]. From
(28) we have
n n
b − bx a + bx
π(n) = π(0)P n = ,
n ≥ 0.
a+b a+b
(32)
As n → ∞, both (31) and (32) give
b a
π(∞) ≡ n→∞
lim π(n) = .
(33)
a+b a+b
39
(33) can also be obtained by using (30):
π(n) = π(0)P n
=⇒ n→∞ lim P n
lim π(n) = π(0) n→∞
b a
a+b a+b
= π(0)
b a
a+b a+b
b a
=
a+b a+b
40
Steady State Analysis
Assume that the following limiting probabilities
exist and are unique
lim p (n),
n→∞ j
j = 0, 1, · · ·
lim p (n),
n→∞ ij
i, j = 0, 1, · · · .
It can be shown that for any j,
lim p (n) = n→∞
n→∞ j
lim pij (n), i = 0, 1, · · · .
Let
yj = n→∞lim pj (n).
Hence,
yj = n→∞lim pj (n) = n→∞lim pij (n), i = 0, 1, · · · . (34)
Let
Y = n→∞lim π(n) = [y0 y1 y2 · · ·]. (35)
Y is called the vector of steady-state or limiting prob-
abilities. It follows from (24), (34) and (35) that
Y
Y
·
n
lim
n→∞
P = lim
n→∞
P (n) =
·
.
(36)
·
Y
Observe how the above results are illustrated
by Eg 6.1.
41
From (28) we have
π(n) = π(0)P n = π(0)P n−1P = π(n − 1)P.
So
lim π(n − 1)P
lim π(n) = n→∞
n→∞
which, in view of (35), yields
Y = Y P. (37)
Also, it is clear that
yj = 1 and yj ≥ 0, j ≥ 0. (38)
X
j
We can compute Y using (37) and (38).
0 1
1 0
(37) gives
0 1
[y0 y1] = [y0 y1]
1 0
=⇒ y0 = y1. (40)
Coupling with (39), we get y0 = y1 = 0.5. Thus,
Y = [0.5 0.5] which means that the DTMC visits
each state, on the average, 50% of the time.
(37) provides
1 − a a
[y0 y1] = [y0 y1]
b 1−b
Y = .
a+b a+b
43
We interpret this as on the average, the DTMC
b
visits state 0 for a+b of the total no. of time
a
steps, and state 1 for a+b of the total no. of
time steps.
1 0 0
44
Problem 6.4: In a certain manufacturing sys-
tem, there are 2 machines M1 and M2. M1 is
a fast and high precision machine whereas M2
is a slow and low precision machine. M2 is em-
ployed only when M1 is down, and it is assumed
that M2 does not fail. Assume that the process-
ing time of parts on M1, the processing time of
parts on M2, the time to failure of M1, and the
repair time of M1 are independent geometric
random variables with parameters p1, p2, f and
r, respectively. Identify a suitable state space
for the DTMC model of the above system and
compute the TPM. Investigate the steady-state
behavior of the DTMC.
45
7. Continuous Time Markov Chain (CTMC)
46
We shall show that Ti is an exponential r.v.
First, by Markov property, the future evolu-
tion of a CTMC is completely specified by its
current state and is independent of the past
trajectory of the process. In particular, it does
not matter how long the process has been in its
current state. Formally,
P (Ti > s + x | Ti > s) = h(x), s, x ≥ 0 (45)
where h(x) is a function of x only. Now,
P (Ti > s + x, Ti > s)
P (Ti > s + x | Ti > s) =
P (Ti > s)
P (Ti > s + x)
=
P (Ti > s)
leads to
P (Ti > s + x)
h(x) = . (46)
P (Ti > s)
Letting s = 0 in (46) and noting that P (Ti > 0) =
1, we find
h(x) = P (Ti > x). (47)
Hence, it follows from (45) and (47) that
P (Ti > s + x | Ti > s) = P (Ti > x), s, x ≥ 0.
(48)
48
(48) is equivalent to the memoryless property
(9). Since the exponential r.v. is the unique
memoryless continuous r.v., the sojourn time
Ti is an exponential r.v., i.e., Ti = EXP (λi),
51
The transition probabilities can be expressed in
matrix form as
H(s, t) = [pij (s, t)].
Note that H(s, s) = I. Now, for 0 ≤ s ≤ u ≤ t,
pij (s, t)
= P (X(t) = j | X(s) = i)
k∈S
k∈S
×P (X(u) = k | X(s) = i)
k∈S
(Markov property)
= pik (s, u)pkj (u, t) (49)
X
k∈S
52
These are the Chapman-Kolmogorov equations
for a CTMC.
∂H(s, t)
= −Q(s)H(s, t), 0≤s≤t (53)
∂s
54
Interpretation of Q(t)
pii(t, t + h) − 1
qii(t) = lim (54)
h→0 h
and
pij (t, t + h)
qij (t) = lim , i 6= j. (55)
h→0 h
Given that the CTMC is in state i at time t, we
may interpret qij (t) to be the rate at which the
CTMC moves from state i to state j (i 6= j) in
the time interval (t, t + h).
Since
55
Homogeneous CTMC
In a homogeneous CTMC, the transition proba-
bilities pij (x, x + t) do not depend on x and de-
pend only on t. Hence, we write
pij (t) = pij (x, x + t), for all x
56
State Probabilities
Assume the state space is S = {0, 1, 2, · · ·}. De-
note
pj (t) = P (X(t) = j), j = 0, 1, 2, · · · . (61)
Let
π(t) = [p0(t) p1(t) p2(t) · · ·]. (62)
By total probability thm,
pj (t) = P (X(t) = j)
= P (X(t) = j, X(0) = i)
X
i∈S
i∈S
= pi(0)pij (t), j = 0, 1, 2, · · · .
X
i∈S
In matrix form,
π(t) = π(0)H(t) = π(0) exp(Qt). (63)
Differentiating (63), we get
dπ(t)
= π(0) exp(Qt)Q = π(t)Q. (64)
dt
57
Steady State Analysis
πj = lim pj (t), j = 0, 1, · · ·
t→∞
1. πj = 1
X
The probabilities
π = [π0 π1 π2 · · ·]
58
To obtain the steady-state probability vector π,
set
dπ(t)
=0
dt
as these probabilities are constant. In view of
(64), this is
π(t)Q = 0.
Hence, π can be obtained as the solution of
πQ = 0
X
πj = 1
j
(65)
πj ≥ 0, j = 0, 1, 2, · · ·
k6=j
k
Therefore, (66) can be written as
qjj πj + qkj πk = qjk πj
X X
k6=j k
k6=j k6=j
59
Eg 9.1. Let us consider Eg 7.1.
0: machine being set up for the next part
1: machine processing a part
2: machine failed, being repaired
Let X(t), t ≥ 0 represent the state of the system
at time t, then {X(t) | t ≥ 0} is a CTMC.
s: setup rate
p: processing rate
f : failure rate
r: repair rate
61
To find the steady-state probability vector π =
[π0 π1 π2] using (65):
π0 s = π1 p
πQ = 0 =⇒ π1(p + f ) = π0s + π2r
π 2 r = π1 f
π 0 + π 1 + π2 = 1
Note that the first 3 equations above are also
the rate balance equations (67) which can be
obtained from the state transition diagram. Upon
solving, we get (show it, Problem 9.1)
pr rs
π0 = , π1 = ,
pr + rs + f s pr + rs + f s
fs
π2 = . (69)
pr + rs + f s
Suppose
s: setup rate = 20 per hour
p: processing rate = 4 per hour
f : failure rate = 0.05 per hour
r: repair rate = 1 per hour
63
then π0 = 0.16, π1 = 0.8, π2 = 0.04. This means
on an average, the machine gets set up for an
operation 16% of the total time, processes parts
for 80% of the total time, and is down for 4%
of the total time. Thus, the efficiency of the
system is 80%.
= π1 p
(70)
rsp
=
pr + rs + f s
1
=1 !
f 1
= 3.2.
s + 1+ r p
−1
f
f 1
= 1 +
r p (72)
65
is found to be (Problem 9.2)
pr + f r rs
π00 = , π10 =
pr + f r + rs + f s pr + f r + rs + f s
fs
π20 = . (74)
pr + f r + rs + f s
Using the same values of p, r, s, f as in Case
1, we obtain π00 = 0.1617, π10 = 0.7984, π20 = 0.039.
Thus, the efficiency of the system is 79.84%.
Average production rate R
= π10 p
(75)
rsp
=
pr + f r + rs + f s
1
=1 1
!
f 1
= 3.08
s + 1+ s + r p
67
Problem 9.3: Examine the single-machine sys-
tem (see Eg 9.1) with resume policy, but pro-
cessing batches of parts. Assume that after each
setup operation, the machine processes exactly
n parts, then it is set up again for the next batch
of n parts. Each setup operation has a duration
of EXP (s) and the processing time on an indi-
vidual part is EXP (p). The machine may fail
during processing, and after repair, it resumes
processing. The time to failure is EXP (f ) and
the repair time is EXP (r). All the r.v.’s involved
are mutually independent and also the machine
does not fail during setup. The state space of
the CTMC model is given by
S = {0, 1, 2, · · · , n, n + 1, n + 2, · · · , 2n}
where
0 : machine being set up for the next batch of
parts
i (1 ≤ i ≤ n) : machine processing ith part of a
batch
n + i (1 ≤ i ≤ n) : machine failed while processing
ith part of a batch, machine being repaired
68
(a) Draw the state transition diagram of the CTMC
model.
(b) Give the transition rate matrix Q.
(c) Write down the rate balance equations.
(d) Find πi, 0 ≤ i ≤ 2n.
(e) Find the production rate R.
69
Problem 10.1: Write down the transition rate
matrix Q for a finite BD process with state
space {0, 1, 2, · · · , N }.
λk πk − µk+1πk+1 = λk−1πk−1 − µk πk
= λk−2πk−2 − µk−1πk−1
= λk−3πk−3 − µk−2πk−2
= · · · = λ0π0 − µ1π1
= 0.
71
Hence, it follows that
λk−1
πk = πk−1, k≥1
µk
λk−1λk−2
= πk−2
µk µk−1
λk−1λk−2λk−3
= πk−3
µk µk−1µk−2
λk−1 · · · λ1λ0
= ··· = π0
µk · · · µ2µ1
or
k−1 λi
πk = π0 , k ≥ 1. (78)
Y
i=0 µi+1
Since
πj = 1,
X
j
using (78) we get
k−1 λi
π0 + π0 =1
X Y
µi+1
k≥1 i=0
72