You are on page 1of 6

BSc (Hons) Computer Science with Network

Security

Cohort: BCNS/10A/FT

Examinations for 2013 / Resit


MODULE: Discrete-Event Simulation

MODULE CODE: MATH2133C

Duration: 2 Hours 15 Minutes

Instructions to Candidates:

1. Answer ALL questions.


2. Questions may be answered in any order but your answers must show
the question number clearly.
3. Always start a new question on a fresh page.
4. All questions carry equal marks.
5. The Chi-Square Table is attached.
6. Total marks 100.

This question paper contains 4 questions and 6 pages.

Page 1 of 6
Answer ALL Questions
Question 1: (25 Marks)
(a) Explain the following concepts in discrete-event simulation:

(i) Model.
(ii) System.
(iii) State.
(iv) Event.
(v) Event List.
(vi) Delay.

[2 + 1 + 1 + 1 + 1 + 1 = 7 marks]

(b) Consider the following inventory problem for the purchase and sales of news-
paper. The paper seller buys the papers for 30 cents each and sells them for
55 cents each. Newspapers not sold at the end of the day are sold as scrap
for 3 cents each. Newspapers can be purchased in bundles of 10. Thus, the
paper seller can buy 50, 60 and so on. Three types of newspapers are known:
good, fair and poor, with probabilities of 0.37, 0.33 and 0.30, respectively.
Tables 1 and 2 provide the distribution of the newspapers demanded and the
distribution for the type of newsday.

Demand Probability Distribution


Demand Good Fair Poor
40 0.02 0.18 0.44
50 0.07 0.10 0.20
60 0.10 0.33 0.18
70 0.24 0.27 0.06
80 0.30 0.07 0.12
90 0.20 0.05 0.00
100 0.07 0.00 0.00

Table 1: Distribution of Newspapers Demanded

Please Turn Over


Page 2 of 6
Discrete Event Simulation MATH2133C
Type of Newsday Probability
Good 0.35
Fair 0.45
Poor 0.20

Table 2: Type of Newsday

(i) Using the information provided in Tables 1 and 2, obtain the random-digit
assignments for both the Newspaper Demanded and the Type of Newsday.
(ii) Consider the following table, which gives the random digits for Type of
Newsday and Demand.

Random Digits for Type of Newsday Random Digits for Demand


94 80
77 20
49 15
45 88
43 98
32 65
49 86
00 73
16 24
24 60

Develop a simulation table for the purchase of 70 Newspaper, specifying


clearly Revenue, Loss Profit from Excess Demand, Salvage from Sale of
Scrap and Daily Profit.
(iii) Compute the total-profit for the 10-day period.

[4 + 11 + 3 = 18 marks]

Please Turn Over


Page 3 of 6
Discrete Event Simulation MATH2133C
Question 2: (25 Marks)
(a) Use the linear congruential method with seed X0 = 20, constant multiplier
a = 5, increment c = 45 and modulus m = 100, to generate 5 integers and a
sequence of 5 2-digit random numbers.

[5 marks]

(b) The inter-arrival times as well as the service times at a Drivers License branch
office have been shown to be exponentially distributed. The values of and
are 2.4 and 7.6 per hour, respectively. Find

(i) the value of the server utilization.


(ii) the time-average number of customers in the system.
(iii) the average time a customer spends in the system.
(iv) the average time a customer spends in the queue.
(v) the time-average number of customers in the system.

[3 + 2 + 3 + 3 + 2 = 13 marks]

(c) Arrivals are occurring at rate = 8 per hour, and management has a choice of
two servers, one who works at rate 1 = 10 customers per hour and the second
at rate 2 = 11 customers per hour.
Assuming that the M/M/1 queue is used, compute the time-average number of
customers in both server 1 and server 2 and discuss on your results.

[7 marks]

Please Turn Over


Page 4 of 6
Discrete Event Simulation MATH2133C
Question 3: (25 Marks)
(a) Develop a random-variate generator for a random variable X with probability
density function given by
 1.5x
e , < x 0;
f (x) =
e1.5x , 0 < x < .

[4 marks]

(b) The cumulative distribution function of a discrete random variable X is given


by
x(x + 1)(2x + 1)
F (x) = , x = 1, 2, . . . , n.
n(n + 1)(2n + 1)
When n = 4, generate three values of X using random numbers R1 = 0.83,
R2 = 0.24 and R3 = 0.57.

[6 marks]

(c) The following data, relates to response times in a fire - emergency operation

3.13, 0.25, 2.05, 1.37, 1.00.

(i) Explain how the response times can be generated using the table lookup
method. Assume the equal probabilities of 1/n for each interval, where n
is the number of data. Also, show all your workings clearly.
(ii) Sketch the empirical distribution with properly labeled axes using the
solution obtained in part (i).
(iii) Generate 4 values of response times using random numbers R for R
[0, 1].

[6 + 5 + 4 = 15 marks]

Please Turn Over


Page 5 of 6
Discrete Event Simulation MATH2133C
Question 4: (25 Marks)
(a) Define the following terms

(i) Verification.
(ii) Validation.

[3 + 3 = 6 marks]

(b) Records pertaining to the weekly number of job-related injuries at an under-


ground coal mine is being studied by a federal agency. The table below lists the
values for the past 100 weeks

Injuries per Week Frequency of Occurrence


0 35
1 20
2 13
3 11
4 15
5 5
6 1

(i) Apply the Chi-Square test to these data to test the hypothesis that the
underlying distribution is Poisson. Use a level of significance of = 0.05.
(ii) Apply the Chi-Square test to these data to test the hypothesis that the
underlying distribution is Poisson with mean 1.0. Use a level of significance
of = 0.05.
(iii) Comment on your results in part (i) and (ii), above.

[8 + 8 + 3 = 19 marks]

***END OF QUESTION PAPER***

Page 6 of 6
Discrete Event Simulation MATH2133C

You might also like