04-Markov Chain
04-Markov Chain
04-Markov Chain
Question 1
An engineering professor purchases a new computer every two years
with preferences for the three model: M1, M2, and M3.
If the present model is M1, the next computer may be M2 with
probability 0.2, or M3 with probability 0.15.
If present model is M2, the probabilities of switching to M1 and M3
are 0.6 and 0.25, respectively.
And, if the present model is M3, then the probabilities of switching to
M1 and M2 are 0.5 and 0.1, respectively.
Represent the situation as a Markov chain and determine the
probability that the professor will purchase the current model in four
years
States:
1. M1
2. M2
3. M3
𝑃 𝑀1 𝑀1 = 0.6175
𝑃 𝑀2 𝑀2 = 0.1675
𝑃 𝑀3 𝑀3 = 0.26
Question 2
When I borrow a book from the city library, I usually try to return it
after one week. Depending on the length of the book and my free time,
there is a 30% chance that I may keep it for another week. If I have had
the book for two weeks, there is a 10% chance that I will keep it for an
additional week. Under no condition do I keep it for more than three
weeks.
• Express the situation as a Markov chain.
• Determine the average number of weeks I keep a book before
returning it to the library.
States:
1. 1: 1 Week
2. 2: 2 Weeks
3. 3: 3 Weeks
4. L: Library
The Markov Chain is:
b) Determine the average number of weeks before returning a book to
the library is 𝐼 − 𝑁 −1 ∗ 1
I will keep the book 1.33 week on an average
Question 3
Population dynamics is impacted by the continual movement of people
who are seeking better quality of life or better employment. The city of
Mobile has an inner city population, a suburban population, and a
surrounding rural population. The census taken in 10-year intervals
shows that 10% of the rural population move to the suburbs and 5% to
the inner city. For the suburban population, 30% move to rural areas
and 15% to the inner city. Inner-city population would not move into
suburbs, but 20% of them move to the quiet rural life.
• Express the population dynamics as a Markov chain.
• If the greater Mobile area currently includes 20,000 rural residents,
100,000 suburbanites, and 30,000 inner city inhabitants, what will the
population distribution be in 10 years? In 20 years?
• Determine the long-run population picture of Mobile.
States:
1. Inner city population
2. Suburban population
3. Surrounding rural population
𝜋1 + 𝜋2 + 𝜋3 = 1
The solution is
𝜋1 = 0.153123 𝜋2 = 0.081206 𝜋3 = 0.719257 𝜋4 = 0.046404
1
𝜇𝐽𝐽 = = 1.39 𝑦𝑒𝑎𝑟𝑠
𝜋3
1
𝜇𝑇𝑇 = = 12.31 𝑦𝑒𝑎𝑟𝑠
𝜋2
1
𝜇𝐹𝐹 = = 6.53 𝑦𝑒𝑎𝑟𝑠
𝜋1
Question 5
Jim and Joe start a game with five tokens, three for Jim and two for Joe.
A coin is tossed and if the outcome is heads, Jim gives Joe a token; else,
Jim gets a token from Joe. The game ends when Jim or Joe has all the
tokens. At this point, there is 30% chance that Jim and Joe will continue
to play the game, again starting with three tokens for Jim and two for
Joe.
a. Represent the game as a Markov chain.
b. Determine the probability that Joe will win in three-coin tosses.
That Jim will win in three coin tosses.
c. Determine the probability that a game will end in Jim's favor. Joe's
favor.
d. Determine the average number of coin tosses needed before Jim
wins. Joe wins.
States:
(Jim-Joe)
3-2, 2-3, 1-4, 4-1, 0-5, 5-0
Initial Probabilities:
𝑎0 = 1 0 0 0 0 0
The Markov Chain is:
b. probability that Joe will win in three-coin tosses, and that Jim will win in
three coin tosses.
𝜋1 = 0.257143 𝜋2 = 0.171429
𝜋3 = 0.085714 𝜋4 = 0.128571
𝜋5 = 0.142857 𝜋6 = 0.214286
a. What is the probability that the student will be in the third year after two years if he is
currently in the second year?
b. What is the steady state probability of the Q state?
c. What is the probability that the student will graduate from this school if he is currently
in the first year?
d. What is the probability that the student will graduate from this school in exactly three
years if he is currently in the first year?
e. What is the average number of years that the student may spend in this school?
a. What is the probability that the student will be in the third year after two
years if he is currently in the second year?
(2)
𝑃23 = 𝑃21 ∗ 𝑃13 + 𝑃22 ∗ 𝑃23 + 𝑃23 ∗ 𝑃33 + 𝑃24 ∗ 𝑃43 + 𝑃25 ∗ 𝑃53
(2)
𝑃23 = 0 ∗ 0 + 0.3 ∗ 0.5 + 0.5 ∗ 0.2 + 0.2 ∗ 0 + 0 ∗ 0
(2)
𝑃23 = 0.25
This is not an ergodic Markov chain, So we cannot compute the steady State
probabilities.
c. What is the probability that the student will graduate from this
school if he is currently in the first year?
𝑃𝑟𝑜𝑏𝑎𝑏𝑖𝑡𝑖𝑒𝑠 𝑜𝑓 𝑎𝑏𝑠𝑜𝑟𝑝𝑡𝑖𝑜𝑛 = 𝐼 − 𝑁 −1 ∗ 𝐴
So, The probability that the student will graduate from this school in exactly three years is
0.25
e. What is the average number of years that the student may spend in
this school?
the average number of years that the student may spend in this school
is 3.28 years