B+D Process: Examples Stat 330 (Spring 2015): slide set 19 Figure 1: State diagram of B+D process 2 ♠ This process sometimes is referred as Random walk, used more in material science, physics, chemistry and biology. ♥ Conditional on X(t) = k, we either move to state k + 1 or to k − 1, depending on whether a birth or a death occurs first. ♥ One can visualize the set-up for a B+D process in a state diagram as movements between consecutive states. Visualization: Last update: February 16, 2015 Stat 330 (Spring 2015) Slide set 19 Stat 330 (Spring 2015): slide set 19 1 11 4.46 job i arrival time 12 4.66 2 0.40 13 4.68 3 0.78 1 0.22 11 5.31 job i finishing time job i finishing time 12 5.54 2 0.63 13 5.59 3 1.61 2. The printer finishes jobs at: 1 0.10 job i arrival time 14 5.62 4 1.71 14 4.89 4 1.06 15 5.84 5 1.76 15 5.01 5 1.36 16 6.04 6 1.90 16 5.56 6 1.84 17 6.83 7 2.32 17 5.56 7 1.87 1. Jobs arrive at the following points in time (in h): 18 7.10 8 2.68 18 5.85 8 2.04 19 7.23 9 3.42 19 6.32 9 3.10 3 20 7.39 10 4.67 20 6.99 10 4.42 Stat Printer: The ”heavy-duty” printer in the Stats department gets 3 jobs per hour. On average, it takes 15 min to complete printing. The printer queue is monitored for a day (8h total time). B+D Process: Examples (Cont’d) Stat 330 (Spring 2015): slide set 19 2. X(t) is still called the state at time t. X(t) is in {0, 1, 2, . . .} for all t. 1. X(t) = k, implies that at time t there are k people/objects in the system. Remarks: Definition:A B+D process X(t) is a stochastic process that monitors the number of people in a system. More motivation: The concept of memoryless property is further formalized by the Markov property. Motivation: Birth and Death process (B + D) is a generalization of Poisson process, and it provides for modeling of queues, i.e. we assume that arrivals stay some time in the system and leave after that. Review: What is a stochastic process? What is a Poisson Process? Birth and Death Processes Stat 330 (Spring 2015): slide set 19 Modeling B & D Processes state k − 1 state k + 1 is λk μ k + λk μk is . μ k + λk 6 ♣ This implies, that, given the process is in state k, the probability of moving to B < D the move is to state k + 1 at time t + B 2. if B > D the move is to state k − 1 at time t + D 3. B and D are independent for each state k. Modeling (Cont’d) this is the 7 ♣ Y itself is, again, an exponential variable, its rate is the the sum of the rates of B and D. ♦ We talked about this discussing the Poisson process: exponential races! = 1 − e(λk +μk )y = Expλk +μk (y), = 1 − e−λk y + 1 − e−μk y − (1 − e−λk y )(1 − e−μk y ) = = P (B ≤ y) + P (D ≤ y) − P (B ≤ y) · P (D ≤ y) = P (B ≤ y) + P (D ≤ y) − P (B ≤ y ∩ D ≤ y) P (Y ≤ y) = P (min(B, D) ≤ y) = P (B ≤ y ∪ D ≤ y) ♦ What can we say about the distribution of Y := min(B, D)? ♣ Notice that Y = min(B, D) is the time the system will be in state k until the move. Stat 330 (Spring 2015): slide set 19 Stat 330 (Spring 2015): slide set 19 = 5) = (5.31 − 5.01) + (5.59 − 5.56) = 0.33 = 0.04125. P (X(t) 8 8 The empirical probability for 5 jobs in the printer is the time, X(t) is in state 5 divided by the total time: 5 1. The model for a birth or a death is given, conditional on X(t) = k, as: B = time till a potential birth ∼ Exp(λk ) N.B. (P (B = D) = 0!) D = time till a potential death ∼ Exp(μk ) Model: Stat 330 (Spring 2015): slide set 19 2. What is the (empirical) probability that there are 5 jobs in the printer and its queue at some time t? Stat Printer (Cont’d) 4 1. Can you draw a graph of X(t) for the value monitored? ♣ Let X(t) be the number of jobs in the printer and its queue at time t. X(t) is a Birth & Death process. Stat Printer (Cont’d) Stat 330 (Spring 2015): slide set 19 k pk = 1. ♥ How to compute pk ? 10 ♣ The pk probabilities are called the steady state probabilities of the B+D process, and they form a probability mass function for X. where the pk are numbers between 0 and 1, with t→∞ k total time t state k by time t → → use (‡) pk (λk + μk ) pk pk · (λk + μk ) = λk pk Similarly, μk pk is the long run rate of transitions from k → k − 1. is the long run rate of transitions from k → k + 1. λk λk +μk pk 11 The long rate of visits to state k is pk (λk + μk ); but we know that a fraction k visits to state k results in moves to state k + 1. So of λ λ+μ k in state k total time t # of visits to state k by time t time in state k until time t → total time t # of visits to mean stay Stat 330 (Spring 2015): slide set 19 Stat 330 (Spring 2015): slide set 19 Sketched arguments: 9 ♦ Mathematically, the notion of a steady state translates to lim P (X(t) = k) = pk for all k, Stat 330 (Spring 2015): slide set 19 ♦ N.E. In the picture, three different simulations of Birth & Death processes are shown. Only in the first case, the process is stable (birth rate < death rate). The other two processes are unstable (birth rate = death rate (2nd process) and birth rate > death rate (3rd process)). p Examples: 8 Equilibrium: Only if the B+D process is stable, it will reach an equilibrium after some time - this is called the steady state of the B+D process. More on stability: • A lot depends on the ratio of births and deaths: • The analysis of this model for small t is mathematically difficult because of “start-up” effects - but in some cases, we can compute the “large t” behaviour. • N.E. A Poisson process with rate λ is a special case of a Birth & Death process, where the birth rates and death rates are constant, λk = λ and μk = 0 for all k. • ‡ The mean staying time therefore is 1/(λk + μk ). • The mean staying time in state k is the expected value of an exponential distribution with rate λk + μk . • Knowing the distribution of Y , the staying time in state k, gives us, e.g. the possibility to compute the mean staying time in state k. Remarks: