MATH MATH 130C HW5
Name:
Selected Solutions
May 15, 2007 7. Individuals join a club in accordance wtih a Poisson process at rate λ. Ea Eacch new member must pass through k consecutive stages to become a full member of the the club club.. Th Thee time time it tak takes to pass pass throug through h eac each stag stagee is expone exponenntially distributed with rate µ. Let N i (t) denote the number of club members at time t who have passed through exactly i stages, i = 1, . . . , k − 1. Also, Also, let let − → N (t) = (N 1 (t), N 2 (t), . . . , Nk −1 (t)). − → (a) Is N (t), t ≥ 0 a continuous-time Markov chain?
Yes: es: At any any fixed fixed time, time, the the stat statee of the the syst system em is a rand random om variable, i.e., the process is stochastic. Also, for any t ≥ 0, the state of the system at a future time u > t depends only upon the state of the system at time t. → (b) If so, give give the infinite infinitesim simal al transiti transition on rates. rates. Tha Thatt is, for any state state − n = (n1 , . . . , nk−1 ) give the possible next states along with their infinitesimal rates. Solution:
→ Let − n = (n1 , · · · , nk −1 ) be the current state of the system. Because we are considering an infinitesimal amount of time, we can assume that that only one event event happen happens. s. Eith Either er a new new cust custom omer er is sign signed ed on, or a customer moves from one stage to the next, or a customer becomes a full member (leaves the k − 1 stage). So, our states are: Solution:
( n1 + 1, 1, n2 , · · · , nk−1 ) S 0 = (n 1, · · · , nk−1) S 1 = (n1 − 1, n2 + 1, .. . ( n1, n2, · · · , ni − 1, ni+1 + 1, 1, ni+2 , · · · , ni−1 ) S i = (n .. . 1). S k−1 = (n1 , n2 , · · · , nk−2 , nk−1 − 1). →,S : Next, Next, we calculate calculate the transition transition rates q− n
→,S = λ q− →,S = n1 µ q− .. . →,S = ni µ q− 1
(the arrival rate) (rate of progression for one person times number of people)
i
for 1 ≤ i ≤ k − 1.
n
n
n
i
0
8. Consider two machines, both of which have an exponential lifetime with mean 1/λ. There is a single single repairm repairman an that that can service service machin machines es at an expone exponent ntial ial /λ. There rate µ. Set up the Kolmogorov backward equations; you need not solve them. Solution:
Let’s set this up as a three-state system:
Document Document URL: Date:
http://math.uci.edu/~pmack http://math.uci.edu/~pmacklin/Math130Cs lin/Math130Cspring2007.htm pring2007.html l Page 1 of 6 June 7, 2007
state 0 1 2
status all machines work 1 machine broken both machines are broken
Let’s think about the instantaneous transition rates between these states: If there are 0 broken machines, they break down at a rate 2 λ. The probability of two simultaneous break-downs is nearly zero. q0,1 = 2λ, q0,2 = 0. If we start with one broken machine, they break down at a rate λ and are repaired at a rate µ: q1,0 = µ, q1,2 = λ. If both machines are broken, they are repaired at a rate of µ, and at any instant, no more than one can be repaired. Thus, q2,0 = 0, q2,1 = µ. Lastly, let’s look at the rates vi : v0 = q0,1 + q0,2 = 2λ, v1 = q1,0 + q1,2 = µ + λ, v2 = q2,0 + q2,1 = µ. So, we now set up the equations: = P i,j
qi,k P k,j − vi P i,j ,
=i k
and so P 0 ,j = 2λP 1,j − 2λP 0,j , P 1,j = µP 0,j + λP 2,j − (λ + µ)P 1,j , P 2 ,j = µP 1,j − µP 2,j ,
j ∈ {0, 1, 2} j ∈ {0, 1, 2} j ∈ {0, 1, 2} .
11. Consider a Yule process starting with a single individual–that is, suppose X (0) = 1. Let T i denote the time it takes the process to go from a population of size i to one of size i + 1. (a) Argue that T i , i = 1, . . . , j, are independent exponentials with respective rates iλ. The Yule birth process is one in which each member gives birth independently at an exponential rate λ. Solution:
Suppose the population is i, and consider T i . For each 1 ≤ j ≤ i, denote T i j to the time at which the j th member of the population gives birth. Then T i j is exponentially distributed and has rate λ. Also, T i is the time of the first i such birth, so T i = min T i j j =1 . We know that for a bunch of independent exponential processes with equal rates λ, this is iλ, and is also exponentially distributed.
Document URL: Date:
http://math.uci.edu/~pmacklin/Math130Cspring2007.html Page 2 of 6 June 7, 2007
(b) Let X 1 , . . . , X j denote independent exponential random variables each having rate λ, and interpret X i as the lifetime of component i. Argue that max(X 1 , . . . , X j ) = 1 + 2 + · · · + j where 1 , 2 , . . . , j are independent exponentials with respective rates jλ, ( j − 1)λ , . . . , λ. Hint:
Interpret i as the time between the i − 1 and the ith failure.
Let j denote the time between the (i − 1)st and ith failures. Then the total time for all j components to fail is 1 + · · · + j . Note intuitively that this time must occur at the time of the last failure, i.e, Solution:
max(X 1 , . . . , X j ) = 1 + · · · + j . Lastly, consider 1 . Until , none of the j individuals have failed. Each fails at a rate λ, and we need the time of the first failure, i.e., the minimum of j independent exponentials. Therefore, 1 occurs at rate jλ. Similarly, for 2 , we need one of the j − 1 remaining items to fail, so 2 ∼ ( j − 1)λ. etc. (c) Using (a) and (b) argue that P {T 1 + · · · + T j ≤ t} = 1 − e−λt
j
.
First, note that T 1 + · · · + T j is the time at which j components have failed, which also equals the max of all the failure times max(X 1 , . . . , X j ). Thus, Solution:
P {T 1 + · · · T j ≤ t} = P {max(X 1 , . . . X j ) ≤ t} = P {X 1 ≤ t and · · · and X j ≤ t} j
=
P {X i ≤ t} = 1 − e−λt
j
.
= e−λt 1 − e−λt
i=1
(d) Use (c) to obtain that P 1 j (t) = 1 − e−λt
j −1
− 1 − e−λt
j
j −1
and hence, given X (0) = 1, X (t) has a geometric distribution with parameter p = e−λt. Solution:
To transition from 1 to j, we need exactly j − 1 failures. This is
equal to: P 1,j (t) = P ( have exactly j − 1 failures ) = P ( have at least j − 1 failures ) − P ( have at least j failures ) = =
Document URL: Date:
1 − e−λt 1 − e−λt
j −1
− 1 − e−λt
j
j −1
1 − 1 − e−λt
= 1 − e−λt e−λt .
http://math.uci.edu/~pmacklin/Math130Cspring2007.html Page 3 of 6 June 7, 2007
(e) Now conclude that P ij (t) =
j−1 i−1
e−λti 1 − e−λt
j −i
.
Blah blah blah. Read the text’s bionomial argument on P. 727. 14. Potential customers arrive at a full-service, one-pump gas station at a Poisson rate of 20 cars per hour. However, customers will only enter the station for gas if there are no more than two cars (including the one currently being attended to) at the pump. Suppose the amount of time required to servicea car is exponentially distributed with a mean of five minutes. (a) What fraction of the attendant’s time will be spent servicing cars? (b) What fraction of potential customers are lost? First, let X (t) denote the number of cars in the queue, including the car being serviced, and note that 0 ≤ X ≤ 2. Let λ = 20 cars · hour−1 denote the rate of arrivals, and µ = 12 cars · hour−1 denote the service rate. Then note that X is a birth-death process with “birth” and “death” rates Solution:
λ0 = λ λ1 = λ λ2 = 0
µ0 = 0 µ1 = µ µ2 = µ.
In this problem, we shall see the steady-state probabilities P 0 , P 1 , and P 2 of the states X = 0, X = 1, and X = 2. By the text discussion on P. 370, λP 0 = λ0 P 0 = µ1 P 1 = µP 1 λP 1 = λ1 P 1 = µ2 P 2 = µP 2 0 = λ2 P 2 = µ3 P 3 .. . Furthermore, we know that the limiting probabilities must sum to 1. (i.e., 100% of all cases are in one state or another at steady state.) Thus, P 0 + P 1 + P 2 = 1 (a) The service person is working iff X = 1 or X = 2, so the answer is given by 1 − P 0 P 1 + P 2 = = 1 − P 0 . 1 P 0 + P 1 + P 2 Now, we can solve for P 0 : P 0 + P 1 + P 2 = 1. By the fact that P 2 = µλ P 1 and P 1 = µλ P 0 ,
λ λ 1 = P 0 + 1 + P 1 = P 0 + 1 + µ µ Document URL: Date:
λ P 0 = µ
λ 1+ + µ
λ µ
2
P 0 .
http://math.uci.edu/~pmacklin/Math130Cspring2007.html Page 4 of 6 June 7, 2007
Therefore,
1
P 0 = 1+
λ µ
+
and our final answer is λ µ
1 − P 0 =
1+
+ λ µ
λ µ
2
λ µ
+
2,
λ µ
2
≈ 81.63%.
(b) A customer is lost if and only if they arrive when X = 2. Assuming a uniform distribution of arrivals (in time), which is true in the long term for exponential processes, our answer is equal to P 2 , the percentage of the time in which the system is in state 2. We can also calculate this as above, using the facts µ P 0 = P 1 λ and µ P 1 = P 2 , λ we can solve for P 2 : P 2 =
1 1+
µ λ
+
µ 2 λ
≈ 18.37%
Notice that as µλ → 0 (so cars arrive much more quickly than they are serviced), P 2 → 1, and 100% of customers are lost. Likewise, as µλ → ∞ (so cars are serviced much more quickly than they arrive), P 2 → 0, so 0% of customers are lost. 17. Each time a machine is repaired it remains up for an exponentially distributed time with rate λ. It then fails, and its failure is either of two types. If it is a type 1 failure, then the time to repair the machine is exponential with rate µ1 ; if it is a type 2 failure, then the repair time is exponential with rate µ2 . Each failure is, independently of the time it took the machine to fail, a type 1 failure with probability p and a type 2 failure with probability 1 − p. What proportion of time is the machine down due to a type 1 failure? What proportion of the time is it down due to a type 2 failure? What proportion of the time is it up? Solution:
For any given machine, it can have one of three states:
state 0 1 2
condition machine works machine suffered failure type 1 and is being repaired machine suffered failure type 2 and is being repaired
For long-term percentages, we need to balance the inflow and outflow rates for each state. For state 0, the inflow rate is the sum of the repair rates, and the outflow rate is the failure rate. For state 1, the inflow rate is the failure rate, and the outflow rate is the repair rate. In mathese: Document URL: Date:
http://math.uci.edu/~pmacklin/Math130Cspring2007.html Page 5 of 6 June 7, 2007
state 0 1 2
inflow rate µ1 P 1 + µ2 P 2 pλP 0 (1 − p)λP 0
outflow rate pλP 0 + (1 − p)λP 0 = λP 0 µ1 P 1 µ2 P 2
The system is in steady-state if all these rates balance. Of course, we have the additional condition P 0 + P 1 + P 2 = 1. Let’s solve this thing:
(1 − p)λ pλ P 0 + P 0 µ1 µ2 (1 − p) p 1+λ + P 0 , µ1 µ2
1 = P 0 + P 1 + P 2 = P 0 + = and so P 0 =
1 1+λ
By the other relationships, P 1 = and P 1 =
p µ1
+
(1− p) µ2
.
pλ pλ P 0 = µ1 µ1 + λ p + (1 − p) µµ
1 2
(1 − p)λ (1 − p)λ P 0 = . µ µ2 µ2 + λ p µ + (1 − p)
2 1
As a way of quickly checking if this is reasonable, suppose that µ1 = µ2 = µ, so both failure types are identical. Then P 0 =
1 1+λ
p µ
+
1− p µ
=
µ , µ+λ
i.e., it’s equal to a sort of relative repair rate. Likewise, since P 1 and P 2 are identical states in this case, we can compute P 1 + P 2 = · · · =
(1 − p)λ pλ + , λ+µ λ+µ
which is like the relative failure rate. Similarly, if p → 1, then this should reduce to a system with two states P 0 and P 1 , and indeed, we see that in this case, P 0 =
µ1 λ , P 1 = , P 2 = 0. µ1 + λ µ1 + λ
Lastly, the answer to the three questions asked are P 1 , P 2 , and P 0 , respectively. :-) Document URL: Date:
http://math.uci.edu/~pmacklin/Math130Cspring2007.html Page 6 of 6 June 7, 2007