# Simulation of Queuing problems using Random numbers

Simulation  Simulation is imitation of some real thing.  The act of simulating something generally involves representation of certain  key characteristics or  behaviours of a selected physical or abstract system. or a process.  Simulation involves the use of models to represent real life situation. .

etc. such as profit and loss. investment returns.  A simulation model will include:    Model inputs that are uncertain numbers/ uncertain variables Intermediate calculations as required Model outputs that depend on the inputs -.These are uncertain functions .Simulation Model  A simulation model is a mathematical model that calculates the impact of uncertain inputs and decisions we make on outcomes that we care about.

 Production planning.Simulation techniques  Simulation techniques can be used to assist management decision-making.  Typical business problems where simulation could be used to aid management decision-making are  Inventory control. where analytical methods are either not available or inappropriate. .  Queuing problems.

 Waiting time has also become more important because of the increased emphasis on quality.Simulation and Queuing problems.  A major application of simulation has been in the analysis of waiting line.  Since the time spent by people and things waiting in line is a valuable resource. Customers equate quality service with quick service and providing quick service has become an important aspect of quality service . or queuing systems. the reduction of waiting time is an important aspect of operations management.

Queuing problems.  For queuing systems.  Simulation can hence be used to investigate problems that are common in any situation involving customers.  For ex:  Customers arrive in a bank and form a single queue. items or orders arriving at a given point. it is usually not possible to develop analytical formulas. and simulation is often the only means of analysis. which feeds a number of service desks. The arrival rate of the customers will determine the number of service desks to have open at any specific point in time . and being processed in a specified order.

 Queue or waiting line: Concerned with what happens between the arrival of an item requiring service and the time when service is carried out.  A queuing problem involves striking a balance between the cost of making reductions in service time and the benefits gained from such a reduction .  Outlet or departure: The exit from the system.  Service: Concerned with the time taken to serve a customer.Components of queuing systems  A queue system can be divided into four components  Arrivals: Concerned with how items (people. cars etc) arrive in the system.

single queue – single service point. **Service time: Is the length of time taken to serve customers .     Single queue – single service point Queue discipline is first come – first served. Service times** are random and for simulation this randomness must be taken into account *Inter-arrival time: Is the time between the arrival of successive customers in a queuing situation.  We will study only one i.e.Structures of queuing system  There are a number of structures of queuing systems in practice. Arrivals* are random and for simulation this randomness must be taken into account.

.Random Numbers  What is the purpose of random numbers?     There is randomness in the way customers are likely to arrive. The service time in most of the cases is also variable. random numbers are used. To account for randomness. The purpose of the random numbers is to allow you to randomly select an arrival or service time from the appropriate distribution.

Random Numbers  Such numbers can be computer generated. 89 07 37 29 28 08 75 01 21 63 34 65 11 80 34 14 92 48 83 91 52 49 98 44 80 04 42 37 87 96  The random numbers are displaced as two-digit numbers in the range between 00 and 99.  Here we have a set of random numbers.  Every number is equally likely to occur and there is no pattern. and are often listed in published statistical tables. and thus no way of predicting what number will be next in the sequence. .

87. 64. 41.83 Assume that the shop opens at 9:00 am in the morning. 92.66. 62. . 68.47.5 0. Use the following random numbers: For IAT: 25. 24.5 0. 19.3 0. For ST: 92.55.2 0.1 Service time (in minutes) 3 4 5 6 Probability 0.07.1 0. 23.52.29. 82.44. 96.1 0. 29. 74.43.1 0.Example Problem  The arrival time of a customer at a retail sales depot is according to the following distribution Inter-arrival time (in minutes) 3 4 5 6 7 Probability 0.1  Simulate the process for 10 arrivals and estimate the average waiting     time for the customer and percentage idle time for the server.

99 Service time 3 4 5 6 Probability 0.3 0.5 0.9 1 Basis of random allocation 3 4 5 6 7 0.79 0.29 0.2 0.0 -.3 -.0.0.79 0.3 0.1 Cumulative Probability 0.8 0.9 -.1 0.9 -.0 -.89 0.89 0.0.8 0.9 1 Basis of random allocation 0.3 -.Solution Calculation of Basis of random allocation Inter arrival time Probability Cumulative Probability 0.1 0.1 0.9 -.29 0.8 -.0.5 0.1 0.09 0.3 0.0.99 .0.0.1 0.0.1 -.0.

89 0.0.3 -.0.0.49 Service Waiting Idle time ends at customer 9.44 9.0 -.99 7 8 9 10 Total time Total waiting time Total idle time 53 mins 4 mins 12 mins .28 9.29 9.3 -.9 -.33 9.29 5 0.89 7 0.19 9.Solution Inter arrival Basis of random time allocation 3 0.9 -.33 9.37 9.0.0.24 9.04 9.0.49 9.19 9.79 0.10 9.53 -2 1 ------1 4 --1 2 1 1 3 --- Service time 3 4 5 6 Basis of random allocation 0.13 9.0.18 9.0 -.14 9.79 6 0.44 9.04 9.1 -.24 9.48 Service starts at 9.10 9.0.8 -.22 9.9 -.29 9.44 9.40 9.0.29 0.09 4 0.99 Customer 1 2 3 4 5 6 Random Inter arrival Random Number time number 25 19 64 82 62 74 29 92 24 23 4 4 5 6 5 5 4 7 4 4 92 41 66 07 44 29 52 43 87 55 Service time 6 4 4 3 4 3 4 4 5 4 Time of arrival 9.40 9.08 9.14 9.32 9.

4 minutes (12/53)*100 = 22.Solution  Average waiting time per customer is  4/10 = .64%  Percentage average for the server is  .

Waiting time should be as less as possible!! Thank you!  .