STA 4821 Homework 6 Question # 00032004 Posted By: steve_jobs Updated on: 11/16/2014 08:31 AM Due on: 12/12/2014 Subject Statistics Topic General Statistics Tutorials: 1 See full Answer Question 40 PointsThe following BASIC code simulates the single-server queue with FIFO service. It generates the interarrivaltimes and the service times for 100,000 customers; and it produces estimates of the server utilization, thefraction of customers who must wait in the queue, and the average waiting time.100110120130140150160170180190200FOR i = 1 TO 100000IA =(generate interarrival time)T = T + IAW = W + X IAIF W < 0 THEN W = 0IF W > 0 THEN c = c + 1SW = SW + WX =(generate service time)SX = SX + XNEXT iPRINT SX/T, c/100000, SW/100000Adapt the program and run it (using the language of your choice) for four different service-timedistributions:(1) exponential service times, with mean service time E(X) = 0.5(2) constant service time, X = 0.5(3) X ~ U(0,1)(4) P(X=1/3) = 0.9, P(X=2)= 0.1Assume that the interarrival times are exponentially distributed with mean value 0.625 (that is, Poissonarrivals with rate = 1.6) . Fill in the table. For case (1), draw the graph of the theoretical distributionfunction of waiting times, Fw(t); and, on the same axes plot the simulation estimates at the values of t as tgoes from 1 to 12 in increments of 1, and fill in the corresponding table.Theory for the M/G/1 queue: If is the arrival rate and X is the service time, then the server utilization isgiven by= E(X) if E ( X ) < 11if E ( X ) 1The probability that a customer must wait in the queue isP(W > 0 ) = ,and the mean waiting time is given by the famous Pollaczek-Khintchine formula,E (W ) =E( X )V (X )1 + 2E (X ) .12In addition, if the service times are exponentially distributed, and the service is FIFO, then0tFw(t) =( 1 )E(X)1 e(t < 0 )(t 0 )There is no simple formula for Fw(t) when the service times are not exponentially distributed. (Therefore,simulation is an important tool for the analysis of queues whose service times have any arbitrary specifieddistribution of service times; and the theoretical results for the special case of exponential service times areimportant because they can be used to check the logic and accuracy of the simulation.)XtheorysimulationP(W > 0)theorysimulationP(W > 0.5)theorysimulation12NA3NA4NAFw(t)t-10123456789101112theorysimulationtheoryE(W)simulation Rating: 4.9/5
Solution: STA 4821 Homework 6