= = = W Wq Lq P (q(t) < 2/6) = 1 − 0.75 · e−20/60·(1/1) = 0.4626. The probability asked for is 2 3 Since X(t) has only a finite number of states, it’s a stable process independently from the values of λ and μ. Its state diagram looks like: X(t) is modelled as a Birth & Death Process with states {0, 1, ..., K}. Unfortunately, it’s computationally slightly harder to deal with. We denoted the waiting time in the queue by q(t). q(t) has the cumulative distribution function 1 − aey(μ−λ). An M/M/1 queue with limited size K is a lot more realistic than the one with infinite queue. Stat 330 (Spring 2015): slide set 22 1 On average, a job has to spend 45 min in the queue. What is the probability that a job has to spend less than 20 min in the queue? Wq λq = 0.75 · 3 = 2.25 The M/M/1/K queue Stat 330 (Spring 2015): slide set 22 1 = 0.25 hours = 15 min μ = Ws L 3 = = 1 hour λ 3 W − Ws = 0.75 hours = 45 minutes E[X(t)] = = L a 0.75 = =3 1−a 0.25 Printer Queue (continued) A certain printer in the Stat Lab gets jobs with a rate of 3 per hour. On average, the printer needs 15 min to finish a job. Let X(t) be the number of jobs in the printer and its queue at time t. We know already: X(t) is a Birth & Death Process with constant arrival rate λ = 3 and constant death rate μ = 4. The properties of interest for this printer system then are: The M/M/1 Queue: Example (cont’d) Last update: March 22, 2015 Stat 330 (Spring 2015) Slide set 22 Stat 330 (Spring 2015): slide set 22 The M/M/1 Queue: Example kak · p0 = ... = L λ̄ 5 Stat 330 (Spring 2015): slide set 22 Stat 330 (Spring 2015): slide set 22 where λ̄ is the average arrival rate into the system. W = 4 a (K + 1)aK+1 − 1−a 1 − aK+1 Similarly, the expected length of the queue is Lq = Wq · λa. Theerefore, the expected total waiting time is then W = L/λa λa = λ − pK λ = (1 − pK )λ. The adjusted rate λa of individuals entering the system is: We have to adjust λ by the rate of individuals who are turned away. 6 7 The probability (or fraction of time) that the owner will be alone is 1−a 0.2 p0 = 1−a K+1 = 1−0.85 = 0.2975. The number of customers in the shop can be modeled as a B & D Process with arrival rate λ = 0.2 per minute and μ = 0.25 per minute and upper size K = 4. 1. What fraction of time will the owner be in the shop on his own? Convenience Store: In a small convenience store there’s room for only 4 customers. The owner himself deals with all the customers - he likes chatting a bit. On average it takes a customer 4 minutes to pay for his/her purchase. Customers arrive at an average of 1 per 5 minutes. If a customer finds the shop full, he/she will go away immediately. k=0 K At this point we have to be careful when dealing with limited systems: λ̄ is NOT equal to the arrival rate λ. kpk = For the expected total waiting time W , we used Little’s theorem: The rate of individuals being turned away therefore is pK · λ. Since an incoming individual is turned away, when the system is full, the probability for being turned away is pK . It’s therefore a good strategy to try and minimize this number. From a marketing perspective they are the ”expensive” ones - they are most likely annoyed and less inclined to return. Another interesting property of a queuing system with limited size is the number of individuals that get turned away. Example k=0 K Stat 330 (Spring 2015): slide set 22 The M/M/1/K queue (cont’d) The M/M/1/K queue (cont’d) = L = E[X(t)] = 0 · p0 + 1 · p1 + 2 · p2 + ... + K · pK The expected number of individuals in the system L then is: where a = μλ , the traffic intensity and S = 1 + a + a2 + ... + aK = 1−a = 1 − aK+1 = = a k p0 p0 = S −1 pk The steady state probabilities pk are: 1−aK+1 1−a . Stat 330 (Spring 2015): slide set 22 The M/M/1/K queue (cont’d) Stat 330 (Spring 2015): slide set 22 a (K + 1)aK+1 = 1.56. − 1−a 1 − aK+1 W = L = 1.56/(0.2 − 0.0243) = 8.88 minutes . λa 4. What is the expected time a customer has to spend for check-out? 8 p4λ = 0.84·0.2975·0.2 per minute = 0.0243 per minute = 1.46 per hour 3. What is the rate of individuals being turned away? L= 2. What is the expected number of customers in the store? Example (cont’d)