 In the last lecture, we talked about M M 1 k's and I will just continue with that. And the basic thing to be noted is that, see the difference between M M 1 k's and M M 1 k k's is only the q size, that is you are restricting the number of people in the system. So, for M M 1 k, the number of states only go up to k. For M M 1, the states were could go up to infinity. So, therefore, the derivation as I showed you in the last lecture, the derivation was straight forward. And then, see I also showed you that as k goes to infinity and if of course, here in this case, here we require that O is rest than 1. And that I am saying is that the formula these are all valid when rho is not equal to 1, because otherwise you cannot divide by 0. So, for rho less than 1, we showed that as k goes to infinity, l will go to rho upon 1 minus rho, which is the k infinite case, which is the M M 1 k's, as it should be, because when you allow your k to become large, then it reduces to the M M 1 k's. And similarly, the derivation for l q, so this is l q is l minus 1 minus p naught. You can see that from the formula for l q, because it will be n minus 1 raise to into p n summation. So, you get this. And therefore, this is the expression and here again you will see. So, I write the expression for l and this is for 1 minus p naught. And therefore, you can simplify this. And finally, as because again this portion will go to for rho less than 1 and as k goes to infinity. So, this portion will become 1, because rho is less than 1. So, I can again divide by. So, you will be simply left with rho here k goes to infinity. And yes, so this portion you can show will go to 1. And therefore, this will be rho upon 1 minus rho minus rho, which will be equal to rho l. So, again the same as M M 1 k's. See here we can try. There are so many ways in which you can actually show that this quantity will go to 1. Just as we worked out for the l k's, the same tricks you can use here and show that this quantity will go to 1. So, therefore, this was the 1 k's. And now just let us look at the probability p k, which is a very important quantity here. So, p k is rho k into 1 minus rho upon 1 minus rho raise to k plus 1, when rho is not equal to 1. And it is 1 upon k plus 1, when rho is equal to 1. So, this part of course, I have asked you to do it as an exercise. Now, p k is the probability that the system is full, because you cannot have more than k people in the system. So, p k is the probability that the system is full, which can also be interpreted as fraction of time over the long run. See remember, we are always talking in terms of steady state probabilities. So, over the long run, this also can be interpreted as a fraction of time, that an arriving customer will find the system full, because it already has k people. So, therefore, no more entries can be allowed. And so, this will be a fraction of a time of the time, when an arriving customer will find the system full. So, therefore, the number of customers blocked per unit time would be the arrival rate lambda into the fraction of time the system is full. And so, p k into lambda is the important number, that tells you the number of customers blocked per unit time. And so, this is your lost business, lost revenue. So, this number is useful in determining increase in waiting space. So, I have been talking about this, what I am saying is that, see now you can the loss of earnings, because of lost customers can be made up by allowing for more customers to join the system. So, therefore, now the management has a very important guiding tool. This is you know, you can find out that if you are losing that many customers per unit time, then over a day or a week or over a year, whatever your planning horizon, how many customers would have been turned away. And therefore, you can compute the estimate the revenue that you would have earned, if those customers were allowed in. And then you can you know, compare it with the cost of increasing your services or allowing for more waiting space and so on. So, therefore, one can then very comfortably come up to a decision as to if the lost customers, the number is large, then you would certainly consider increasing your waiting space and allowing for more people to be serviced and come to the system. So, as I have been saying that you know, these are really useful models and they help you and the management or the people concerned people can always use these as guidelines, not again go by exact number, but at least they can be very good guidelines, they give very good guidelines. Now, as I said, special case when rho is equal to 1 is an exercise in the problem sheet, which we will be discussing at the end of this lecture, exercise 9. So, I put this you know, just for you to compute very simple, but you can then see that the all the quantities can be computed when rho is equal to 1. That means, that is this implies that lambda is equal to mu. So, the service rate and so here again there is no question of the system blowing up, because it is a finite space or a finite finite space model. So, now the case that again I will not go into detail, but it needs to be mentioned and I have written down the formula for completion sake. So, this is the MMSK model. So, now you have S servers, S greater than 1 and again finite space, you know you cannot allow more than K people in the system and certainly your number of servers have to be less than or equal to K. Otherwise, it does not make sense, if you are allowing for only 10 people to be in the system and you have 12 servers. So, certainly the 2 servers will always be idle. So, therefore, S is less than or equal to K and there is nothing really to spend time on arriving on these formulae, because the transition diagram is the same as for MMS case just as here. The things were exactly the same as for MM 1 case, except that you had we have to stop at after state K and here MMS case these 2 are similar except that here again you are chopping off after state K is reached. So, therefore, the same transition diagram and you can write the same balance equations and then you can obtain the proper value for P n. So, this will be lambda by mu raise to n upon n factorial P naught for all values of n from 1 to S and for values of n greater than S S plus 1 to K this will be lambda by mu raise to n upon S factorial then 1 upon S raise to n minus S and P naught. So, then P naught can be written as this by summing up all the probabilities. So, this is your value for P naught. Now, again we will write down the formula for L and L q the derivation is exactly the same as for MMS and then you know go on with the other this thing. So, when the expression for L q will be derived exactly as for the MMS case, but K is infinity and the argument will be the same exactly you will be this summing up sigma n minus S into P n from n varying from 0 to K instead of 0 to infinity that is all. So, therefore that is why this portion has come in. So, otherwise when K goes to infinity and for rho less than 1 you will see that this expression will be gone and so you will be left with this which is exactly equal to your L q for MMS case. So, then you can derive that fine and surely your rho is this and so for K becoming very large then your rho has to be less than 1 this has to be less than 1 and then the expression for L can be then obtained from L q and so that is all I mean we just write down the expressions I am doing this for the completeness sake. So, that you can yourself if you want to derive them then you can check that the answers are ok. Now, expression for W and W q for both MMS 1 K and MMS K are not simple and so what we basically do is we use the computer calculations to given the values of K and then value of S and lambda and mu we will simply put these values in and write a small program to compute the values of W and W q and of course some people in some text books you may find just as we plotted graph for MMS case you know we could plot p naught against the values lambda and S and mu and so on. So, you will find these values tabulated somewhere now the interesting case out of this is the one in which your number of servers is equal to the number of people allowed in the system that means you allow only as many people in the system as you have servers and of course an immediate example is your telephone network with S trunk lines. So, if you have S trunk lines callers get a busy signal when all routes are busy. So, therefore, obviously they cannot make a call unless some route becomes free. So, therefore the special cases of lot of interest when the number of servers is equal to the number of people allowed in the system and of course the other extreme case would be when you know you go to a restaurant it is self service. So, then that means the number of servers is equal to the number of people in the system. So, that of course is also there then maternity ward of your hospital because there also see the number of beds that are available only you can only entertain that many patients that many women who are going to deliver and. So, you have to turn away other people and. So, these are these cases also of interest and here in this case p s will be the will represent the fraction of time the system is full. So, otherwise in these two cases it was p k, but now since S is equal to k. So, p s is the will represent the fraction of time the system is full and therefore, again you can find out. So, the number of customers lost per unit time will be then given by lambda p s if a lambda is your arrival rate then it will be the number of people who are turned away. Now, this is also called the Erlang's loss. See Erlang a k Erlang was a Danish was a Danish telephone engineer and is considered to be the founder of queuing theory in the early 20th century. So, you see it is amazing how as a telephone engineer he had you know access to these queuing systems and therefore, he sort of initiated lot of ideas where the whole queuing theory has now been developed. So, now I like to just look at this MMS k k s through an example and I have just adapted. See this is from Bravindran Phillips and Sohlberg, but I have adapted it to our system and so I have just named it the hospital as the Lady Harding Medical College which is it is not school college Lady Harding Medical College which is in New Delhi and this is the maternity wing of the Lady Harding Medical College. So, suppose there are 12 deliveries per day. Now, the thing is that only the labour rooms where the people where the people come when the pregnant ladies come with labour pains. So, then they have to wait and then the actual. So, the labour rooms are the bottleneck because that is where the patients lie till the delivery has to be has to take place. So, delivery rooms are used for actual delivery and do not take long and the recovery rooms are not a problem because once the baby is delivered then they can be put in the general whatever any because there is no special medical attention is needed at that time. So, the recovery rooms are also not a problem. On the average a labour room is occupied by a patient from 3 to 5 hours and then a half an hour is taken for reading the patient for the delivery. So, therefore, this is where the bottleneck is because this is the occupied the longest by a patient. So, and therefore, the idea here is that you can say that may be 6 deliveries per day. So, the deliveries that can. So, one labour room can accommodate 6 deliveries, sorry one labour room can accommodate 6 patients a day and of course, your arrival rate is 12 per day. So, we just now look at the parameters L Q and the number of patients who get turned away and so on. So, since the number of labour rooms is the bottleneck. So, we will call the servers number of servers is the number of labour rooms. So, therefore, as we saw that the system can be modelled as a MMSS case, the maternity wing of the Lady Harding medical college which is also has the hospital attached to it. So, that will be treated as an MMSS case since we are taking the arrival and the service pattern to be Markovian. So, and then the fraction of maternity patients turned away is P s into lambda. So, this is the fraction of time that the system is blocked and then lambda is the arrival rate. So, this is the fraction of the maternity patients that will be turned away in the rate of maternity patients turned away, which the formula for that would be lambda by mu raise to s upon s factorial into 1 upon. So, your P naught would be just adding up to 1, I mean this whole thing, the formula is we have obtained it number of times by now. So, P naught will be 1 upon this only because you will not go beyond s and therefore, this lambda by mu raise to n divided by n factorial n varying from 0 to s. So, this is your formula for the number of fraction of maternity patients that will be turned away because your labour rooms are all occupied. So, compute the occupancy rate of the labour rooms, we compute expected value of P n which is for which our notation is l that means, the average number of people in the system and this is will be summation j varying from 0 to s j into P j, because either you do not have any patient or you have 1, 2, 3 up to s only because you only permit as many patients as there are labour rooms. So, therefore, l q is 0, there will be no waiting q, there will be no people waiting in the q and summation. So, 1 minus sigma P j j varying from 0 to s minus 1 is equal to P s. So, with these conditions we can compute this and that will give us the occupancy rate of the labour rooms. Now, let us compare the situation that means, the hospital has the or the college authorities have a choice whether to continue with the current 2 labour rooms or to increase the labour rooms. So, that you do not cause discomfort and you do not turn away too many people because that does certainly has a reputation on the hospital. If you are saying that all the time your beds are full, your labour rooms are busy fine. So, when s is 2 because your lambda is 12 and you are able to the labour room can be u occupied 6 number or the number of times it can be occupied is 6. So, we will say that the service rate service rate is 6 and the arrival rate is 12. So, 12 by 6 square into P naught your P s from here and your P naught will be. So, this is 2 square upon 1 plus 2 plus 1 by 2 into 2 square because your s is 2. So, just apply this formula and when you do the computations it comes out to be 4 by 5 because your P naught is 1 by 5 and this is 4. So, 4 by 5 is your which is you can see is high 4 that means, the fraction of time you turn away patients is 4 by 5 and the number of patients turned away. So, the rate of number of patients turned away per unit time will be 4 by 5 into 12 which is 48 by 5. When per day you are turning away 48 by 5 patients you are not able to accommodate them. When you have 2 labour rooms and this of course see here this I do not consider is really important because this will depend on the since you are only allowing as many people as there are servers as the number of labour rooms. So, therefore, this just as you that as you are calling it the occupancy rate of the labour rooms this is 6 by 5. Now, for s equal to 3 when you make the computations your P naught is comes out to be 3 by 19 because now you will go up to 3 the summation sigma n varying from 0 to 3. So, this is the computation and therefore, it comes out to be this which is 3 by 19. So, therefore, P naught is of course, the probability that there is no there is no patient in the labour rooms and here your P naught was 1 by 5 this was 1 by 5 and this is 3 by 19 then P 3 comes out to be 4 by 19. And therefore, the loss of patients is 4 by 19 into 12 which is 48 by 19. So, this is definitely less than 48 by 5. In fact, much much less than this number. So, therefore, the loss of patients drastically comes down by increasing 1 labour room. So, with 3 labour rooms the average number of patients present in the hospital in the maternity ward L will be given by P 1 plus 2 P 2 plus 3 P 3 and so that will be this number into 3 by 19 which is your P 0. And so this turns out to be 30 by 19 which is much higher than 6 by 5 because this will be 150 and this is 114. So, therefore, what is being said is that which of course, is obvious in a sense that L is higher for 3 labour rooms than when you had 2 labour rooms. So, this was your traffic and intensity or utility whatever you want to call it with 2 labour rooms and this is. So, why because you are turning away less patients and if good will counts then certainly it is more important to have lot of good will in the community and so 3 labour rooms may be worthwhile than 2 labour rooms. Now, considering the expense of having another labour room in the new one more doctor, one more labour nurse and so on. But anyway what so this is something for the organization to consider, but anyway the numbers tell you something and this is a good measure to see that your utility would be higher 3 labour rooms obviously, but then important thing is that you are turning away less patients. So, that you know and the whole idea it was actually in this course the idea was not to discuss queuing theory extensively, but I essentially wanted to show you because after having developed probability theory, I thought it was important if you get insight into why this theory is so useful and therefore, I started talking about its applications in the sense that. So, you have seen that throughout your discussion of queuing theory, we have almost used all the concepts of probability theory that we developed and other stochastic process is also that we have the Markov process that we have discussed already. There also you see that you will be using that we have used the concepts of probability theory. So, the whole idea was that by you know seeing these applications, you get a good insight and good understanding of the probability theory. So, that was the basic ideas not that we were trying to really cover the Markov processes and queuing theory extensively. So, now, I will just discuss exercise 9, where I have collected some problems and then we will continue with some more discussions of some more applications of the probability theory we have used may be through reliability you know I want to show you the applications of probability theory to reliability which will come later. So, exercise 9, suppose that at fixed time instance t 0 which is positive the number x t 0 of. So, now, since I have collected these problems from different books, so the notation may be a little different. So, here x t naught is the number of customers in an M M 1 stationary queue. We have been referring to the number of customers in a queue as n t 0. So, does not matter and is smaller than or equal to 4. So, at a fixed time the number of customers in an M M 1 stationary queue is smaller than or equal to 4. Calculate the expected value of the random variable x t naught as well as its variance if lambda is mu by 3. So, you are given the rho, rho is 1 by 3 and you are asked to compute the expected value of the random variable. So, therefore, see what are the possible values of x t naught all you are told is that it is less than or equal to 4. So, therefore, the possible values can be 0, 1, 2, 3 and 4. So, we just have to compute the probability conditional probability that probability x t naught equal to say i given that x t naught is less than or equal to 4. So, you can do this whatever we have learned enough methods to compute your conditional probabilities. So, once you have the conditional PMF of x t naught you will be able to then find out the expected value and the variance of this random variable. So, I have given the hint also I have said that compute the conditional probability density function of x t naught given that x t naught is less than or equal to 4. Now, question 2 says that for M M 1 k model compute the probabilities P n n 0, 1, 2, k when lambda is mu. So, I had said that during the lecture also that when your rho is 1 we want to find out the probabilities and also the values of l and l q. So, the value for P n I have already given to you as 1 upon they all will be the same. So, therefore, it will be 1 upon k plus 1 and now you have to compute l and l q fine. So, that is straightforward. Question 3 is that x t naught is number of customers in a birth and death process and with t non-negative let the state space be consisting of 3 states which are 0, 1 and 2 that is a system can have no customers, 1 customers or 2 customers. So, birth and death rates are given by the transition diagram you can see that lambda naught will be lambda, but when lambda 1 will be 2 lambda and mu 1 is mu, mu 2 is 2 mu. So, here they have defined the arrival rate and the departure rate. So, the arrival rate is when there is 1 then it is 2 lambda it becomes 2 lambda. So, set up the balance equations and find the steady state probabilities P naught, P 1 and P 2. So, I have deliberately given this because it is departure from your we have not really discussed the case when lambda is also change, but since there are only 3 possible states you should be able to write down the balance equations and therefore, then compute your the probabilities P naught, P 1 and P 2. So, I hope you enjoy doing this. Then question 4 is again this is an M M 1 q in equilibrium with lambda equal to 2 mu by 3 find the probability that there are more than 4 customers in the system given that there are at least 2. So, again this is a computation of this thing. So, that means you are saying that your n t if you know for a fixed time t you are saying that n t is greater than or equal to 4 given that n t is. So, there are more than 4 customers means n t is greater than 4 and then and you are given that n t is at least 2. So, that means n t is greater than or equal to 2. So, conditional probability of n t more than 4 given that n t is greater than or equal to 2. So, again a simple computation of the conditional probability. Now, let us come to question 5 consider a 2 server queuing system. So, your S is 2 where all service times are independent and identically distributed according to an exponential distribution with a mean of 10 minutes. Now, the problem 5 and 6 I have taken from Hillier and Lieberman's book and so therefore, the statements are little different in the sense that see the service times are independent and identically distributed which we have been referring to as Markov process. So, with a mean of 10 minutes. So, remember the mean is 10 that means the parameter for the exponential distribution will be 1 by 10. When a particular customer arrives he finds that both servers are busy and no one is waiting in the queue. So, then what is the probability distribution including its mean and standard deviation of this customer's waiting time in the queue. See, so you are asked to find out what is the customer comes into the comes to the system both the servers are busy. So, you are asked to find the probability distribution of this customer's waiting time in the queue. So, W queue when 2 servers are busy. Now, what will be the see since the 2 servers are busy that means any one of them can get serviced and then his turn will come. So, his waiting time is till one of the services gets completed and so therefore, his waiting time is over in the queue the moment one of the services is completed. So, now since there are 2 servers and each of them is you know with the mean time of 10 minutes. So, one service over that means so see what we have been doing. So, our mu is 1 by 10. So, now when there are 2 servers our this thing mu will be 2 by mu 2 by 10. So, which is 1 by 5 and therefore, the corresponding mu will be the mean service time would be 5 minutes. So, therefore, you can then compute the so that means it will again be exponential with mean as 5 minutes and therefore, you can compute the variance. I am just giving the hints and waiting time in the system. Now, you can also determine the expected value and standard deviation of this customer's waiting time in the system. So, in the system when you want to compute that it will be the waiting time plus your mu because his own service see the mean service time is 10. So, therefore, your w is w q plus mu and your mu is 10 the mean service time. See let us not confuse here I am calling mu as 10. So, 1 by mu will be 1 by 10 which is the parameter for the exponential distribution. So, I am calling the mean service time whichever way you like if you still want to refer to mu as 1 by 10 then here it will be 1 by mu because his w q has a mean of 5 and his own service time has an average of 10 minutes. So, then it will be 15 minutes. So, that means in the system his mean time in the system would be 15 and so correspondingly you will have the variance because for the exponential distribution if mu is 1 by mu is the mean then 1 by mu square is the variance. So, you can compute accordingly. So, let us go to problem 6. Now, consider an M M 2 queuing system with lambda equal to 4 and mu equal to 3. Determine the mean rate at which service completions occur during the periods when no customers are waiting in the queue. Determine the mean rate at which service completions occur during the periods when no customers are waiting in the queue. So, here it is lambda is 4 mu is 3 and so you will compute see here it is little departure and again I thought I will give you the I have put the problem in just to show you. See, you will compute p 0, p 1 and p 2 because there are two people in the system, two servers. There are two servers. So, therefore, either no people in the system, one person in the system or two people in the system. So, mean rate when no customer in the queue. So, the mean rate when no customer in the queue I am writing as the formula for that is. So, mean rate when no customer in the queue. So, this I am defining as mu naught p naught plus mu 1 p 1 plus mu 2 p 2 which is and divided by p naught plus p 1 plus p 2. You see by definition mu naught is 0 since no service is completed when no one is in the system. So, then your mu 1 is 3, but your mu 2 becomes 6, twice mu 1, this is twice mu 1. So, this is the mean rate when no customer in the queue and this is how we are defining it. So, you compute p naught p 1 and p 2 and then for an M M 2 queue and you can then write down this. Now, seventh is that server in an M M 1 queuing system works twice as fast where there are at least two customers in the system. This means that your mu n t is mu if n t is 1. So, now, I am back to my notation because here n t is the number of people in the system at time t up to time t. So, therefore, this mean or at time t that is better better way to put it. So, mu n t is mu if n t is 1 and mu n t is 2 mu if n t is greater than or equal to 2. So, here again just change the system a little and now you can write down the balance equations for this system and then what is the condition for the existence of the limiting probabilities and you can compute the probabilities. So, I have kept the thing at small and therefore, you can do these changes and experiment with that. Question 8 is what is the average number of customers in an M M 1 queuing system in equilibrium given that the number of customers is an odd number. That is you have to find expected value of n t where n t is an odd number. So, here again I have taken this problem from Heeler and Lieberman. Now, see remember you have to just compute the expected value of. So, your n t will be equal to 2 n plus 1 as n varies from 0 1 to n since we are asking for odd number of people in the system. So, to find the expected value this is a conditional expectation. So, expectation of n t given that n t is odd. So, which you will write as 2 n plus 1 summation n varying from 0 to infinity 2 n plus 1 into probability that there are 2 n plus 1 people in the system and then divided by number of the probability of there being odd people in the system which is sigma n varying from 0 to infinity probability 2 n plus 1. 9 is a customer who was unable to enter an M M 1 c. So, here again c means here or k that means finite capacity queuing system at time t 0 decides to come back at t 0 plus 2. What is the probability that the customer in question is then able to enter the system given that exactly one customer arrived in the interval and was unable to enter the system. So, this I leave for you people to you know really think about it because this is interesting and a challenging problem. So, let us see that you are able to crack it. So, the whole idea is that between t 0 and t 0 plus 2 somebody arrives the system is still full. So, that means exactly at t 0 plus 2 there is one vacancy that means one of the services has been completed and therefore, this person is able to. So, that means at t 0 the system was full and then exactly at t 0 plus 2 the system is empty that has one vacancy and so this person can enter. So, you have to work out this problem. So, I hope you enjoy doing this assignment sheet.