Professional Documents
Culture Documents
Matteo Brunelli
Consider a system whose state is observed in the discrete time. The state of
the system is also finite and ranges in {0, 1, 2, . . . , M − 1, M }
Consider a system whose state is observed in the discrete time. The state of
the system is also finite and ranges in {0, 1, 2, . . . , M − 1, M }
D EFINITION
A stochastic process is an indexed collection of random variables {Xt }t=1,...,T
where the index t runs through a given set T .
Consider a system whose state is observed in the discrete time. The state of
the system is also finite and ranges in {0, 1, 2, . . . , M − 1, M }
D EFINITION
A stochastic process is an indexed collection of random variables {Xt }t=1,...,T
where the index t runs through a given set T .
Consider a system whose state is observed in the discrete time. The state of
the system is also finite and ranges in {0, 1, 2, . . . , M − 1, M }
D EFINITION
A stochastic process is an indexed collection of random variables {Xt }t=1,...,T
where the index t runs through a given set T .
E XAMPLE
The value of a given investment
The price of oil
The amount of rain
The quantity of a given good in the inventory
···
E XAMPLE
1 A camera store stocks a particular model camera that can be ordered
weekly. Let {D1 , D2 , . . .} represent the demand for this camera (the
number of units that would be sold if the inventory is not depleted) during
the first week, second week, . . ., respectively. It is assumed that the Di
are independent and identically distributed random variables having a
Poisson distribution with a mean of 1.
E XAMPLE
1 A camera store stocks a particular model camera that can be ordered
weekly. Let {D1 , D2 , . . .} represent the demand for this camera (the
number of units that would be sold if the inventory is not depleted) during
the first week, second week, . . ., respectively. It is assumed that the Di
are independent and identically distributed random variables having a
Poisson distribution with a mean of 1.
2 Let X0 represent the number of cameras on hand at the outset, X1 the
number of cameras on hand at the end of week 1, X2 the number of
cameras on hand at the end of week 2, and so on.
E XAMPLE
1 A camera store stocks a particular model camera that can be ordered
weekly. Let {D1 , D2 , . . .} represent the demand for this camera (the
number of units that would be sold if the inventory is not depleted) during
the first week, second week, . . ., respectively. It is assumed that the Di
are independent and identically distributed random variables having a
Poisson distribution with a mean of 1.
2 Let X0 represent the number of cameras on hand at the outset, X1 the
number of cameras on hand at the end of week 1, X2 the number of
cameras on hand at the end of week 2, and so on.
3 On Saturday night the store places an order that is delivered in time for
the next opening on Monday. The store uses the following order policy: If
there are no cameras in stock, the store orders 3 cameras. However, if
there are any cameras in stock, no order is placed.
E XAMPLE
1 A camera store stocks a particular model camera that can be ordered
weekly. Let {D1 , D2 , . . .} represent the demand for this camera (the
number of units that would be sold if the inventory is not depleted) during
the first week, second week, . . ., respectively. It is assumed that the Di
are independent and identically distributed random variables having a
Poisson distribution with a mean of 1.
2 Let X0 represent the number of cameras on hand at the outset, X1 the
number of cameras on hand at the end of week 1, X2 the number of
cameras on hand at the end of week 2, and so on.
3 On Saturday night the store places an order that is delivered in time for
the next opening on Monday. The store uses the following order policy: If
there are no cameras in stock, the store orders 3 cameras. However, if
there are any cameras in stock, no order is placed.
(
max{3 − Dt+1 , 0} if Xt = 0
Xt+1 =
max{Xt − Dt+1 , 0} if Xt ≥ 1
M. B RUNELLI M ARKOV CHAINS A PRIL 17, 2018 3 / 25
Markov chain
P ROPERTIES
(n)
pij ≥ 0, ∀i, j, n (3)
M
(n)
X
pij = 1, ∀i, n (4)
j=0
P ROPERTIES
(n)
pij ≥ 0, ∀i, j, n (3)
M
(n)
X
pij = 1, ∀i, n (4)
j=0
0 1 ··· M
(n) (n) (n)
0 p00 p01 ··· p0M
1 p(n) 0 (n)
p11 ···
(n)
p1M
10
P(n) = .
.. .. .. .. ..
. . . .
(n) (n) (n)
M pM 0 pM 1 ··· pM M
E XAMPLE
Suppose that a player has 1 and with each play of the game wins 1 with
probability p > 0 or loses 1 with probability (1 − p). The game ends when the
player either accumulates 3 or goes broke. This game is a Markov chain with
the states representing the player’s current holding of money, that is, 0, 1, 2, or
3, and with the transition matrix given by
E XAMPLE
Suppose that a player has 1 and with each play of the game wins 1 with
probability p > 0 or loses 1 with probability (1 − p). The game ends when the
player either accumulates 3 or goes broke. This game is a Markov chain with
the states representing the player’s current holding of money, that is, 0, 1, 2, or
3, and with the transition matrix given by
0 1 2 3
0 1 0 0 0
11 − p 0 p 0
P(1) =P=
2 0 1−p 0 p
3 0 0 0 1
E XAMPLE
0 1 2 3
0 p00 p01 p02 p03
1 p10 p11 p12 p13
P=
2 p20 p21 p22 p23
3 p30 p31 p32 p33
E XAMPLE
0 1 2 3
0 p00 p01 p02 p03
1 p10 p11 p12 p13
P=
2 p20 p21 p22 p23
3 p30 p31 p32 p33
(1)n e−1
P {Dt+1 = n} =
n!
E XAMPLE
0 1 2 3
0 p00 p01 p02 p03
1 p10 p11 p12 p13
P=
2 p20 p21 p22 p23
3 p30 p31 p32 p33
(1)n e−1
P {Dt+1 = n} =
n!
which yields
P {Dt+1 = 0} = 0.368
P {Dt+1 = 1} = 0.368
P {Dt+1 = 2} = 0.184
P {Dt+1 ≥ 3} = 1 − P {Dt+1 ≤ 2} = 1 − (0.368 + 0.368 + 0.184) = 0.080
M. B RUNELLI M ARKOV CHAINS A PRIL 17, 2018 8 / 25
Cameras (cont.)
E XAMPLE
Remember the reorder policy,
(
max{3 − Dt+1 , 0} if Xt = 0
Xt+1 =
max{Xt − Dt+1 , 0} if Xt ≥ 1
p03
E XAMPLE
Remember the reorder policy,
(
max{3 − Dt+1 , 0} if Xt = 0
Xt+1 =
max{Xt − Dt+1 , 0} if Xt ≥ 1
E XAMPLE
Remember the reorder policy,
(
max{3 − Dt+1 , 0} if Xt = 0
Xt+1 =
max{Xt − Dt+1 , 0} if Xt ≥ 1
E XAMPLE
Remember the reorder policy,
(
max{3 − Dt+1 , 0} if Xt = 0
Xt+1 =
max{Xt − Dt+1 , 0} if Xt ≥ 1
E XAMPLE
Remember the reorder policy,
(
max{3 − Dt+1 , 0} if Xt = 0
Xt+1 =
max{Xt − Dt+1 , 0} if Xt ≥ 1
E XAMPLE
Remember the reorder policy,
(
max{3 − Dt+1 , 0} if Xt = 0
Xt+1 =
max{Xt − Dt+1 , 0} if Xt ≥ 1
E XAMPLE
Similarly
p12 = p13 = p23 = 0
p11 = P {Dt+1 = 0} = 0.368
p10 = P {Dt+1 ≥ 1} = 0.632
p22 = P {Dt+1 = 0} = 0.368
p20 = P {Dt+1 ≥ 2} = 0.264
E XAMPLE
Similarly
p12 = p13 = p23 = 0
0.080 0.184 0.368 0.368
p11 = P {Dt+1 = 0} = 0.368
0.632 0.368 0 0
p10 = P {Dt+1 ≥ 1} = 0.632 =⇒ P =
0.264 0.368 0.368 0
p22 = P {Dt+1 = 0} = 0.368
0.080 0.184 0.368 0.368
p20 = P {Dt+1 ≥ 2} = 0.264
Q UESTION
Can we find P(2) ?
Consider a Markov chain with states 0, 1, . . . , M . What is the probability that
from 1 at time t we will end up at 2 at state t + 2?
Q UESTION
Can we find P(2) ?
Consider a Markov chain with states 0, 1, . . . , M . What is the probability that
from 1 at time t we will end up at 2 at state t + 2?
t t+1 t+2
0 0 0
1 1 1
2 2 2
.. .. ..
. . .
M M M
In general
M
(2)
X
pij = (pi0 · p0j ) + (pi1 · p1j ) + · · · + (piM · pM j ) = pik pkj .
k=0
| {z }
matr. multipl.
In general
M
(2)
X
pij = (pi0 · p0j ) + (pi1 · p1j ) + · · · + (piM · pM j ) = pik pkj .
k=0
| {z }
matr. multipl.
Therefore,
P(2) = PP
In general
M X
M
(3)
X
pij = pik1 pk1 k2 pk2 j
k1 =0 k2 =0
| {z }
matrix multiplication
In general
M X
M
(3)
X
pij = pik1 pk1 k2 pk2 j
k1 =0 k2 =0
| {z }
matrix multiplication
Therefore,
P(3) = PPP = P(2) P
In general
M X
M
(3)
X
pij = pik1 pk1 k2 pk2 j
k1 =0 k2 =0
| {z }
matrix multiplication
Therefore,
P(3) = PPP = P(2) P
In the case of the general n
P(n) = |P ·{z
· · P}
n times
P(n) = P · · P} = |P ·{z
| ·{z · · P} = P(m) P(n−m)
· · P} |P ·{z
n times m times (n−m) times
P(n) = P · · P} = |P ·{z
| ·{z · · P} = P(m) P(n−m)
· · P} |P ·{z
n times m times (n−m) times
M
(n) (m) (n−m)
X
pij = pik pkj
k=0
D EFINITION (ACCESSIBILITY )
(n)
State j is accessible from i if there is at least one pij > 0 for some n
D EFINITION (ACCESSIBILITY )
(n)
State j is accessible from i if there is at least one pij > 0 for some n
D EFINITION (ACCESSIBILITY )
(n)
State j is accessible from i if there is at least one pij > 0 for some n
D EFINITION (I RREDUCIBILITY )
A Markov chain where all the states communicate with each other is called
irreducible.
M. B RUNELLI M ARKOV CHAINS A PRIL 17, 2018 16 / 25
Recurrent and transient states
D EFINITION (P ERIODICITY )
The period of state i is defined to be the integer t (t > 1) such that pnii = 0 for
all values of n other than t, 2t, 3t, . . . and t is the largest integer with this
property. If a state has a period of 1, then it is said to be aperiodic.
D EFINITION (P ERIODICITY )
The period of state i is defined to be the integer t (t > 1) such that pnii = 0 for
all values of n other than t, 2t, 3t, . . . and t is the largest integer with this
property. If a state has a period of 1, then it is said to be aperiodic.
R EFLECTIONS
After a large enough number of steps the probability of being in j does
not depend on the starting point i
R EFLECTIONS
After a large enough number of steps the probability of being in j does
not depend on the starting point i
We have some ‘steady state’ probabilities. In the long run the probability
of having 2 cameras in the storage will be
R EFLECTIONS
After a large enough number of steps the probability of being in j does
not depend on the starting point i
We have some ‘steady state’ probabilities. In the long run the probability
of having 2 cameras in the storage will be 0.264.
R EFLECTIONS
After a large enough number of steps the probability of being in j does
not depend on the starting point i
We have some ‘steady state’ probabilities. In the long run the probability
of having 2 cameras in the storage will be 0.264.
When can we play this trick?
E XAMPLE
For the example of cameras, with
0.080 0.184 0.368 0.368
0.632 0.368 0 0
0.264 0.368 0.368 0
0.080 0.184 0.368 0.368
we shall solve
π0 = 0.080π0 + 0.632π1 + 0.264π2 + 0.080π3
1 = 0.184π0 + 0.368π1 + 0.368π2 + 0.184π3
π
π2 = 0.368π0 + 0.632π2 + 0.368π3
π 3 = 0.368π0 + 0.368π3
π + π + π + π = 1
0 1 2 3
and obtain
π0 = 0.286 π1 = 0.285 π2 = 0.264 π3 = 0.166
M. B RUNELLI M ARKOV CHAINS A PRIL 17, 2018 21 / 25
Cameras (cont.)
E XAMPLE
n
!
1 X (k)
For P as above, we have that lim pij = 0.5
n→∞ n
k=1
E XAMPLE
n
!
1 X (k)
For P as above, we have that lim pij = 0.5
n→∞ n
k=1
Consider the costs of being at different states C(0), . . . , C(M ). The expected
average cost for the first n periods is
" n #
1X
E C(Xt )
n t=1
Consider the costs of being at different states C(0), . . . , C(M ). The expected
average cost for the first n periods is
" n #
1X
E C(Xt )
n t=1
Consider the costs of being at different states C(0), . . . , C(M ). The expected
average cost for the first n periods is
" n #
1X
E C(Xt )
n t=1
Consider the costs of being at different states C(0), . . . , C(M ). The expected
average cost for the first n periods is
" n #
1X
E C(Xt )
n t=1
C̄ = π0 C(0) + · · · + πM C(M )
E XAMPLE
Let C(xt ) be the yearly cost of having xt cameras in the inventory
0 if xt =0
2 if xt =1
C(xt ) =
8 if xt =2
18 if xt =3
E XAMPLE
Let C(xt ) be the yearly cost of having xt cameras in the inventory
0 if xt =0
2 if xt =1
C(xt ) =
8 if xt =2
18 if xt =3
Then we have,
| {z } ·0) + (0.285
C̄ = (0.286 | {z } ·2) + (0.263
| {z } ·8) + (0.166
| {z } ·18) = 5.662
π0 π1 π2 π3
One observation:
Object of our observation is P
Next lecture:
First passage
Probability of absorption
Exercises